quorate/services/project-delivery/k8s/workflows/lazaret/network-policy.yaml

156 lines
4.8 KiB
YAML
Raw Permalink Normal View History

apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: lazaret-source
namespace: project-delivery
spec:
endpointSelector:
matchLabels:
delivery.quorate.dev/stage: lazaret-source
egress:
- toEndpoints:
- matchLabels:
k8s:io.kubernetes.pod.namespace: kube-system
k8s-app: kube-dns
toPorts:
- ports:
- {port: "53", protocol: UDP}
- {port: "53", protocol: TCP}
rules:
dns:
- matchName: forge-git-http.forgejo-public.svc.cluster.local
- toEndpoints:
- matchLabels:
k8s:io.kubernetes.pod.namespace: forgejo-public
app.kubernetes.io/name: forgejo
app.kubernetes.io/instance: forge-git
toPorts:
- ports:
- {port: "3000", protocol: TCP}
---
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: lazaret-upstream
namespace: project-delivery
spec:
endpointSelector:
matchLabels:
delivery.quorate.dev/stage: lazaret-upstream
egress:
- toEndpoints:
- matchLabels:
k8s:io.kubernetes.pod.namespace: kube-system
k8s-app: kube-dns
toPorts:
- ports:
- {port: "53", protocol: UDP}
- {port: "53", protocol: TCP}
rules:
dns:
- matchName: bcr.bazel.build
- matchName: codeload.github.com
- matchName: download.gnome.org
- matchName: dl.google.com
- matchName: files.pythonhosted.org
- matchName: github.com
- matchName: go.dev
- matchName: golang.google.cn
- matchName: index.crates.io
- matchName: mirror.bazel.build
- matchName: packages.wolfi.dev
- matchName: pkgconfig.freedesktop.org
- matchName: proxy.golang.org
- matchName: release-assets.githubusercontent.com
- matchName: releases.bazel.build
- matchName: static.crates.io
- matchName: static.rust-lang.org
- matchName: storage.googleapis.com
- toFQDNs:
- {matchName: bcr.bazel.build}
- {matchName: codeload.github.com}
- {matchName: download.gnome.org}
- {matchName: dl.google.com}
- {matchName: files.pythonhosted.org}
- {matchName: github.com}
- {matchName: go.dev}
- {matchName: golang.google.cn}
- {matchName: index.crates.io}
- {matchName: mirror.bazel.build}
- {matchName: packages.wolfi.dev}
- {matchName: pkgconfig.freedesktop.org}
- {matchName: proxy.golang.org}
- {matchName: release-assets.githubusercontent.com}
- {matchName: releases.bazel.build}
- {matchName: static.crates.io}
- {matchName: static.rust-lang.org}
- {matchName: storage.googleapis.com}
toPorts:
- ports:
- {port: "443", protocol: TCP}
---
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: lazaret-cache
namespace: project-delivery
spec:
endpointSelector:
matchExpressions:
- key: delivery.quorate.dev/stage
operator: In
values: [lazaret-cache-pull, lazaret-cache-export]
egress:
- toEndpoints:
- matchLabels:
k8s:io.kubernetes.pod.namespace: kube-system
k8s-app: kube-dns
toPorts:
- ports:
- {port: "53", protocol: UDP}
- {port: "53", protocol: TCP}
rules:
dns:
- matchName: s3.quorate.internal
- toCIDR: [10.66.127.81/32]
toPorts:
- ports:
- {port: "443", protocol: TCP}
- toEndpoints:
- matchLabels:
k8s:io.kubernetes.pod.namespace: versitygw
app.kubernetes.io/name: versitygw
app.kubernetes.io/instance: versitygw
toPorts:
- ports:
- {port: "7070", protocol: TCP}
---
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: lazaret-publication
namespace: project-delivery
spec:
endpointSelector:
matchLabels:
delivery.quorate.dev/stage: lazaret-publication
egress:
- toEndpoints:
- matchLabels:
k8s:io.kubernetes.pod.namespace: kube-system
k8s-app: kube-dns
toPorts:
- ports:
- {port: "53", protocol: UDP}
- {port: "53", protocol: TCP}
rules:
dns:
- matchName: forge-git-http.forgejo-public.svc.cluster.local
- toEndpoints:
- matchLabels:
k8s:io.kubernetes.pod.namespace: forgejo-public
app.kubernetes.io/name: forgejo
app.kubernetes.io/instance: forge-git
toPorts:
- ports:
- {port: "3000", protocol: TCP}