Files
cloud-configuration/helm/cluster_setup/templates/cilium/hubble-ui-networkpolicy.yaml
T
2023-11-18 12:24:21 +01:00

76 lines
1.7 KiB
YAML

{{- if .Values.cilium.enabled }}
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: hubble-ui
namespace: kube-system
specs:
- endpointSelector:
# apply to hubble relay endpoints
matchLabels:
io.cilium.k8s.policy.serviceaccount: hubble-relay
ingress:
# hubble ui -> hubble relay
- fromEndpoints:
- matchLabels:
io.cilium.k8s.policy.serviceaccount: hubble-ui
toPorts:
- ports:
- port: '80'
protocol: TCP
- port: '4245'
protocol: TCP
- endpointSelector:
# apply to hubble ui endpoints
matchLabels:
io.cilium.k8s.policy.serviceaccount: hubble-ui
egress:
# hubble ui -> api server
- toEntities:
- kube-apiserver
toPorts:
- ports:
- port: '16443'
protocol: TCP
# hubble ui -> core dns
- toEntities:
- world
toPorts:
- ports:
- port: '443'
protocol: TCP
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: hubble-ui
namespace: kube-system
spec:
podSelector:
matchLabels:
k8s-app: hubble-ui
policyTypes:
- Egress
egress:
- to:
- podSelector:
matchLabels:
k8s-app: hubble-relay
ports:
- port: '80'
protocol: TCP
- port: '4245'
protocol: TCP
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: kube-system
- podSelector:
matchLabels:
k8s-app: kube-dns
ports:
- port: '53'
protocol: UDP
---
{{- end }}