Skip to content

Commit 1204f0c

Browse files
committed
feat(scw-cilium-hubble): create chart to install hubble as an add-on
1 parent 8ae996c commit 1204f0c

File tree

9 files changed

+246
-0
lines changed

9 files changed

+246
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: cilium
3+
repository: https://helm.cilium.io/
4+
version: 1.16.3
5+
digest: sha256:d14420bef27e2f6259e52a581ff8e5a2cd6e975706bf92e2f9f3ed001e1fd6f6
6+
generated: "2024-12-19T16:22:55.708643724+01:00"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: v2
2+
name: scaleway-cilium-hubble
3+
description: A Helm chart for adding Hubble to Cilium managed by Scaleway
4+
type: application
5+
version: 0.1.0
6+
appVersion: "v0.1.0"
7+
sources:
8+
- https://github.com/scaleway/helm-charts/scaleway-cilium-hubble
9+
home: https://github.com/scaleway/helm-charts/scaleway-cilium-hubble
10+
keywords:
11+
- scaleway
12+
- kapsule
13+
- cilium
14+
kubeVersion: ">= 1.31.0"
15+
dependencies:
16+
- name: cilium
17+
version: 1.16.3
18+
repository: https://helm.cilium.io/
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Scaleway Cilium Hubble
2+
3+
This charts deploys Hubble as an add-on to Scaleway Kubernetes clusters.
4+
5+
## Requirements
6+
7+
* Scaleway Kubernetes cluster >= 1.31.0
8+
9+
## Installation
10+
11+
To add the Scaleway Helm repository and install the chart from there, use the following commands:
12+
13+
```sh
14+
helm repo add scaleway https://helm.scw.cloud/
15+
helm repo update
16+
helm upgrade --install scaleway-cilium-hubble scaleway/scaleway-cilium-hubble
17+
```
18+
19+
You'll then need to rollout cilium agents to load the new configuration:
20+
21+
```sh
22+
kubectl -n kube-system rollout restart daemonset cilium
23+
```
24+
25+
## Configuration
26+
27+
The following table lists the configurable parameters of the Scaleway Cilium Hubble chart and their default values.
28+
29+
| Parameter | Description | Default Value |
30+
| --------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -------------------------------------- |
31+
| `nodeConfig.enable-hubble` | Enable Hubble gRPC service. | `"true"` |
32+
| `nodeConfig.hubble-socket-path` | UNIX domain socket for Hubble server to listen to. | `"/var/run/cilium/hubble.sock"` |
33+
| `nodeConfig.hubble-event-buffer-capacity` | Capacity of the buffer to store recent events. | `"32767"` |
34+
| `nodeConfig.hubble-metrics-server` | Address to expose Hubble metrics (e.g. ":7070"). Metrics server will be disabled if this field is not set. | `":9965"` |
35+
| `nodeConfig.hubble-metrics-server-enable-tls` | Enable or disable TLS for Hubble metrics server. | `"false"` |
36+
| `nodeConfig.hubble-metrics` | A space separated list of metrics to enable. | see `values.yaml` for the default list |
37+
| `nodeConfig.enable-hubble-open-metrics` | Enable or disable Hubble OpenMetrics. | `"false"` |
38+
| `nodeConfig.hubble-export-file-max-size-mb` | Maximum size of the Hubble export file in MB. | `"10"` |
39+
| `nodeConfig.hubble-export-file-max-backups` | Maximum number of backups for the Hubble export file. | `"5"` |
40+
| `nodeConfig.hubble-listen-address` | An additional address for Hubble server to listen to (e.g. ":4244"). | `":4244"` |
41+
42+
For other parameters, refer to cilium's own chart documentation under the `cilium` top level key.
43+
44+
> Make sure not to enable the `operator`/`envoy`/`agent` as it will break the managed `cilium`.
45+
46+
## Usage
47+
48+
Once the chart is installed, you can forward the relay port to the local machine:
49+
50+
```sh
51+
cilium hubble port-forward
52+
```
53+
54+
Then open Hubble ui:
55+
56+
```sh
57+
cilium hubble ui
58+
```
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
The scaleway-cilium-hubble chart was successfully installed.
2+
You may now restart cilium agents:
3+
kubectl -n kube-system rollout restart daemonset cilium
4+
5+
Have fun!
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "scaleway-cilium-hubble.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create chart name and version as used by the chart label.
10+
*/}}
11+
{{- define "scaleway-cilium-hubble.chart" -}}
12+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
13+
{{- end }}
14+
15+
{{/*
16+
Common labels
17+
*/}}
18+
{{- define "scaleway-cilium-hubble.labels" -}}
19+
helm.sh/chart: {{ include "scaleway-cilium-hubble.chart" . }}
20+
{{ include "scaleway-cilium-hubble.selectorLabels" . }}
21+
{{- if .Chart.AppVersion }}
22+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
23+
{{- end }}
24+
app.kubernetes.io/managed-by: {{ .Release.Service }}
25+
{{- end }}
26+
27+
{{/*
28+
Selector labels
29+
*/}}
30+
{{- define "scaleway-cilium-hubble.selectorLabels" -}}
31+
app.kubernetes.io/name: {{ include "scaleway-cilium-hubble.name" . }}
32+
app.kubernetes.io/instance: {{ .Release.Name }}
33+
{{- end }}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Per node config to enable Hubble
2+
apiVersion: cilium.io/v2
3+
kind: CiliumNodeConfig
4+
metadata:
5+
name: enable-hubble
6+
namespace: {{ .Release.Namespace }}
7+
{{- with .Values.cilium.hubble.annotations }}
8+
annotations:
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
11+
labels: {{- include "scaleway-cilium-hubble.labels" . | nindent 4 }}
12+
spec:
13+
nodeSelector:
14+
matchLabels: {} # match all nodes
15+
defaults:
16+
{{- toYaml .Values.nodeConfig | nindent 4 }}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# source: https://github.com/cilium/cilium/blob/v1.16.3/install/kubernetes/cilium/templates/hubble/peer-service.yaml
2+
#
3+
# With the following changes:
4+
# removed the condition to have the agent enabled
5+
# added the `cilium` top level key
6+
# changed the labels
7+
{{- if .Values.cilium.hubble.enabled }}
8+
apiVersion: v1
9+
kind: Service
10+
metadata:
11+
name: hubble-peer
12+
namespace: {{ .Release.Namespace }}
13+
{{- with .Values.cilium.hubble.annotations }}
14+
annotations:
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
17+
labels: {{- include "scaleway-cilium-hubble.labels" . | nindent 4 }}
18+
spec:
19+
selector:
20+
k8s-app: cilium
21+
ports:
22+
- name: peer-service
23+
{{- if .Values.cilium.hubble.peerService.servicePort }}
24+
port: {{ .Values.cilium.hubble.peerService.servicePort }}
25+
{{- else }}
26+
port: {{ .Values.cilium.hubble.tls.enabled | ternary 443 80 }}
27+
{{- end }}
28+
protocol: TCP
29+
targetPort: {{ .Values.cilium.hubble.peerService.targetPort }}
30+
internalTrafficPolicy: Local
31+
{{- end }}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
nodeConfig:
2+
# Enable Hubble gRPC service.
3+
enable-hubble: "true"
4+
# UNIX domain socket for Hubble server to listen to.
5+
hubble-socket-path: "/var/run/cilium/hubble.sock"
6+
# Capacity of the buffer to store recent events.
7+
hubble-event-buffer-capacity: "32767"
8+
# Address to expose Hubble metrics (e.g. ":7070"). Metrics server will be disabled if this
9+
# field is not set.
10+
hubble-metrics-server: ":9965"
11+
hubble-metrics-server-enable-tls: "false"
12+
# A space separated list of metrics to enable. See [0] for available metrics.
13+
#
14+
# https://github.com/cilium/hubble/blob/master/Documentation/metrics.md
15+
hubble-metrics:
16+
dns:query;ignoreAAAA
17+
drop
18+
flow
19+
flows-to-world:any-drop;port
20+
httpV2
21+
icmp
22+
port-distribution
23+
tcp
24+
enable-hubble-open-metrics: "false"
25+
hubble-export-file-max-size-mb: "10"
26+
hubble-export-file-max-backups: "5"
27+
# An additional address for Hubble server to listen to (e.g. ":4244").
28+
hubble-listen-address: ":4244"
29+
30+
cilium:
31+
hubble:
32+
enabled: true
33+
eventBufferCapacity: 32767
34+
metrics:
35+
enabled:
36+
- dns:query;ignoreAAAA
37+
- drop
38+
- flow
39+
- flows-to-world:any-drop;port
40+
- httpV2
41+
- icmp
42+
- port-distribution
43+
- tcp
44+
relay:
45+
enabled: true
46+
ui:
47+
enabled: true
48+
tls:
49+
auto:
50+
method: cronjob
51+
52+
agent: false
53+
operator:
54+
enabled: false
55+
envoy:
56+
enabled: false

0 commit comments

Comments
 (0)