Skip to content

Commit

Permalink
helm: generate Cilium chart
Browse files Browse the repository at this point in the history
  • Loading branch information
burgerdev committed Jan 15, 2024
1 parent 9257115 commit 42bccb1
Show file tree
Hide file tree
Showing 17 changed files with 468 additions and 216 deletions.
4 changes: 2 additions & 2 deletions internal/constellation/helm/charts/cilium/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: cilium
displayName: Cilium
home: https://cilium.io/
version: 1.15.0-pre.2
appVersion: 1.15.0-pre.2
version: 1.15.0-pre.3
appVersion: 1.15.0-pre.3
kubeVersion: ">= 1.16.0-0"
icon: https://cdn.jsdelivr.net/gh/cilium/cilium@main/Documentation/images/logo-solo.svg
description: eBPF-based Networking, Security, and Observability
Expand Down
64 changes: 39 additions & 25 deletions internal/constellation/helm/charts/cilium/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"prefix": "/metrics"
},
"route": {
"cluster": "envoy-admin",
"cluster": "/envoy-admin",
"prefix_rewrite": "/stats/prometheus"
}
}
Expand Down Expand Up @@ -102,7 +102,7 @@
"prefix": "/healthz"
},
"route": {
"cluster": "envoy-admin",
"cluster": "/envoy-admin",
"prefix_rewrite": "/ready"
}
}
Expand Down Expand Up @@ -245,11 +245,11 @@
}
},
{
"name": "envoy-admin",
"name": "/envoy-admin",
"type": "STATIC",
"connectTimeout": "{{ .Values.envoy.connectTimeoutSeconds }}s",
"loadAssignment": {
"clusterName": "envoy-admin",
"clusterName": "/envoy-admin",
"endpoints": [
{
"lbEndpoints": [
Expand Down Expand Up @@ -301,6 +301,14 @@
"resourceApiVersion": "V3"
}
},
"bootstrapExtensions": [
{
"name": "envoy.bootstrap.internal_listener",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.bootstrap.internal_listener.v3.InternalListener"
}
}
],
"layeredRuntime": {
"layers": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3226,7 +3226,7 @@
]
},
"timezone": "",
"title": "Hubble",
"title": "Hubble Metrics and Monitoring",
"uid": "5HftnJAWz",
"version": 24
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ spec:
failureThreshold: {{ .Values.startupProbe.failureThreshold }}
periodSeconds: {{ .Values.startupProbe.periodSeconds }}
successThreshold: 1
initialDelaySeconds: 5
{{- end }}
livenessProbe:
{{- if or .Values.keepDeprecatedProbes $defaultKeepDeprecatedProbes }}
Expand Down Expand Up @@ -375,6 +376,11 @@ spec:
mountPropagation: {{ .mountPropagation }}
{{- end }}
{{- end }}
{{- if .Values.hubble.export.dynamic.enabled }}
- name: hubble-flowlog-config
mountPath: /flowlog-config
readOnly: true
{{- end }}
{{- with .Values.extraVolumeMounts }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -688,10 +694,10 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- "/install-plugin.sh"
{{- with .Values.cni.resources }}
resources:
requests:
cpu: 100m
memory: 10Mi
{{- toYaml . | trim | nindent 10 }}
{{- end }}
securityContext:
{{- if .Values.securityContext.privileged }}
privileged: true
Expand Down Expand Up @@ -929,6 +935,12 @@ spec:
path: client-ca.crt
{{- end }}
{{- end }}
{{- if .Values.hubble.export.dynamic.enabled }}
- name: hubble-flowlog-config
configMap:
name: {{ .Values.hubble.export.dynamic.config.configMapName }}
optional: true
{{- end }}
{{- range .Values.extraHostPathMounts }}
- name: {{ .name }}
hostPath:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ kind: ServiceAccount
metadata:
name: {{ .Values.serviceAccounts.cilium.name | quote }}
namespace: {{ .Release.Namespace }}
{{- if .Values.serviceAccounts.cilium.annotations }}
annotations:
{{- toYaml .Values.serviceAccounts.cilium.annotations | nindent 4 }}
{{- end }}
{{- if or .Values.serviceAccounts.cilium.annotations .Values.annotations }}
annotations:
{{- with .Values.annotations }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{{- if and (.Values.agent) (not .Values.preflight.enabled) }}
{{- /* Default values with backwards compatibility */ -}}
{{- $defaultEnableCnpStatusUpdates := "true" -}}
{{- $defaultBpfMapDynamicSizeRatio := 0.0 -}}
{{- $defaultBpfMasquerade := "false" -}}
{{- $defaultBpfClockProbe := "false" -}}
Expand All @@ -13,10 +12,11 @@
{{- $fragmentTracking := "true" -}}
{{- $defaultKubeProxyReplacement := "false" -}}
{{- $azureUsePrimaryAddress := "true" -}}
{{- $defaultK8sClientQPS := 5 -}}
{{- $defaultK8sClientBurst := 10 -}}

{{- /* Default values when 1.8 was initially deployed */ -}}
{{- if semverCompare ">=1.8" (default "1.8" .Values.upgradeCompatibility) -}}
{{- $defaultEnableCnpStatusUpdates = "false" -}}
{{- $defaultBpfMapDynamicSizeRatio = 0.0025 -}}
{{- $defaultBpfMasquerade = "true" -}}
{{- $defaultBpfClockProbe = "true" -}}
Expand Down Expand Up @@ -76,6 +76,11 @@
{{- else if (not (kindIs "invalid" .Values.cni.chainingTarget)) -}}
{{- $cniChainingMode = "generic-veth" -}}
{{- end -}}

{{- if semverCompare ">=1.27-0" .Capabilities.KubeVersion.Version -}}
{{- $defaultK8sClientQPS = 10 -}}
{{- $defaultK8sClientBurst = 20 -}}
{{- end -}}
---
apiVersion: v1
kind: ConfigMap
Expand Down Expand Up @@ -451,19 +456,9 @@ data:
{{- else if .Values.routingMode }}
routing-mode: {{ .Values.routingMode | quote }}
{{- else }}
{{- if eq .Values.tunnel "disabled" }}
routing-mode: "native"
{{- else if eq .Values.tunnel "vxlan" }}
routing-mode: "tunnel"
tunnel-protocol: "vxlan"
{{- else if eq .Values.tunnel "geneve" }}
routing-mode: "tunnel"
tunnel-protocol: "geneve"
{{- else }}
# Default case
routing-mode: "tunnel"
tunnel-protocol: "vxlan"
{{- end }}
{{- end }}

{{- if .Values.tunnelProtocol }}
Expand All @@ -474,6 +469,10 @@ data:
tunnel-port: {{ .Values.tunnelPort | quote }}
{{- end }}

{{- if .Values.serviceNoBackendResponse }}
service-no-backend-response: "{{ .Values.serviceNoBackendResponse }}"
{{- end}}

{{- if .Values.MTU }}
mtu: {{ .Values.MTU | quote }}
{{- end }}
Expand Down Expand Up @@ -819,6 +818,9 @@ data:
{{- if (not (kindIs "invalid" .Values.cni.chainingTarget)) }}
cni-chaining-target: {{ .Values.cni.chainingTarget | quote }}
{{- end}}
{{- if (not (kindIs "invalid" .Values.cni.externalRouting)) }}
cni-external-routing: {{ .Values.cni.externalRouting | quote }}
{{- end}}
{{- if .Values.kubeConfigPath }}
k8s-kubeconfig-path: {{ .Values.kubeConfigPath | quote }}
{{- end }}
Expand Down Expand Up @@ -883,6 +885,8 @@ data:
{{- if .Values.hubble.redact.http }}
# Enables redaction of the http URL query part in flows
hubble-redact-http-urlquery: {{ .Values.hubble.redact.http.urlQuery | quote }}
# Enables redaction of the http user info in flows
hubble-redact-http-userinfo: {{ .Values.hubble.redact.http.userInfo | quote }}
{{- if .Values.hubble.redact.http.headers }}
{{- if .Values.hubble.redact.http.headers.allow }}
# Redact all http headers that do not match this list
Expand All @@ -904,6 +908,19 @@ data:
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.hubble.export }}
hubble-export-file-max-size-mb: {{ .Values.hubble.export.fileMaxSizeMb | quote }}
hubble-export-file-max-backups: {{ .Values.hubble.export.fileMaxBackups | quote }}
{{- if .Values.hubble.export.static.enabled }}
hubble-export-file-path: {{ .Values.hubble.export.static.filePath | quote }}
hubble-export-fieldmask: {{ .Values.hubble.export.static.fieldMask | join " " | quote }}
hubble-export-allowlist: {{ .Values.hubble.export.static.allowList | join "," | quote }}
hubble-export-denylist: {{ .Values.hubble.export.static.denyList | join "," | quote }}
{{- end }}
{{- if .Values.hubble.export.dynamic.enabled }}
hubble-flowlogs-config-path: /flowlog-config/flowlogs.yaml
{{- end }}
{{- end }}
{{- if hasKey .Values.hubble "listenAddress" }}
# An additional address for Hubble server to listen to (e.g. ":4244").
hubble-listen-address: {{ .Values.hubble.listenAddress | quote }}
Expand Down Expand Up @@ -983,13 +1000,6 @@ data:
api-rate-limit: {{ .Values.apiRateLimit | quote }}
{{- end }}

{{- if .Values.enableCnpStatusUpdates }}
disable-cnp-status-updates: "false"
{{- else if (eq $defaultEnableCnpStatusUpdates "false") }}
disable-cnp-status-updates: "true"
cnp-node-status-gc-interval: "0s"
{{- end }}

{{- if .Values.egressGateway.enabled }}
enable-ipv4-egress-gateway: "true"
{{- end }}
Expand Down Expand Up @@ -1019,10 +1029,6 @@ data:
{{- end }}
{{- end }}

{{- if .Values.enableK8sEventHandover }}
enable-k8s-event-handover: "true"
{{- end }}

{{- if .Values.crdWaitTimeout }}
crd-wait-timeout: {{ include "validateDuration" .Values.crdWaitTimeout | quote }}
{{- end }}
Expand Down Expand Up @@ -1121,10 +1127,8 @@ data:
annotate-k8s-node: "true"
{{- end }}

{{- if hasKey .Values "k8sClientRateLimit" }}
k8s-client-qps: {{ .Values.k8sClientRateLimit.qps | quote }}
k8s-client-burst: {{ .Values.k8sClientRateLimit.burst | quote }}
{{- end }}
k8s-client-qps: {{ .Values.k8sClientRateLimit.qps | default $defaultK8sClientQPS | quote}}
k8s-client-burst: {{ .Values.k8sClientRateLimit.burst | default $defaultK8sClientBurst | quote }}

{{- if and .Values.operator.setNodeTaints (not .Values.operator.removeNodeTaints) -}}
{{ fail "Cannot have operator.setNodeTaintsMaxNodes and not operator.removeNodeTaints = false" }}
Expand Down Expand Up @@ -1212,6 +1216,10 @@ data:
envoy-log: {{ .Values.envoy.log.path | quote }}
{{- end }}

{{- if hasKey .Values.clustermesh "maxConnectedClusters" }}
max-connected-clusters: {{ .Values.clustermesh.maxConnectedClusters | quote }}
{{- end }}

# Extra config allows adding arbitrary properties to the cilium config.
# By putting it at the end of the ConfigMap, it's also possible to override existing properties.
{{- if .Values.extraConfig }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ spec:
failureThreshold: {{ .Values.envoy.startupProbe.failureThreshold }}
periodSeconds: {{ .Values.envoy.startupProbe.periodSeconds }}
successThreshold: 1
initialDelaySeconds: 5
{{- end }}
livenessProbe:
httpGet:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ metadata:
namespace: {{ .Release.Namespace }}
{{- if or (not .Values.envoy.prometheus.serviceMonitor.enabled) .Values.envoy.annotations }}
annotations:
{{- if not .Values.envoy.prometheus.serviceMonitor.enabled }}
prometheus.io/scrape: "true"
prometheus.io/port: {{ .Values.proxy.prometheus.port | default .Values.envoy.prometheus.port | quote }}
{{- end }}
{{- with .Values.envoy.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if not .Values.envoy.prometheus.serviceMonitor.enabled }}
prometheus.io/scrape: "true"
prometheus.io/port: {{ .Values.proxy.prometheus.port | default .Values.envoy.prometheus.port | quote }}
{{- end }}
{{- with .Values.envoy.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
labels:
k8s-app: cilium-envoy
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if and .Values.hubble.export.dynamic.enabled .Values.hubble.export.dynamic.config.createConfigMap }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.hubble.export.dynamic.config.configMapName }}
namespace: {{ .Release.Namespace }}
data:
flowlogs.yaml: |
flowLogs:
{{ .Values.hubble.export.dynamic.config.content | toYaml | indent 4 }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ metadata:
{{- with $.Values.operator.dashboards.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.operator.annotations }}
{{- with $.Values.operator.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
Expand Down
Loading

0 comments on commit 42bccb1

Please sign in to comment.