Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions deploy/chart/templates/0000_50_olm_01-networkpolicies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny-all-traffic
namespace: {{ .Values.namespace }}
spec:
podSelector: { }
policyTypes:
- Ingress
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: olm-operator
namespace: {{ .Values.namespace }}
spec:
podSelector:
matchLabels:
app: olm-operator
ingress:
- {{ .Values.networkPolicy.metrics | toYaml | nindent 6 | trimSuffix "\n" }}
egress:
- {{ .Values.networkPolicy.kubeAPIServer | toYaml | nindent 6 | trimSuffix "\n" }}
- {{ .Values.networkPolicy.dns | toYaml | nindent 6 | trimSuffix "\n" }}
policyTypes:
- Ingress
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: catalog-operator
namespace: {{ .Values.namespace }}
spec:
podSelector:
matchLabels:
app: catalog-operator
ingress:
- {{ .Values.networkPolicy.metrics | toYaml | nindent 6 | trimSuffix "\n" }}
egress:
- {{ .Values.networkPolicy.kubeAPIServer | toYaml | nindent 6 | trimSuffix "\n" }}
- {{ .Values.networkPolicy.dns | toYaml | nindent 6 | trimSuffix "\n" }}
- ports: # This is another distinct rule in the egress list
- protocol: TCP
port: {{ .Values.catalogGrpcServicePort }}
policyTypes:
- Ingress
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: packageserver
namespace: {{ .Values.namespace }}
spec:
podSelector:
matchLabels:
app: packageserver
ingress:
- ports:
- protocol: TCP
port: {{ .Values.package.service.internalPort }}
egress:
- {{ .Values.networkPolicy.dns | toYaml | nindent 6 | trimSuffix "\n" }}
- ports:
- protocol: TCP
port: {{ .Values.catalogGrpcServicePort }}
policyTypes:
- Ingress
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-allow-all
namespace: {{ .Values.operator_namespace }}
spec:
podSelector: { }
policyTypes:
- Ingress
- Egress
ingress:
- { }
egress:
- { }
32 changes: 32 additions & 0 deletions deploy/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ writeStatusName: '""'
imagestream: false
debug: false
installType: upstream
catalogGrpcServicePort: 50051

olm:
replicaCount: 1
image:
Expand Down Expand Up @@ -75,3 +77,33 @@ package:
monitoring:
enabled: false
namespace: monitoring

networkPolicy:
dns:
ports:
- protocol: TCP
port: 53
- protocol: UDP
port: 53
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: kube-system
podSelector:
matchLabels:
k8s-app: kube-dns
kubeAPIServer:
ports:
- protocol: TCP
port: 6443
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: kube-system
podSelector:
matchLabels:
component: kube-apiserver
metrics:
ports:
- protocol: TCP
port: metrics