Files
Sameer Naik cb429c0bc5 [stable/osclass] bump major version (#18700)
Helm performs a lookup for the object based on its group (apps), version (v1), and kind (Deployment). Also known as its GroupVersionKind, or GVK. Changing the GVK is considered a compatibility breaker from Kubernetes' point of view, so you cannot "upgrade" those objects to the new GVK in-place. Earlier versions of Helm 3 did not perform the lookup correctly which has since been fixed to match the spec.

In https://github.com/helm/charts/pull/17303 the `apiVersion` of the deployment resources was updated to `apps/v1` in tune with the api's deprecated, resulting in compatibility breakage.

This major version signifies this change.

Signed-off-by: Sameer Naik <sameersbn@vmware.com>
2019-11-12 00:46:30 -08:00

170 lines
5.8 KiB
YAML

{{- if include "osclass.host" . -}}
apiVersion: {{ template "osclass.deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ template "osclass.fullname" . }}
labels:
app: {{ template "osclass.fullname" . }}
chart: {{ template "osclass.chart" . }}
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
selector:
matchLabels:
app: {{ template "osclass.fullname" . }}
release: "{{ .Release.Name }}"
template:
metadata:
labels:
app: {{ template "osclass.fullname" . }}
chart: {{ template "osclass.chart" . }}
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:
{{- include "osclass.imagePullSecrets" . | indent 6 }}
hostAliases:
- ip: "127.0.0.1"
hostnames:
- "status.localhost"
containers:
- name: {{ template "osclass.fullname" . }}
image: {{ template "osclass.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
env:
- name: ALLOW_EMPTY_PASSWORD
value: {{ .Values.allowEmptyPassword | quote }}
{{- if .Values.mariadb.enabled }}
- name: MARIADB_HOST
value: {{ template "osclass.mariadb.fullname" . }}
- name: MARIADB_PORT_NUMBER
value: "3306"
- name: OSCLASS_DATABASE_NAME
value: {{ .Values.mariadb.db.name | quote }}
- name: OSCLASS_DATABASE_USER
value: {{ .Values.mariadb.db.user | quote }}
- name: OSCLASS_DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "osclass.mariadb.fullname" . }}
key: mariadb-password
{{- else }}
- name: MARIADB_HOST
value: {{ .Values.externalDatabase.host | quote }}
- name: MARIADB_PORT_NUMBER
value: {{ .Values.externalDatabase.port | quote }}
- name: OSCLASS_DATABASE_NAME
value: {{ .Values.externalDatabase.database | quote }}
- name: OSCLASS_DATABASE_USER
value: {{ .Values.externalDatabase.user | quote }}
- name: OSCLASS_DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ printf "%s-%s" .Release.Name "externaldb" }}
key: db-password
{{- end }}
{{- $port:=.Values.service.port | toString }}
- name: OSCLASS_HOST
value: "{{ include "osclass.host" . }}{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}"
- name: OSCLASS_USERNAME
value: {{ default "" .Values.osclassUsername | quote }}
- name: OSCLASS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "osclass.fullname" . }}
key: osclass-password
- name: OSCLASS_EMAIL
value: {{ default "" .Values.osclassEmail | quote }}
- name: OSCLASS_WEB_TITLE
value: {{ default "" .Values.osclassWebTitle | quote }}
- name: OSCLASS_PING_ENGINES
value: {{ default "" .Values.osclassPingEngines | quote }}
- name: OSCLASS_SAVE_STATS
value: {{ default "" .Values.osclassSaveStats | quote }}
- name: SMTP_HOST
value: {{ default "" .Values.smtpHost | quote }}
- name: SMTP_PORT
value: {{ default "" .Values.smtpPort | quote }}
- name: SMTP_USER
value: {{ default "" .Values.smtpUser | quote }}
- name: SMTP_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "osclass.fullname" . }}
key: smtp-password
- name: SMTP_PROTOCOL
value: {{ default "" .Values.smtpProtocol | quote }}
ports:
- name: http
containerPort: 80
- name: https
containerPort: 443
livenessProbe:
httpGet:
path: /index.php
port: http
httpHeaders:
- name: Host
value: {{ include "osclass.host" . | quote }}
initialDelaySeconds: 120
timeoutSeconds: 120
failureThreshold: 6
readinessProbe:
httpGet:
path: /index.php
port: http
httpHeaders:
- name: Host
value: {{ include "osclass.host" . | quote }}
initialDelaySeconds: 30
timeoutSeconds: 120
periodSeconds: 5
resources:
{{ toYaml .Values.resources | indent 10 }}
volumeMounts:
- name: osclass-data
mountPath: /bitnami/osclass
{{- if .Values.metrics.enabled }}
- name: metrics
image: {{ template "osclass.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: osclass-data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ template "osclass.fullname" . }}-osclass
{{- else }}
emptyDir: {}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- end -}}