diff --git a/k8s/network/Readme.md b/k8s/network/Readme.md new file mode 100644 index 0000000..cee86a0 --- /dev/null +++ b/k8s/network/Readme.md @@ -0,0 +1,12 @@ +# Enable +gcloud container clusters create [CLUSTER_NAME] --enable-network-policy + +or + +gcloud container clusters update [CLUSTER_NAME] --update-addons=NetworkPolicy=ENABLED +gcloud container clusters update [CLUSTER_NAME] --enable-network-policy + + +# Disable + +gcloud container clusters update [CLUSTER_NAME] --no-enable-network-policy \ No newline at end of file diff --git a/k8s/network/egress-block.yaml b/k8s/network/egress-block.yaml new file mode 100644 index 0000000..76d7822 --- /dev/null +++ b/k8s/network/egress-block.yaml @@ -0,0 +1,22 @@ +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: deny-egress-traffic + namespace: ballerina-playground-v2 +spec: + policyTypes: + - Egress + podSelector: + matchLabels: + app: ballerina-playground-executor + egress: + - to: + - podSelector: + matchLabels: + app: ballerina-playground-controller + - ports: + - port: 53 + protocol: TCP + - port: 53 + protocol: UDP +