Skip to content

Commit

Permalink
operator: configurable webhook port (#1507)
Browse files Browse the repository at this point in the history
* operator: configurable webhook port

* fixed cleanup hook

* fixed typo
  • Loading branch information
AndrewChubatiuk committed Sep 19, 2024
1 parent 03edda2 commit c389e65
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions charts/victoria-metrics-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

- Moved crds to a shared chart and import them as a dependency
- replaced `crd.enabled` property to `crds.plain`. Instead of disabling CRDs it selects if CRDs should be rendered from template or as plain CRDs
- Made webhook port configurable. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1506)
- Changed crd cleanup hook delete policy to prevent `resource already exists` error.

## 0.34.8

Expand Down
6 changes: 3 additions & 3 deletions charts/victoria-metrics-operator/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies:
- name: victoria-metrics-common
repository: https://victoriametrics.github.io/helm-charts
version: 0.0.11
version: 0.0.13
- name: crds
repository: ""
version: 0.0.*
digest: sha256:14667a2da4b0843956aa57c97b737fbefc3bd24f0376f81b2c2b7e84919e5214
generated: "2024-09-12T13:21:35.804808+03:00"
digest: sha256:6d82d9a15a778259efa73e4798f46d461877cea5a8f382b7bf7eb4164fccfc1b
generated: "2024-09-17T00:20:51.436479+03:00"
2 changes: 1 addition & 1 deletion charts/victoria-metrics-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Expand the name of the chart.
{{- define "vm-operator.cleanup.annotations" -}}
"helm.sh/hook": pre-delete
"helm.sh/hook-weight": "{{ .hookWeight }}"
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
"helm.sh/hook-delete-policy": before-hook-creation
{{- end }}

{{/*
Expand Down
4 changes: 2 additions & 2 deletions charts/victoria-metrics-operator/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ spec:
{{- end }}
ports:
- name: http
port: 8080
port: {{ .Values.service.servicePort }}
targetPort: http
protocol: TCP
- name: webhook
port: 9443
port: {{ .Values.service.webhookPort }}
targetPort: webhook
selector: {{ include "vm-operator.selectorLabels" . | nindent 4 }}
2 changes: 1 addition & 1 deletion charts/victoria-metrics-operator/templates/webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ webhooks:
namespace: {{ include "vm.namespace" $ }}
name: {{ include "vm-operator.fullname" $ }}
path: /validate-operator-victoriametrics-com-v1beta1-{{ $name }}
port: 9443
port: {{ .Values.service.webhookPort }}
{{- if not $.Values.admissionWebhooks.certManager.enabled }}
caBundle: {{ $tls.caCert }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions charts/victoria-metrics-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ service:
externalTrafficPolicy: ""
ipFamilyPolicy: ""
ipFamilies: []
servicePort: 8080
webhookPort: 9443

# -- See `kubectl explain poddisruptionbudget.spec` for more or check [these docs](https://kubernetes.io/docs/tasks/run-application/configure-pdb/)
podDisruptionBudget:
Expand Down

0 comments on commit c389e65

Please sign in to comment.