From 40e9fd649bf88614c1b2715a9f3bf04967e64580 Mon Sep 17 00:00:00 2001 From: jmuecke <48099698+jmuecke@users.noreply.github.com> Date: Tue, 2 Mar 2021 15:32:01 +0100 Subject: [PATCH 1/9] Remove docker from build step --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 76bf510..1f6f820 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,7 +29,7 @@ variables: build: stage: build-npm - <<: *commonheader + <<: *tags image: node:12-slim artifacts: paths: -- GitLab From 9acdad23ff1cc276eb3509093125fe16cfa07829 Mon Sep 17 00:00:00 2001 From: jmuecke <48099698+jmuecke@users.noreply.github.com> Date: Tue, 2 Mar 2021 15:37:59 +0100 Subject: [PATCH 2/9] Install npm packages --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1f6f820..0fc3fec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -37,6 +37,7 @@ build: expire_in: 2 days when: always script: + - npm ci - npm run build build-container: -- GitLab From 9d776407d5ede13258d29244666437dd50369be3 Mon Sep 17 00:00:00 2001 From: jmuecke <48099698+jmuecke@users.noreply.github.com> Date: Tue, 2 Mar 2021 16:20:36 +0100 Subject: [PATCH 3/9] Add docker secretes --- charts/theautomatedlife/templates/app.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/charts/theautomatedlife/templates/app.yml b/charts/theautomatedlife/templates/app.yml index 76619dc..547fa7c 100644 --- a/charts/theautomatedlife/templates/app.yml +++ b/charts/theautomatedlife/templates/app.yml @@ -1,3 +1,12 @@ +--- +apiVersion: v1 +kind: Secret +metadata: + name: dockersecret-bigsister-ui +type: kubernetes.io/dockerconfigjson +data: + .dockerconfigjson: {{ .Values.dockersecret }} +--- apiVersion: extensions/v1beta1 kind: Deployment metadata: @@ -29,6 +38,8 @@ spec: value: {{ .Values.fowPsqlUri }} - name: FOW_AUTH_KEY value: {{ .Values.fowAuthKey }} + imagePullSecrets: + - name: dockersecret-bigsister-ui --- apiVersion: v1 kind: Service -- GitLab From d796100fb3681cf5b18f19c75b6c18ffb3a6784e Mon Sep 17 00:00:00 2001 From: jmuecke <48099698+jmuecke@users.noreply.github.com> Date: Tue, 2 Mar 2021 17:19:25 +0100 Subject: [PATCH 4/9] Parallel deployment of the new version --- charts/theautomatedlife/templates/app.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/charts/theautomatedlife/templates/app.yml b/charts/theautomatedlife/templates/app.yml index 547fa7c..20d4aca 100644 --- a/charts/theautomatedlife/templates/app.yml +++ b/charts/theautomatedlife/templates/app.yml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Secret metadata: - name: dockersecret-bigsister-ui + name: dockersecret-future-of-work type: kubernetes.io/dockerconfigjson data: .dockerconfigjson: {{ .Values.dockersecret }} @@ -10,13 +10,13 @@ data: apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: future-of-work + name: future-of-work-2 spec: replicas: 1 template: metadata: labels: - app: future-of-work + app: future-of-work-2 spec: containers: - image: {{ .Values.registryUrl }}/{{ .Values.dockerRegistryPrefix }}/future-of-work:{{ .Values.imageTag }} @@ -39,37 +39,37 @@ spec: - name: FOW_AUTH_KEY value: {{ .Values.fowAuthKey }} imagePullSecrets: - - name: dockersecret-bigsister-ui + - name: dockersecret-future-of-work --- apiVersion: v1 kind: Service metadata: - name: future-of-work + name: future-of-work-2 spec: ports: - port: 80 targetPort: 8080 protocol: TCP selector: - app: future-of-work + app: future-of-work-2 --- apiVersion: extensions/v1beta1 kind: Ingress metadata: - name: future-of-work + name: future-of-work-2 annotations: kubernetes.io/tls-acme: "true" kubernetes.io/ingress.class: "nginxtal" spec: tls: - hosts: - - theautomated.life -# secretName: ingress-ca + - fuw2.eks-test-default.mpg-chm.com + # secretName: ingress-ca rules: - host: theautomated.life http: paths: - path: / backend: - serviceName: future-of-work + serviceName: future-of-work-2 servicePort: 80 -- GitLab From 4dfbc1d7c058e1b88efc9e35b12f5eb9359e9443 Mon Sep 17 00:00:00 2001 From: jmuecke <48099698+jmuecke@users.noreply.github.com> Date: Tue, 2 Mar 2021 17:31:01 +0100 Subject: [PATCH 5/9] use test host --- charts/theautomatedlife/templates/app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/theautomatedlife/templates/app.yml b/charts/theautomatedlife/templates/app.yml index 20d4aca..9a767f7 100644 --- a/charts/theautomatedlife/templates/app.yml +++ b/charts/theautomatedlife/templates/app.yml @@ -66,7 +66,7 @@ spec: - fuw2.eks-test-default.mpg-chm.com # secretName: ingress-ca rules: - - host: theautomated.life + - host: fuw2.eks-test-default.mpg-chm.com http: paths: - path: / -- GitLab From 47cd09a5390d8c7166c6ded634e77d5187df4dbe Mon Sep 17 00:00:00 2001 From: jmuecke <48099698+jmuecke@users.noreply.github.com> Date: Tue, 2 Mar 2021 17:55:18 +0100 Subject: [PATCH 6/9] Use correct image path --- charts/theautomatedlife/templates/app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/theautomatedlife/templates/app.yml b/charts/theautomatedlife/templates/app.yml index 9a767f7..0bc20c4 100644 --- a/charts/theautomatedlife/templates/app.yml +++ b/charts/theautomatedlife/templates/app.yml @@ -19,7 +19,7 @@ spec: app: future-of-work-2 spec: containers: - - image: {{ .Values.registryUrl }}/{{ .Values.dockerRegistryPrefix }}/future-of-work:{{ .Values.imageTag }} + - image: {{ .Values.registryUrl }}/{{ .Values.dockerRegistryPrefix }}/theautomatedlife:{{ .Values.imageTag }} imagePullPolicy: Always name: future-of-work ports: -- GitLab From b22b00274d5df7983e92c464c1bbb3ed1f02c111 Mon Sep 17 00:00:00 2001 From: jmuecke <48099698+jmuecke@users.noreply.github.com> Date: Tue, 2 Mar 2021 18:05:20 +0100 Subject: [PATCH 7/9] different load balancer for testing --- charts/theautomatedlife/templates/app.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/theautomatedlife/templates/app.yml b/charts/theautomatedlife/templates/app.yml index 0bc20c4..8b11e63 100644 --- a/charts/theautomatedlife/templates/app.yml +++ b/charts/theautomatedlife/templates/app.yml @@ -58,8 +58,8 @@ kind: Ingress metadata: name: future-of-work-2 annotations: - kubernetes.io/tls-acme: "true" - kubernetes.io/ingress.class: "nginxtal" + #kubernetes.io/tls-acme: "true" + #kubernetes.io/ingress.class: "nginxtal" spec: tls: - hosts: -- GitLab From c462b871ddf67b4f7949da2af9fa555affd867b1 Mon Sep 17 00:00:00 2001 From: jmuecke <48099698+jmuecke@users.noreply.github.com> Date: Tue, 2 Mar 2021 18:12:07 +0100 Subject: [PATCH 8/9] Switch to correct domain --- charts/theautomatedlife/templates/app.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/theautomatedlife/templates/app.yml b/charts/theautomatedlife/templates/app.yml index 8b11e63..9f87295 100644 --- a/charts/theautomatedlife/templates/app.yml +++ b/charts/theautomatedlife/templates/app.yml @@ -58,15 +58,15 @@ kind: Ingress metadata: name: future-of-work-2 annotations: - #kubernetes.io/tls-acme: "true" - #kubernetes.io/ingress.class: "nginxtal" + kubernetes.io/tls-acme: "true" + kubernetes.io/ingress.class: "nginxtal" spec: tls: - hosts: - - fuw2.eks-test-default.mpg-chm.com + - theautomated.life # secretName: ingress-ca rules: - - host: fuw2.eks-test-default.mpg-chm.com + - host: theautomated.life http: paths: - path: / -- GitLab From ca4e13bf1ff227c9abc4d72a69a2b268d2666c53 Mon Sep 17 00:00:00 2001 From: jmuecke <48099698+jmuecke@users.noreply.github.com> Date: Tue, 2 Mar 2021 18:17:42 +0100 Subject: [PATCH 9/9] Do not deploy on dev branches --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0fc3fec..5206657 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -58,6 +58,9 @@ build-container: deploy: stage: deploy <<: *commonheader + only: + refs: + - master image: ${REGISTERY_URL}/${DOCKER_REGISTERY_PREFIX}/app/cd-tools:0.1 script: - set -xv -- GitLab