139 lines
3.7 KiB
YAML
139 lines
3.7 KiB
YAML
|
|
---
|
||
|
|
# Longhorn UI only accepts browser traffic through oauth2-proxy.
|
||
|
|
apiVersion: cilium.io/v2
|
||
|
|
kind: CiliumNetworkPolicy
|
||
|
|
metadata:
|
||
|
|
name: longhorn-ui-auth-proxy-ingress
|
||
|
|
namespace: longhorn
|
||
|
|
spec:
|
||
|
|
endpointSelector:
|
||
|
|
matchLabels:
|
||
|
|
app: longhorn-ui
|
||
|
|
ingress:
|
||
|
|
- fromEndpoints:
|
||
|
|
- matchLabels:
|
||
|
|
k8s:io.kubernetes.pod.namespace: longhorn
|
||
|
|
app.kubernetes.io/name: oauth2-proxy
|
||
|
|
app.kubernetes.io/instance: longhorn
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "8000"
|
||
|
|
protocol: TCP
|
||
|
|
---
|
||
|
|
# longhorn-oauth2-proxy: Gateway ingress, upstream Longhorn UI, Zitadel OIDC.
|
||
|
|
apiVersion: cilium.io/v2
|
||
|
|
kind: CiliumNetworkPolicy
|
||
|
|
metadata:
|
||
|
|
name: longhorn-oauth2-proxy
|
||
|
|
namespace: longhorn
|
||
|
|
spec:
|
||
|
|
endpointSelector:
|
||
|
|
matchLabels:
|
||
|
|
app.kubernetes.io/name: oauth2-proxy
|
||
|
|
app.kubernetes.io/instance: longhorn
|
||
|
|
ingress:
|
||
|
|
# Kubelet probes, local port-forwarding, and same-node Gateway backend flows.
|
||
|
|
- fromEntities:
|
||
|
|
- host
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "4180"
|
||
|
|
protocol: TCP
|
||
|
|
# Gateway I Envoy proxy: outbound connections use reserved:ingress identity.
|
||
|
|
- fromEntities:
|
||
|
|
- ingress
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "4180"
|
||
|
|
protocol: TCP
|
||
|
|
- fromEndpoints:
|
||
|
|
- matchLabels:
|
||
|
|
gateway.networking.k8s.io/gateway-name: gateway-internal
|
||
|
|
k8s:io.kubernetes.pod.namespace: kube-system
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "4180"
|
||
|
|
protocol: TCP
|
||
|
|
egress:
|
||
|
|
- toEndpoints:
|
||
|
|
- matchLabels:
|
||
|
|
k8s:io.kubernetes.pod.namespace: longhorn
|
||
|
|
app: longhorn-ui
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "8000"
|
||
|
|
protocol: TCP
|
||
|
|
- toEndpoints:
|
||
|
|
- matchLabels:
|
||
|
|
k8s:io.kubernetes.pod.namespace: zitadel
|
||
|
|
app.kubernetes.io/name: zitadel-oidc-internal
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "8080"
|
||
|
|
protocol: TCP
|
||
|
|
- toEndpoints:
|
||
|
|
- matchLabels:
|
||
|
|
k8s:io.kubernetes.pod.namespace: kube-system
|
||
|
|
k8s-app: kube-dns
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "53"
|
||
|
|
protocol: UDP
|
||
|
|
- port: "53"
|
||
|
|
protocol: TCP
|
||
|
|
---
|
||
|
|
apiVersion: cilium.io/v2
|
||
|
|
kind: CiliumClusterwideNetworkPolicy
|
||
|
|
metadata:
|
||
|
|
name: gateway-internal-egress-longhorn-oauth2-proxy
|
||
|
|
spec:
|
||
|
|
endpointSelector:
|
||
|
|
matchLabels:
|
||
|
|
"reserved:ingress": ""
|
||
|
|
egress:
|
||
|
|
- toEndpoints:
|
||
|
|
- matchLabels:
|
||
|
|
k8s:io.kubernetes.pod.namespace: longhorn
|
||
|
|
app.kubernetes.io/name: oauth2-proxy
|
||
|
|
app.kubernetes.io/instance: longhorn
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "4180"
|
||
|
|
protocol: TCP
|
||
|
|
---
|
||
|
|
apiVersion: cilium.io/v2
|
||
|
|
kind: CiliumClusterwideNetworkPolicy
|
||
|
|
metadata:
|
||
|
|
name: host-egress-longhorn-oauth2-proxy
|
||
|
|
spec:
|
||
|
|
nodeSelector: {}
|
||
|
|
egress:
|
||
|
|
- toEndpoints:
|
||
|
|
- matchLabels:
|
||
|
|
k8s:io.kubernetes.pod.namespace: longhorn
|
||
|
|
app.kubernetes.io/name: oauth2-proxy
|
||
|
|
app.kubernetes.io/instance: longhorn
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "4180"
|
||
|
|
protocol: TCP
|
||
|
|
---
|
||
|
|
# Same-node Gateway backend selections can return to node-local ephemeral
|
||
|
|
# source ports via the host path.
|
||
|
|
apiVersion: cilium.io/v2
|
||
|
|
kind: CiliumClusterwideNetworkPolicy
|
||
|
|
metadata:
|
||
|
|
name: host-ingress-longhorn-oauth2-proxy-replies
|
||
|
|
spec:
|
||
|
|
nodeSelector: {}
|
||
|
|
ingress:
|
||
|
|
- fromEndpoints:
|
||
|
|
- matchLabels:
|
||
|
|
k8s:io.kubernetes.pod.namespace: longhorn
|
||
|
|
app.kubernetes.io/name: oauth2-proxy
|
||
|
|
app.kubernetes.io/instance: longhorn
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "32768"
|
||
|
|
endPort: 60999
|
||
|
|
protocol: TCP
|