Commit 12846bf5 authored by Matthias's avatar Matthias
Browse files

add k8s manifests

parent adf0a20b
Pipeline #25046 passed with stages
in 2 minutes and 9 seconds
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.k8sGroupId }}-{{ .Values.k8sName }}-{{ .Values.k8sEnvironment}}-config
namespace: memobase
data:
IMPORT_API_URL: {{ .Values.importApiUrl }}
DRUPAL_API_URL: {{ .Values.drupalApiUrl }}
TOPIC_CONFIGS: {{ .Values.topicConfigs }}
TOPIC_DRUPAL_EXPORT: {{ .Values.topicDrupalExport }}
\ No newline at end of file
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ .Values.k8sGroupId }}-{{ .Values.k8sName }}-{{ .Values.k8sEnvironment}}"
namespace: "{{ .Values.k8sNamespace }}"
labels:
app: "{{ .Values.k8sGroupId }}-{{ .Values.k8sName }}-{{ .Values.k8sEnvironment}}-app"
spec:
selector:
matchLabels:
app: "{{ .Values.k8sGroupId }}-{{ .Values.k8sName }}-{{ .Values.k8sEnvironment}}-app"
replicas: {{ .Values.k8sReplicas }}
template:
metadata:
labels:
app: "{{ .Values.k8sGroupId }}-{{ .Values.k8sName }}-{{ .Values.k8sEnvironment}}-app"
group: "{{ .Values.k8sGroupName }}"
environment: "{{ .Values.k8sEnvironment }}"
spec:
serviceAccountName: {{ .Values.k8sGroupId }}-{{ .Values.k8sName }}-{{ .Values.k8sEnvironment}}-service-account #to be able to manage other pods inside the cluster
containers:
- name: "{{ .Values.k8sGroupId }}-{{ .Values.k8sName }}-{{ .Values.k8sEnvironment}}-container"
image: "{{ .Values.registry }}/{{ .Values.image }}:{{ .Values.tag }}"
envFrom:
- secretRef:
name: {{ .Values.drupalApiCredentials }}
- secretRef:
name: {{ .Values.sftpConfigs }}
- configMapRef:
name: "{{ .Values.kafkaConfigs }}"
- configMapRef:
name: "{{ .Values.importApiConfig }}"
ports:
- containerPort: 5000
name: http
protocol: TCP
imagePullPolicy: Always
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
namespace: {{ .Values.k8sNamespace }}
name: {{ .Values.k8sGroupId }}-{{ .Values.k8sName }}-{{ .Values.k8sEnvironment}}-ingress
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
tls:
- hosts:
- {{ .Values.k8sEnvironment}}-import.memobase.k8s.unibas.ch
secretName: {{ .Values.k8sEnvironment}}-import.memobase.k8s.unibas.ch-tls
rules:
- host: {{ .Values.k8sEnvironment}}-import.memobase.k8s.unibas.ch
http:
paths:
- path: /
backend:
serviceName: {{ .Values.k8sGroupId }}-{{ .Values.k8sName }}-{{ .Values.k8sEnvironment}}-service-account
servicePort: 5000
\ No newline at end of file
apiVersion: v1
kind: Service
metadata:
namespace: {{ .Values.k8sNamespace }}
name: {{ .Values.k8sGroupId }}-{{ .Values.k8sName }}-{{ .Values.k8sEnvironment}}-service-account
labels:
app: {{ .Values.k8sGroupId }}-{{ .Values.k8sName }}-{{ .Values.k8sEnvironment}}
spec:
ports:
- port: 5000
selector:
app: {{ .Values.k8sGroupId }}-{{ .Values.k8sName }}-{{ .Values.k8sEnvironment}}
tier: web
clusterIP: None
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment