mirror of
https://github.com/wahyd4/charts.git
synced 2026-08-24 12:36:23 +10:00
* Change -scrape_uri to --scrape_uri * [bitnami/apache] Update components versions Signed-off-by: Bitnami Containers <containers@bitnami.com> Co-authored-by: Bitnami Containers <containers@bitnami.com>
157 lines
6.0 KiB
YAML
157 lines
6.0 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "apache.fullname" . }}
|
|
labels: {{- include "apache.labels" . | nindent 4 }}
|
|
spec:
|
|
selector:
|
|
matchLabels: {{- include "apache.matchLabels" . | nindent 6 }}
|
|
replicas: {{ .Values.replicaCount }}
|
|
template:
|
|
metadata:
|
|
labels: {{- include "apache.labels" . | nindent 8 }}
|
|
{{- if or .Values.podAnnotations (and .Values.metrics.enabled .Values.metrics.podAnnotations) }}
|
|
annotations:
|
|
{{- if .Values.podAnnotations }}
|
|
{{- toYaml .Values.podAnnotations | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.metrics.podAnnotations }}
|
|
{{- toYaml .Values.metrics.podAnnotations | nindent 8 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
spec:
|
|
{{- include "apache.imagePullSecrets" . | nindent 6 }}
|
|
hostAliases:
|
|
- ip: "127.0.0.1"
|
|
hostnames:
|
|
- "status.localhost"
|
|
{{- if .Values.affinity }}
|
|
affinity: {{- include "apache.tplValue" (dict "value" .Values.affinity "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.nodeSelector }}
|
|
nodeSelector: {{- include "apache.tplValue" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.tolerations }}
|
|
tolerations: {{- include "apache.tplValue" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.cloneHtdocsFromGit.enabled }}
|
|
initContainers:
|
|
- name: git-clone-repository
|
|
image: {{ include "git.image" . }}
|
|
imagePullPolicy: {{ .Values.git.pullPolicy | quote }}
|
|
command:
|
|
- /bin/bash
|
|
- -ec
|
|
- |
|
|
git clone {{ .Values.cloneHtdocsFromGit.repository }} --branch {{ .Values.cloneHtdocsFromGit.branch }} /app
|
|
volumeMounts:
|
|
- name: htdocs
|
|
mountPath: /app
|
|
containers:
|
|
- name: git-repo-syncer
|
|
image: {{ include "git.image" . }}
|
|
imagePullPolicy: {{ .Values.git.pullPolicy | quote }}
|
|
command:
|
|
- /bin/bash
|
|
- -ec
|
|
- |
|
|
while true; do
|
|
cd /app && git pull origin {{ .Values.cloneHtdocsFromGit.branch }}
|
|
sleep {{ .Values.cloneHtdocsFromGit.interval }}
|
|
done
|
|
volumeMounts:
|
|
- name: htdocs
|
|
mountPath: /app
|
|
{{- else }}
|
|
containers:
|
|
{{- end }}
|
|
- name: apache
|
|
image: {{ include "apache.image" . }}
|
|
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
|
env:
|
|
- name: BITNAMI_DEBUG
|
|
value: {{ ternary "true" "false" .Values.image.debug | quote }}
|
|
ports:
|
|
- name: http
|
|
containerPort: 8080
|
|
- name: https
|
|
containerPort: 8443
|
|
{{- if .Values.livenessProbe.enabled }}
|
|
livenessProbe:
|
|
httpGet:
|
|
path: {{ .Values.livenessProbe.path }}
|
|
port: http
|
|
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
|
|
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
|
|
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
|
|
successThreshold: {{ .Values.livenessProbe.successThreshold }}
|
|
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
|
|
{{- end }}
|
|
{{- if .Values.readinessProbe.enabled }}
|
|
readinessProbe:
|
|
httpGet:
|
|
path: {{ .Values.readinessProbe.path }}
|
|
port: http
|
|
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
|
|
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
|
|
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
|
|
successThreshold: {{ .Values.readinessProbe.successThreshold }}
|
|
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
|
|
{{- end }}
|
|
{{- if .Values.resources }}
|
|
resources: {{- toYaml .Values.resources | nindent 12 }}
|
|
{{- end }}
|
|
volumeMounts:
|
|
{{- if (include "apache.useHtdocs" .) }}
|
|
- name: htdocs
|
|
mountPath: /app
|
|
{{- end }}
|
|
{{- if or (.Files.Glob "files/vhosts/*.conf") (.Values.vhostsConfigMap) }}
|
|
- name: vhosts
|
|
mountPath: /vhosts
|
|
{{- end }}
|
|
{{- if or (.Files.Glob "files/httpd.conf") (.Values.httpdConfConfigMap) }}
|
|
- name: httpd-conf
|
|
mountPath: /opt/bitnami/apache/conf/httpd.conf
|
|
subPath: httpd.conf
|
|
{{- end }}
|
|
{{- if .Values.metrics.enabled }}
|
|
- name: metrics
|
|
image: {{ template "apache.metrics.image" . }}
|
|
imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
|
|
command: ['/bin/apache_exporter', '--scrape_uri', 'http://status.localhost:8080/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 }}
|
|
volumes:
|
|
{{- if (include "apache.useHtdocs" .) }}
|
|
- name: htdocs
|
|
{{- include "apache.htdocsVolume" . | nindent 10 }}
|
|
{{- end }}
|
|
{{- if or (.Files.Glob "files/vhosts/*.conf") (.Values.vhostsConfigMap) }}
|
|
- name: vhosts
|
|
configMap:
|
|
name: {{ include "apache.vhostsConfigMap" . }}
|
|
{{- end }}
|
|
{{- if or (.Files.Glob "files/httpd.conf") (.Values.httpdConfConfigMap) }}
|
|
- name: httpd-conf
|
|
configMap:
|
|
name: {{ include "apache.httpdConfConfigMap" . }}
|
|
{{- end }}
|