Commit 1303183b authored by Jens Langhammer's avatar Jens Langhammer

Add optional tier0 deployment to Helm Chart

parent f1fcb6e9
Pipeline #3859 passed with stage
in 1 minute and 30 seconds
{{- if .Values.beta_enable_tier0 -}}
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ include "p2.fullname" . }}-tier0
labels:
app.kubernetes.io/name: {{ include "p2.name" . }}
helm.sh/chart: {{ include "p2.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
replicas: {{ .Values.deployment.tier0Instances }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "p2.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "p2.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
k8s.p2.io/component: tier0
spec:
containers:
- name: {{ .Chart.Name }}
image: "docker.beryju.org/p2/tier0:{{ .Values.image.tag }}"
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 8092
protocol: TCP
- name: http-cache
containerPort: 8093
protocol: TCP
livenessProbe:
initialDelaySeconds: 20
timeoutSeconds: 5
httpGet:
path: /
port: http
readinessProbe:
initialDelaySeconds: 20
timeoutSeconds: 5
httpGet:
path: /
port: http
{{- end }}
{{- if .Values.beta_enable_tier0 -}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "p2.fullname" . }}-tier0
labels:
app.kubernetes.io/name: {{ include "p2.name" . }}
helm.sh/chart: {{ include "p2.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
type: ClusterIP
ports:
- port: 8092
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: {{ include "p2.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
k8s.p2.io/component: tier0
{{- end }}
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "p2.fullname" . -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}
name: {{ include "p2.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "p2.name" . }}
helm.sh/chart: {{ include "p2.chart" . }}
......@@ -33,9 +31,20 @@ spec:
- host: {{ . | quote }}
http:
paths:
- path: {{ $ingressPath }}
{{- if .Values.beta_enable_tier0 -}}
- path: /_/
backend:
serviceName: {{ $fullName }}
serviceName: {{ include "p2.fullname" . }}-web
servicePort: http
- path: /
backend:
serviceName: {{ include "p2.fullname" . }}-tier0
servicePort: http
{{- else }}
- path: /
backend:
serviceName: {{ include "p2.fullname" . }}-web
servicePort: http
{{- end }}
{{- end }}
{{- end }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "p2.fullname" . }}
name: {{ include "p2.fullname" . }}-web
labels:
app.kubernetes.io/name: {{ include "p2.name" . }}
helm.sh/chart: {{ include "p2.chart" . }}
......
......@@ -15,9 +15,12 @@ config:
# By default uses the first ingresss host
# s3_base_domain: ""
beta_enable_tier0: false
deployment:
webInstances: 2
workerInstances: 1
tier0Instances: 2
postgresql:
postgresqlUsername: p2
......@@ -26,7 +29,6 @@ postgresql:
ingress:
enabled: true
path: /
hosts:
- p2.k8s.local
tls: []
......
Markdown is supported
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