43 lines
1.4 KiB
YAML
43 lines
1.4 KiB
YAML
{{- if and .Values.admissionWebhooks.create .Values.admissionWebhooks.certManager.enabled }}
|
|
apiVersion: v1
|
|
kind: Pod
|
|
metadata:
|
|
name: "{{ include "opentelemetry-operator.fullname" . }}-cert-manager"
|
|
namespace: {{ .Release.Namespace }}
|
|
labels:
|
|
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
|
|
app.kubernetes.io/component: webhook
|
|
annotations:
|
|
"helm.sh/hook": test
|
|
spec:
|
|
containers:
|
|
- name: wget
|
|
image: "{{ .Values.testFramework.image.repository }}:{{ .Values.testFramework.image.tag }}"
|
|
env:
|
|
- name: CERT_MANAGER_CLUSTERIP
|
|
value: "cert-manager-webhook"
|
|
- name: CERT_MANAGER_PORT
|
|
value: "443"
|
|
command:
|
|
- sh
|
|
- -c
|
|
# The following shell script tests if the cert-manager service is up. If the service is up, when we try
|
|
# to wget its exposed port, we will get an HTTP error 400.
|
|
- |
|
|
wget_output=$(wget -q "$CERT_MANAGER_CLUSTERIP:$CERT_MANAGER_PORT")
|
|
if wget_output=="wget: server returned error: HTTP/1.0 400 Bad Request"
|
|
then exit 0
|
|
else exit 1
|
|
fi
|
|
restartPolicy: Never
|
|
{{- with .Values.affinity }}
|
|
affinity: {{ toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
{{- with .Values.tolerations }}
|
|
tolerations: {{ toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
{{- with .Values.nodeSelector }}
|
|
nodeSelector: {{ toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
{{- end }}
|