From d220908a53467e7a996b6574481fdabb12c10e51 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Wed, 2 Jul 2025 08:29:58 +0200 Subject: [PATCH 1/2] feat: Add product-operator Service --- .../[[operator]]/templates/deployment.yaml.j2 | 6 ++++++ .../helm/[[operator]]/templates/service.yaml | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 template/deploy/helm/[[operator]]/templates/service.yaml 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..486a3498 --- /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 From 6ae235eae4e44d2b4d4f4fc93e60df9ede5d5b53 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Wed, 2 Jul 2025 09:15:26 +0200 Subject: [PATCH 2/2] yamllint --- template/deploy/helm/[[operator]]/templates/service.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/deploy/helm/[[operator]]/templates/service.yaml b/template/deploy/helm/[[operator]]/templates/service.yaml index 486a3498..0cb05696 100644 --- a/template/deploy/helm/[[operator]]/templates/service.yaml +++ b/template/deploy/helm/[[operator]]/templates/service.yaml @@ -10,7 +10,7 @@ metadata: labels: {{- include "operator.labels" . | nindent 4 }} spec: - selector: + selector: {{- include "operator.selectorLabels" . | nindent 6 }} ports: - name: conversion-webhook