Add network policy examples
Longhorn-1805 Signed-off-by: Phan Le <phan.le@suse.com>
This commit is contained in:
parent
b6b6e4824d
commit
94c883e501
@ -0,0 +1,25 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: backing-image-data-source
|
||||
namespace: longhorn-system
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
longhorn.io/component: backing-image-data-source
|
||||
policyTypes:
|
||||
- Ingress
|
||||
ingress:
|
||||
- from:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app: longhorn-manager
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
longhorn.io/component: instance-manager
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
longhorn.io/component: backing-image-manager
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
longhorn.io/component: backing-image-data-source
|
@ -0,0 +1,25 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: backing-image-manager
|
||||
namespace: longhorn-system
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
longhorn.io/component: backing-image-manager
|
||||
policyTypes:
|
||||
- Ingress
|
||||
ingress:
|
||||
- from:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app: longhorn-manager
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
longhorn.io/component: instance-manager
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
longhorn.io/component: backing-image-manager
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
longhorn.io/component: backing-image-data-source
|
25
examples/network-policy/instance-manager-networking.yaml
Normal file
25
examples/network-policy/instance-manager-networking.yaml
Normal file
@ -0,0 +1,25 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: instance-manager
|
||||
namespace: longhorn-system
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
longhorn.io/component: instance-manager
|
||||
policyTypes:
|
||||
- Ingress
|
||||
ingress:
|
||||
- from:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app: longhorn-manager
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
longhorn.io/component: instance-manager
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
longhorn.io/component: backing-image-manager
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
longhorn.io/component: backing-image-data-source
|
33
examples/network-policy/manager-network-policy.yaml
Normal file
33
examples/network-policy/manager-network-policy.yaml
Normal file
@ -0,0 +1,33 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: longhorn-manager
|
||||
namespace: longhorn-system
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: longhorn-manager
|
||||
policyTypes:
|
||||
- Ingress
|
||||
ingress:
|
||||
- from:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app: longhorn-manager
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app: longhorn-ui
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app: longhorn-csi-plugin
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
longhorn.io/managed-by: longhorn-manager
|
||||
matchExpressions:
|
||||
- { key: recurring-job.longhorn.io, operator: Exists }
|
||||
- podSelector:
|
||||
matchExpressions:
|
||||
- { key: longhorn.io/job-task, operator: Exists }
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app: longhorn-driver-deployer
|
23
examples/network-policy/ui-network-policy.yaml
Normal file
23
examples/network-policy/ui-network-policy.yaml
Normal file
@ -0,0 +1,23 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: longhorn-ui
|
||||
namespace: longhorn-system
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: longhorn-ui
|
||||
policyTypes:
|
||||
- Ingress
|
||||
ingress:
|
||||
- from:
|
||||
# Depending on the ingress controller setup in your cluster, Change the following
|
||||
# info to allow the traffic from the ingress controller pods to Longhorn UI
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: ingress-nginx
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/component: controller
|
||||
app.kubernetes.io/instance: ingress-nginx
|
||||
app.kubernetes.io/name: ingress-nginx
|
Loading…
Reference in New Issue
Block a user