Skip to content

Commit caef5a1

Browse files
Add bindPort & webhook port.
Allows customization of the metrics bind port for the operator container as well as the webhook port. Important for when hostNetwork is `true` Signed-off-by: Christopher Pitstick <cpitstick@lat.ai>
1 parent 8e00a35 commit caef5a1

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

chart/open-feature-operator/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,6 @@ The command removes all the Kubernetes components associated with the chart and
177177
| `controllerManager.replicas` | Sets number of replicas of the OpenFeature operator pod. | `1` |
178178
| `managerConfig.flagsValidatonEnabled` | Enables the validating webhook for FeatureFlag CR. | `true` |
179179
| `managerConfig.controllerManagerConfigYaml.health.healthProbeBindAddress` | Sets the bind address for health probes. | `:8081` |
180-
| `managerConfig.controllerManagerConfigYaml.metrics.bindAddress` | Sets the bind address for metrics. | `127.0.0.1:8080` |
180+
| `managerConfig.controllerManagerConfigYaml.metrics.bindAddress` | Sets the bind address for metrics (combined with bindPort). | `127.0.0.1` |
181+
| `managerConfig.controllerManagerConfigYaml.metrics.bindPort` | Sets the bind port for metrics. | `8080` |
181182
| `managerConfig.controllerManagerConfigYaml.webhook.port` | Sets the bind address for webhook. | `9443` |

chart/open-feature-operator/values.yaml

+5-3
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,11 @@ managerConfig:
151151
health:
152152
## @param managerConfig.controllerManagerConfigYaml.health.healthProbeBindAddress Sets the bind address for health probes.
153153
healthProbeBindAddress: :8081
154-
metrics:
155-
## @param managerConfig.controllerManagerConfigYaml.metrics.bindAddress Sets the bind address for metrics.
156-
bindAddress: 127.0.0.1:8080
154+
metrics:
155+
## @param managerConfig.controllerManagerConfigYaml.metrics.bindAddress Sets the bind address for metrics (combined with bindPort).
156+
bindAddress: 127.0.0.1
157+
## @param managerConfig.controllerManagerConfigYaml.metrics.bindPort Sets the bind port for metrics.
158+
bindPort: 8080
157159
webhook:
158160
## @param managerConfig.controllerManagerConfigYaml.webhook.port Sets the bind address for webhook.
159161
port: 9443

config/overlays/helm/controller_manager_config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ kind: ControllerManagerConfig
33
health:
44
healthProbeBindAddress: "{{ .Values.managerConfig.controllerManagerConfigYaml.health.healthProbeBindAddress }}"
55
metrics:
6-
bindAddress: "{{ .Values.managerConfig.controllerManagerConfigYaml.metrics.bindAddress }}"
6+
bindAddress: "{{ .Values.managerConfig.controllerManagerConfigYaml.metrics.bindAddress }}:{{ .Values.managerConfig.controllerManagerConfigYaml.metrics.bindPort }}"
77
webhook:
88
port: 0{{ .Values.managerConfig.controllerManagerConfigYaml.webhook.port }}

config/overlays/helm/manager.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ spec:
2222
requests:
2323
cpu: "{{ .Values.controllerManager.manager.resources.requests.cpu }}"
2424
memory: "{{ .Values.controllerManager.manager.resources.requests.memory }}"
25+
ports:
26+
- containerPort: "___{{ .Values.managerConfig.controllerManagerConfigYaml.webhook.port }} ___"
27+
name: webhook-server
28+
protocol: TCP
29+
- containerPort: "___{{ .Values.managerConfig.controllerManagerConfigYaml.metrics.bindPort }}___"
30+
name: metrics-server
31+
protocol: TCP
2532
env:
2633
- name: SIDECAR_MANAGEMENT_PORT
2734
value: "{{ .Values.sidecarConfiguration.managementPort }}"
@@ -96,6 +103,7 @@ spec:
96103
- --sidecar-cpu-request={{ .Values.sidecarConfiguration.resources.requests.cpu }}
97104
- --sidecar-ram-request={{ .Values.sidecarConfiguration.resources.requests.memory }}
98105
- --image-pull-secrets={{ range .Values.imagePullSecrets }}{{ .name }},{{- end }}
106+
- --metrics-bind-address=:{{ .Values.managerConfig.controllerManagerConfigYaml.metrics.bindPort }}
99107
- name: kube-rbac-proxy
100108
image: "{{ .Values.controllerManager.kubeRbacProxy.image.repository }}:{{ .Values.controllerManager.kubeRbacProxy.image.tag }}"
101109
resources:

0 commit comments

Comments
 (0)