From a732abd06404851abac46e13778ce6e81e74fcaa Mon Sep 17 00:00:00 2001 From: mhoffm-aiven <88316042+mhoffm-aiven@users.noreply.github.com> Date: Thu, 9 Sep 2021 14:47:10 +0200 Subject: [PATCH] rename charts (#6) --- .github/workflows/test.yaml | 8 +-- README.md | 16 +++--- .../templates/certificate.yaml | 33 ----------- .../templates/cluster_role_binding.yaml | 15 ----- .../templates/election_role_binding.yaml | 15 ----- .../templates/service.yaml | 19 ------- .../.helmignore | 0 .../Chart.yaml | 4 +- .../templates/crds.yaml | 0 .../values.yaml | 0 .../.helmignore | 0 .../Chart.yaml | 4 +- .../ci/test-values.yaml | 0 .../templates/_helpers.tpl | 26 ++++----- .../aiven-operator/templates/certificate.yaml | 33 +++++++++++ .../templates/cluster_role.yaml | 27 +++++++-- .../templates/cluster_role_binding.yaml | 15 +++++ .../templates/deployment.yaml | 10 ++-- .../templates/election_role.yaml | 6 +- .../templates/election_role_binding.yaml | 15 +++++ ..._cert_manager_if_webhooks_are_enabled.yaml | 0 .../mutating_webhook_configuration.yaml | 56 +++++++++---------- charts/aiven-operator/templates/service.yaml | 19 +++++++ .../validating_webhook_configuration.yaml | 56 +++++++++---------- .../values.yaml | 2 +- 25 files changed, 199 insertions(+), 180 deletions(-) delete mode 100644 charts/aiven-kubernetes-operator/templates/certificate.yaml delete mode 100644 charts/aiven-kubernetes-operator/templates/cluster_role_binding.yaml delete mode 100644 charts/aiven-kubernetes-operator/templates/election_role_binding.yaml delete mode 100644 charts/aiven-kubernetes-operator/templates/service.yaml rename charts/{aiven-kubernetes-operator-crds => aiven-operator-crds}/.helmignore (100%) rename charts/{aiven-kubernetes-operator-crds => aiven-operator-crds}/Chart.yaml (51%) rename charts/{aiven-kubernetes-operator-crds => aiven-operator-crds}/templates/crds.yaml (100%) rename charts/{aiven-kubernetes-operator-crds => aiven-operator-crds}/values.yaml (100%) rename charts/{aiven-kubernetes-operator => aiven-operator}/.helmignore (100%) rename charts/{aiven-kubernetes-operator => aiven-operator}/Chart.yaml (58%) rename charts/{aiven-kubernetes-operator => aiven-operator}/ci/test-values.yaml (100%) rename charts/{aiven-kubernetes-operator => aiven-operator}/templates/_helpers.tpl (64%) create mode 100644 charts/aiven-operator/templates/certificate.yaml rename charts/{aiven-kubernetes-operator => aiven-operator}/templates/cluster_role.yaml (88%) create mode 100644 charts/aiven-operator/templates/cluster_role_binding.yaml rename charts/{aiven-kubernetes-operator => aiven-operator}/templates/deployment.yaml (85%) rename charts/{aiven-kubernetes-operator => aiven-operator}/templates/election_role.yaml (63%) create mode 100644 charts/aiven-operator/templates/election_role_binding.yaml rename charts/{aiven-kubernetes-operator => aiven-operator}/templates/ensure_cert_manager_if_webhooks_are_enabled.yaml (100%) rename charts/{aiven-kubernetes-operator => aiven-operator}/templates/mutating_webhook_configuration.yaml (65%) create mode 100644 charts/aiven-operator/templates/service.yaml rename charts/{aiven-kubernetes-operator => aiven-operator}/templates/validating_webhook_configuration.yaml (66%) rename charts/{aiven-kubernetes-operator => aiven-operator}/values.yaml (90%) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e4fb729..b1f1b01 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -26,8 +26,8 @@ jobs: - name: Create kind cluster uses: helm/kind-action@v1.2.0 - - name: Install aiven-kubernetes-operator CRDs - run: helm install charts/aiven-kubernetes-operator-crds --generate-name + - name: Install aiven-operator CRDs + run: helm install charts/aiven-operator-crds --generate-name - - name: Test aiven-kubernetes-operator chart - run: ct install --charts charts/aiven-kubernetes-operator + - name: Test aiven-operator chart + run: ct install --charts charts/aiven-operator diff --git a/README.md b/README.md index e65d8a4..41d483b 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,33 @@ -# Aiven Helm Charts +# Aiven Charts This repository contains official Helm charts that are maintained by [Aiven](https://aiven.io) ## Adding the repository ```bash -helm repo add aiven https://aiven-helm-charts.github.io && helm repo update +helm repo add aiven https://aiven-charts.github.io && helm repo update ``` ## Installing a chart from the repository -### Installing the aiven-kubernetes-operator-crds chart +### Installing the aiven-operator-crds chart ```bash -helm install aiven/aiven-kubernetes-operator-crds --generate-name +helm install aiven/aiven-operator-crds --generate-name ``` -### Installing the aiven-kubernetes-operator chart +### Installing the aiven-operator chart -Before installing the `aiven-kubernetes-operator` chart, please make sure to have the CRDs chart installed. +Before installing the `aiven-operator` chart, please make sure to have the CRDs chart installed. Installation with webhooks enabled ( requires a cert-manager deployment in the cluster ): ```bash -helm install aiven/aiven-kubernetes-operator --generate-name +helm install aiven/aiven-operator --generate-name ``` Without webhooks enabled: ```bash -helm install aiven/aiven-kubernetes-operator --generate-name --set webhooks.enabled=false +helm install aiven/aiven-operator --generate-name --set webhooks.enabled=false ``` diff --git a/charts/aiven-kubernetes-operator/templates/certificate.yaml b/charts/aiven-kubernetes-operator/templates/certificate.yaml deleted file mode 100644 index 1d2aad8..0000000 --- a/charts/aiven-kubernetes-operator/templates/certificate.yaml +++ /dev/null @@ -1,33 +0,0 @@ -{{- if .Values.webhooks.enabled }} - -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-certificate - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} - labels: - {{- include "aiven-kubernetes-operator.labels" . | nindent 4 }} -spec: - dnsNames: - - {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service.{{ include "aiven-kubernetes-operator.namespace" . }}.svc - - {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service.{{ include "aiven-kubernetes-operator.namespace" . }}.svc.cluster.local - issuerRef: - kind: Issuer - name: {{ include "aiven-kubernetes-operator.fullname" . }}-selfsigned-issuer - secretName: webhook-server-cert - ---- - -apiVersion: cert-manager.io/v1 -kind: Issuer -metadata: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-selfsigned-issuer - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} - labels: - {{- include "aiven-kubernetes-operator.labels" . | nindent 4 }} -spec: - selfSigned: {} - ---- - -{{- end }} diff --git a/charts/aiven-kubernetes-operator/templates/cluster_role_binding.yaml b/charts/aiven-kubernetes-operator/templates/cluster_role_binding.yaml deleted file mode 100644 index 33dff14..0000000 --- a/charts/aiven-kubernetes-operator/templates/cluster_role_binding.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-rolebinding - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} - labels: - {{- include "aiven-kubernetes-operator.labels" . | nindent 4 }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: {{ include "aiven-kubernetes-operator.fullname" . }}-role -subjects: -- kind: ServiceAccount - name: default - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} diff --git a/charts/aiven-kubernetes-operator/templates/election_role_binding.yaml b/charts/aiven-kubernetes-operator/templates/election_role_binding.yaml deleted file mode 100644 index 5bffeb0..0000000 --- a/charts/aiven-kubernetes-operator/templates/election_role_binding.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-election-rolebinding - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} - labels: - {{- include "aiven-kubernetes-operator.labels" . | nindent 4 }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: {{ include "aiven-kubernetes-operator.fullname" . }}-election-role -subjects: -- kind: ServiceAccount - name: default - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} diff --git a/charts/aiven-kubernetes-operator/templates/service.yaml b/charts/aiven-kubernetes-operator/templates/service.yaml deleted file mode 100644 index 2067043..0000000 --- a/charts/aiven-kubernetes-operator/templates/service.yaml +++ /dev/null @@ -1,19 +0,0 @@ -{{- if .Values.webhooks.enabled }} - -apiVersion: v1 -kind: Service -metadata: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} - labels: - {{- include "aiven-kubernetes-operator.labels" . | nindent 4 }} -spec: - ports: - - port: {{ .Values.webhooks.servicePort }} - targetPort: webhook - protocol: TCP - name: webhook - selector: - {{- include "aiven-kubernetes-operator.selectorLabels" . | nindent 4 }} - -{{- end }} diff --git a/charts/aiven-kubernetes-operator-crds/.helmignore b/charts/aiven-operator-crds/.helmignore similarity index 100% rename from charts/aiven-kubernetes-operator-crds/.helmignore rename to charts/aiven-operator-crds/.helmignore diff --git a/charts/aiven-kubernetes-operator-crds/Chart.yaml b/charts/aiven-operator-crds/Chart.yaml similarity index 51% rename from charts/aiven-kubernetes-operator-crds/Chart.yaml rename to charts/aiven-operator-crds/Chart.yaml index ff73729..eb89954 100644 --- a/charts/aiven-kubernetes-operator-crds/Chart.yaml +++ b/charts/aiven-operator-crds/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 -name: aiven-kubernetes-operator-crds -description: A Helm chart to deploy the aiven k8s operator custom resource definitions +name: aiven-operator-crds +description: A Helm chart to deploy the aiven operator custom resource definitions type: application version: v0.1.0 appVersion: v0.0.1 diff --git a/charts/aiven-kubernetes-operator-crds/templates/crds.yaml b/charts/aiven-operator-crds/templates/crds.yaml similarity index 100% rename from charts/aiven-kubernetes-operator-crds/templates/crds.yaml rename to charts/aiven-operator-crds/templates/crds.yaml diff --git a/charts/aiven-kubernetes-operator-crds/values.yaml b/charts/aiven-operator-crds/values.yaml similarity index 100% rename from charts/aiven-kubernetes-operator-crds/values.yaml rename to charts/aiven-operator-crds/values.yaml diff --git a/charts/aiven-kubernetes-operator/.helmignore b/charts/aiven-operator/.helmignore similarity index 100% rename from charts/aiven-kubernetes-operator/.helmignore rename to charts/aiven-operator/.helmignore diff --git a/charts/aiven-kubernetes-operator/Chart.yaml b/charts/aiven-operator/Chart.yaml similarity index 58% rename from charts/aiven-kubernetes-operator/Chart.yaml rename to charts/aiven-operator/Chart.yaml index f20e5d7..2ba15ca 100644 --- a/charts/aiven-kubernetes-operator/Chart.yaml +++ b/charts/aiven-operator/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 -name: aiven-kubernetes-operator -description: A Helm chart to deploy the aiven k8s operator +name: aiven-operator +description: A Helm chart to deploy the aiven operator type: application version: v0.1.0 appVersion: v0.0.1 diff --git a/charts/aiven-kubernetes-operator/ci/test-values.yaml b/charts/aiven-operator/ci/test-values.yaml similarity index 100% rename from charts/aiven-kubernetes-operator/ci/test-values.yaml rename to charts/aiven-operator/ci/test-values.yaml diff --git a/charts/aiven-kubernetes-operator/templates/_helpers.tpl b/charts/aiven-operator/templates/_helpers.tpl similarity index 64% rename from charts/aiven-kubernetes-operator/templates/_helpers.tpl rename to charts/aiven-operator/templates/_helpers.tpl index a063c98..c19aadc 100644 --- a/charts/aiven-kubernetes-operator/templates/_helpers.tpl +++ b/charts/aiven-operator/templates/_helpers.tpl @@ -1,11 +1,11 @@ {{/* Expand the name of the chart. */}} -{{- define "aiven-kubernetes-operator.name" -}} +{{- define "aiven-operator.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} -{{- define "aiven-kubernetes-operator.namespace" -}} +{{- define "aiven-operator.namespace" -}} {{- .Release.Namespace }} {{- end }} @@ -14,7 +14,7 @@ Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). If release name contains chart name it will be used as a full name. */}} -{{- define "aiven-kubernetes-operator.fullname" -}} +{{- define "aiven-operator.fullname" -}} {{- if .Values.fullnameOverride }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} @@ -30,16 +30,16 @@ If release name contains chart name it will be used as a full name. {{/* Create chart name and version as used by the chart label. */}} -{{- define "aiven-kubernetes-operator.chart" -}} +{{- define "aiven-operator.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} -{{- define "aiven-kubernetes-operator.labels" -}} -helm.sh/chart: {{ include "aiven-kubernetes-operator.chart" . }} -{{ include "aiven-kubernetes-operator.selectorLabels" . }} +{{- define "aiven-operator.labels" -}} +helm.sh/chart: {{ include "aiven-operator.chart" . }} +{{ include "aiven-operator.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} @@ -49,8 +49,8 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Selector labels */}} -{{- define "aiven-kubernetes-operator.selectorLabels" -}} -app.kubernetes.io/name: {{ include "aiven-kubernetes-operator.name" . }} +{{- define "aiven-operator.selectorLabels" -}} +app.kubernetes.io/name: {{ include "aiven-operator.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} control-plane: controller-manager {{- end }} @@ -58,9 +58,9 @@ control-plane: controller-manager {{/* Create the name of the service account to use */}} -{{- define "aiven-kubernetes-operator.serviceAccountName" -}} +{{- define "aiven-operator.serviceAccountName" -}} {{- if .Values.serviceAccount.create }} -{{- default (include "aiven-kubernetes-operator.fullname" .) .Values.serviceAccount.name }} +{{- default (include "aiven-operator.fullname" .) .Values.serviceAccount.name }} {{- else }} {{- default "default" .Values.serviceAccount.name }} {{- end }} @@ -69,6 +69,6 @@ Create the name of the service account to use {{/* Common annotation our custom resource */}} -{{- define "aiven-kubernetes-operator.ca_injection_annotation" -}} -cert-manager.io/inject-ca-from: {{ include "aiven-kubernetes-operator.namespace" . }}/webhook-server-cert +{{- define "aiven-operator.ca_injection_annotation" -}} +cert-manager.io/inject-ca-from: {{ include "aiven-operator.namespace" . }}/webhook-server-cert {{- end }} diff --git a/charts/aiven-operator/templates/certificate.yaml b/charts/aiven-operator/templates/certificate.yaml new file mode 100644 index 0000000..c074e3c --- /dev/null +++ b/charts/aiven-operator/templates/certificate.yaml @@ -0,0 +1,33 @@ +{{- if .Values.webhooks.enabled }} + +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: {{ include "aiven-operator.fullname" . }}-webhook-certificate + namespace: {{ include "aiven-operator.namespace" . }} + labels: + {{- include "aiven-operator.labels" . | nindent 4 }} +spec: + dnsNames: + - {{ include "aiven-operator.fullname" . }}-webhook-service.{{ include "aiven-operator.namespace" . }}.svc + - {{ include "aiven-operator.fullname" . }}-webhook-service.{{ include "aiven-operator.namespace" . }}.svc.cluster.local + issuerRef: + kind: Issuer + name: {{ include "aiven-operator.fullname" . }}-selfsigned-issuer + secretName: webhook-server-cert + +--- + +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + name: {{ include "aiven-operator.fullname" . }}-selfsigned-issuer + namespace: {{ include "aiven-operator.namespace" . }} + labels: + {{- include "aiven-operator.labels" . | nindent 4 }} +spec: + selfSigned: {} + +--- + +{{- end }} diff --git a/charts/aiven-kubernetes-operator/templates/cluster_role.yaml b/charts/aiven-operator/templates/cluster_role.yaml similarity index 88% rename from charts/aiven-kubernetes-operator/templates/cluster_role.yaml rename to charts/aiven-operator/templates/cluster_role.yaml index c6407f3..1ef570b 100644 --- a/charts/aiven-kubernetes-operator/templates/cluster_role.yaml +++ b/charts/aiven-operator/templates/cluster_role.yaml @@ -1,10 +1,10 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-role - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-role + namespace: {{ include "aiven-operator.namespace" . }} labels: - {{- include "aiven-kubernetes-operator.labels" . | nindent 4 }} + {{- include "aiven-operator.labels" . | nindent 4 }} rules: - apiGroups: - "" @@ -81,6 +81,26 @@ rules: - kafkaacls/status verbs: - get +- apiGroups: + - aiven.io + resources: + - kafkaconnectors + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - aiven.io + resources: + - kafkaconnectors/status + verbs: + - get + - patch + - update - apiGroups: - aiven.io resources: @@ -268,4 +288,3 @@ rules: - get - list - update - diff --git a/charts/aiven-operator/templates/cluster_role_binding.yaml b/charts/aiven-operator/templates/cluster_role_binding.yaml new file mode 100644 index 0000000..0b6fa57 --- /dev/null +++ b/charts/aiven-operator/templates/cluster_role_binding.yaml @@ -0,0 +1,15 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ include "aiven-operator.fullname" . }}-rolebinding + namespace: {{ include "aiven-operator.namespace" . }} + labels: + {{- include "aiven-operator.labels" . | nindent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ include "aiven-operator.fullname" . }}-role +subjects: +- kind: ServiceAccount + name: default + namespace: {{ include "aiven-operator.namespace" . }} diff --git a/charts/aiven-kubernetes-operator/templates/deployment.yaml b/charts/aiven-operator/templates/deployment.yaml similarity index 85% rename from charts/aiven-kubernetes-operator/templates/deployment.yaml rename to charts/aiven-operator/templates/deployment.yaml index a42a821..693b4c7 100644 --- a/charts/aiven-kubernetes-operator/templates/deployment.yaml +++ b/charts/aiven-operator/templates/deployment.yaml @@ -1,15 +1,15 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "aiven-kubernetes-operator.fullname" . }} - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }} + namespace: {{ include "aiven-operator.namespace" . }} labels: -{{- include "aiven-kubernetes-operator.labels" . | nindent 4 }} +{{- include "aiven-operator.labels" . | nindent 4 }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: -{{- include "aiven-kubernetes-operator.selectorLabels" . | nindent 6 }} +{{- include "aiven-operator.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} @@ -17,7 +17,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: -{{- include "aiven-kubernetes-operator.selectorLabels" . | nindent 8 }} +{{- include "aiven-operator.selectorLabels" . | nindent 8 }} spec: terminationGracePeriodSeconds: 10 diff --git a/charts/aiven-kubernetes-operator/templates/election_role.yaml b/charts/aiven-operator/templates/election_role.yaml similarity index 63% rename from charts/aiven-kubernetes-operator/templates/election_role.yaml rename to charts/aiven-operator/templates/election_role.yaml index 80cdcf8..b7c5ed9 100644 --- a/charts/aiven-kubernetes-operator/templates/election_role.yaml +++ b/charts/aiven-operator/templates/election_role.yaml @@ -1,10 +1,10 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-election-role - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-election-role + namespace: {{ include "aiven-operator.namespace" . }} labels: - {{- include "aiven-kubernetes-operator.labels" . | nindent 4 }} + {{- include "aiven-operator.labels" . | nindent 4 }} rules: - apiGroups: - "" diff --git a/charts/aiven-operator/templates/election_role_binding.yaml b/charts/aiven-operator/templates/election_role_binding.yaml new file mode 100644 index 0000000..1c1b2dc --- /dev/null +++ b/charts/aiven-operator/templates/election_role_binding.yaml @@ -0,0 +1,15 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ include "aiven-operator.fullname" . }}-election-rolebinding + namespace: {{ include "aiven-operator.namespace" . }} + labels: + {{- include "aiven-operator.labels" . | nindent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ include "aiven-operator.fullname" . }}-election-role +subjects: +- kind: ServiceAccount + name: default + namespace: {{ include "aiven-operator.namespace" . }} diff --git a/charts/aiven-kubernetes-operator/templates/ensure_cert_manager_if_webhooks_are_enabled.yaml b/charts/aiven-operator/templates/ensure_cert_manager_if_webhooks_are_enabled.yaml similarity index 100% rename from charts/aiven-kubernetes-operator/templates/ensure_cert_manager_if_webhooks_are_enabled.yaml rename to charts/aiven-operator/templates/ensure_cert_manager_if_webhooks_are_enabled.yaml diff --git a/charts/aiven-kubernetes-operator/templates/mutating_webhook_configuration.yaml b/charts/aiven-operator/templates/mutating_webhook_configuration.yaml similarity index 65% rename from charts/aiven-kubernetes-operator/templates/mutating_webhook_configuration.yaml rename to charts/aiven-operator/templates/mutating_webhook_configuration.yaml index c977e10..73a57d2 100644 --- a/charts/aiven-kubernetes-operator/templates/mutating_webhook_configuration.yaml +++ b/charts/aiven-operator/templates/mutating_webhook_configuration.yaml @@ -4,19 +4,19 @@ apiVersion: admissionregistration.k8s.io/v1 kind: MutatingWebhookConfiguration metadata: annotations: -{{- include "aiven-kubernetes-operator.ca_injection_annotation" . | nindent 4 }} - name: {{ include "aiven-kubernetes-operator.fullname" . }}-mutating-webhook-configuration - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} +{{- include "aiven-operator.ca_injection_annotation" . | nindent 4 }} + name: {{ include "aiven-operator.fullname" . }}-mutating-webhook-configuration + namespace: {{ include "aiven-operator.namespace" . }} labels: -{{- include "aiven-kubernetes-operator.labels" . | nindent 4 }} +{{- include "aiven-operator.labels" . | nindent 4 }} webhooks: - admissionReviewVersions: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /mutate-aiven-io-v1alpha1-connectionpool failurePolicy: Fail name: mconnectionpool.kb.io @@ -35,8 +35,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /mutate-aiven-io-v1alpha1-database failurePolicy: Fail name: mdatabase.kb.io @@ -55,8 +55,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /mutate-aiven-io-v1alpha1-kafka failurePolicy: Fail name: mkafka.kb.io @@ -75,8 +75,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /mutate-aiven-io-v1alpha1-kafkaacl failurePolicy: Fail name: mkafkaacl.kb.io @@ -95,8 +95,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /mutate-aiven-io-v1alpha1-kafkaconnect failurePolicy: Fail name: mkafkaconnect.kb.io @@ -115,8 +115,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /mutate-aiven-io-v1alpha1-kafkaschema failurePolicy: Fail name: mkafkaschema.kb.io @@ -135,8 +135,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /mutate-aiven-io-v1alpha1-kafkatopic failurePolicy: Fail name: mkafkatopic.kb.io @@ -155,8 +155,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /mutate-aiven-io-v1alpha1-postgresql failurePolicy: Fail name: mpg.kb.io @@ -175,8 +175,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /mutate-aiven-io-v1alpha1-project failurePolicy: Fail name: mproject.kb.io @@ -195,8 +195,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /mutate-aiven-io-v1alpha1-projectvpc failurePolicy: Fail name: mprojectvpc.kb.io @@ -215,8 +215,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /mutate-aiven-io-v1alpha1-serviceintegration failurePolicy: Fail name: mserviceintegration.kb.io @@ -235,8 +235,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /mutate-aiven-io-v1alpha1-serviceuser failurePolicy: Fail name: mserviceuser.kb.io diff --git a/charts/aiven-operator/templates/service.yaml b/charts/aiven-operator/templates/service.yaml new file mode 100644 index 0000000..a66eb88 --- /dev/null +++ b/charts/aiven-operator/templates/service.yaml @@ -0,0 +1,19 @@ +{{- if .Values.webhooks.enabled }} + +apiVersion: v1 +kind: Service +metadata: + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} + labels: + {{- include "aiven-operator.labels" . | nindent 4 }} +spec: + ports: + - port: {{ .Values.webhooks.servicePort }} + targetPort: webhook + protocol: TCP + name: webhook + selector: + {{- include "aiven-operator.selectorLabels" . | nindent 4 }} + +{{- end }} diff --git a/charts/aiven-kubernetes-operator/templates/validating_webhook_configuration.yaml b/charts/aiven-operator/templates/validating_webhook_configuration.yaml similarity index 66% rename from charts/aiven-kubernetes-operator/templates/validating_webhook_configuration.yaml rename to charts/aiven-operator/templates/validating_webhook_configuration.yaml index 3a09c05..055467c 100644 --- a/charts/aiven-kubernetes-operator/templates/validating_webhook_configuration.yaml +++ b/charts/aiven-operator/templates/validating_webhook_configuration.yaml @@ -4,18 +4,18 @@ apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration metadata: annotations: -{{- include "aiven-kubernetes-operator.ca_injection_annotation" . | nindent 4 }} - name: {{ include "aiven-kubernetes-operator.fullname" . }}-validating-webhook-configuration - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} +{{- include "aiven-operator.ca_injection_annotation" . | nindent 4 }} + name: {{ include "aiven-operator.fullname" . }}-validating-webhook-configuration + namespace: {{ include "aiven-operator.namespace" . }} labels: - {{- include "aiven-kubernetes-operator.labels" . | nindent 4 }} + {{- include "aiven-operator.labels" . | nindent 4 }} webhooks: - admissionReviewVersions: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /validate-aiven-io-v1alpha1-connectionpool failurePolicy: Fail name: vconnectionpool.kb.io @@ -35,8 +35,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /validate-aiven-io-v1alpha1-database failurePolicy: Fail name: vdatabase.kb.io @@ -56,8 +56,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /validate-aiven-io-v1alpha1-kafka failurePolicy: Fail name: vkafka.kb.io @@ -77,8 +77,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /validate-aiven-io-v1alpha1-kafkaacl failurePolicy: Fail name: vkafkaacl.kb.io @@ -97,8 +97,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /validate-aiven-io-v1alpha1-kafkaconnect failurePolicy: Fail name: vkafkaconnect.kb.io @@ -118,8 +118,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /validate-aiven-io-v1alpha1-kafkaschema failurePolicy: Fail name: vkafkaschema.kb.io @@ -138,8 +138,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /validate-aiven-io-v1alpha1-kafkatopic failurePolicy: Fail name: vkafkatopic.kb.io @@ -159,8 +159,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /validate-aiven-io-v1alpha1-postgresql failurePolicy: Fail name: vpg.kb.io @@ -180,8 +180,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /validate-aiven-io-v1alpha1-project failurePolicy: Fail name: vproject.kb.io @@ -201,8 +201,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /validate-aiven-io-v1alpha1-projectvpc failurePolicy: Fail name: vprojectvpc.kb.io @@ -221,8 +221,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /validate-aiven-io-v1alpha1-serviceintegration failurePolicy: Fail name: vserviceintegration.kb.io @@ -241,8 +241,8 @@ webhooks: - v1 clientConfig: service: - name: {{ include "aiven-kubernetes-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-kubernetes-operator.namespace" . }} + name: {{ include "aiven-operator.fullname" . }}-webhook-service + namespace: {{ include "aiven-operator.namespace" . }} path: /validate-aiven-io-v1alpha1-serviceuser failurePolicy: Fail name: vserviceuser.kb.io diff --git a/charts/aiven-kubernetes-operator/values.yaml b/charts/aiven-operator/values.yaml similarity index 90% rename from charts/aiven-kubernetes-operator/values.yaml rename to charts/aiven-operator/values.yaml index f7f91c9..b92aef1 100644 --- a/charts/aiven-kubernetes-operator/values.yaml +++ b/charts/aiven-operator/values.yaml @@ -10,7 +10,7 @@ webhooks: # generic deployment configurations image: - repository: aivenoy/aiven-kubernetes-operator + repository: aivenoy/aiven-operator pullPolicy: IfNotPresent # default is .Chart.AppVersion but can be overriden here tag: ""