Skip to content

Commit

Permalink
charts/operator: Add option to enable hostNetwork for custom CNI depl…
Browse files Browse the repository at this point in the history
…oyments (#1896)

* charts/operator: Enable hostNetwork for custom CNI based deployments

* charts/victoria-metrics-operator: Add option to enable hostNetwork for custom CNI deployments
  • Loading branch information
tanmay-bhat authored Dec 23, 2024
1 parent b1f5296 commit 3bc7c0f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/victoria-metrics-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Next release

- TODO
- add option to enable hostNetwork for custom CNI based deployments

## 0.40.1

Expand Down
9 changes: 9 additions & 0 deletions charts/victoria-metrics-operator/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ extraVolumeMounts:

This configuration disables the automatic ServiceAccount token mount and mounts the token explicitly.

## Enable hostNetwork on operator

When running managed Kubernetes such as EKS with custom CNI solution like Cilium or Calico, EKS control plane cannot communicate with CNI's pod CIDR.
In that scenario, we need to run webhook service i.e operator with hostNetwork so that it can share node's network namespace.

```yaml
hostNetwork: true
```

## Parameters

The following tables lists the configurable parameters of the chart and their default values.
Expand Down
3 changes: 3 additions & 0 deletions charts/victoria-metrics-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ spec:
{{- if .Values.podSecurityContext.enabled }}
securityContext: {{ include "vm.securityContext" (dict "securityContext" .Values.podSecurityContext "helm" .) | nindent 8 }}
{{- end }}
{{- if .Values.hostNetwork }}
hostNetwork: true
{{- end }}
{{- if or (.Values.serviceAccount).name (.Values.serviceAccount).create }}
serviceAccountName: {{ (.Values.serviceAccount).name | default $fullname }}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions charts/victoria-metrics-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ extraContainers:
# - name: config-reloader
# image: reloader-image

# -- Enable hostNetwork on operator deployment
hostNetwork: false

# -- Configures resource validation
admissionWebhooks:
# -- Enables validation webhook.
Expand Down

0 comments on commit 3bc7c0f

Please sign in to comment.