Files
charts/bitnami/phpmyadmin/templates/deployment.yaml
Francisco de Paz Galán 5b66c4638f [bitnami/phpmyadmin] Major version. Adapt Chart to apiVersion: v2 and Update MariaDB Dependency (#4428)
* [bitnami/phpmyadmin] Bump MariaDB dependency major and drop Helm v2 support

* Use recommended K8s labels

* [bitnami/phpmyadmin] Update components versions

Signed-off-by: Bitnami Containers <containers@bitnami.com>

Co-authored-by: fdepaz <fdepaz@bitnami.com>
Co-authored-by: Carlos Rodríguez Hernández <carlosrh@vmware.com>
Co-authored-by: Bitnami Containers <containers@bitnami.com>
2020-11-25 14:17:00 +01:00

179 lines
6.9 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "phpmyadmin.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "phpmyadmin.fullname" . }}
helm.sh/chart: {{ include "phpmyadmin.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: {{ include "phpmyadmin.fullname" . }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "phpmyadmin.fullname" . }}
helm.sh/chart: {{ include "phpmyadmin.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
{{- if .Values.podLabels }}
{{ toYaml .Values.podLabels | indent 8 }}
{{- end }}
{{- if or .Values.podAnnotations .Values.metrics.enabled }}
annotations:
{{- if .Values.podAnnotations }}
{{ toYaml .Values.podAnnotations | indent 8 }}
{{- end }}
{{- if .Values.metrics.podAnnotations }}
{{ toYaml .Values.metrics.podAnnotations | indent 8 }}
{{- end }}
{{- end }}
spec:
{{- include "phpmyadmin.imagePullSecrets" . | indent 6 }}
{{- with .Values.nodeSelector }}
nodeSelector: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations: {{ toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.podSecurityContext }}
securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- end }}
hostAliases:
- ip: "127.0.0.1"
hostnames:
- "status.localhost"
containers:
- name: {{ .Chart.Name }}
image: {{ template "phpmyadmin.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.containerSecurityContext }}
securityContext: {{- toYaml .Values.containerSecurityContext | nindent 12 }}
{{- end }}
env:
- name: DATABASE_PORT_NUMBER
value: {{ .Values.db.port | quote }}
{{- if .Values.db.chartName }}
- name: DATABASE_HOST
value: "{{ template "phpmyadmin.dbfullname" . }}"
{{- else if .Values.db.bundleTestDB }}
- name: DATABASE_HOST
value: "{{ template "mariadb.fullname" . }}"
{{- else }}
- name: DATABASE_HOST
value: {{ .Values.db.host | quote }}
{{- end }}
{{- if and (not .Values.db.chartName) (not .Values.db.host) }}
- name: PHPMYADMIN_ALLOW_NO_PASSWORD
value: "true"
- name: PHPMYADMIN_ALLOW_ARBITRARY_SERVER
value: {{ .Values.db.allowArbitraryServer | quote }}
{{- else }}
- name: PHPMYADMIN_ALLOW_NO_PASSWORD
value: "false"
{{- end }}
- name: DATABASE_ENABLE_SSL
value: {{ ternary "yes" "no" .Values.db.enableSsl | quote }}
{{- if .Values.db.enableSsl }}
{{- if not (empty .Values.db.ssl.clientKey) }}
- name: DATABASE_SSL_KEY
value: "/db_certs/server_key.pem"
{{- end }}
{{- if not (empty .Values.db.ssl.clientCertificate) }}
- name: DATABASE_SSL_CERT
value: "/db_certs/server_certificate.pem"
{{- end }}
{{- if not (empty .Values.db.ssl.caCertificate) }}
- name: DATABASE_SSL_CA
value: "/db_certs/ca_certificate.pem"
{{- end }}
{{- if .Values.db.ssl.ciphers }}
- name: DATABASE_SSL_CIPHERS
values: {{ .Values.db.ssl.ciphers | quote }}
{{- end }}
- name: DATABASE_SSL_VERIFY
value: {{ ternary "yes" "no" .Values.db.ssl.verify | quote }}
{{- end }}
{{- if .Values.extraEnvVars }}
{{- include "phpmyadmin.tplValue" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
envFrom:
{{- if .Values.extraEnvVarsCM }}
- configMapRef:
name: {{- include "phpmyadmin.tplValue" (dict "value" .Values.extraEnvVarsCM "context" $) | nindent 18 }}
{{- end }}
{{- if .Values.extraEnvVarsSecret }}
- secretRef:
name: {{- include "phpmyadmin.tplValue" (dict "value" .Values.extraEnvVarsSecret "context" $) | nindent 18 }}
{{- end }}
ports:
- name: http
containerPort: 8080
protocol: TCP
- name: https
containerPort: 8443
protocol: TCP
{{- if .Values.livenessProbe }}
livenessProbe: {{- include "phpmyadmin.tplValue" (dict "value" .Values.livenessProbe "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.readinessProbe }}
readinessProbe: {{- include "phpmyadmin.tplValue" (dict "value" .Values.readinessProbe "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.resources }}
resources: {{- toYaml .Values.resources | nindent 12 }}
{{- end }}
{{- if .Values.db.enableSsl }}
volumeMounts:
- name: ssl-certs
mountPath: /db_certs
{{- end }}
{{- if .Values.metrics.enabled }}
- name: metrics
image: {{ template "phpmyadmin.metrics.image" . }}
imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
command: [ '/bin/apache_exporter', '--scrape_uri', 'http://status.localhost:80/server-status/?auto']
ports:
- name: metrics
containerPort: 9117
livenessProbe:
httpGet:
path: /metrics
port: metrics
initialDelaySeconds: 15
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /metrics
port: metrics
initialDelaySeconds: 5
timeoutSeconds: 1
{{- if .Values.metrics.resources }}
resources: {{ toYaml .Values.metrics.resources | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.db.enableSsl }}
volumes:
- name: ssl-certs
secret:
secretName: {{ template "phpmyadmin.fullname" . }}-certs
items:
{{- if not (empty .Values.db.ssl.clientKey) }}
- key: server_key.pem
path: server_key.pem
{{- end }}
{{- if not (empty .Values.db.ssl.clientCertificate) }}
- key: server_certificate.pem
path: server_certificate.pem
{{- end }}
{{- if not (empty .Values.db.ssl.caCertificate) }}
- key: ca_certificate.pem
path: ca_certificate.pem
{{- end }}
{{- end }}