Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4b1e030
feat(policyyaml): add Terraform tab (#2241)
slonka Mar 12, 2025
9336ed1
docs: add logging section for control/data planes & DNS
dascole Feb 25, 2025
41ee043
Fix: Linting issues
dascole Feb 26, 2025
73e16f1
Fix: Linting issue for logging levels
dascole Feb 26, 2025
ad775d8
Fix: Linting issues in logging.md
dascole Feb 26, 2025
4b1d4cc
Fix: Adjust tabs layout after updates in #2216
dascole Mar 12, 2025
089a7a9
Merge branch 'master' into feat/add-troubleshooting-guide
dascole Mar 12, 2025
17169f9
Merge branch 'master' into feat/add-troubleshooting-guide
lukidzi Mar 13, 2025
a41428f
Merge branch 'master' into feat/add-troubleshooting-guide
dascole Mar 14, 2025
232edc6
Merge branch 'master' into feat/add-troubleshooting-guide
dascole Mar 17, 2025
8fb6b6f
Merge branch 'master' into feat/add-troubleshooting-guide
dascole Mar 18, 2025
972dc19
Merge branch 'master' into feat/add-troubleshooting-guide
dascole Mar 19, 2025
df0315f
Merge branch 'master' into feat/add-troubleshooting-guide
dascole Mar 20, 2025
1f361ea
Merge branch 'master' into feat/add-troubleshooting-guide
dascole Mar 21, 2025
4e55e88
Merge branch 'master' into feat/add-troubleshooting-guide
dascole Mar 25, 2025
608164b
Merge branch 'master' into feat/add-troubleshooting-guide
dascole Mar 31, 2025
d7c1ce9
Merge branch 'master' into feat/add-troubleshooting-guide
dascole Apr 7, 2025
89c2870
Merge branch 'master' into feat/add-troubleshooting-guide
dascole Apr 8, 2025
2a8f4c4
Merge branch 'master' into feat/add-troubleshooting-guide
dascole Apr 18, 2025
d78ce15
Update app/_src/guides/logging.md
dascole Apr 22, 2025
0cf0701
Merge branch 'master' into feat/add-troubleshooting-guide
dascole Apr 22, 2025
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
7 changes: 7 additions & 0 deletions app/_data/docs_nav_kuma_2.10.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,16 @@ items:
- text: Producer and consumer policies
url: /guides/consumer-producer-policies/
- text: Configuring inbound traffic with Rules API
url: /guides/rules
- title: Troubleshooting
group: true
items:
- text: Logging
url: /guides/logging
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to put it under "Using Kuma". WDYT @bartsmykla ?

url: /guides/rules/
- text: Upgrading Transparent Proxy
url: /guides/upgrading-transparent-proxy/

- title: Reference
group: true
items:
Expand Down
5 changes: 5 additions & 0 deletions app/_data/docs_nav_kuma_2.6.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,11 @@ items:
url: /guides/gateway-delegated/
- text: Upgrading Transparent Proxy
url: /guides/upgrading-transparent-proxy/
- title: Troubleshooting
group: true
items:
- text: Logging
url: /guides/logging
- title: Reference
group: true
items:
Expand Down
5 changes: 5 additions & 0 deletions app/_data/docs_nav_kuma_2.7.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,11 @@ items:
url: /guides/migration-to-the-new-policies/
- text: Upgrading Transparent Proxy
url: /guides/upgrading-transparent-proxy/
- title: Troubleshooting
group: true
items:
- text: Logging
url: /guides/logging
- title: Reference
group: true
items:
Expand Down
5 changes: 5 additions & 0 deletions app/_data/docs_nav_kuma_2.8.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,11 @@ items:
url: /guides/migration-to-the-new-policies/
- text: Upgrading Transparent Proxy
url: /guides/upgrading-transparent-proxy/
- title: Troubleshooting
group: true
items:
- text: Logging
url: /guides/logging
- title: Reference
group: true
items:
Expand Down
5 changes: 5 additions & 0 deletions app/_data/docs_nav_kuma_2.9.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,11 @@ items:
url: /guides/consumer-producer-policies
- text: Upgrading Transparent Proxy
url: /guides/upgrading-transparent-proxy/
- title: Troubleshooting
group: true
items:
- text: Logging
url: /guides/logging
- title: Reference
group: true
items:
Expand Down
181 changes: 181 additions & 0 deletions app/_src/guides/logging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
---
title: Logging
---

When encountering issues, it is often necessary to increase logging levels to gain further insight into the problem. Below, we will explore the options for changing the log levels of various components in both Kubernetes and Universal deployments.

## Adjusting logging levels for Kuma-DP
Logging levels can be adjusted on a per-kuma-dp-based component basis. These components include:

* Data plane proxies
* Zone ingress
* Zone egress


The available Envoy logging levels are:

* trace
* debug
* info
* warning/warn
* error
* critical
* off

See `ALL_LOGGER_IDS` in [logger.h from Envoy source](https://github.com/envoyproxy/envoy/blob/main/source/common/common/logger.h#L36) for a list of available components.


{% tabs %}
{% tab Kubernetes %}
**Option 1: Annotations**

The below annotations can be used to adjust logging levels and components:

`kuma.io/envoy-log-level`: Specifies the log level for Envoy system logs to enable (affects all components).

`kuma.io/envoy-component-log-level`: Specifies the log level for Envoy system logs to enable by component. This allows targeting specific components, each with its own log level.

**Note**: These annotations must be added to the pod or pod template of a workload. Making this change will trigger a `restart` or `rollout` of the workload.

All components:
```yaml
spec:
selector:
matchLabels:
app: postgres
replicas: 1
template:
metadata:
annotations:
kuma.io/envoy-log-level: debug
kuma.io/envoy-component-log-level: dns:debug
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line is not for "all components"

Suggested change
kuma.io/envoy-component-log-level: dns:debug

```

Targeted Components:
```yaml
spec:
selector:
matchLabels:
app: postgres
replicas: 1
template:
metadata:
annotations:
kuma.io/envoy-component-log-level: "dns:debug,connection:trace"
```
**Option 2: Port forwarding**
The Envoy interface can also be accessed directly. This can be achieved using Kubernetes port-forwarding capabilities, as the Envoy admin interface is not exposed by default.

```shell
kubectl port-forward kuma-demo-app-76df4d8cf5-9q9j9 -n kuma-demo 9901:9901 2>&1 &
```

Once port forwarding is set up, you can increase the log level by sending an `HTTP POST` request with one of the supported values. The debug-level logs will then be available via the standard logging facilities (for example, stderr on Kubernetes):

```shell
curl -X POST http://localhost:9901/logging?level=debug
```
Or targeting a particular component:

```shell
curl -X POST http://localhost:9901/logging?wasm=debug
```

{% endtab %}
{% tab Universal %}

In Universal mode, logging can be enabled by passing the `--envoy-log-level` flag to the kuma-dp process.

```shell
kuma-dp run --envoy-log-level=debug
```

You can optionally target specific components, each with its own log level, by passing the flag:
`--envoy-component-log-level`

```shell
kuma-dp run --envoy-component-log-level="upstream:debug,connection:trace"
```

{% endtab %}
{% endtabs %}


## Adjusting logging levels for Kuma-CP
The available logging levels for Control Planes are:

* debug
* info
* off


{% tabs %}
{% tab Kubernetes %}
When using Helm to deploy on Kubernetes, the following can be used to change the Control Plane log level:

```yaml
kuma:
controlPlane:
logLevel: "debug"
```

Additionally, the --log-level flag can be passed as an argument to the kuma-cp binary in your container's definition.

```yaml
containers:
- name: control-plane
image: "docker.io/kong/kuma-cp:2.9.3"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the image field is not correct for kuma. We may just remove it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same suggestion applys to other code snippets underneath.

args:
- run
- --log-level=debug
- --config-file=/etc/kuma.io/kuma-control-plane/config.yaml
```

{% endtab %}
{% tab Universal %}

In Universal mode, logging can be enabled by passing the `--envoy-log-level` flag to the kuma-dp process.

```shell
kuma-cp run --log-level=debug
```

{% endtab %}
{% endtabs %}

## Adjusting logging levels for CoreDNS
Logging for CoreDNS does not have specific levels; it is either on/true or off/false.


{% tabs %}
{% tab Kubernetes %}
When using Helm to deploy on Kubernetes, the following can be used to change the DNS log level:

```yaml
kuma:
dataPlane:
dnsLogging: true
```

Additionally, the environment variable `KUMA_RUNTIME_KUBERNETES_INJECTOR_BUILTIN_DNS_LOGGING` can be set in your container's definition.

```yaml
containers:
- name: control-plane
image: "docker.io/kong/kuma-cp:2.9.3"
env:
- name: KUMA_RUNTIME_KUBERNETES_INJECTOR_BUILTIN_DNS_LOGGING
value: "true"
```

{% endtab %}
{% tab Universal %}

In Universal mode, logging can be enabled by setting the environment variable `KUMA_RUNTIME_KUBERNETES_INJECTOR_BUILTIN_DNS_LOGGING`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Universal DPs use KUMA_DNS_ENABLE_LOGGING, insead of KUMA_RUNTIME_KUBERNETES_INJECTOR_BUILTIN_DNS_LOGGING


```shell
export KUMA_RUNTIME_KUBERNETES_INJECTOR_BUILTIN_DNS_LOGGING=true
```

{% endtab %}
{% endtabs %}
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,12 @@ def render(context)
site_data = context.registers[:site].config

use_meshservice = @params["use_meshservice"] == "true" && Gem::Version.new(release.value.dup.sub "x", "0") >= TARGET_VERSION

show_tf = Gem::Version.new(release.value.dup.sub "x", "0") >= TARGET_VERSION
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change is not needed, right?


show_tf = Gem::Version.new(release.value.dup.sub "x", "0") >= TF_TARGET_VERSION


namespace = @params["namespace"] || site_data['mesh_namespace']
styles = [
{ name: :uni_legacy, env: :universal, legacy_output: true },
Expand Down
Loading