From a8494c67137ba5d9d4efed810a4db81e8898e511 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Tue, 6 Jun 2023 12:55:54 +0200 Subject: [PATCH] fix(cnpg): use hardcoded and fixed cnpg-webhook-service servicename (#9429) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** It seems cnpg uses a hardcoded servicename, we need to adapt for that as well. **โš™๏ธ Type of change** - [ ] โš™๏ธ Feature/App addition - [x] ๐Ÿช› Bugfix - [ ] โš ๏ธ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] ๐Ÿ”ƒ Refactor of current code **๐Ÿงช How Has This Been Tested?** **๐Ÿ“ƒ Notes:** **โœ”๏ธ Checklist:** - [ ] โš–๏ธ My code follows the style guidelines of this project - [ ] ๐Ÿ‘€ I have performed a self-review of my own code - [ ] #๏ธโƒฃ I have commented my code, particularly in hard-to-understand areas - [ ] ๐Ÿ“„ I have made corresponding changes to the documentation - [ ] โš ๏ธ My changes generate no new warnings - [ ] ๐Ÿงช I have added tests to this description that prove my fix is effective or that my feature works - [ ] โฌ†๏ธ I increased versions for any altered app according to semantic versioning **โž• App addition** If this PR is an app addition please make sure you have done the following. - [ ] ๐Ÿชž I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] ๐Ÿ–ผ๏ธ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --- charts/operators/cloudnative-pg/Chart.yaml | 4 +-- .../_mutatingwebhookconfiguration.tpl | 6 ++--- .../_validatingwebhookconfiguration.tpl | 8 +++--- charts/operators/cloudnative-pg/values.yaml | 27 ++++++++++--------- 4 files changed, 24 insertions(+), 21 deletions(-) diff --git a/charts/operators/cloudnative-pg/Chart.yaml b/charts/operators/cloudnative-pg/Chart.yaml index 1e15d6ab8ac..b9035529c8a 100644 --- a/charts/operators/cloudnative-pg/Chart.yaml +++ b/charts/operators/cloudnative-pg/Chart.yaml @@ -11,7 +11,7 @@ keywords: dependencies: - name: common repository: https://library-charts.truecharts.org - version: 12.12.1 + version: 12.12.3 kubeVersion: ">=1.16.0-0" maintainers: - email: info@truecharts.org @@ -23,7 +23,7 @@ sources: - https://github.com/cloudnative-pg - https://cloudnative-pg.io/ type: application -version: 0.0.1 +version: 0.0.2 annotations: truecharts.org/catagories: | - operators diff --git a/charts/operators/cloudnative-pg/templates/_mutatingwebhookconfiguration.tpl b/charts/operators/cloudnative-pg/templates/_mutatingwebhookconfiguration.tpl index e77dbb4a5fd..54d022d1f31 100644 --- a/charts/operators/cloudnative-pg/templates/_mutatingwebhookconfiguration.tpl +++ b/charts/operators/cloudnative-pg/templates/_mutatingwebhookconfiguration.tpl @@ -22,7 +22,7 @@ webhooks: - v1 clientConfig: service: - name: {{ include "tc.v1.common.lib.chart.names.fullname" $ }} + name: cnpg-webhook-service namespace: {{ .Release.Namespace }} path: /mutate-postgresql-cnpg-io-v1-backup port: {{ .Values.service.main.ports.main.port }} @@ -43,7 +43,7 @@ webhooks: - v1 clientConfig: service: - name: {{ include "tc.v1.common.lib.chart.names.fullname" $ }} + name: cnpg-webhook-service namespace: {{ .Release.Namespace }} path: /mutate-postgresql-cnpg-io-v1-cluster port: {{ .Values.service.main.ports.main.port }} @@ -64,7 +64,7 @@ webhooks: - v1 clientConfig: service: - name: {{ include "tc.v1.common.lib.chart.names.fullname" $ }} + name: cnpg-webhook-service namespace: {{ .Release.Namespace }} path: /mutate-postgresql-cnpg-io-v1-scheduledbackup port: {{ .Values.service.main.ports.main.port }} diff --git a/charts/operators/cloudnative-pg/templates/_validatingwebhookconfiguration.tpl b/charts/operators/cloudnative-pg/templates/_validatingwebhookconfiguration.tpl index 35d35d75665..a240caa5e05 100644 --- a/charts/operators/cloudnative-pg/templates/_validatingwebhookconfiguration.tpl +++ b/charts/operators/cloudnative-pg/templates/_validatingwebhookconfiguration.tpl @@ -22,7 +22,7 @@ webhooks: - v1 clientConfig: service: - name: {{ include "tc.v1.common.lib.chart.names.fullname" $ }} + name: cnpg-webhook-service namespace: {{ .Release.Namespace }} path: /validate-postgresql-cnpg-io-v1-backup port: {{ .Values.service.main.ports.main.port }} @@ -43,7 +43,7 @@ webhooks: - v1 clientConfig: service: - name: {{ include "tc.v1.common.lib.chart.names.fullname" $ }} + name: cnpg-webhook-service namespace: {{ .Release.Namespace }} path: /validate-postgresql-cnpg-io-v1-cluster port: {{ .Values.service.main.ports.main.port }} @@ -64,7 +64,7 @@ webhooks: - v1 clientConfig: service: - name: {{ include "tc.v1.common.lib.chart.names.fullname" $ }} + name: cnpg-webhook-service namespace: {{ .Release.Namespace }} path: /validate-postgresql-cnpg-io-v1-scheduledbackup port: {{ .Values.service.main.ports.main.port }} @@ -85,7 +85,7 @@ webhooks: - v1 clientConfig: service: - name: {{ include "tc.v1.common.lib.chart.names.fullname" $ }} + name: cnpg-webhook-service namespace: {{ .Release.Namespace }} path: /validate-postgresql-cnpg-io-v1-pooler port: {{ .Values.service.main.ports.main.port }} diff --git a/charts/operators/cloudnative-pg/values.yaml b/charts/operators/cloudnative-pg/values.yaml index 191b74f091a..d80b3605e6c 100644 --- a/charts/operators/cloudnative-pg/values.yaml +++ b/charts/operators/cloudnative-pg/values.yaml @@ -13,18 +13,20 @@ workload: - --leader-elect - --config-map-name={{ include "tc.v1.common.lib.chart.names.fullname" $ }}-config - --secret-name={{ include "tc.v1.common.lib.chart.names.fullname" $ }}-config - - --webhook-port={{ $.Values.service.main.ports.main.targetPort }} + - --webhook-port=9443 command: - /manager probes: liveness: - port: main + port: webhook + type: https path: /readyz readiness: - port: main + port: webhook + type: https path: /readyz startup: - port: main + port: webhook type: tcp env: OPERATOR_IMAGE_NAME: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" @@ -40,16 +42,17 @@ service: main: ports: main: + protocol: http + port: 8080 + cnpg-webhook-service: + enabled: true + expandObjectName: false + ports: + webhook: + enabled: true protocol: https port: 443 targetPort: 9443 - metrics: - enabled: true - ports: - metrics: - enabled: true - protocol: http - port: 8080 operator: register: true @@ -81,7 +84,7 @@ metrics: enabled: false type: "podmonitor" endpoints: - - port: metrics + - port: main interval: 5s scrapeTimeout: 5s path: /