From 3e4a38a8c9cdae16e5a2596eafb17ccd6775c6c9 Mon Sep 17 00:00:00 2001 From: Antun Franjin Date: Fri, 13 May 2022 07:31:47 +0200 Subject: [PATCH] Add bioplus deployment production. --- 02_hetzner/01_prod/bioplus/deployment.yaml | 129 +++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 02_hetzner/01_prod/bioplus/deployment.yaml diff --git a/02_hetzner/01_prod/bioplus/deployment.yaml b/02_hetzner/01_prod/bioplus/deployment.yaml new file mode 100644 index 0000000..f1fa070 --- /dev/null +++ b/02_hetzner/01_prod/bioplus/deployment.yaml @@ -0,0 +1,129 @@ +# Deployment description +apiVersion: apps/v1 +kind: Deployment +metadata: + name: bioplus-deployment + namespace: prod-environment + labels: + app: bioplus-prod +spec: + strategy: + type: Recreate + replicas: 1 + selector: + matchLabels: + app: bioplus-prod + template: + metadata: + labels: + app: bioplus-prod + spec: + securityContext: + runAsUser: 1000 + runAsGroup: 1000 + fsGroup: 1000 + containers: + - name: bioplus + image: packages.semapp.lan:5000/bioplus_backend:V1.0.0 + imagePullPolicy: Always + resources: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "256Mi" + cpu: "4" + ports: + - containerPort: 8000 + name: bioplus-http + protocol: TCP + envFrom: + - configMapRef: + name: bioplus-prod-config-prod + volumeMounts: + - mountPath: bioplus_wagtail/media/. + name: bioplus-pv-prod + volumes: + - name: bioplus-pv-prod + persistentVolumeClaim: + claimName: bioplus-pvc-prod +--- +apiVersion: v1 +kind: ConfigMap +metadata: + namespace: prod-environment + name: bioplus-prod-config-prod + labels: + app: bioplus-prod +data: + DJANGO_DB_ENGINE: "django.db.backends.postgresql_psycopg2" + DJANGO_DB_NAME: "bioplus-wagtail" + DJANGO_DB_USER: "bioplus-wagtail" + DJANGO_DB_PASSWORD: "jNeF7PfvrDG1bJLNCibb" + DJANGO_DB_HOST: "psql.semprod.local" + DJANGO_DB_PORT: "5432" + +--- +# Persistent Volume Claim description +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: bioplus-pvc-prod + namespace: prod-environment + labels: + app: bioplus-prod +spec: + storageClassName: longhorn + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi +--- +# semapp Service +apiVersion: v1 +kind: Service +metadata: + name: bioplus + namespace: prod-environment +spec: + selector: + app: bioplus-prod + ports: + - name: bioplus-http + port: 8000 + targetPort: bioplus-http + type: NodePort +--- + +# Ingress description +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: bioplus-prod-ingress + namespace: prod-environment + annotations: + kubernetes.io/ingress.class: "traefik" +spec: + rules: + - host: bioplus.k8s.semprod.local + http: + paths: + - backend: + service: + name: bioplus + port: + number: 8000 + path: / + pathType: ImplementationSpecific + + - host: bioplus.semapp.de + http: + paths: + - backend: + service: + name: bioplus + port: + number: 8000 + path: / + pathType: ImplementationSpecific \ No newline at end of file