From dbff63ef0efef1d21f72124e3c829c9c717dd959 Mon Sep 17 00:00:00 2001 From: Kekskurse Date: Wed, 27 Nov 2019 17:13:24 +0100 Subject: [PATCH] Stuff --- Chart.yaml | 2 +- templates/api.yml | 16 ++++++----- templates/gui.yml | 14 +++++----- templates/ingress.yml | 56 +++++++++++++++++++++++++++++++++++++++ templates/queueworker.yml | 2 +- values.yaml | 35 +++++++++++++++--------- 6 files changed, 98 insertions(+), 27 deletions(-) create mode 100644 templates/ingress.yml diff --git a/Chart.yaml b/Chart.yaml index a61431b..dbb3e7b 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -18,4 +18,4 @@ version: 0.1.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. -appVersion: 1.16.0 +appVersion: 0.1.0 diff --git a/templates/api.yml b/templates/api.yml index 844fc51..2792f37 100644 --- a/templates/api.yml +++ b/templates/api.yml @@ -13,7 +13,7 @@ data: DB_PASSWORD: "{{.Values.mysql.password}}" SAVE_TOKEN_TO_SESSION: "false" NEW_GUI: "1" - GUI_URL: "{{.Values.guiURL}}" + GUI_URL: "{{.Values.api.frontendURL}}" S3_ACCESS_KEY: "{{.Values.s3.accessKey}}" S3_SECRET: "{{.Values.s3.secret}}" S3_Bucket: "{{.Values.s3.bucket}}" @@ -33,7 +33,7 @@ spec: initContainers: - name: init-migration imagePullPolicy: {{.Values.api.imagePullPolicy}} - image: docker.keks.cloud/keksaccount/web:{{.Values.api.version}} + image: {{.Values.api.container}}:{{.Values.api.version}} command: ['php', 'artisan', 'migrate', '--force'] envFrom: - configMapRef: @@ -41,7 +41,7 @@ spec: containers: - name: api imagePullPolicy: {{.Values.api.imagePullPolicy}} - image: docker.keks.cloud/keksaccount/web:{{.Values.api.version}} + image: {{.Values.api.container}}:{{.Values.api.version}} ports: - containerPort: 80 envFrom: @@ -79,10 +79,11 @@ spec: issuerRef: name: letsencrypt-prod kind: ClusterIssuer - commonName: '{{ .Values.apiUrl }}' + commonName: '{{ .Values.api.url }}' dnsNames: - - {{ .Values.apiUrl }} + - {{ .Values.api.url }} {{ end }} +{{ if .Values.api.ingress }} --- apiVersion: extensions/v1beta1 kind: Ingress @@ -91,7 +92,7 @@ metadata: namespace: {{ .Release.Namespace }} spec: rules: - - host: {{ .Values.apiUrl }} + - host: {{ .Values.api.url }} http: paths: - backend: @@ -100,5 +101,6 @@ spec: path: / {{ if .Values.api.ssl }} tls: - - secretName: account-keks-cloud-tls + - secretName: api-tls +{{ end }} {{ end }} diff --git a/templates/gui.yml b/templates/gui.yml index 77acb29..6081164 100644 --- a/templates/gui.yml +++ b/templates/gui.yml @@ -4,7 +4,7 @@ metadata: name: env-gui namespace: {{ .Release.Namespace }} data: - VUE_APP_API_URL: "{{.Values.apiUrl}}" + VUE_APP_API_URL: "{{.Values.gui.backendURL}}" --- apiVersion: extensions/v1beta1 kind: Deployment @@ -21,7 +21,7 @@ spec: containers: - name: gui imagePullPolicy: {{.Values.gui.imagePullPolicy}} - image: docker.keks.cloud/keksaccount/gui:{{.Values.gui.version}} + image: {{.Values.gui.container}}:{{.Values.gui.version}} ports: - containerPort: 8080 envFrom: @@ -59,10 +59,11 @@ spec: issuerRef: name: letsencrypt-prod kind: ClusterIssuer - commonName: '{{ .Values.guiURL }}' + commonName: '{{ .Values.gui.url }}' dnsNames: - - {{ .Values.guiURL }} + - {{ .Values.gui.url }} {{ end }} +{{ if .Values.api.ingress }} --- apiVersion: extensions/v1beta1 kind: Ingress @@ -71,7 +72,7 @@ metadata: namespace: {{ .Release.Namespace }} spec: rules: - - host: {{ .Values.guiURL }} + - host: {{ .Values.gui.url }} http: paths: - backend: @@ -80,5 +81,6 @@ spec: path: / {{ if .Values.gui.ssl }} tls: - - secretName: account-keks-cloud-tls + - secretName: gui-tls +{{ end }} {{ end }} diff --git a/templates/ingress.yml b/templates/ingress.yml new file mode 100644 index 0000000..7a1627a --- /dev/null +++ b/templates/ingress.yml @@ -0,0 +1,56 @@ +{{ if .Values.ingress.enabled }} +{{ if .Values.ingress.ssl }} +--- +apiVersion: cert-manager.io/v1alpha2 +kind: Certificate +metadata: + name: ingress-tls + namespace: {{ .Release.Namespace }} +spec: + secretName: ingress-tls + issuerRef: + name: letsencrypt-prod + kind: ClusterIssuer + commonName: '{{ .Values.ingress.url }}' + dnsNames: + - {{ .Values.ingress.url }} +{{ end }} +--- +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: ingress + namespace: {{ .Release.Namespace }} +spec: + rules: + - host: {{ .Values.ingress.url }} + http: + paths: + - path: /gitlab/ + backend: + serviceName: ingress-api + servicePort: 80 + - path: /oauth/ + backend: + serviceName: ingress-api + servicePort: 80 + - path: /api/ + backend: + serviceName: ingress-api + servicePort: 80 + {{ if .Values.ingress.oldGui }} + - path: /gui/ + backend: + serviceName: ingress-api + servicePort: 80 + {{ end }} + - path: / + backend: + serviceName: ingress-gui + servicePort: 80 + +{{ if .Values.ingress.ssl }} + tls: + - secretName: ingress-tls +{{ end }} +{{ end }} diff --git a/templates/queueworker.yml b/templates/queueworker.yml index dbe7dee..0c0293c 100644 --- a/templates/queueworker.yml +++ b/templates/queueworker.yml @@ -13,7 +13,7 @@ spec: containers: - name: app imagePullPolicy: {{.Values.queueworker.imagePullPolicy}} - image: docker.keks.cloud/keksaccount/app:{{.Values.queueworker.version}} + image: {{.Values.queueworker.container}}:{{.Values.queueworker.version}} envFrom: - configMapRef: name: env-api diff --git a/values.yaml b/values.yaml index 111e5ef..e368ade 100644 --- a/values.yaml +++ b/values.yaml @@ -1,9 +1,5 @@ - -apiUrl: api.account.helm.keks.cloud -guiURL: account.helm.keks.cloud - mysql: - ownServer: true # Just used for development stuff + ownServer: false # Just used for development stuff host: mysql port: 3306 username: account @@ -17,24 +13,39 @@ s3: bucket: "" api: + ingress: false + url: api.account.helm.keks.cloud + frontendURL: https://account-stg.keks.cloud replicas: 3 newGui: "1" tls: true - version: latest - imagePullPolicy: Always + version: 0.2.0-pre1 + container: kekscloud/keksaccount-api + imagePullPolicy: IfNotPresent ssl: false queueworker: replicas: 2 - version: latest - imagePullPolicy: Always + container: kekscloud/keksaccount-api + version: 0.2.0-pre1 + imagePullPolicy: IfNotPresent gui: + ingress: false + url: gui.account.helm.keks.cloud + backendURL: https://account-stg.keks.cloud/ replicas: 2 - version: latest - imagePullPolicy: Always + version: 0.2.0-pre1.1 + container: kekscloud/keksaccount-gui + imagePullPolicy: IfNotPresent ssl: false dockerHub: - enabled: true + enabled: false secret: docker-keks-cloud + +ingress: + enabled: true + ssl: false + url: account-stg.keks.cloud + oldGui: true #Used until all features are migrated to v0.2.0