diff --git a/kustomize/overlays/prod/deployment_patch.yaml b/kustomize/overlays/prod/deployment_patch.yaml new file mode 100644 index 0000000..38da60e --- /dev/null +++ b/kustomize/overlays/prod/deployment_patch.yaml @@ -0,0 +1,55 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: csw-deployment + labels: + app: csw-prod +spec: + selector: + matchLabels: + app: csw-prod + template: + metadata: + labels: + app: csw-prod + spec: + containers: + - name: csw + image: ghcr.io/dbca-wa/csw:1.3.8 + imagePullPolicy: IfNotPresent + env: + - name: DATABASE_URL + valueFrom: + secretKeyRef: + name: csw-env-prod + key: DATABASE_URL + - name: SECRET_KEY + valueFrom: + secretKeyRef: + name: csw-env-prod + key: SECRET_KEY + - name: BASE_URL + valueFrom: + secretKeyRef: + name: csw-env-prod + key: BASE_URL + - name: CORS_URL + valueFrom: + secretKeyRef: + name: csw-env-prod + key: CORS_URL + - name: AZURE_ACCOUNT_NAME + valueFrom: + secretKeyRef: + name: csw-env-prod + key: AZURE_ACCOUNT_NAME + - name: AZURE_ACCOUNT_KEY + valueFrom: + secretKeyRef: + name: csw-env-prod + key: AZURE_ACCOUNT_KEY + - name: AZURE_CONTAINER + valueFrom: + secretKeyRef: + name: csw-env-prod + key: AZURE_CONTAINER diff --git a/kustomize/overlays/prod/ingress.yaml b/kustomize/overlays/prod/ingress.yaml new file mode 100644 index 0000000..177319c --- /dev/null +++ b/kustomize/overlays/prod/ingress.yaml @@ -0,0 +1,17 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: csw-ingress +spec: + ingressClassName: nginx + rules: + - host: csw.dbca.wa.gov.au + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: csw-clusterip-prod + port: + number: 8080 diff --git a/kustomize/overlays/prod/kustomization.yaml b/kustomize/overlays/prod/kustomization.yaml new file mode 100644 index 0000000..1d37b7d --- /dev/null +++ b/kustomize/overlays/prod/kustomization.yaml @@ -0,0 +1,19 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +nameSuffix: -prod +secretGenerator: +- name: csw-env + type: Opaque + envs: + - .env +resources: +- ../../base +- ingress.yaml +- pdb.yaml +labels: +- includeSelectors: true + pairs: + variant: prod +patches: +- path: deployment_patch.yaml +- path: service_patch.yaml diff --git a/kustomize/overlays/prod/pdb.yaml b/kustomize/overlays/prod/pdb.yaml new file mode 100644 index 0000000..5ce61d8 --- /dev/null +++ b/kustomize/overlays/prod/pdb.yaml @@ -0,0 +1,10 @@ +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: csw-pdb +spec: + minAvailable: 1 + selector: + matchLabels: + app: csw-prod + variant: prod diff --git a/kustomize/overlays/prod/service_patch.yaml b/kustomize/overlays/prod/service_patch.yaml new file mode 100644 index 0000000..b925f51 --- /dev/null +++ b/kustomize/overlays/prod/service_patch.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Service +metadata: + name: csw-clusterip +spec: + type: ClusterIP + selector: + app: csw-prod + variant: prod