diff --git a/deploy/base/deployment.yaml b/deploy/base/deployment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..20fee733c7905054ed31748f24b7c707ff5d9d8f --- /dev/null +++ b/deploy/base/deployment.yaml @@ -0,0 +1,40 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: teckids-website + namespace: teckids-website + labels: + app: teckids-website +spec: + replicas: 3 + selector: + matchLabels: + app: teckids-website + template: + metadata: + labels: + app: teckids-website + spec: + containers: + - 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 diff --git a/deploy/base/ingress.yaml b/deploy/base/ingress.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b22f57169f82a07d9fc04e72da518dcc6cf09eb3 --- /dev/null +++ b/deploy/base/ingress.yaml @@ -0,0 +1,11 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + cert-manager.io/cluster-issuer: letsencrypt-prod + kubernetes.io/tls-acme: "true" + name: teckids-website-caddy + namespace: teckids-website +spec: + ingressClassName: nginx + rules: [] diff --git a/deploy/base/kustomization.yaml b/deploy/base/kustomization.yaml new file mode 100644 index 0000000000000000000000000000000000000000..dfde199d8db02f02b99d92457f7106be6d4377c2 --- /dev/null +++ b/deploy/base/kustomization.yaml @@ -0,0 +1,10 @@ +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 diff --git a/deploy/service.yaml b/deploy/base/service.yaml similarity index 100% rename from deploy/service.yaml rename to deploy/base/service.yaml diff --git a/deploy/deployment.yaml b/deploy/deployment.yaml deleted file mode 100644 index 53688d5f2e86aeb6976b77c77b49e0635897180f..0000000000000000000000000000000000000000 --- a/deploy/deployment.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: teckids-website - namespace: teckids-website - labels: - app: teckids-website -spec: - replicas: 3 - selector: - matchLabels: - app: teckids-website - template: - metadata: - labels: - app: teckids-website - spec: - containers: - - name: caddy - image: registry.edugit.org/teckids/team-pr/teckids.org:IMAGE_TAG - ports: - - containerPort: 80 diff --git a/deploy/ingress.yaml b/deploy/overlays/production/ingress_patch.yaml similarity index 100% rename from deploy/ingress.yaml rename to deploy/overlays/production/ingress_patch.yaml diff --git a/deploy/overlays/production/kustomization.yaml b/deploy/overlays/production/kustomization.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e5903017ada6000717f739bab73aff5373ec2d2c --- /dev/null +++ b/deploy/overlays/production/kustomization.yaml @@ -0,0 +1,12 @@ +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 +patchesStrategicMerge: +- ingress_patch.yaml diff --git a/deploy/overlays/review/ingress_patch.yaml b/deploy/overlays/review/ingress_patch.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f4e70331c34fad7eb90af4bc46b8c4c8f9f871e0 --- /dev/null +++ b/deploy/overlays/review/ingress_patch.yaml @@ -0,0 +1,25 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + cert-manager.io/cluster-issuer: letsencrypt-prod + kubernetes.io/tls-acme: "true" + name: teckids-website-caddy + namespace: teckids-website +spec: + ingressClassName: nginx + rules: + - host: __REVIEW_ENVIRONMENT__.staging.teckids.org + http: + paths: + - backend: + service: + name: teckids-website + port: + number: 80 + path: / + pathType: Prefix + tls: + - hosts: + - __REVIEW_ENVIRONMENT__.staging.teckids.org + secretName: __REVIEW_ENVIRONMENT__-teckids-website-tls diff --git a/deploy/overlays/review/kustomization.yaml b/deploy/overlays/review/kustomization.yaml new file mode 100644 index 0000000000000000000000000000000000000000..549a7e02cf15e709c3d3d5a51621e295a51abbb6 --- /dev/null +++ b/deploy/overlays/review/kustomization.yaml @@ -0,0 +1,13 @@ +bases: +- ../../base +commonAnnotations: + source-repository: https://edugit.org/Teckids/team-pr/teckids.org +commonLabels: + app: teckids-website + environment: __REVIEW_ENVIRONMENT__ +namePrefix: __REVIEW_ENVIRONMENT__- +namespace: teckids-website +patchesStrategicMerge: +- ingress_patch.yaml +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization