You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
110 lines
3.7 KiB
110 lines
3.7 KiB
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "saberes.fullname" . }}
|
|
labels:
|
|
{{- include "saberes.labels" . | nindent 4 }}
|
|
spec:
|
|
{{- if not .Values.autoscaling.enabled }}
|
|
replicas: {{ .Values.replicaCount }}
|
|
{{- end }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "saberes.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
{{- with .Values.podAnnotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "saberes.selectorLabels" . | nindent 8 }}
|
|
spec:
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
securityContext:
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
containers:
|
|
- name: {{ .Chart.Name }}
|
|
securityContext:
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
env:
|
|
- name: MOODLE_DB_HOST
|
|
value: {{ .Values.moodle.dbHost | quote }}
|
|
- name: MOODLE_DB_NAME
|
|
value: {{ .Values.moodle.dbName | quote }}
|
|
- name: MOODLE_DB_PASS
|
|
value: {{ .Values.moodle.dbPass | quote }}
|
|
- name: MOODLE_DB_USER
|
|
value: {{ .Values.moodle.dbUser | quote }}
|
|
- name: MOODLE_REVERSEPROXY
|
|
value: {{ .Values.moodle.reverseProxy | quote }}
|
|
- name: MOODLE_SSLPROXY
|
|
value: {{ .Values.moodle.sslProxy | quote }}
|
|
- name: MOODLE_URL
|
|
{{- if .Values.ingress.tls.enabled }}
|
|
value: https://{{ .Values.ingress.hostname }}
|
|
{{- else -}}
|
|
value: http://{{ .Values.ingress.hostname }}
|
|
{{- end }}
|
|
- name: OSTICKET_API_KEY
|
|
value: {{ .Values.osticket.apiKey | quote }}
|
|
- name: OSTICKET_API_URL
|
|
value: {{ .Values.osticket.url | quote }}
|
|
volumeMounts:
|
|
- mountPath: /var/moodledata
|
|
name: moodledata
|
|
ports:
|
|
- name: http
|
|
containerPort: 80
|
|
protocol: TCP
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /version.php
|
|
port: http
|
|
initialDelaySeconds: 20
|
|
periodSeconds: 10
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /version.php
|
|
port: http
|
|
initialDelaySeconds: 20
|
|
periodSeconds: 10
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
volumes:
|
|
- name: moodledata
|
|
{{- if .Values.persistence.enabled }}
|
|
persistentVolumeClaim:
|
|
claimName: {{ include "saberes.fullname" . }}-moodledata
|
|
{{- else }}
|
|
emptyDir: {}
|
|
{{- end }}
|
|
{{- with .Values.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
affinity:
|
|
podAntiAffinity:
|
|
preferredDuringSchedulingIgnoredDuringExecution:
|
|
- weight: 100
|
|
podAffinityTerm:
|
|
labelSelector:
|
|
matchExpressions:
|
|
- key: app.kubernetes.io/name
|
|
operator: In
|
|
values:
|
|
- {{ include "saberes.name" . }}
|
|
- key: app.kubernetes.io/instance
|
|
operator: In
|
|
values:
|
|
- {{ .Release.Name }}
|
|
topologyKey: "kubernetes.io/hostname"
|
|
{{- with .Values.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
|