deployment automation for staging
This commit is contained in:
parent
f773cf169b
commit
dafd73b7d5
11 changed files with 187 additions and 5 deletions
2
deployment/kustomize/base/database/kustomization.yaml
Normal file
2
deployment/kustomize/base/database/kustomization.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
resources:
|
||||
- vshnpostgresql.yaml
|
19
deployment/kustomize/base/database/vshnpostgresql.yaml
Normal file
19
deployment/kustomize/base/database/vshnpostgresql.yaml
Normal file
|
@ -0,0 +1,19 @@
|
|||
apiVersion: vshn.appcat.vshn.io/v1
|
||||
kind: VSHNPostgreSQL
|
||||
metadata:
|
||||
name: servala
|
||||
spec:
|
||||
parameters:
|
||||
service:
|
||||
majorVersion: "16"
|
||||
pgSettings:
|
||||
timezone: Europe/Zurich
|
||||
size:
|
||||
plan: standard-2
|
||||
backup:
|
||||
schedule: "30 23 * * *"
|
||||
retention: 12
|
||||
encryption:
|
||||
enabled: true
|
||||
writeConnectionSecretToRef:
|
||||
name: database-creds
|
62
deployment/kustomize/base/portal/deployment.yaml
Normal file
62
deployment/kustomize/base/portal/deployment.yaml
Normal file
|
@ -0,0 +1,62 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app: servala
|
||||
name: servala
|
||||
spec:
|
||||
replicas: 1
|
||||
revisionHistoryLimit: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: servala
|
||||
strategy:
|
||||
type: RollingUpdate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: servala
|
||||
spec:
|
||||
containers:
|
||||
- name: servala
|
||||
image: servala-2nkgm.app.codey.ch/servala/servala-portal:latest
|
||||
imagePullPolicy: Always
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /admin/
|
||||
port: 8080
|
||||
periodSeconds: 60
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /admin/
|
||||
port: 8080
|
||||
periodSeconds: 60
|
||||
initialDelaySeconds: 5
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8080
|
||||
protocol: TCP
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: servala
|
||||
env:
|
||||
- name: SERVALA_DB_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: database-creds
|
||||
key: POSTGRESQL_USER
|
||||
- name: SERVALA_DB_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: database-creds
|
||||
key: POSTGRESQL_PASSWORD
|
||||
- name: SERVALA_DB_HOST
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: database-creds
|
||||
key: POSTGRESQL_HOST
|
||||
- name: SERVALA_DB_PORT
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: database-creds
|
||||
key: POSTGRESQL_PORT
|
3
deployment/kustomize/base/portal/kustomization.yaml
Normal file
3
deployment/kustomize/base/portal/kustomization.yaml
Normal file
|
@ -0,0 +1,3 @@
|
|||
resources:
|
||||
- deployment.yaml
|
||||
- service.yaml
|
15
deployment/kustomize/base/portal/service.yaml
Normal file
15
deployment/kustomize/base/portal/service.yaml
Normal file
|
@ -0,0 +1,15 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: servala
|
||||
labels:
|
||||
app: servala
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
port: 8080
|
||||
protocol: TCP
|
||||
targetPort: http
|
||||
selector:
|
||||
app: servala
|
||||
type: ClusterIP
|
22
deployment/kustomize/overlays/staging/ingress.yaml
Normal file
22
deployment/kustomize/overlays/staging/ingress.yaml
Normal file
|
@ -0,0 +1,22 @@
|
|||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt-production
|
||||
name: servala
|
||||
spec:
|
||||
rules:
|
||||
- host: staging.portal.servala.com
|
||||
http:
|
||||
paths:
|
||||
- pathType: Prefix
|
||||
path: /
|
||||
backend:
|
||||
service:
|
||||
name: servala
|
||||
port:
|
||||
number: 8080
|
||||
tls:
|
||||
- hosts:
|
||||
- staging.portal.servala.com
|
||||
secretName: ingress-cert
|
13
deployment/kustomize/overlays/staging/kustomization.yaml
Normal file
13
deployment/kustomize/overlays/staging/kustomization.yaml
Normal file
|
@ -0,0 +1,13 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
labels:
|
||||
- includeSelectors: true
|
||||
pairs:
|
||||
app.kubernetes.io/instance: test
|
||||
app.kubernetes.io/name: servala
|
||||
resources:
|
||||
- ../../base/portal
|
||||
- ../../base/database
|
||||
- ingress.yaml
|
||||
patches:
|
||||
- path: portal-deployment.yaml
|
14
deployment/kustomize/overlays/staging/portal-deployment.yaml
Normal file
14
deployment/kustomize/overlays/staging/portal-deployment.yaml
Normal file
|
@ -0,0 +1,14 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: servala
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: servala
|
||||
env:
|
||||
- name: SERVALA_ENVIRONMENT
|
||||
value: staging
|
||||
- name: SERVALA_ALLOWED_HOSTS
|
||||
value: staging.portal.servala.com
|
Loading…
Add table
Add a link
Reference in a new issue