| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: {{ template "openshift-console-plugin.name" . }}
- namespace: {{ .Release.Namespace }}
- labels:
- {{- include "openshift-console-plugin.labels" . | nindent 4 }}
- app.openshift.io/runtime-namespace: {{ .Release.Namespace }}
- spec:
- replicas: {{ .Values.plugin.replicas }}
- selector:
- matchLabels:
- {{- include "openshift-console-plugin.selectorLabels" . | nindent 6 }}
- template:
- metadata:
- labels:
- {{- include "openshift-console-plugin.labels" . | nindent 8 }}
- spec:
- containers:
- - name: {{ template "openshift-console-plugin.name" . }}
- image: {{ required "Plugin image must be specified!" .Values.plugin.image }}
- command:
- - /bin/sh
- - -c
- - |
- if echo "$POD_IP" | grep -qE '^([0-9]{1,3}\.){3}[0-9]{1,3}$'; then
- LISTEN_ADDRESS_PORT_REPLACED_AT_RUNTIME="{{ .Values.plugin.port }}"
- else
- LISTEN_ADDRESS_PORT_REPLACED_AT_RUNTIME="[::]:{{ .Values.plugin.port }}"
- fi
- sed "s/LISTEN_ADDRESS_PORT_REPLACED_AT_RUNTIME/$LISTEN_ADDRESS_PORT_REPLACED_AT_RUNTIME/g" /etc/nginx/nginx.conf > /tmp/nginx.conf
- exec nginx -c /tmp/nginx.conf -g 'daemon off;'
- env:
- - name: POD_IP
- valueFrom:
- fieldRef:
- fieldPath: status.podIP
- ports:
- - containerPort: {{ .Values.plugin.port }}
- protocol: TCP
- imagePullPolicy: {{ .Values.plugin.imagePullPolicy }}
- {{- if and (.Values.plugin.securityContext.enabled) (.Values.plugin.containerSecurityContext) }}
- securityContext: {{ tpl (toYaml (omit .Values.plugin.containerSecurityContext "enabled")) $ | nindent 12 }}
- {{- end }}
- resources:
- {{- toYaml .Values.plugin.resources | nindent 12 }}
- volumeMounts:
- - name: {{ template "openshift-console-plugin.certificateSecret" . }}
- readOnly: true
- mountPath: /var/cert
- - name: nginx-conf
- readOnly: true
- mountPath: /etc/nginx/nginx.conf
- subPath: nginx.conf
- volumes:
- - name: {{ template "openshift-console-plugin.certificateSecret" . }}
- secret:
- secretName: {{ template "openshift-console-plugin.certificateSecret" . }}
- defaultMode: 420
- - name: nginx-conf
- configMap:
- name: {{ template "openshift-console-plugin.name" . }}
- defaultMode: 420
- restartPolicy: Always
- dnsPolicy: ClusterFirst
- {{- if and (.Values.plugin.securityContext.enabled) (.Values.plugin.podSecurityContext) }}
- securityContext: {{ tpl (toYaml (omit .Values.plugin.podSecurityContext "enabled")) $ | nindent 8 }}
- {{- end }}
- strategy:
- type: RollingUpdate
- rollingUpdate:
- maxUnavailable: 25%
- maxSurge: 25%
|