kubernetes-nmstate
by nmstate
Kubernetes operator for declarative node network configuration using nmstate and NetworkManager
About this chart
kubernetes-nmstate
kubernetes-nmstate is a Kubernetes operator for declarative node network configuration using nmstate and NetworkManager. It reports the current network state of cluster nodes and applies desired configuration through Kubernetes custom resources.
Prerequisites
Install Helm (>= 3.8) and ensure NetworkManager is running on the cluster nodes. See the arbitrary cluster guide for node requirements.
kubernetes-nmstate is a cluster singleton: only one release of this chart per
cluster is supported. The chart creates cluster-scoped resources with fixed
names (such as the nmstate-operator ClusterRole and ClusterRoleBinding), so
installing a second release would conflict with the first one.
Install
Choose a chart version from
Artifact Hub.
Use that version without a leading v for <version> in the commands below.
helm install nmstate oci://quay.io/nmstate/kubernetes-nmstate \
--version <version> \
--namespace nmstate \
--create-namespace
This deploys the operator and, by default (nmstate.enabled=true), an
NMState custom resource that makes the operator deploy the
kubernetes-nmstate handler on all nodes.
If your cluster enforces Pod Security admission and the handler namespace equals the release namespace, the operator labels the namespace for privileged workloads automatically.
Values
Helm validates chart values against the packaged values.schema.json schema.
Use --set-string when a string value looks like a number or boolean, such as
a numeric namespace name. Fields inside nmstate.spec are validated by the
NMState CRD.
| Key | Default | Description |
|---|---|---|
operator.image | "" | Operator image; empty means quay.io/nmstate/kubernetes-nmstate-operator:<appVersion> |
operator.pullPolicy | IfNotPresent | Operator image pull policy |
handler.image | "" | Handler image; empty means quay.io/nmstate/kubernetes-nmstate-handler:<appVersion> |
handler.pullPolicy | IfNotPresent | Handler image pull policy |
handler.namespace | nmstate | Namespace the operator deploys the handler into |
handler.prefix | "" | Optional name prefix for the handler resources deployed by the operator; when empty no HANDLER_PREFIX env is rendered |
handler.imageEnvVar | RELATED_IMAGE_HANDLER_IMAGE | Name of the operator env var carrying the handler image |
plugin.image | "" | Console plugin image for downstream distributions; when empty no PLUGIN_IMAGE env is rendered |
monitoring.namespace | monitoring | Cluster monitoring namespace |
createNamespace | false | Emit a Namespace object for the release namespace (use helm install --create-namespace instead) |
nmstate.enabled | true | Create the NMState custom resource (named nmstate) at install time |
nmstate.spec | {} | Passthrough for NMState spec fields (nodeSelector, tolerations, ...) |
Upgrade
Helm does not modify custom resource definitions shipped in the chart's
crds/ directory on upgrade. Apply the NMState CRD manually first. GitHub
release tags use a leading v, unlike Helm chart versions:
kubectl apply -f https://github.com/nmstate/kubernetes-nmstate/releases/download/v<version>/nmstate.io_nmstates.yaml
helm upgrade nmstate oci://quay.io/nmstate/kubernetes-nmstate \
--version <version> \
--namespace nmstate
Uninstall
helm uninstall nmstate --namespace nmstate --wait
Usage and support
Deploy kubernetes-nmstate with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has kubernetes-nmstate on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartkubernetes-nmstate is pinned at v0.87.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply