zammad: Match on instance

This commit is contained in:
Nico Schottelius 2021-10-11 10:46:24 +09:00
parent f128bf8f38
commit e84330320f

View file

@ -6,12 +6,13 @@ metadata:
spec: spec:
selector: selector:
matchLabels: matchLabels:
app: {{ .Release.Name }}-postgres instance: {{ .Release.Name }}-postgres
replicas: 1 replicas: 1
template: template:
metadata: metadata:
labels: labels:
app: {{ .Release.Name }}-postgres app: postgres
instance: {{ .Release.Name }}-postgres
spec: spec:
containers: containers:
- name: postgres - name: postgres
@ -21,7 +22,6 @@ spec:
envFrom: envFrom:
- secretRef: - secretRef:
name: {{ tpl .Values.identifier . }}-postgres-config name: {{ tpl .Values.identifier . }}-postgres-config
volumeMounts: volumeMounts:
- name: postgres-data - name: postgres-data
mountPath: "/var/lib/postgresql/data" mountPath: "/var/lib/postgresql/data"
@ -45,12 +45,13 @@ metadata:
spec: spec:
selector: selector:
matchLabels: matchLabels:
app: {{ .Release.Name }}-elasticsearch instance: {{ .Release.Name }}-elasticsearch
replicas: 1 replicas: 1
template: template:
metadata: metadata:
labels: labels:
app: {{ .Release.Name }}-elasticsearch app: elasticsearch
instance: {{ .Release.Name }}-elasticsearch
spec: spec:
containers: containers:
- name: elasticsearch - name: elasticsearch
@ -76,28 +77,47 @@ kind: Service
metadata: metadata:
name: {{ .Release.Name }}-elasticsearch name: {{ .Release.Name }}-elasticsearch
labels: labels:
app: {{ .Release.Name }}-elasticsearch app: elasticsearch
instance: {{ .Release.Name }}-elasticsearch
spec: spec:
type: ClusterIP type: ClusterIP
ports: ports:
- port: 9200 - port: 9200
name: elasticsearch name: elasticsearch
selector: selector:
app: {{ .Release.Name }}-elasticsearch instance: {{ .Release.Name }}-elasticsearch
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ .Release.Name }}-postgres name: {{ .Release.Name }}-postgres
labels: labels:
app: {{ .Release.Name }}-postgres instance: {{ .Release.Name }}-postgres
app: postgres
spec: spec:
type: ClusterIP type: ClusterIP
ports: ports:
- port: 5432 - port: 5432
name: postgres name: postgres
selector: selector:
app: {{ .Release.Name }}-postgres instance: {{ .Release.Name }}-postgres
---
apiVersion: v1
kind: Service
metadata:
name: {{ tpl .Values.identifier . }}
labels:
app: zammad
instance: {{ tpl .Values.identifier . }}
spec:
type: ClusterIP
ports:
- port: 80
name: http
- port: 443
name: https
selector:
instance: {{ .Release.Name }}-zammad
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
@ -106,25 +126,17 @@ metadata:
spec: spec:
selector: selector:
matchLabels: matchLabels:
app: {{ .Release.Name }}-zammad instance: {{ .Release.Name }}-zammad
replicas: 1 replicas: 1
template: template:
metadata: metadata:
labels: labels:
app: {{ .Release.Name }}-zammad app: zammad
instance: {{ .Release.Name }}-zammad
annotations: annotations:
checksum/config: {{ include (print $.Template.BasePath "/nginxconf.yaml") . | sha256sum }} checksum/config: {{ include (print $.Template.BasePath "/nginxconf.yaml") . | sha256sum }}
spec: spec:
initContainers: initContainers:
# - name: wait-for-cert
# image: busybox
# command:
# - sh
# - -c
# - until ls /etc/letsencrypt/live/{{ tpl .Values.fqdn . }}/fullchain.pem; do sleep 5; done
# volumeMounts:
# - name: etcletsencrypt
# mountPath: "/etc/letsencrypt"
- name: change-permissions - name: change-permissions
image: busybox image: busybox
command: command:
@ -188,18 +200,6 @@ spec:
mountPath: "/etc/letsencrypt" mountPath: "/etc/letsencrypt"
- name: zammad-data - name: zammad-data
mountPath: "/opt/zammad" mountPath: "/opt/zammad"
# # Is it ready to work?
# readinessProbe:
# tcpSocket:
# port: 443
# initialDelaySeconds: 5
# periodSeconds: 10
# # Is it still working?
# livenessProbe:
# tcpSocket:
# port: 443
# initialDelaySeconds: 15
# periodSeconds: 20
- name: memcached - name: memcached
image: memcached:1.6.12-alpine image: memcached:1.6.12-alpine
resources: resources:
@ -213,13 +213,13 @@ spec:
- containerPort: 11211 - containerPort: 11211
- name: redis - name: redis
image: redis:6.2.6-alpine image: redis:6.2.6-alpine
# resources: resources:
# requests: requests:
# memory: "64Mi" memory: "32Mi"
# cpu: "100m" cpu: "100m"
# limits: limits:
# memory: "128Mi" memory: "64Mi"
# cpu: "500m" cpu: "200m"
ports: ports:
- containerPort: 6379 - containerPort: 6379
- name: zammad-railsserver - name: zammad-railsserver
@ -234,26 +234,6 @@ spec:
limits: limits:
memory: "512Mi" memory: "512Mi"
cpu: "500m" cpu: "500m"
# Wait for 10 minutes to get ready
# startupProbe:
# httpGet:
# path: /ocs/v2.php/apps/serverinfo/api/v1/info
# port: fpm
# failureThreshold: 20
# periodSeconds: 30
# Dead if failing for 1 minute
# livenessProbe:
# httpGet:
# path: /ocs/v2.php/apps/serverinfo/api/v1/info
# port: fpm
# failureThreshold: 6
# periodSeconds: 10
# readinessProbe:
# httpGet:
# path: /ocs/v2.php/apps/serverinfo/api/v1/info
# port: fpm
# failureThreshold: 3
# periodSeconds: 30
ports: ports:
- containerPort: 3000 - containerPort: 3000
name: rails name: rails
@ -281,18 +261,6 @@ spec:
value: "localhost:11211" value: "localhost:11211"
- name: ELASTICSEARCH_HOST - name: ELASTICSEARCH_HOST
value: "{{ .Release.Name }}-elasticsearch" value: "{{ .Release.Name }}-elasticsearch"
# - name: ZAMMAD_TRUSTED_DOMAINS
# value: "{{ tpl .Values.fqdn . }}"
# - name: ZAMMAD_ADMIN_USER
# valueFrom:
# secretKeyRef:
# name: {{ tpl .Values.identifier . }}-zammad
# key: USERNAME
# - name: ZAMMAD_ADMIN_PASSWORD
# valueFrom:
# secretKeyRef:
# name: {{ tpl .Values.identifier . }}-zammad
# key: PASSWORD
volumeMounts: volumeMounts:
- name: zammad-data - name: zammad-data
mountPath: "/opt/zammad" mountPath: "/opt/zammad"
@ -365,18 +333,6 @@ spec:
value: "localhost:11211" value: "localhost:11211"
- name: ELASTICSEARCH_HOST - name: ELASTICSEARCH_HOST
value: "{{ .Release.Name }}-elasticsearch" value: "{{ .Release.Name }}-elasticsearch"
# - name: ZAMMAD_TRUSTED_DOMAINS
# value: "{{ tpl .Values.fqdn . }}"
# - name: ZAMMAD_ADMIN_USER
# valueFrom:
# secretKeyRef:
# name: {{ tpl .Values.identifier . }}-zammad
# key: USERNAME
# - name: ZAMMAD_ADMIN_PASSWORD
# valueFrom:
# secretKeyRef:
# name: {{ tpl .Values.identifier . }}-zammad
# key: PASSWORD
volumeMounts: volumeMounts:
- name: zammad-data - name: zammad-data
mountPath: "/opt/zammad" mountPath: "/opt/zammad"
@ -405,33 +361,16 @@ spec:
name: {{ tpl .Values.identifier . }}-nginx-config name: {{ tpl .Values.identifier . }}-nginx-config
--- ---
apiVersion: v1 apiVersion: v1
kind: Service
metadata:
name: {{ tpl .Values.identifier . }}
labels:
app: {{ tpl .Values.identifier . }}
spec:
type: ClusterIP
ports:
# Required for letsencrypt
- port: 80
name: http
- port: 443
name: https
selector:
app: {{ .Release.Name }}-zammad
---
apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
name: {{ tpl .Values.identifier . }}-letsencrypt-certs name: {{ tpl .Values.identifier . }}-letsencrypt-certs
spec: spec:
accessModes: accessModes:
- ReadWriteMany - ReadWriteOnce
resources: resources:
requests: requests:
storage: 50Mi storage: 50Mi
storageClassName: rook-cephfs storageClassName: rook-ceph-block
--- ---
apiVersion: v1 apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim