Add cilium chart
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
{{- define "hubble-ui.nginx.conf" }}
|
||||
server {
|
||||
listen 8081;
|
||||
{{- if .Values.hubble.ui.frontend.server.ipv6.enabled }}
|
||||
listen [::]:8081;
|
||||
{{- end }}
|
||||
server_name localhost;
|
||||
root /app;
|
||||
index index.html;
|
||||
client_max_body_size 1G;
|
||||
|
||||
location / {
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
||||
# CORS
|
||||
add_header Access-Control-Allow-Methods "GET, POST, PUT, HEAD, DELETE, OPTIONS";
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
add_header Access-Control-Max-Age 1728000;
|
||||
add_header Access-Control-Expose-Headers content-length,grpc-status,grpc-message;
|
||||
add_header Access-Control-Allow-Headers range,keep-alive,user-agent,cache-control,content-type,content-transfer-encoding,x-accept-content-transfer-encoding,x-accept-response-streaming,x-user-agent,x-grpc-web,grpc-timeout;
|
||||
if ($request_method = OPTIONS) {
|
||||
return 204;
|
||||
}
|
||||
# /CORS
|
||||
|
||||
location {{ .Values.hubble.ui.baseUrl }}api {
|
||||
{{- if not (eq .Values.hubble.ui.baseUrl "/") }}
|
||||
rewrite ^{{ (trimSuffix "/" .Values.hubble.ui.baseUrl) }}(/.*)$ $1 break;
|
||||
{{- end }}
|
||||
proxy_http_version 1.1;
|
||||
proxy_pass_request_headers on;
|
||||
proxy_hide_header Access-Control-Allow-Origin;
|
||||
{{- if eq .Values.hubble.ui.baseUrl "/" }}
|
||||
proxy_pass http://127.0.0.1:8090;
|
||||
{{- else }}
|
||||
proxy_pass http://127.0.0.1:8090/;
|
||||
{{- end }}
|
||||
}
|
||||
|
||||
{{- if not (eq .Values.hubble.ui.baseUrl "/") }}
|
||||
sub_filter_once on;
|
||||
sub_filter '<base href="/"/>' '<base href="{{ .Values.hubble.ui.baseUrl }}"/>';
|
||||
{{- end }}
|
||||
location {{ .Values.hubble.ui.baseUrl }} {
|
||||
{{- if not (eq .Values.hubble.ui.baseUrl "/") }}
|
||||
rewrite ^{{ (trimSuffix "/" .Values.hubble.ui.baseUrl) }}(/.*)$ $1 break;
|
||||
{{- end }}
|
||||
# double `/index.html` is required here
|
||||
try_files $uri $uri/ /index.html /index.html;
|
||||
}
|
||||
|
||||
# Liveness probe
|
||||
location /healthz {
|
||||
access_log off;
|
||||
add_header Content-Type text/plain;
|
||||
return 200 'ok';
|
||||
}
|
||||
}
|
||||
}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,50 @@
|
||||
{{- if and (or .Values.hubble.enabled .Values.hubble.ui.standalone.enabled) .Values.hubble.ui.enabled .Values.serviceAccounts.ui.create }}
|
||||
kind: ClusterRole
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: hubble-ui
|
||||
{{- with .Values.hubble.ui.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app.kubernetes.io/part-of: cilium
|
||||
rules:
|
||||
- apiGroups:
|
||||
- networking.k8s.io
|
||||
resources:
|
||||
- networkpolicies
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- componentstatuses
|
||||
- endpoints
|
||||
- namespaces
|
||||
- nodes
|
||||
- pods
|
||||
- services
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- apiextensions.k8s.io
|
||||
resources:
|
||||
- customresourcedefinitions
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- cilium.io
|
||||
resources:
|
||||
- "*"
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
{{- end }}
|
||||
@@ -0,0 +1,20 @@
|
||||
{{- if and (or .Values.hubble.enabled .Values.hubble.ui.standalone.enabled) .Values.hubble.ui.enabled .Values.serviceAccounts.ui.create }}
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: hubble-ui
|
||||
{{- with .Values.hubble.ui.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app.kubernetes.io/part-of: cilium
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: hubble-ui
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ .Values.serviceAccounts.ui.name | quote }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,14 @@
|
||||
{{- if and (or .Values.hubble.enabled .Values.hubble.ui.standalone.enabled) .Values.hubble.ui.enabled }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: hubble-ui-nginx
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- with .Values.hubble.ui.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
data:
|
||||
nginx.conf: {{ include "hubble-ui.nginx.conf" . | trim | quote }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,214 @@
|
||||
{{- if and (or .Values.hubble.enabled .Values.hubble.ui.standalone.enabled) .Values.hubble.ui.enabled }}
|
||||
kind: Deployment
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: hubble-ui
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- with .Values.hubble.ui.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
k8s-app: hubble-ui
|
||||
app.kubernetes.io/name: hubble-ui
|
||||
app.kubernetes.io/part-of: cilium
|
||||
spec:
|
||||
replicas: {{ .Values.hubble.ui.replicas }}
|
||||
selector:
|
||||
matchLabels:
|
||||
k8s-app: hubble-ui
|
||||
{{- with .Values.hubble.ui.updateStrategy }}
|
||||
strategy:
|
||||
{{- toYaml . | trim | nindent 4 }}
|
||||
{{- end }}
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
{{- if .Values.hubble.ui.rollOutPods }}
|
||||
# ensure pods roll when configmap updates
|
||||
cilium.io/hubble-ui-nginx-configmap-checksum: {{ include (print $.Template.BasePath "/hubble-ui/configmap.yaml") . | sha256sum | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.hubble.ui.podAnnotations }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
k8s-app: hubble-ui
|
||||
app.kubernetes.io/name: hubble-ui
|
||||
app.kubernetes.io/part-of: cilium
|
||||
{{- with .Values.hubble.ui.podLabels }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.hubble.ui.securityContext }}
|
||||
securityContext:
|
||||
{{- omit . "enabled" | toYaml | nindent 8 }}
|
||||
{{- end }}
|
||||
priorityClassName: {{ .Values.hubble.ui.priorityClassName }}
|
||||
serviceAccount: {{ .Values.serviceAccounts.ui.name | quote }}
|
||||
serviceAccountName: {{ .Values.serviceAccounts.ui.name | quote }}
|
||||
automountServiceAccountToken: {{ .Values.serviceAccounts.ui.automount }}
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: frontend
|
||||
image: {{ include "cilium.image" .Values.hubble.ui.frontend.image | quote }}
|
||||
imagePullPolicy: {{ .Values.hubble.ui.frontend.image.pullPolicy }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8081
|
||||
{{- with .Values.hubble.ui.frontend.extraEnv }}
|
||||
env:
|
||||
{{- toYaml . | trim | nindent 12 }}
|
||||
{{- end }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /healthz
|
||||
port: 8081
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 8081
|
||||
{{- with .Values.hubble.ui.frontend.resources }}
|
||||
resources:
|
||||
{{- toYaml . | trim | nindent 10 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: hubble-ui-nginx-conf
|
||||
mountPath: /etc/nginx/conf.d/default.conf
|
||||
subPath: nginx.conf
|
||||
- name: tmp-dir
|
||||
mountPath: /tmp
|
||||
{{- with .Values.hubble.ui.frontend.extraVolumeMounts }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
terminationMessagePolicy: FallbackToLogsOnError
|
||||
{{- with .Values.hubble.ui.frontend.securityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | trim | nindent 10 }}
|
||||
{{- end }}
|
||||
- name: backend
|
||||
image: {{ include "cilium.image" .Values.hubble.ui.backend.image | quote }}
|
||||
imagePullPolicy: {{ .Values.hubble.ui.backend.image.pullPolicy }}
|
||||
env:
|
||||
- name: EVENTS_SERVER_PORT
|
||||
value: "8090"
|
||||
{{- if .Values.hubble.relay.tls.server.enabled }}
|
||||
- name: FLOWS_API_ADDR
|
||||
value: "hubble-relay:443"
|
||||
- name: TLS_TO_RELAY_ENABLED
|
||||
value: "true"
|
||||
- name: TLS_RELAY_SERVER_NAME
|
||||
value: {{ .Values.hubble.relay.tls.server.relayName }}
|
||||
- name: TLS_RELAY_CA_CERT_FILES
|
||||
value: /var/lib/hubble-ui/certs/hubble-relay-ca.crt
|
||||
- name: TLS_RELAY_CLIENT_CERT_FILE
|
||||
value: /var/lib/hubble-ui/certs/client.crt
|
||||
- name: TLS_RELAY_CLIENT_KEY_FILE
|
||||
value: /var/lib/hubble-ui/certs/client.key
|
||||
{{- else }}
|
||||
- name: FLOWS_API_ADDR
|
||||
value: "hubble-relay:80"
|
||||
{{- end }}
|
||||
{{- with .Values.hubble.ui.backend.extraEnv }}
|
||||
{{- toYaml . | trim | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.hubble.ui.backend.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /healthz
|
||||
port: 8090
|
||||
{{- end }}
|
||||
{{- if .Values.hubble.ui.backend.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /healthz
|
||||
port: 8090
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: grpc
|
||||
containerPort: 8090
|
||||
{{- with .Values.hubble.ui.backend.resources }}
|
||||
resources:
|
||||
{{- toYaml . | trim | nindent 10 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
{{- if .Values.hubble.relay.tls.server.enabled }}
|
||||
- name: hubble-ui-client-certs
|
||||
mountPath: /var/lib/hubble-ui/certs
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- with .Values.hubble.ui.backend.extraVolumeMounts }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
terminationMessagePolicy: FallbackToLogsOnError
|
||||
{{- with .Values.hubble.ui.backend.securityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | trim | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- with .Values.hubble.ui.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.hubble.ui.topologySpreadConstraints }}
|
||||
topologySpreadConstraints:
|
||||
{{- range $constraint := . }}
|
||||
- {{ toYaml $constraint | nindent 8 | trim }}
|
||||
{{- if not $constraint.labelSelector }}
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
k8s-app: hubble-ui
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.hubble.ui.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | trim | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.hubble.ui.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | trim | nindent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- configMap:
|
||||
defaultMode: 420
|
||||
name: hubble-ui-nginx
|
||||
name: hubble-ui-nginx-conf
|
||||
- emptyDir: {}
|
||||
name: tmp-dir
|
||||
{{- if .Values.hubble.relay.tls.server.enabled }}
|
||||
- name: hubble-ui-client-certs
|
||||
{{- if .Values.hubble.ui.standalone.enabled }}
|
||||
{{- toYaml .Values.hubble.ui.standalone.tls.certsVolume | nindent 8 }}
|
||||
{{- else }}
|
||||
projected:
|
||||
# note: the leading zero means this number is in octal representation: do not remove it
|
||||
defaultMode: 0400
|
||||
sources:
|
||||
- secret:
|
||||
name: hubble-ui-client-certs
|
||||
items:
|
||||
- key: tls.crt
|
||||
path: client.crt
|
||||
- key: tls.key
|
||||
path: client.key
|
||||
{{- if not .Values.tls.caBundle.enabled }}
|
||||
- key: ca.crt
|
||||
path: hubble-relay-ca.crt
|
||||
{{- else }}
|
||||
- {{ .Values.tls.caBundle.useSecret | ternary "secret" "configMap" }}:
|
||||
name: {{ .Values.tls.caBundle.name }}
|
||||
items:
|
||||
- key: {{ .Values.tls.caBundle.key }}
|
||||
path: hubble-relay-ca.crt
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.hubble.ui.frontend.extraVolumes }}
|
||||
{{- toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- with .Values.hubble.ui.backend.extraVolumes }}
|
||||
{{- toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,40 @@
|
||||
{{- if and (or .Values.hubble.enabled .Values.hubble.ui.standalone.enabled) .Values.hubble.ui.enabled .Values.hubble.ui.ingress.enabled }}
|
||||
{{- $baseUrl := .Values.hubble.ui.baseUrl -}}
|
||||
apiVersion: {{ template "ingress.apiVersion" . }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: hubble-ui
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
k8s-app: hubble-ui
|
||||
app.kubernetes.io/name: hubble-ui
|
||||
app.kubernetes.io/part-of: cilium
|
||||
{{- with .Values.hubble.ui.ingress.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.hubble.ui.ingress.annotations .Values.hubble.ui.annotations }}
|
||||
annotations:
|
||||
{{- with .Values.hubble.ui.annotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.hubble.ui.ingress.annotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.hubble.ui.ingress.className }}
|
||||
ingressClassName: {{ .Values.hubble.ui.ingress.className }}
|
||||
{{- end }}
|
||||
{{- if .Values.hubble.ui.ingress.tls }}
|
||||
tls:
|
||||
{{- toYaml .Values.hubble.ui.ingress.tls | nindent 4 }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range .Values.hubble.ui.ingress.hosts }}
|
||||
- host: {{ . }}
|
||||
http:
|
||||
paths:
|
||||
- path: {{ $baseUrl | quote }}
|
||||
{{- include "ingress.paths" $ | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,26 @@
|
||||
{{- if and (or .Values.hubble.enabled .Values.hubble.ui.standalone.enabled) .Values.hubble.ui.enabled .Values.hubble.ui.podDisruptionBudget.enabled }}
|
||||
{{- $component := .Values.hubble.ui.podDisruptionBudget }}
|
||||
apiVersion: {{ include "podDisruptionBudget.apiVersion" . }}
|
||||
kind: PodDisruptionBudget
|
||||
metadata:
|
||||
name: hubble-ui
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- with .Values.hubble.ui.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
k8s-app: hubble-ui
|
||||
app.kubernetes.io/name: hubble-ui
|
||||
app.kubernetes.io/part-of: cilium
|
||||
spec:
|
||||
{{- with $component.maxUnavailable }}
|
||||
maxUnavailable: {{ . }}
|
||||
{{- end }}
|
||||
{{- with $component.minAvailable }}
|
||||
minAvailable: {{ . }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
k8s-app: hubble-ui
|
||||
{{- end }}
|
||||
@@ -0,0 +1,31 @@
|
||||
{{- if and (or .Values.hubble.enabled .Values.hubble.ui.standalone.enabled) .Values.hubble.ui.enabled }}
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: hubble-ui
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- if or .Values.hubble.ui.service.annotations .Values.hubble.ui.annotations }}
|
||||
annotations:
|
||||
{{- with .Values.hubble.ui.annotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.hubble.ui.service.annotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
labels:
|
||||
k8s-app: hubble-ui
|
||||
app.kubernetes.io/name: hubble-ui
|
||||
app.kubernetes.io/part-of: cilium
|
||||
spec:
|
||||
type: {{ .Values.hubble.ui.service.type | quote }}
|
||||
selector:
|
||||
k8s-app: hubble-ui
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
targetPort: 8081
|
||||
{{- if and (eq "NodePort" .Values.hubble.ui.service.type) .Values.hubble.ui.service.nodePort }}
|
||||
nodePort: {{ .Values.hubble.ui.service.nodePort }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,16 @@
|
||||
{{- if and (or .Values.hubble.enabled .Values.hubble.ui.standalone.enabled) .Values.hubble.ui.enabled .Values.serviceAccounts.ui.create }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ .Values.serviceAccounts.ui.name | quote }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- if or .Values.serviceAccounts.ui.annotations .Values.hubble.ui.annotations }}
|
||||
annotations:
|
||||
{{- with .Values.hubble.ui.annotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.serviceAccounts.ui.annotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user