forked from kubeflow/manifests
-
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.
Add networkpolicies under /contrib/networkpolicies (kubeflow#2121)
* Create .gitkeep * Add files via upload * Create OWNERS * Create README.md * Delete default-deny-not-istio-system.yaml * Create default-allow-same-namespace.yaml * Create centraldashboard.yaml * Create jupyter-web-app.yaml * Create katib-ui.yaml * Create kfserving-models-web-app.yaml * Create ml-pipeline-ui.yaml * Update ml-pipeline.yaml * Create volumes-web-app.yaml * Update kustomization.yaml * Update OWNERS
- Loading branch information
1 parent
cc964a7
commit 5538d5e
Showing
20 changed files
with
385 additions
and
0 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
|
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
approvers: | ||
- juliusvonkohout | ||
reviewers: | ||
- juliusvonkohout | ||
- kimwnasptd |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
### 1. Why would a user apply the extra policies? | ||
It is a second line of defence after Istio autorization policies and it protects pods and services that are not protected by Istio | ||
|
||
### 2. Effects they will have in the cluster | ||
Please consult the name of and comments in each networkpolicy for further information. | ||
|
||
### 3. We should achieve the same with AuthorizationPolicies | ||
But there are components, e.g. Katib that are not secured by istio |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
name: cache-server | ||
namespace: kubeflow | ||
spec: | ||
podSelector: | ||
matchExpressions: | ||
- key: app | ||
operator: In | ||
values: | ||
- cache-server # mutating webhook | ||
# https://www.elastic.co/guide/en/cloud-on-k8s/1.1/k8s-webhook-network-policies.html | ||
# The kubernetes api server must reach the webhook | ||
ingress: | ||
- ports: | ||
- protocol: TCP | ||
port: 8443 | ||
policyTypes: | ||
- Ingress | ||
|
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
name: centraldashboard | ||
namespace: kubeflow | ||
spec: | ||
podSelector: | ||
matchExpressions: | ||
- key: app | ||
operator: In | ||
values: | ||
- centraldashboard | ||
ingress: | ||
- from: | ||
- namespaceSelector: | ||
matchExpressions: | ||
- key: kubernetes.io/metadata.name | ||
operator: In | ||
values: | ||
- istio-system | ||
- podSelector: {} | ||
policyTypes: | ||
- Ingress |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
name: default-allow-same-namespace | ||
namespace: kubeflow | ||
spec: | ||
podSelector: {} | ||
ingress: | ||
- from: | ||
- podSelector: {} | ||
policyTypes: | ||
- Ingress |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
name: jupyter-web-app | ||
namespace: kubeflow | ||
spec: | ||
podSelector: | ||
matchExpressions: | ||
- key: app | ||
operator: In | ||
values: | ||
- jupyter-web-app | ||
ingress: | ||
- from: | ||
- namespaceSelector: | ||
matchExpressions: | ||
- key: kubernetes.io/metadata.name | ||
operator: In | ||
values: | ||
- istio-system | ||
- podSelector: {} | ||
policyTypes: | ||
- Ingress |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
name: katib-controller | ||
namespace: kubeflow | ||
spec: | ||
podSelector: | ||
matchExpressions: | ||
- key: katib.kubeflow.org/component | ||
operator: In | ||
values: | ||
- controller # katib mutating webhook to add metrics logger | ||
# https://www.elastic.co/guide/en/cloud-on-k8s/1.1/k8s-webhook-network-policies.html | ||
# The kubernetes api server must reach the webhook | ||
ingress: | ||
- ports: # webhook | ||
- protocol: TCP | ||
port: 8443 | ||
# - ports: # metrics | ||
# - protocol: TCP | ||
# port: 8080 | ||
policyTypes: | ||
- Ingress |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
name: katib-db-manager | ||
namespace: kubeflow | ||
spec: | ||
podSelector: | ||
matchExpressions: | ||
- key: katib.kubeflow.org/component | ||
operator: In | ||
values: | ||
- db-manager # the metrics loggers write directly to this database | ||
ingress: | ||
- from: | ||
- namespaceSelector: | ||
matchExpressions: | ||
- key: app.kubernetes.io/part-of | ||
operator: In | ||
values: | ||
- kubeflow-profile | ||
- podSelector: {} # allow all pods from the same namespace | ||
policyTypes: | ||
- Ingress |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
name: katib-ui | ||
namespace: kubeflow | ||
spec: | ||
podSelector: | ||
matchExpressions: | ||
- key: katib.kubeflow.org/component | ||
operator: In | ||
values: | ||
- ui | ||
ingress: | ||
- from: | ||
- namespaceSelector: | ||
matchExpressions: | ||
- key: kubernetes.io/metadata.name | ||
operator: In | ||
values: | ||
- istio-system | ||
policyTypes: | ||
- Ingress |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
name: kfserving-models-web-app | ||
namespace: kubeflow | ||
spec: | ||
podSelector: | ||
matchExpressions: | ||
- key: app.kubernetes.io/component | ||
operator: In | ||
values: | ||
- kfserving-models-web-app | ||
ingress: | ||
- from: | ||
- namespaceSelector: | ||
matchExpressions: | ||
- key: kubernetes.io/metadata.name | ||
operator: In | ||
values: | ||
- istio-system | ||
policyTypes: | ||
- Ingress |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
name: kfserving | ||
namespace: kubeflow | ||
spec: | ||
podSelector: | ||
matchExpressions: | ||
- key: control-plane | ||
operator: In | ||
values: | ||
- kfserving-controller-manager # mutating webhook | ||
# https://www.elastic.co/guide/en/cloud-on-k8s/1.1/k8s-webhook-network-policies.html | ||
# The kubernetes api server must reach the webhook | ||
ingress: | ||
- ports: | ||
- protocol: TCP | ||
port: 9443 | ||
policyTypes: | ||
- Ingress |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
namespace: kubeflow | ||
resources: | ||
- cache-server.yaml | ||
- centraldashboard.yaml | ||
- default-allow-same-namespace.yaml | ||
- jupyter-web-app.yaml | ||
- katib-controller.yaml | ||
- katib-db-manager.yaml | ||
- katib-ui.yaml | ||
- kfserving-models-web-app.yaml | ||
- kfserving.yaml | ||
- metadata-grpc-server.yaml | ||
- minio.yaml | ||
- ml-pipeline-ui.yaml | ||
- ml-pipeline.yaml | ||
- poddefaults.yaml | ||
- seldon.yaml | ||
- volumes-web-app.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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
name: metadata-grpc-server | ||
namespace: kubeflow | ||
spec: | ||
podSelector: | ||
matchExpressions: | ||
- key: component | ||
operator: In | ||
values: | ||
- metadata-grpc-server # metadata server | ||
ingress: | ||
- from: | ||
- namespaceSelector: | ||
matchExpressions: | ||
- key: app.kubernetes.io/part-of | ||
operator: In | ||
values: | ||
- kubeflow-profile | ||
- podSelector: {} # allow all pods from the same namespace | ||
policyTypes: | ||
- Ingress | ||
|
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
name: minio | ||
namespace: kubeflow | ||
spec: | ||
podSelector: | ||
matchExpressions: | ||
- key: app | ||
operator: In | ||
values: | ||
- minio # artifact storage | ||
ingress: | ||
- from: | ||
- namespaceSelector: | ||
matchExpressions: | ||
- key: app.kubernetes.io/part-of | ||
operator: In | ||
values: | ||
- kubeflow-profile | ||
- podSelector: {} # allow all pods from the same namespace | ||
policyTypes: | ||
- Ingress |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
name: ml-pipeline-ui | ||
namespace: kubeflow | ||
spec: | ||
podSelector: | ||
matchExpressions: | ||
- key: app | ||
operator: In | ||
values: | ||
- ml-pipeline-ui | ||
ingress: | ||
- from: | ||
- namespaceSelector: | ||
matchExpressions: | ||
- key: kubernetes.io/metadata.name | ||
operator: In | ||
values: | ||
- istio-system | ||
policyTypes: | ||
- Ingress |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
name: ml-pipeline | ||
namespace: kubeflow | ||
spec: | ||
podSelector: | ||
matchExpressions: | ||
- key: app | ||
operator: In | ||
values: | ||
- ml-pipeline # just the apiserver | ||
ingress: | ||
- from: | ||
- namespaceSelector: | ||
matchExpressions: | ||
- key: app.kubernetes.io/part-of | ||
operator: In | ||
values: | ||
- kubeflow-profile | ||
- namespaceSelector: | ||
matchExpressions: | ||
- key: kubernetes.io/metadata.name | ||
operator: In | ||
values: | ||
- istio-system | ||
policyTypes: | ||
- Ingress |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
name: poddefaults | ||
namespace: kubeflow | ||
spec: | ||
podSelector: | ||
matchExpressions: | ||
- key: app | ||
operator: In | ||
values: | ||
- poddefaults # mutating webhook | ||
# https://www.elastic.co/guide/en/cloud-on-k8s/1.1/k8s-webhook-network-policies.html | ||
# The kubernetes api server must reach the webhook | ||
ingress: | ||
- ports: | ||
- protocol: TCP | ||
port: 4443 | ||
policyTypes: | ||
- Ingress |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
name: seldon | ||
namespace: kubeflow | ||
spec: | ||
podSelector: | ||
matchExpressions: | ||
- key: control-plane | ||
operator: In | ||
values: | ||
- seldon-controller-manager # validating webhook | ||
# https://www.elastic.co/guide/en/cloud-on-k8s/1.1/k8s-webhook-network-policies.html | ||
# The kubernetes api server must reach the webhook | ||
ingress: | ||
- ports: | ||
- protocol: TCP | ||
port: 4443 | ||
policyTypes: | ||
- Ingress | ||
|
Oops, something went wrong.