forked from gardener/gardener
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move
shoot-core/network-policies
Helm chart into responsible compon…
…ents packages (gardener#7401) * Move `addons-nginx-controller` specific `NetworkPolicy` template into component package * Move `allow-from-seed` `NetworkPolicy` template into `vpnshoot` package * Move `allow-to-apiserver` `NetworkPolicy` template into `shootsystem` package * Move `allow-to-dns` `NetworkPolicy` template into `shootsystem` package * Move `allow-to-kubelet` `NetworkPolicy` template into `shootsystem` package * Move `allow-to-public-networks` `NetworkPolicy` template into `shootsystem` package * Cleanup special code related to shoot Helm charts
- Loading branch information
Showing
18 changed files
with
384 additions
and
347 deletions.
There are no files selected for viewing
22 changes: 3 additions & 19 deletions
22
charts/shoot-core/components/charts/network-policies/templates/allow-from-seed.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,8 @@ | ||
# TODO(rfranzke): Delete this Helm chart in a future version. | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
annotations: | ||
gardener.cloud/description: | | ||
Allows Ingress from the control plane to pods labeled with | ||
'networking.gardener.cloud/from-seed=allowed'. | ||
name: gardener.cloud--allow-from-seed | ||
namespace: kube-system | ||
labels: | ||
origin: gardener | ||
spec: | ||
podSelector: | ||
matchLabels: | ||
networking.gardener.cloud/from-seed: allowed | ||
policyTypes: | ||
- Ingress | ||
ingress: | ||
- from: | ||
- podSelector: | ||
matchLabels: | ||
app: vpn-shoot | ||
gardener.cloud/role: system-component | ||
origin: gardener | ||
annotations: | ||
resources.gardener.cloud/mode: Ignore |
19 changes: 3 additions & 16 deletions
19
charts/shoot-core/components/charts/network-policies/templates/allow-from-to-nginx.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,8 @@ | ||
# TODO(rfranzke): Delete this Helm chart in a future version. | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
annotations: | ||
gardener.cloud/description: | | ||
Allows all Egress and Ingress for the nginx-controller | ||
name: gardener.cloud--allow-to-from-nginx | ||
namespace: kube-system | ||
labels: | ||
origin: gardener | ||
spec: | ||
podSelector: | ||
matchLabels: | ||
app: nginx-ingress | ||
policyTypes: | ||
- Ingress | ||
- Egress | ||
egress: | ||
- {} | ||
ingress: | ||
- {} | ||
annotations: | ||
resources.gardener.cloud/mode: Ignore |
18 changes: 3 additions & 15 deletions
18
charts/shoot-core/components/charts/network-policies/templates/allow-to-api-server.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,8 @@ | ||
# TODO(rfranzke): Delete this Helm chart in a future version. | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
annotations: | ||
gardener.cloud/description: | | ||
Allows traffic to api server in TCP Port 443 | ||
name: gardener.cloud--allow-to-apiserver | ||
namespace: kube-system | ||
labels: | ||
origin: gardener | ||
spec: | ||
podSelector: | ||
matchLabels: | ||
networking.gardener.cloud/to-apiserver: allowed | ||
egress: | ||
- ports: | ||
- port: 443 | ||
protocol: TCP | ||
policyTypes: | ||
- Egress | ||
annotations: | ||
resources.gardener.cloud/mode: Ignore |
38 changes: 3 additions & 35 deletions
38
charts/shoot-core/components/charts/network-policies/templates/allow-to-dns.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,8 @@ | ||
# TODO(rfranzke): Delete this Helm chart in a future version. | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
annotations: | ||
gardener.cloud/description: | | ||
Allows Egress from pods labeled with 'networking.gardener.cloud/to-dns=allowed' | ||
to DNS running in the 'kube-system' namespace. | ||
name: gardener.cloud--allow-to-dns | ||
namespace: kube-system | ||
labels: | ||
origin: gardener | ||
spec: | ||
podSelector: | ||
matchLabels: | ||
networking.gardener.cloud/to-dns: allowed | ||
policyTypes: | ||
- Egress | ||
egress: | ||
- to: | ||
- podSelector: | ||
matchExpressions: | ||
- {key: k8s-app, operator: In, values: [kube-dns]} | ||
ports: | ||
- protocol: UDP | ||
port: 8053 | ||
- protocol: TCP | ||
port: 8053 | ||
# this allows Pods with 'dnsPolicy: Default' to talk to | ||
# the node's DNS provider. | ||
- to: | ||
- ipBlock: | ||
cidr: 0.0.0.0/0 | ||
- podSelector: | ||
matchExpressions: | ||
- {key: k8s-app, operator: In, values: [node-local-dns]} | ||
ports: | ||
- protocol: UDP | ||
port: 53 | ||
- protocol: TCP | ||
port: 53 | ||
annotations: | ||
resources.gardener.cloud/mode: Ignore |
18 changes: 3 additions & 15 deletions
18
charts/shoot-core/components/charts/network-policies/templates/allow-to-kubelet.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,8 @@ | ||
# TODO(rfranzke): Delete this Helm chart in a future version. | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
annotations: | ||
gardener.cloud/description: | | ||
Allows traffic to kubelet in TCP Port 10250 | ||
name: gardener.cloud--allow-to-kubelet | ||
namespace: kube-system | ||
labels: | ||
origin: gardener | ||
spec: | ||
podSelector: | ||
matchLabels: | ||
networking.gardener.cloud/to-kubelet: allowed | ||
egress: | ||
- ports: | ||
- port: 10250 | ||
protocol: TCP | ||
policyTypes: | ||
- Egress | ||
annotations: | ||
resources.gardener.cloud/mode: Ignore |
19 changes: 3 additions & 16 deletions
19
charts/shoot-core/components/charts/network-policies/templates/allow-to-public-networks.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,8 @@ | ||
# TODO(rfranzke): Delete this Helm chart in a future version. | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
annotations: | ||
gardener.cloud/description: | | ||
Allows Egress from pods labeled with 'networking.gardener.cloud/to-public-networks=allowed' | ||
to all networks. | ||
name: gardener.cloud--allow-to-public-networks | ||
namespace: kube-system | ||
labels: | ||
origin: gardener | ||
spec: | ||
podSelector: | ||
matchLabels: | ||
networking.gardener.cloud/to-public-networks: allowed | ||
policyTypes: | ||
- Egress | ||
egress: | ||
- to: | ||
- ipBlock: | ||
cidr: 0.0.0.0/0 | ||
annotations: | ||
resources.gardener.cloud/mode: Ignore |
3 changes: 0 additions & 3 deletions
3
charts/shoot-core/components/charts/network-policies/values.yaml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
pkg/operation/botanist/addons/networkpolicy/shoot_network_policy.go
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.