v0.11.0: HTTP details on links where Cilium parses L7

Requests, response classes, p50/p95 latency and the busiest paths per link,
from Hubble L7 flows (method, path, status, latency only; headers are never
requested). The two inner legs of a proxied connection (Envoy -> pod, and the
pod's answers to the node on an ephemeral port) are no longer counted as
links.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Виталий Чефанов
2026-09-25 02:13:10 +03:00
co-authored by Claude Opus 5.5
parent c50020e420
commit 4c5eb288cb
11 changed files with 587 additions and 17 deletions
+30 -1
View File
@@ -50,4 +50,33 @@ spec:
enabled: false
```
No action buttons, and the user's token is no longer passed to the module.
No action buttons. With `auth.visibility: Everything` as well, the user's token is no longer passed to the module.
## HTTP details for one service
This policy selects the pods of the `web` Deployment and sends port 8080 through Envoy without restricting anything: `enableDefaultDeny: false` keeps all other traffic allowed, and the empty `http` rule matches every request.
```yaml
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: http-visibility
namespace: shop
spec:
endpointSelector:
matchLabels:
app: web
enableDefaultDeny:
ingress: false
egress: false
ingress:
- toPorts:
- ports:
- port: "8080"
protocol: TCP
rules:
http:
- {}
```
Delete the policy to go back to L3/L4. Before applying it to a service, read the notes in [HTTP details](README.md#http-details).
+30 -1
View File
@@ -50,4 +50,33 @@ spec:
enabled: false
```
Кнопок действий нет, и токен пользователя модулю больше не передаётся.
Кнопок действий нет. Если к тому же задано `auth.visibility: Everything`, токен пользователя модулю больше не передаётся.
## Подробности HTTP для одного сервиса
Политика выбирает поды Deployment `web` и пускает порт 8080 через Envoy, ничего не ограничивая: `enableDefaultDeny: false` оставляет весь остальной трафик разрешённым, а пустое правило `http` подходит под любой запрос.
```yaml
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: http-visibility
namespace: shop
spec:
endpointSelector:
matchLabels:
app: web
enableDefaultDeny:
ingress: false
egress: false
ingress:
- toPorts:
- ports:
- port: "8080"
protocol: TCP
rules:
http:
- {}
```
Чтобы вернуться к L3/L4, удалите политику. Прежде чем включать её для сервиса, прочитайте замечания в разделе [Подробности HTTP](README_RU.md#подробности-http).
+11 -1
View File
@@ -73,6 +73,16 @@ The collector runs in one of three modes, see `traffic.mode`:
History is kept in memory: after a pod restart the windows fill again. The status line says how much of the window has actually been seen.
## HTTP details
Where Cilium parses HTTP on a port, the map adds to that link the number of requests, responses by class (2xx, 3xx, 4xx, 5xx), p50 and p95 latency and the ten busiest paths. A link with 5xx responses is drawn in the warning colour. Paths are grouped: the query string is dropped and segments that look like IDs (numbers, UUIDs, long hex strings) become `:id`, so `/api/users/42?x=1` and `/api/users/43` are one row `/api/users/:id`.
Cilium parses HTTP only on ports named in an L7 rule of a `CiliumNetworkPolicy`; the module does not create such policies. To enable it for one service without restricting its traffic, see [the example](EXAMPLES.md#http-details-for-one-service). Keep in mind:
- the connections to that port go through the Envoy proxy on the node: a fraction of a millisecond per request and CPU of the Cilium agent in proportion to the request rate;
- the port must speak plain HTTP/1.x or HTTP/2 (h2c): Envoy cannot see inside TLS, so put the rule on the backend port behind the Ingress, not on 443. gRPC is parsed, but its status is in the trailers and every call shows as 200; a gRPC stream or a WebSocket is one request, not a series of messages;
- request and response headers reach Hubble, including `Authorization` and cookies. The module asks Hubble for the method, path, status and latency only; the headers are not read, stored or shown. Other Hubble clients (the Hubble UI, `hubble observe`) do see them.
## Requirements
- Deckhouse Kubernetes Platform 1.72 or newer.
@@ -107,4 +117,4 @@ The pod exposes Prometheus metrics on port `9090` (`cluster_map_*`: Hubble strea
- One replica: traffic history lives in the process. A second replica would keep its own history and double the load on hubble-relay.
- Visibility is by namespace: a user who can list pods in a namespace sees all its cards, including the manifests of its Deployments and Services, even if their role would not let them read those objects one by one.
- Alerts need the `prometheus` module, which creates `ClusterAlert` objects. Without it the map shows problems from object state and events only.
- Traffic is L3/L4. HTTP-level details (paths, status codes) need Cilium L7 visibility and are not shown yet.
- HTTP details only where a CiliumNetworkPolicy turns on L7 parsing, see [HTTP details](#http-details). Other protocols are shown at L3/L4.
+11 -1
View File
@@ -73,6 +73,16 @@ Workload'ы под нестандартными контроллерами то
История хранится в памяти: после рестарта пода окна заполняются заново. Строка статуса пишет, сколько из окна реально видно.
## Подробности HTTP
Там, где Cilium разбирает HTTP на порту, карта добавляет к связи число запросов, ответы по классам (2xx, 3xx, 4xx, 5xx), задержку p50 и p95 и десять самых нагруженных путей. Связь, на которой были ответы 5xx, рисуется цветом предупреждения. Пути группируются: строка запроса отбрасывается, а сегменты, похожие на идентификаторы (числа, UUID, длинные hex-строки), заменяются на `:id` — `/api/users/42?x=1` и `/api/users/43` попадают в одну строку `/api/users/:id`.
Cilium разбирает HTTP только на портах, упомянутых в L7-правиле `CiliumNetworkPolicy`; сам модуль таких политик не создаёт. Как включить это для одного сервиса, не ограничивая его трафик, — в [примере](EXAMPLES_RU.md#подробности-http-для-одного-сервиса). Учтите:
- соединения на этот порт идут через прокси Envoy на ноде: доли миллисекунды на запрос и CPU агента Cilium пропорционально числу запросов;
- порт должен говорить на обычном HTTP/1.x или HTTP/2 (h2c): внутрь TLS Envoy не заглядывает, поэтому правило ставится на порт бэкенда за Ingress, а не на 443. gRPC разбирается, но его статус лежит в трейлерах, и каждый вызов виден как 200; поток gRPC или WebSocket — это один запрос, а не последовательность сообщений;
- заголовки запроса и ответа попадают в Hubble, включая `Authorization` и cookie. Модуль запрашивает у Hubble только метод, путь, код и задержку; заголовки он не читает, не хранит и не показывает. Другие клиенты Hubble (Hubble UI, `hubble observe`) их видят.
## Требования
- Deckhouse Kubernetes Platform 1.72 или новее.
@@ -107,4 +117,4 @@ Workload'ы под нестандартными контроллерами то
- Одна реплика: история трафика живёт в процессе. Вторая реплика держала бы свою историю и удвоила бы нагрузку на hubble-relay.
- Видимость — по namespace: пользователь, который может смотреть поды в namespace, видит все его карточки, включая манифесты Deployment и Service, даже если его роль не дала бы прочитать эти объекты по отдельности.
- Для алертов нужен модуль `prometheus`, он создаёт объекты `ClusterAlert`. Без него карта показывает проблемы только по состоянию объектов и событиям.
- Трафик на уровне L3/L4. Подробности HTTP (пути, коды ответа) требуют L7-видимости Cilium и пока не показываются.
- Подробности HTTP — только там, где CiliumNetworkPolicy включает разбор L7, см. [Подробности HTTP](#подробности-http). Остальные протоколы показываются на уровне L3/L4.