Skip to content

Commit

Permalink
Add bindPort
Browse files Browse the repository at this point in the history
Allows customization of the metrics bind port for the operator
container.

Signed-off-by: Christopher Pitstick <[email protected]>
  • Loading branch information
Christopher Pitstick committed Jun 17, 2024
1 parent 339e5c8 commit fc49453
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 70 deletions.
3 changes: 2 additions & 1 deletion chart/open-feature-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,5 +175,6 @@ The command removes all the Kubernetes components associated with the chart and
| `controllerManager.replicas` | Sets number of replicas of the OpenFeature operator pod. | `1` |
| `managerConfig.flagsValidatonEnabled` | Enables the validating webhook for FeatureFlag CR. | `true` |
| `managerConfig.controllerManagerConfigYaml.health.healthProbeBindAddress` | Sets the bind address for health probes. | `:8081` |
| `managerConfig.controllerManagerConfigYaml.metrics.bindAddress` | Sets the bind address for metrics. | `127.0.0.1:8080` |
| `managerConfig.controllerManagerConfigYaml.metrics.bindAddress` | Sets the bind address for metrics. | `127.0.0.1` |
| `managerConfig.controllerManagerConfigYaml.metrics.bindPort` | Sets the bind port for metrics. Distinct from address | `:8080` |
| `managerConfig.controllerManagerConfigYaml.webhook.port` | Sets the bind address for webhook. | `9443` |
3 changes: 2 additions & 1 deletion chart/open-feature-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ managerConfig:
healthProbeBindAddress: :8081
metrics:
## @param managerConfig.controllerManagerConfigYaml.metrics.bindAddress Sets the bind address for metrics.
bindAddress: 127.0.0.1:8080
bindAddress: 127.0.0.1
bindPort: :8080
webhook:
## @param managerConfig.controllerManagerConfigYaml.webhook.port Sets the bind address for webhook.
port: 9443
3 changes: 2 additions & 1 deletion config/manager/controller_manager_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ kind: ControllerManagerConfig
health:
healthProbeBindAddress: :8081
metrics:
bindAddress: 127.0.0.1:8080
bindAddress: 127.0.0.1
bindPort: :8080
webhook:
port: 9443
leaderElection:
Expand Down
2 changes: 1 addition & 1 deletion config/overlays/helm/controller_manager_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: ControllerManagerConfig
health:
healthProbeBindAddress: "{{ .Values.managerConfig.controllerManagerConfigYaml.health.healthProbeBindAddress }}"
metrics:
bindAddress: "{{ .Values.managerConfig.controllerManagerConfigYaml.metrics.bindAddress }}"
bindAddress: "{{ .Values.managerConfig.controllerManagerConfigYaml.metrics.bindAddress }}{{ .Values.managerConfig.controllerManagerConfigYaml.metrics.bindPort }}"
webhook:
port: 0{{ .Values.managerConfig.controllerManagerConfigYaml.webhook.port }}
133 changes: 67 additions & 66 deletions config/overlays/helm/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,79 +20,80 @@ spec:
cpu: "{{ .Values.controllerManager.manager.resources.requests.cpu }}"
memory: "{{ .Values.controllerManager.manager.resources.requests.memory }}"
env:
- name: SIDECAR_MANAGEMENT_PORT
value: "{{ .Values.sidecarConfiguration.managementPort }}"
- name: SIDECAR_PORT
value: "{{ .Values.sidecarConfiguration.port }}"
- name: SIDECAR_SOCKET_PATH
value: "{{ .Values.sidecarConfiguration.socketPath }}"
- name: SIDECAR_IMAGE
value: "{{ .Values.sidecarConfiguration.image.repository }}"
- name: SIDECAR_TAG
value: "{{ .Values.sidecarConfiguration.image.tag }}"
- name: SIDECAR_PROVIDER_ARGS
value: "{{ .Values.sidecarConfiguration.providerArgs }}"
- name: SIDECAR_ENV_VAR_PREFIX
value: "{{ .Values.sidecarConfiguration.envVarPrefix }}"
- name: SIDECAR_SYNC_PROVIDER
value: "{{ .Values.sidecarConfiguration.defaultSyncProvider }}"
- name: SIDECAR_EVALUATOR
value: "{{ .Values.sidecarConfiguration.evaluator }}"
- name: SIDECAR_LOG_FORMAT
value: "{{ .Values.sidecarConfiguration.logFormat }}"
- name: SIDECAR_PROBES_ENABLED
value: "{{ .Values.sidecarConfiguration.probesEnabled }}"
- name: FLAGD_PROXY_IMAGE
value: "{{ .Values.flagdProxyConfiguration.image.repository }}"
- name: FLAGD_PROXY_TAG
value: "{{ .Values.flagdProxyConfiguration.image.tag }}"
- name: FLAGD_PROXY_PORT
value: "{{ .Values.flagdProxyConfiguration.port }}"
- name: FLAGD_PROXY_MANAGEMENT_PORT
value: "{{ .Values.flagdProxyConfiguration.managementPort }}"
- name: FLAGD_PROXY_DEBUG_LOGGING
value: "{{ .Values.flagdProxyConfiguration.debugLogging }}"
- name: FLAGD_IMAGE
value: "{{ .Values.flagdConfiguration.image.repository }}"
- name: FLAGD_TAG
value: "{{ .Values.flagdConfiguration.image.tag }}"
- name: FLAGD_PORT
value: "{{ .Values.flagdConfiguration.port }}"
- name: FLAGD_OFREP_PORT
value: "{{ .Values.flagdConfiguration.ofrepPort }}"
- name: FLAGD_SYNC_PORT
value: "{{ .Values.flagdConfiguration.syncPort }}"
- name: FLAGD_MANAGEMENT_PORT
value: "{{ .Values.flagdConfiguration.managementPort }}"
- name: FLAGD_DEBUG_LOGGING
value: "{{ .Values.flagdConfiguration.debugLogging }}"
- name: FLAGS_VALIDATION_ENABLED
value: "{{ .Values.managerConfig.flagsValidatonEnabled }}"
- name: IN_PROCESS_PORT
value: "{{ .Values.inProcessConfiguration.port }}"
- name: IN_PROCESS_HOST
value: "{{ .Values.inProcessConfiguration.host }}"
- name: IN_PROCESS_SOCKET_PATH
value: "{{ .Values.inProcessConfiguration.socketPath }}"
- name: IN_PROCESS_TLS
value: "{{ .Values.inProcessConfiguration.tls }}"
- name: IN_PROCESS_OFFLINE_FLAG_SOURCE_PATH
value: "{{ .Values.inProcessConfiguration.offlineFlagSourcePath }}"
- name: IN_PROCESS_SELECTOR
value: "{{ .Values.inProcessConfiguration.selector }}"
- name: IN_PROCESS_CACHE
value: "{{ .Values.inProcessConfiguration.cache.type }}"
- name: IN_PROCESS_ENV_VAR_PREFIX
value: "{{ .Values.inProcessConfiguration.envVarPrefix }}"
- name: IN_PROCESS_CACHE_MAX_SIZE
value: "{{ .Values.inProcessConfiguration.cache.size }}"
- name: SIDECAR_MANAGEMENT_PORT
value: "{{ .Values.sidecarConfiguration.managementPort }}"
- name: SIDECAR_PORT
value: "{{ .Values.sidecarConfiguration.port }}"
- name: SIDECAR_SOCKET_PATH
value: "{{ .Values.sidecarConfiguration.socketPath }}"
- name: SIDECAR_IMAGE
value: "{{ .Values.sidecarConfiguration.image.repository }}"
- name: SIDECAR_TAG
value: "{{ .Values.sidecarConfiguration.image.tag }}"
- name: SIDECAR_PROVIDER_ARGS
value: "{{ .Values.sidecarConfiguration.providerArgs }}"
- name: SIDECAR_ENV_VAR_PREFIX
value: "{{ .Values.sidecarConfiguration.envVarPrefix }}"
- name: SIDECAR_SYNC_PROVIDER
value: "{{ .Values.sidecarConfiguration.defaultSyncProvider }}"
- name: SIDECAR_EVALUATOR
value: "{{ .Values.sidecarConfiguration.evaluator }}"
- name: SIDECAR_LOG_FORMAT
value: "{{ .Values.sidecarConfiguration.logFormat }}"
- name: SIDECAR_PROBES_ENABLED
value: "{{ .Values.sidecarConfiguration.probesEnabled }}"
- name: FLAGD_PROXY_IMAGE
value: "{{ .Values.flagdProxyConfiguration.image.repository }}"
- name: FLAGD_PROXY_TAG
value: "{{ .Values.flagdProxyConfiguration.image.tag }}"
- name: FLAGD_PROXY_PORT
value: "{{ .Values.flagdProxyConfiguration.port }}"
- name: FLAGD_PROXY_MANAGEMENT_PORT
value: "{{ .Values.flagdProxyConfiguration.managementPort }}"
- name: FLAGD_PROXY_DEBUG_LOGGING
value: "{{ .Values.flagdProxyConfiguration.debugLogging }}"
- name: FLAGD_IMAGE
value: "{{ .Values.flagdConfiguration.image.repository }}"
- name: FLAGD_TAG
value: "{{ .Values.flagdConfiguration.image.tag }}"
- name: FLAGD_PORT
value: "{{ .Values.flagdConfiguration.port }}"
- name: FLAGD_OFREP_PORT
value: "{{ .Values.flagdConfiguration.ofrepPort }}"
- name: FLAGD_SYNC_PORT
value: "{{ .Values.flagdConfiguration.syncPort }}"
- name: FLAGD_MANAGEMENT_PORT
value: "{{ .Values.flagdConfiguration.managementPort }}"
- name: FLAGD_DEBUG_LOGGING
value: "{{ .Values.flagdConfiguration.debugLogging }}"
- name: FLAGS_VALIDATION_ENABLED
value: "{{ .Values.managerConfig.flagsValidatonEnabled }}"
- name: IN_PROCESS_PORT
value: "{{ .Values.inProcessConfiguration.port }}"
- name: IN_PROCESS_HOST
value: "{{ .Values.inProcessConfiguration.host }}"
- name: IN_PROCESS_SOCKET_PATH
value: "{{ .Values.inProcessConfiguration.socketPath }}"
- name: IN_PROCESS_TLS
value: "{{ .Values.inProcessConfiguration.tls }}"
- name: IN_PROCESS_OFFLINE_FLAG_SOURCE_PATH
value: "{{ .Values.inProcessConfiguration.offlineFlagSourcePath }}"
- name: IN_PROCESS_SELECTOR
value: "{{ .Values.inProcessConfiguration.selector }}"
- name: IN_PROCESS_CACHE
value: "{{ .Values.inProcessConfiguration.cache.type }}"
- name: IN_PROCESS_ENV_VAR_PREFIX
value: "{{ .Values.inProcessConfiguration.envVarPrefix }}"
- name: IN_PROCESS_CACHE_MAX_SIZE
value: "{{ .Values.inProcessConfiguration.cache.size }}"
args:
- --leader-elect
- --sidecar-cpu-limit={{ .Values.sidecarConfiguration.resources.limits.cpu }}
- --sidecar-ram-limit={{ .Values.sidecarConfiguration.resources.limits.memory }}
- --sidecar-cpu-request={{ .Values.sidecarConfiguration.resources.requests.cpu }}
- --sidecar-ram-request={{ .Values.sidecarConfiguration.resources.requests.memory }}
- --image-pull-secrets={{ range .Values.imagePullSecrets }}{{ .name }},{{- end }}
- --metrics-bind-address={{ .Values.managerConfig.controllerManagerConfigYaml.metrics.bindPort }}
- name: kube-rbac-proxy
image: "{{ .Values.controllerManager.kubeRbacProxy.image.repository }}:{{ .Values.controllerManager.kubeRbacProxy.image.tag }}"
resources:
Expand Down

0 comments on commit fc49453

Please sign in to comment.