> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Demo Updating Cilium Configuration

> Updating Cilium configuration on Kubernetes clusters using Helm or ConfigMap edits, restarting components, and verifying changes.

This guide shows two ways to change an existing Cilium configuration on a Kubernetes cluster:

* Update via Helm (recommended when Cilium was installed with Helm).
* Edit the Cilium ConfigMap directly (useful for quick runtime changes or when Helm was not used).

These instructions assume you have kubectl and, if using Helm, the Helm CLI configured for the cluster.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/3_oH8WobznU4DXye/images/Prep-Course-Cilium-Certified-Associate-CCA-Certification/Installing-Configuring-Cilium/Demo-Updating-Cilium-Configuration/updating-cilium-configuration-demo-slide.jpg?fit=max&auto=format&n=3_oH8WobznU4DXye&q=85&s=bf7a73286f97f3899069512aa89d8cb4" alt="A presentation slide titled &#x22;Updating Cilium Configuration&#x22; with a large turquoise curved shape on the right containing the word &#x22;Demo.&#x22; The bottom-left shows a small &#x22;© Copyright KodeKloud&#x22; attribution." width="1920" height="1080" data-path="images/Prep-Course-Cilium-Certified-Associate-CCA-Certification/Installing-Configuring-Cilium/Demo-Updating-Cilium-Configuration/updating-cilium-configuration-demo-slide.jpg" />
</Frame>

## 1 — Verify cluster and Cilium installation

Confirm cluster nodes:

```bash theme={null}
kubectl get nodes
```

Confirm Cilium pods (all namespaces):

```bash theme={null}
kubectl get pods -A
```

Example (abbreviated) output:

```text theme={null}
NAMESPACE     NAME                                             READY   STATUS    RESTARTS   AGE
kube-system   cilium-hpfns                                     1/1     Running   0          2m
kube-system   cilium-operator-59944f4b8f-kw9p9                 1/1     Running   0          2m
kube-system   cilium-qn9dg                                     1/1     Running   0          2m
kube-system   coredns-668d6bf9bc-gpc8z                         1/1     Running   0          3m
...
```

If Cilium was installed with Helm, prefer updating configuration via Helm so your changes are tracked by the release.

## Quick comparison: Helm vs ConfigMap editing

| Resource Type                | Use Case                                                     | Recommended when                                                                       |
| ---------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------- |
| Helm values + helm upgrade   | Persistent, repeatable configuration changes tracked by Helm | Cilium installed with Helm; you want changes preserved across upgrades                 |
| Edit cilium-config ConfigMap | Immediate runtime tweaks or when Helm was not used           | Quick tests or clusters without Helm-managed Cilium (note: may be overwritten by Helm) |

## 2 — Update configuration via Helm (recommended)

1. Export or open the `values.yaml` you used for the Helm release and change the values you want.\
   Example: enable debug logging by changing:

```yaml theme={null}
debug:
  # -- Enable debug logging
  enabled: false
```

to:

```yaml theme={null}
debug:
  # -- Enable debug logging
  enabled: true
```

2. Confirm the Helm release and namespace (Cilium commonly lives in `kube-system`):

```bash theme={null}
helm list -n kube-system
```

3. Apply the updated values with `helm upgrade`. The `-n` (namespace) flag must match the existing release:

```bash theme={null}
helm upgrade cilium cilium/cilium -n kube-system -f values.yaml
```

A successful upgrade will generate and apply new Kubernetes manifests. Example summary:

```text theme={null}
STATUS: deployed
REVISION: 2
NOTES:
You have successfully upgraded Cilium.
```

## 3 — Update configuration by editing the ConfigMap directly

Cilium stores many runtime options in the `cilium-config` ConfigMap in the `kube-system` namespace. Use this method for quick runtime changes or when Cilium was not installed with Helm.

Inspect whether a specific flag (e.g., `debug`) is set:

```bash theme={null}
kubectl describe configmap cilium-config -n kube-system | grep -i debug -A 3
```

Example output:

```text theme={null}
debug:
true
```

Edit the ConfigMap:

```bash theme={null}
kubectl edit configmap cilium-config -n kube-system
```

Make required changes in the `data:` section. Example — disable IPv6:
Before:

```yaml theme={null}
enable-ipv6: "true"
k8s-require-ipv6-pod-cidr: "true"
```

After:

```yaml theme={null}
enable-ipv6: "false"
# removed k8s-require-ipv6-pod-cidr
```

After saving the edit you should see:

```text theme={null}
configmap/cilium-config edited
```

<Callout icon="warning" color="#F2B44C">
  If Cilium is managed by Helm, the `cilium-config` ConfigMap may be owned by the Helm release. Direct edits with `kubectl` can be overwritten by future `helm upgrade` or `helm rollback` actions. Prefer updating Helm values when possible or coordinate ConfigMap edits with your Helm values.
</Callout>

## 4 — Restart Cilium components so changes take effect

After modifying the ConfigMap (or after a Helm upgrade), restart the operator and agent so they pick up the new configuration.

Restart the operator (Deployment) and the agent (DaemonSet):

```bash theme={null}
kubectl rollout restart deployment cilium-operator -n kube-system
kubectl rollout restart daemonset cilium -n kube-system
```

Example outputs:

```text theme={null}
deployment.apps/cilium-operator restarted
daemonset.apps/cilium restarted
```

Monitor pod status while they restart:

```bash theme={null}
kubectl get pods -A --watch
```

Wait until the new Cilium pods reach `Running` status. Init containers may take a short while to complete.

<Callout icon="lightbulb" color="#1CB2FE">
  After changing the Cilium ConfigMap, you must restart the operator and agent pods so the new configuration is applied.
</Callout>

## 5 — Verify the change (example: confirm IPv6 disabled)

Create a test pod:

```bash theme={null}
kubectl run nginx --image=nginx --restart=Never
kubectl get pods -w
```

Describe the test pod to inspect assigned IP(s):

```bash theme={null}
kubectl describe pod nginx
```

Relevant excerpt showing only an IPv4 address (IPv6 disabled):

```text theme={null}
IP:             10.0.2.163
IPs:
  IP:           10.0.2.163
```

## Troubleshooting tips

* If changes do not appear to apply:
  * Verify you edited the correct ConfigMap and namespace.
  * Confirm the Cilium Helm release is not overwriting settings (check `helm get values <release> -n <ns>`).
  * Check operator and agent logs for errors:
    ```bash theme={null}
    kubectl logs -l k8s-app=cilium -n kube-system --tail=200
    kubectl logs deployment/cilium-operator -n kube-system --tail=200
    ```
* For transient issues after restart, allow a few minutes for init containers and datapath programs to reinitialize.

## Summary

* Prefer updating the Helm `values.yaml` and running `helm upgrade` when Cilium was installed with Helm—this preserves configuration in the release.
* Editing the `cilium-config` ConfigMap is useful for quick runtime changes or on clusters where Cilium was not installed with Helm. After editing, restart the `cilium-operator` deployment and the `cilium` daemonset so changes take effect.
* Always validate changes by creating test pods and checking their assigned IPs and Cilium logs.

## Links and references

* [Cilium Documentation](https://docs.cilium.io/)
* [Kubernetes Documentation — Pods](https://kubernetes.io/docs/concepts/workloads/pods/)
* [Helm Documentation](https://helm.sh/docs/)
* [KodeKloud Helm course](https://learn.kodekloud.com/user/courses/helm-for-beginners)

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/cilium-certified-associate-cca/module/2fded455-95ea-4183-8cce-f17de214691f/lesson/99b26348-588c-4672-afd9-92851a2b81fe" />

  <Card title="Practice Lab" icon="flask-conical" cta="Learn more" href="https://learn.kodekloud.com/user/courses/cilium-certified-associate-cca/module/2fded455-95ea-4183-8cce-f17de214691f/lesson/abfc64d5-1dba-4802-a679-e5857635ef8b" />
</CardGroup>
