cilium-mesh
by Helm
Cilium service mesh configuration
About this chart
Cilium Mesh Helm Chart
Helm chart for configuring Cilium service mesh and network policies in Kubernetes. It manages three Cilium CRDs — CiliumEnvoyConfig, CiliumClusterwideNetworkPolicy, and CiliumNetworkPolicy — providing a declarative, values-driven way to configure Envoy proxy behavior and L7 network policies across your cluster.
Who Is This For?
Platform engineers and Kubernetes operators who run Cilium as their CNI and want a reusable, standardized way to:
- Configure Envoy-based load balancing, circuit breaking, retries, and timeouts for services
- Define cluster-wide or namespace-scoped L7 network policies with CIDR and HTTP rules
- Embed Cilium mesh configuration into existing Helm-based deployment workflows
Assumption: Cilium is already installed and configured in your cluster with Envoy proxy support enabled. This chart does not install Cilium itself.
Core Concepts
What This Chart Does
Cilium's service mesh capabilities are powerful but verbose to configure. This chart abstracts the underlying CRD manifests behind a clean values.yaml interface:
- CiliumEnvoyConfig — Generates full Envoy listener, cluster, and route configurations from a handful of values (load balancer policy, connection pool, outlier detection, timeouts, retries).
- CiliumClusterwideNetworkPolicy — Creates L7-aware ingress policies that apply across all namespaces, filtering by CIDR and HTTP attributes (host, method, path).
- CiliumNetworkPolicy — Creates namespace-scoped L7 ingress policies with pod label selectors.
How to Use
Add cilium-mesh as a dependency in your application's Chart.yaml:
dependencies:
- name: cilium-mesh
version: 1.0.2
condition: cilium-mesh.enabled
repository: https://charts.softonic.io
Then pass values under the cilium-mesh key in your application's values.yaml:
cilium-mesh:
enabled: true
CiliumServiceMesh:
my-api:
serviceName: my-api
port: 8080
namespace: production
loadBalancerPolicy: ROUND_ROBIN
timeout: "1s"
retries: 3
Pull the dependency and install:
helm dependency update
helm template my-release . -f values.yaml
helm install my-release . -f values.yaml -n my-namespace
Tip: Set
cilium-mesh.enabled: falseto disable the dependency entirely without removing it fromChart.yaml.
Configuration Reference
CiliumServiceMesh
Configures Envoy proxy resources. Each key becomes a separate CiliumEnvoyConfig resource.
| Parameter | Description | Default | Required |
|---|---|---|---|
serviceName | Kubernetes service name | — | Yes |
port | Service port | — | No |
namespace | Kubernetes namespace | Release namespace | No |
loadBalancerPolicy | Envoy LB algorithm (LEAST_REQUEST, ROUND_ROBIN, RANDOM, etc.) | LEAST_REQUEST | No |
timeout | Request timeout (Envoy duration format) | "0.600s" | No |
retries | Number of retry attempts | 3 | No |
retryOn | Comma-separated retry conditions | "gateway-error,connect-failure,reset,refused-stream" | No |
connectionPool.maxConnections | Max concurrent connections (circuit breaker) | 1024 | No |
connectionPool.maxPendingRequests | Max queued requests | 1024 | No |
connectionPool.maxRequestsPerConnection | Max requests per connection before closing | 1 | No |
connectionPool.idleTimeout | Idle connection timeout | "3s" | No |
outlierDetection.interval | Health check interval | "1s" | No |
outlierDetection.baseEjectionTime | Base duration for ejecting unhealthy hosts | "10s" | No |
outlierDetection.maxEjectionPercent | Max percentage of hosts that can be ejected | 20 | No |
outlierDetection.minHealthPercent | Minimum healthy host percentage (panic threshold) | 70 | No |
CiliumClusterwideNetworkPolicy
Defines cluster-wide L7 network policies. Each key becomes a separate CiliumClusterwideNetworkPolicy resource targeting reserved:ingress endpoints on port 443/TCP.
| Parameter | Description | Default | Required |
|---|---|---|---|
fromCIDR | List of allowed source CIDR blocks | — | Yes |
httprules | List of HTTP match rules | — | No |
httprules[].host | Host header regex | — | Yes (if httprules used) |
httprules[].method | HTTP method (GET, POST, etc.) | — | No |
httprules[].path | URL path to match | — | No |
CiliumNetworkPolicy
Defines namespace-scoped L7 network policies with pod label selectors.
| Parameter | Description | Default | Required |
|---|---|---|---|
labels | Pod selector labels (matchLabels) | — | Yes |
port | Allowed destination port | — | Yes |
fromCIDR | List of allowed source CIDR blocks | — | Yes |
httprules | List of HTTP match rules | — | No |
httprules[].host | Host header regex | — | Yes (if httprules used) |
httprules[].method | HTTP method | — | No |
httprules[].path | URL path to match | — | No |
Examples
Example 1: Minimal Service Mesh Setup
Configure Envoy load balancing for a single service with all defaults:
# values.yaml
cilium-mesh:
enabled: true
CiliumServiceMesh:
my-api:
serviceName: my-api
port: 8080
namespace: production
This creates a CiliumEnvoyConfig with:
LEAST_REQUESTload balancing- 600ms timeout
- 3 retries on gateway errors
- Default connection pool (1024 max connections)
Example 2: Advanced Multi-Service Setup with Network Policies
Full configuration with circuit breaking, outlier detection, and L7 network policies:
# values.yaml
cilium-mesh:
enabled: true
# --- Envoy Proxy Configuration ---
CiliumServiceMesh:
frontend:
serviceName: frontend-svc
port: 3000
namespace: web
loadBalancerPolicy: ROUND_ROBIN
timeout: "2s"
retries: 5
retryOn: "5xx,connect-failure,reset"
connectionPool:
maxConnections: 2048
maxPendingRequests: 512
maxRequestsPerConnection: 10
idleTimeout: "5s"
outlierDetection:
interval: 5s
baseEjectionTime: 30s
maxEjectionPercent: 10
minHealthPercent: 80
backend-api:
serviceName: backend-api
port: 8080
namespace: api
loadBalancerPolicy: LEAST_REQUEST
timeout: "5s"
retries: 3
# --- Cluster-Wide Network Policies ---
CiliumClusterwideNetworkPolicy:
allow-monitoring:
fromCIDR:
- 10.0.0.0/8
httprules:
- host: "^monitoring\\.example\\.com$"
method: "GET"
path: "/healthz"
- host: "^monitoring\\.example\\.com$"
method: "GET"
path: "/metrics"
allow-partner-api:
fromCIDR:
- 203.0.113.0/24
- 198.51.100.0/24
httprules:
- host: "^api\\.example\\.com$"
method: "POST"
path: "/v1/webhook"
# --- Namespace-Scoped Network Policies ---
CiliumNetworkPolicy:
allow-frontend-ingress:
labels:
app: frontend
tier: web
port: 3000
fromCIDR:
- 10.0.0.0/8
httprules:
- host: "^app\\.example\\.com$"
Best Practices
Naming Conventions
- Use descriptive keys in
CiliumServiceMeshthat match your service names for clarity. - Policy names in
CiliumClusterwideNetworkPolicyandCiliumNetworkPolicyshould describe what they allow (e.g.,allow-monitoring,allow-partner-webhook).
Security
- Always use explicit CIDR lists in
CiliumClusterwideNetworkPolicy— avoid 0.0.0.0/0 unless you intentionally want to allow all traffic. - Use
CiliumNetworkPolicy(namespace-scoped) when policies should only apply to specific pods, keeping blast radius small. - Always use regex anchors (
^...$) inhostfields to prevent partial matches.
Resilience Tuning
- Start with conservative
outlierDetectionsettings (lowmaxEjectionPercent, highminHealthPercent) and loosen as you gain confidence. - Set
maxRequestsPerConnection: 1for HTTP/1.1 services to avoid head-of-line blocking. - Keep
retryOnconditions specific — avoid retrying on non-idempotent failures.
Versioning
- The root chart (v1.0.2) and
helm/chart (v0.1.3) are versioned independently. Pin the version when using as a dependency. - When upgrading, always run
helm templateto diff rendered manifests before applying.
Troubleshooting
No Resources Created
Symptom: helm template produces empty output.
Cause: All top-level value maps (CiliumServiceMesh, CiliumClusterwideNetworkPolicy, CiliumNetworkPolicy) default to {}. Templates only render when entries are present.
Fix: Ensure you are passing a values file with at least one entry:
helm template my-release . -f my-values.yaml
CiliumEnvoyConfig Not Routing Traffic
Symptom: Envoy config is created but traffic is not being routed.
Possible causes:
serviceNamedoes not match the actual Kubernetes service name.namespaceis wrong or omitted (defaults to release namespace).portdoes not match the service's exposed port.- Cilium Envoy proxy is not enabled in your Cilium installation.
Debug:
# Verify the CiliumEnvoyConfig was created
kubectl get ciliumenvoyconfig -A
# Check Cilium agent logs for Envoy errors
kubectl -n kube-system logs -l k8s-app=cilium | grep -i envoy
Network Policy Not Allowing Expected Traffic
Symptom: Requests from allowed CIDRs are being blocked.
Possible causes:
- CIDR notation is incorrect (e.g., missing
/32for single IPs). hostregex does not match the actualHostheader sent by clients.- The
reserved:ingressendpoint selector (cluster-wide policies) requires Cilium's ingress controller to be configured. - For
CiliumNetworkPolicy, podlabelsdo not match any running pods.
Debug:
# Check policy status
kubectl get ciliumclusterwidenetworkpolicy
kubectl get ciliumnetworkpolicy -A
# Verify policy is applied to endpoints
kubectl get ciliumendpoint -A
# Monitor policy drops
hubble observe --verdict DROPPED
Deploy cilium-mesh with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has cilium-mesh 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 chartcilium-mesh is pinned at v1.0.2 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