diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3e7cee4488d7b077622aa5705c7e506ffd2d9378..d6f54b8304e5021b999228aabd12beb6fc95ceab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -83,6 +83,7 @@ deploy review: script: - cd deploy/overlays/review - kustomize edit set image registry.edugit.org/teckids/team-pr/teckids.org:$CI_COMMIT_REF_NAME@$(cat ../../../DIGESTFILE) + - kustomize edit set nameprefix $CI_COMMIT_REF_SLUG - kustomize build | sed s/__REVIEW_NAME__/$CI_COMMIT_REF_SLUG/g > output.yaml - kubectl --kubeconfig=/tmp/kubeconfig apply -f output.yaml @@ -95,7 +96,7 @@ delete review: before_script: - echo $KUBECONFIG | base64 -d > /tmp/kubeconfig - cd deploy/overlays/review - - kustomize build | envsubst > output.yaml + - kustomize build | sed s/__REVIEW_NAME__/$CI_COMMIT_REF_SLUG/g > output.yaml script: - kubectl --kubeconfig=/tmp/kubeconfig delete -f output.yaml when: manual diff --git a/deploy/base/deployment.yaml b/deploy/base/deployment.yaml index 20fee733c7905054ed31748f24b7c707ff5d9d8f..37d1473b57cbeab790fc554da59db5990d637b7f 100644 --- a/deploy/base/deployment.yaml +++ b/deploy/base/deployment.yaml @@ -19,22 +19,19 @@ spec: - name: caddy image: registry.edugit.org/teckids/team-pr/teckids.org:IMAGE_TAG ports: - - containerPort: 80 - livenessProbe: - httpGet: - scheme: HTTP - port: http - path: / - timeoutSeconds: 10 - initialDelaySeconds: 60 - name: adressbuch - ports: - - containerPort: 80 - name: http - readinessProbe: - httpGet: - scheme: HTTP - port: http - path: / - timeoutSeconds: 10 - initialDelaySeconds: 120 + - containerPort: 80 + name: http + livenessProbe: + httpGet: + scheme: HTTP + port: http + path: / + timeoutSeconds: 10 + initialDelaySeconds: 60 + readinessProbe: + httpGet: + scheme: HTTP + port: http + path: / + timeoutSeconds: 10 + initialDelaySeconds: 120 diff --git a/deploy/base/kustomization.yaml b/deploy/base/kustomization.yaml index dfde199d8db02f02b99d92457f7106be6d4377c2..05be69a0a2858bfcff8a0fe91ea4aad6252ade01 100644 --- a/deploy/base/kustomization.yaml +++ b/deploy/base/kustomization.yaml @@ -2,9 +2,11 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization commonAnnotations: source-repository: https://edugit.org/Teckids/team-pr/teckids.org -commonLabels: - app: teckids-website resources: - - deployment.yaml - - service.yaml - - ingress.yaml +- deployment.yaml +- service.yaml +- ingress.yaml +labels: +- includeSelectors: true + pairs: + app: teckids-website diff --git a/deploy/overlays/production/kustomization.yaml b/deploy/overlays/production/kustomization.yaml index e02d0bfd83ce7a06e8c8954a54cdb6ebea4da69f..aeffaa3dd37a513a643c4fa61b40a2d847892f55 100644 --- a/deploy/overlays/production/kustomization.yaml +++ b/deploy/overlays/production/kustomization.yaml @@ -1,21 +1,23 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -bases: -- ../../base commonAnnotations: source-repository: https://edugit.org/Teckids/team-pr/teckids.org -commonLabels: - app: teckids-website - environment: production namespace: teckids-website patches: -- target: - kind: Ingress - name: teckids-website-caddy - patch: |- +- patch: |- - op: replace path: /spec/rules/0/host value: teckids.org - op: replace path: /spec/tls/0/hosts/0 value: teckids.org + target: + kind: Ingress + name: teckids-website-caddy +resources: +- ../../base +labels: +- includeSelectors: true + pairs: + app: teckids-website + environment: production diff --git a/deploy/overlays/review/kustomization.yaml b/deploy/overlays/review/kustomization.yaml index 58a8bcb99f359f35da1012f2faa9c3cc6a1b15c5..07e58d7eca10d24f8121304f528d76e08b88824b 100644 --- a/deploy/overlays/review/kustomization.yaml +++ b/deploy/overlays/review/kustomization.yaml @@ -1,18 +1,10 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -bases: -- ../../base commonAnnotations: source-repository: https://edugit.org/Teckids/team-pr/teckids.org -commonLabels: - app: teckids-website - environment: __REVIEW_NAME__ namespace: teckids-website patches: -- target: - kind: Ingress - name: teckids-website-caddy - patch: |- +- patch: |- - op: replace path: /spec/rules/0/host value: __REVIEW_NAME__.review.teckids.org @@ -22,3 +14,13 @@ patches: - op: replace path: /spec/tls/0/secretName value: __REVIEW_NAME__-website-tls + target: + kind: Ingress + name: teckids-website-caddy +resources: +- ../../base +labels: +- includeSelectors: true + pairs: + app: teckids-website + environment: __REVIEW_NAME__