{{ if .Values.kubeRBACProxy.enabled }} --- apiVersion: v1 kind: Pod metadata: name: "{{ include "opentelemetry-operator.fullname" . }}-metrics" namespace: {{ .Release.Namespace }} labels: {{- include "opentelemetry-operator.labels" . | nindent 4 }} app.kubernetes.io/component: controller-manager annotations: "helm.sh/hook": test spec: containers: - name: wget image: "{{ .Values.testFramework.image.repository }}:{{ .Values.testFramework.image.tag }}" env: - name: MANAGER_METRICS_SERVICE_CLUSTERIP value: "{{ include "opentelemetry-operator.fullname" . }}" - name: MANAGER_METRICS_SERVICE_PORT value: "{{ .Values.kubeRBACProxy.ports.proxyPort }}" command: - sh - -c # The following shell script tests if the controller-manager-metrics-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 "$MANAGER_METRICS_SERVICE_CLUSTERIP:$MANAGER_METRICS_SERVICE_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 }} --- apiVersion: v1 kind: Pod metadata: name: "{{ include "opentelemetry-operator.fullname" . }}-webhook" namespace: {{ .Release.Namespace }} labels: {{- include "opentelemetry-operator.labels" . | nindent 4 }} app.kubernetes.io/component: controller-manager annotations: "helm.sh/hook": test spec: containers: - name: wget image: "{{ .Values.testFramework.image.repository }}:{{ .Values.testFramework.image.tag }}" env: - name: WEBHOOK_SERVICE_CLUSTERIP value: "{{ include "opentelemetry-operator.fullname" . }}-webhook" - name: WEBHOOK_SERVICE_PORT value: "{{ .Values.admissionWebhooks.servicePort }}" command: - sh - -c # The following shell script tests if the webhook 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 "$WEBHOOK_SERVICE_CLUSTERIP:$WEBHOOK_SERVICE_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 }}