> ## 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.

# Cilium CLI

> Explains cilium-cli commands to view and modify Cilium configuration, enable and disable debug logging, and verify pod restarts and logs for troubleshooting on Kubernetes.

In this lesson we cover two essential cilium-cli commands for administering Cilium on a Kubernetes cluster: how to view the active Cilium configuration and how to enable debug-level logging for troubleshooting. These commands read from and modify the `cilium-config` ConfigMap and (when needed) trigger a restart of Cilium agents so changes take effect.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/3_oH8WobznU4DXye/images/Prep-Course-Cilium-Certified-Associate-CCA-Certification/Exploring-Cilium/Cilium-CLI/cilium-cli-slide-blue-teal-gradient.jpg?fit=max&auto=format&n=3_oH8WobznU4DXye&q=85&s=e80c6fa46aa432fe1456a45c755f086e" alt="A simple presentation slide with the title &#x22;Cilium CLI&#x22; centered on a blue-to-teal gradient background. In the bottom-left corner is a small &#x22;© Copyright KodeKloud&#x22; notice." width="1920" height="1080" data-path="images/Prep-Course-Cilium-Certified-Associate-CCA-Certification/Exploring-Cilium/Cilium-CLI/cilium-cli-slide-blue-teal-gradient.jpg" />
</Frame>

Why these commands are useful:

* Inspect current runtime and configuration values.
* Temporarily increase logging detail to diagnose networking, policy, or datapath issues.
* Apply and revert settings without editing ConfigMaps manually.

## Quick command reference

|                                             Command | Purpose                                                                       | Example                                             |
| --------------------------------------------------: | ----------------------------------------------------------------------------- | --------------------------------------------------- |
|                                `cilium config view` | Display the active Cilium configuration (from the `cilium-config` ConfigMap). | `cilium config view`                                |
|                      `cilium config set debug true` | Enable debug logging (patches the ConfigMap and restarts Cilium pods).        | `cilium config set debug true`                      |
|                     `cilium config set debug false` | Disable debug logging (revert to default logging level).                      | `cilium config set debug false`                     |
| `kubectl -n kube-system get pods -l k8s-app=cilium` | Verify Cilium pods and check for restarts after config changes.               | `kubectl -n kube-system get pods -l k8s-app=cilium` |
|     `kubectl -n kube-system logs <cilium-pod-name>` | Inspect Cilium pod logs (useful when debug is enabled).                       | `kubectl -n kube-system logs cilium-abcde`          |

## View the current Cilium configuration

Use this to quickly inspect values stored in the `cilium-config` ConfigMap and confirm how Cilium is configured in the cluster:

```bash theme={null}
cilium config view
```

If you prefer to inspect the raw ConfigMap with kubectl:

```bash theme={null}
kubectl -n kube-system get configmap cilium-config -o yaml
```

This is helpful when you want to see timestamps, annotations, or any fields not surfaced by the `cilium` CLI output.

## Enable debug logging (toggle)

Enabling debug logging increases log verbosity from Cilium agents, which is useful when isolating issues in datapath, agent communication, or policy enforcement. The cilium CLI patches the `cilium-config` ConfigMap and restarts Cilium pods so agents pick up the change.

Enable debug logging:

```bash theme={null}
cilium config set debug true
```

Typical CLI output after enabling debug:

```text theme={null}
Patching ConfigMap cilium-config with debug=true...
Restarted Cilium pods
```

To revert debug logging back to normal (disable verbose logs):

```bash theme={null}
cilium config set debug false
```

## Verify pods and inspect logs

After toggling debug, confirm the pods restarted and examine logs:

```bash theme={null}
# list Cilium pods (typically in the kube-system namespace)
kubectl -n kube-system get pods -l k8s-app=cilium

# view logs from a specific Cilium pod
kubectl -n kube-system logs <cilium-pod-name>
```

When debug is enabled, logs will contain more detailed information about policy decisions, BPF loading, and datapath events. Use pod logs combined with `cilium status` and `cilium endpoint list` for deeper troubleshooting.

<Callout icon="lightbulb" color="#1CB2FE">
  Enabling debug logging produces verbose output and can increase log volume significantly. Use it for troubleshooting and disable it (set debug false) when finished.
</Callout>

<Callout icon="warning" color="#FF6B6B">
  Do not leave debug logging enabled in production for long periods. Increased log volume can impact storage and performance and may expose sensitive internal details.
</Callout>

## Links and references

* [Cilium documentation](https://cilium.io/docs/)
* [Kubernetes documentation - ConfigMaps](https://kubernetes.io/docs/concepts/configuration/configmap/)
* [kubectl reference](https://kubernetes.io/docs/reference/kubectl/)

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/cilium-certified-associate-cca/module/0807e400-fd1b-4f25-bba5-d0fdb0f4e3f2/lesson/85a788b7-157b-4a8e-afda-d67aa52cf9d3" />
</CardGroup>
