Interlegis Public Rancher Charts for Kubernetes
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.

134 lines
4.8 KiB

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "caduser.fullname" . }}
labels:
{{- include "caduser.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "caduser.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "caduser.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "caduser.serviceAccountName" . }}
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 }}
ports:
- name: http
containerPort: 80
protocol: TCP
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: {{ .Values.postgresql.clusterName }}-app
key: uri
- name: MEMCACHED_LOCATION
value: {{ printf "%s:11211" (include "memcached.fullname" .) | quote }}
- name: ADMINS
value: "{{ .Values.caduser.adminUsers }}"
- name: DEBUG
value: "{{ .Values.caduser.debug }}"
- name: EMAIL_PORT
value: "{{ .Values.caduser.emailPort }}"
- name: EMAIL_HOST
value: "{{ .Values.caduser.emailHost }}"
- name: EMAIL_HOST_USER
value: "{{ .Values.caduser.emailHostUser }}"
- name: EMAIL_HOST_PASSWORD
value: "{{ .Values.caduser.emailHostPassword }}"
- name: EMAIL_SUBJECT_PREFIX
value: "{{ .Values.caduser.emailSubjectPrefix }}"
- name: EMAIL_USE_LOCALTIME
value: "{{ .Values.caduser.emailUseLocaltime }}"
- name: EMAIL_USE_TLS
value: "{{ .Values.caduser.emailUseTls }}"
- name: EMAIL_USE_SSL
value: "{{ .Values.caduser.emailUseSsl }}"
- name: EMAIL_TIMEOUT
value: "{{ .Values.caduser.emailTimeout }}"
- name: DEFAULT_FROM_EMAIL
value: "{{ .Values.caduser.defaultFromEmail }}"
- name: MAXMIND_ACCOUNT_ID
value: "{{ .Values.caduser.maxmindAccountId }}"
- name: MAXMIND_LICENCE_KEY
value: "{{ .Values.caduser.maxmindLicenceKey }}"
- name: MOODLE_BASE_URL
value: "{{ .Values.caduser.moodleBaseUrl }}"
- name: MOODLE_API_TOKEN
value: "{{ .Values.caduser.moodleApiToken }}"
- name: LANG
value: "pt_BR.UTF-8"
volumeMounts:
- mountPath: /srv/interlegis/caduser/media
name: media
livenessProbe:
httpGet:
path: /admin/login/
port: http
initialDelaySeconds: 60
failureThreshold: 3
periodSeconds: 60
successThreshold: 1
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /admin/login/
port: http
initialDelaySeconds: 30
failureThreshold: 3
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 5
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: media
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ include "caduser.fullname" . }}-media
{{- else }}
emptyDir: {}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
{{- if eq .Values.persistence.accessMode "ReadWriteOnce" }}
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- {{ include "caduser.name" . }}
topologyKey: kubernetes.io/hostname
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}