Skip to content

Commit

Permalink
Create Kustomize prod overlay.
Browse files Browse the repository at this point in the history
  • Loading branch information
ropable committed Oct 12, 2023
1 parent eb0f748 commit 6b68527
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 0 deletions.
55 changes: 55 additions & 0 deletions kustomize/overlays/prod/deployment_patch.yaml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions kustomize/overlays/prod/ingress.yaml
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions kustomize/overlays/prod/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions kustomize/overlays/prod/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: csw-pdb
spec:
minAvailable: 1
selector:
matchLabels:
app: csw-prod
variant: prod
9 changes: 9 additions & 0 deletions kustomize/overlays/prod/service_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: csw-clusterip
spec:
type: ClusterIP
selector:
app: csw-prod
variant: prod

0 comments on commit 6b68527

Please sign in to comment.