Files
deprecated-helm-charts/stable/phpbb/templates/deployment.yaml
T
Javier J. Salmerón-García 856f64ca96 [stable/phpbb] Add apache exporter (#8854)
* [stable/phpbb] Add apache exporter

Signed-off-by: Javier J. Salmeron Garcia <jsalmeron@bitnami.com>

* [stable/phpbb] Add podAnnotations

Signed-off-by: Javier J. Salmeron Garcia <jsalmeron@bitnami.com>

* [stable/phpbb] Add podAnnotations

Signed-off-by: Javier J. Salmeron Garcia <jsalmeron@bitnami.com>
2018-10-31 03:43:57 -07:00

167 lines
5.3 KiB
YAML

{{- if or .Values.mariadb.enabled .Values.externalDatabase.host -}}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "phpbb.fullname" . }}
labels:
app: {{ template "phpbb.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
selector:
matchLabels:
app: {{ template "phpbb.fullname" . }}
release: "{{ .Release.Name }}"
replicas: 1
template:
metadata:
labels:
app: {{ template "phpbb.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
{{- 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:
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.pullSecrets }}
- name: {{ . }}
{{- end}}
{{- end }}
hostAliases:
- ip: "127.0.0.1"
hostnames:
- "status.localhost"
containers:
- name: {{ template "phpbb.fullname" . }}
image: {{ template "phpbb.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
env:
- name: ALLOW_EMPTY_PASSWORD
value: {{ .Values.allowEmptyPassword | quote }}
- name: MARIADB_HOST
{{- if .Values.mariadb.enabled }}
value: {{ template "phpbb.mariadb.fullname" . }}
{{- else }}
value: {{ .Values.externalDatabase.host | quote }}
{{- end }}
- name: MARIADB_PORT_NUMBER
{{- if .Values.mariadb.enabled }}
value: "3306"
{{- else }}
value: {{ .Values.externalDatabase.port | quote }}
{{- end }}
- name: PHPBB_DATABASE_NAME
{{- if .Values.mariadb.enabled }}
value: {{ .Values.mariadb.db.name | quote }}
{{- else }}
value: {{ .Values.externalDatabase.database | quote }}
{{- end }}
- name: PHPBB_DATABASE_USER
{{- if .Values.mariadb.enabled }}
value: {{ .Values.mariadb.db.user | quote }}
{{- else }}
value: {{ .Values.externalDatabase.user | quote }}
{{- end }}
- name: PHPBB_DATABASE_PASSWORD
valueFrom:
secretKeyRef:
{{- if .Values.mariadb.enabled }}
name: {{ template "phpbb.mariadb.fullname" . }}
key: mariadb-password
{{- else }}
name: {{ printf "%s-%s" .Release.Name "externaldb" }}
key: db-password
{{- end }}
- name: PHPBB_USERNAME
value: {{ .Values.phpbbUser | quote }}
- name: PHPBB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "phpbb.fullname" . }}
key: phpbb-password
- name: PHPBB_EMAIL
value: {{ .Values.phpbbEmail | quote }}
- name: SMTP_HOST
value: {{ .Values.smtpHost | quote }}
- name: SMTP_PORT
value: {{ .Values.smtpPort | quote }}
- name: SMTP_USER
value: {{ .Values.smtpUser | quote }}
- name: SMTP_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "phpbb.fullname" . }}
key: smtp-password
- name: SMTP_PROTOCOL
value: {{ default "" .Values.smtpProtocol | quote }}
ports:
- name: http
containerPort: 80
- name: https
containerPort: 443
livenessProbe:
httpGet:
path: /ucp.php
port: http
initialDelaySeconds: 120
readinessProbe:
httpGet:
path: /ucp.php
port: http
initialDelaySeconds: 30
resources:
{{ toYaml .Values.resources | indent 10 }}
volumeMounts:
- name: phpbb-data
mountPath: /bitnami/phpbb
- name: apache-data
mountPath: /bitnami/apache
{{- if .Values.metrics.enabled }}
- name: metrics
image: {{ template "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
resources:
{{ toYaml .Values.metrics.resources | indent 10 }}
{{- end }}
volumes:
- name: phpbb-data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ template "phpbb.fullname" . }}-phpbb
{{- else }}
emptyDir: {}
{{- end }}
- name: apache-data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ template "phpbb.fullname" . }}-apache
{{- else }}
emptyDir: {}
{{- end }}
{{- end }}