-
Notifications
You must be signed in to change notification settings - Fork 93
CNTRLPLANE-2905: add network policies #414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
bindata/assets/openshift-controller-manager/networkpolicy-allow.yaml
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Network policy for the openshift-controller-manager pods. | ||
| # | ||
| # Egress: | ||
| # - Allow all egress to support communication with the Kubernetes API server, | ||
| # whose IP address and port are not known at manifest time. This implicitly | ||
| # covers DNS resolution as well. | ||
| # | ||
| # Ingress: | ||
| # - Allow ingress on port 8443 (metrics) for metrics scraping. | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: NetworkPolicy | ||
| metadata: | ||
| name: allow-controller-manager | ||
| namespace: openshift-controller-manager | ||
| spec: | ||
| podSelector: | ||
| matchLabels: | ||
| controller-manager: "true" | ||
| ingress: | ||
| - ports: | ||
| - protocol: TCP | ||
| port: 8443 | ||
| egress: | ||
| - {} # Allow all egress for API server access | ||
| policyTypes: | ||
| - Ingress | ||
| - Egress | ||
22 changes: 22 additions & 0 deletions
22
bindata/assets/openshift-controller-manager/networkpolicy-default-deny.yaml
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # Default-deny network policy for the openshift-controller-manager namespace. | ||
| # This policy selects all pods in the namespace and enables default-deny for both | ||
| # ingress and egress by specifying policyTypes without any allow rules. | ||
| # | ||
| # NetworkPolicies are additive (use OR logic): | ||
| # - This policy enables default-deny for all pods | ||
| # - Subsequent policies add specific allow rules | ||
| # - If any policy allows traffic, that traffic is permitted | ||
| # - Policies cannot override or block traffic allowed by other policies | ||
| # | ||
| # Without this policy, all pods would have unrestricted network access (allow-all). | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: NetworkPolicy | ||
| metadata: | ||
| name: default-deny | ||
| namespace: openshift-controller-manager | ||
| spec: | ||
| podSelector: {} # Selects all pods in the namespace | ||
| policyTypes: | ||
| - Ingress | ||
| - Egress | ||
| # No ingress or egress rules - denies all traffic by default |
27 changes: 27 additions & 0 deletions
27
...ata/assets/openshift-controller-manager/route-controller-manager-networkpolicy-allow.yaml
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Network policy for the route-controller-manager pods. | ||
| # | ||
| # Egress: | ||
| # - Allow all egress to support communication with the Kubernetes API server, | ||
| # whose IP address and port are not known at manifest time. This implicitly | ||
| # covers DNS resolution as well. | ||
| # | ||
| # Ingress: | ||
| # - Allow ingress on port 8443 (metrics) for metrics scraping. | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: NetworkPolicy | ||
| metadata: | ||
| name: allow-route-controller-manager | ||
| namespace: openshift-route-controller-manager | ||
| spec: | ||
| podSelector: | ||
| matchLabels: | ||
| route-controller-manager: "true" | ||
| ingress: | ||
| - ports: | ||
| - protocol: TCP | ||
| port: 8443 | ||
|
dusk125 marked this conversation as resolved.
|
||
| egress: | ||
| - {} # Allow all egress for API server access | ||
| policyTypes: | ||
| - Ingress | ||
| - Egress | ||
22 changes: 22 additions & 0 deletions
22
...ets/openshift-controller-manager/route-controller-manager-networkpolicy-default-deny.yaml
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # Default-deny network policy for the openshift-route-controller-manager namespace. | ||
| # This policy selects all pods in the namespace and enables default-deny for both | ||
| # ingress and egress by specifying policyTypes without any allow rules. | ||
| # | ||
| # NetworkPolicies are additive (use OR logic): | ||
| # - This policy enables default-deny for all pods | ||
| # - Subsequent policies add specific allow rules | ||
| # - If any policy allows traffic, that traffic is permitted | ||
| # - Policies cannot override or block traffic allowed by other policies | ||
| # | ||
| # Without this policy, all pods would have unrestricted network access (allow-all). | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: NetworkPolicy | ||
| metadata: | ||
| name: default-deny | ||
| namespace: openshift-route-controller-manager | ||
| spec: | ||
| podSelector: {} # Selects all pods in the namespace | ||
| policyTypes: | ||
| - Ingress | ||
| - Egress | ||
| # No ingress or egress rules - denies all traffic by default |
30 changes: 30 additions & 0 deletions
30
manifests/0000_25_openshift-controller-manager-operator_00_network-policy-operator.yaml
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Network policy for the openshift-controller-manager-operator pod. | ||
| # | ||
| # Egress: | ||
| # - Allow all egress to support communication with the Kubernetes API server, | ||
| # whose IP address and port are not known at manifest time. This implicitly | ||
| # covers DNS resolution as well. | ||
| # | ||
| # Ingress: | ||
| # - Allow ingress on port 8443 (metrics) for metrics scraping. | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: NetworkPolicy | ||
| metadata: | ||
| name: allow-operator | ||
| namespace: openshift-controller-manager-operator | ||
| annotations: | ||
| include.release.openshift.io/self-managed-high-availability: "true" | ||
| include.release.openshift.io/single-node-developer: "true" | ||
| spec: | ||
| podSelector: | ||
| matchLabels: | ||
| app: openshift-controller-manager-operator | ||
| ingress: | ||
| - ports: | ||
| - protocol: TCP | ||
| port: 8443 | ||
|
dusk125 marked this conversation as resolved.
|
||
| egress: | ||
| - {} # Allow all egress for API server access | ||
| policyTypes: | ||
| - Ingress | ||
| - Egress | ||
25 changes: 25 additions & 0 deletions
25
manifests/0000_26_openshift-controller-manager-operator_00_network-policy-default-deny.yaml
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Default-deny network policy for the openshift-controller-manager-operator namespace. | ||
| # This policy selects all pods in the namespace and enables default-deny for both | ||
| # ingress and egress by specifying policyTypes without any allow rules. | ||
| # | ||
| # NetworkPolicies are additive (use OR logic): | ||
| # - This policy enables default-deny for all pods | ||
| # - Subsequent policies add specific allow rules | ||
| # - If any policy allows traffic, that traffic is permitted | ||
| # - Policies cannot override or block traffic allowed by other policies | ||
| # | ||
| # Without this policy, all pods would have unrestricted network access (allow-all). | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: NetworkPolicy | ||
| metadata: | ||
| name: default-deny | ||
| namespace: openshift-controller-manager-operator | ||
| annotations: | ||
| include.release.openshift.io/self-managed-high-availability: "true" | ||
| include.release.openshift.io/single-node-developer: "true" | ||
| spec: | ||
| podSelector: {} # Selects all pods in the namespace | ||
| policyTypes: | ||
| - Ingress | ||
| - Egress | ||
| # No ingress or egress rules - denies all traffic by default |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.