diff --git a/template/deploy/helm/[[operator]]/templates/deployment.yaml.j2 b/template/deploy/helm/[[operator]]/templates/deployment.yaml.j2 index 2626c3f2..42abdd41 100644 --- a/template/deploy/helm/[[operator]]/templates/deployment.yaml.j2 +++ b/template/deploy/helm/[[operator]]/templates/deployment.yaml.j2 @@ -48,6 +48,12 @@ spec: valueFrom: fieldRef: fieldPath: metadata.annotations['internal.stackable.tech/image'] + - name: OPERATOR_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: OPERATOR_SERVICE_NAME + value: {{ include "operator.fullname" . }} {{- if .Values.kubernetesClusterDomain }} - name: KUBERNETES_CLUSTER_DOMAIN value: {{ .Values.kubernetesClusterDomain | quote }} diff --git a/template/deploy/helm/[[operator]]/templates/service.yaml b/template/deploy/helm/[[operator]]/templates/service.yaml new file mode 100644 index 00000000..0cb05696 --- /dev/null +++ b/template/deploy/helm/[[operator]]/templates/service.yaml @@ -0,0 +1,19 @@ + +--- +apiVersion: v1 +kind: Service +metadata: + # Note(@sbernauer): We could also call the Service something like + # "product-operator-conversion-webhook". However, in the future we will have more webhooks, and + # it seems like an overkill to have a dedicated Service per webhook. + name: {{ include "operator.fullname" . }} + labels: + {{- include "operator.labels" . | nindent 4 }} +spec: + selector: + {{- include "operator.selectorLabels" . | nindent 6 }} + ports: + - name: conversion-webhook + protocol: TCP + port: 8443 + targetPort: 8443