Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

charts/operator: Add option to enable hostNetwork for custom CNI deployments #1896

Merged
merged 2 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading