Skip to content
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

Default network Policy and extraObjects #350

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion charts/psmdb-db/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ appVersion: "1.16.1"
description: A Helm chart for installing Percona Server MongoDB Cluster Databases using the PSMDB Operator.
name: psmdb-db
home: https://www.percona.com/doc/kubernetes-operator-for-psmongodb/index.html
version: 1.16.2
version: 1.16.3
maintainers:
- name: tplavcic
email: [email protected]
Expand Down
9 changes: 9 additions & 0 deletions charts/psmdb-db/templates/extraObjects.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{ range .Values.extraObjects }}
---
{{- if typeIs "string" . }}
{{- tpl . $ }}
{{- else }}
{{- tpl (toYaml .) $ }}
{{- end }}
{{ end }}

34 changes: 34 additions & 0 deletions charts/psmdb-db/templates/networkPolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{ if .Values.networkPolicy.enabled }}
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-ingress-psmdb-operator
spec:
podSelector: {}
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: {{ .Values.networkPolicy.operatorNamespace }}
ports:
- port: 27017
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-ingress-in-namespace
spec:
podSelector: {}
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: {{ .Release.Namespace }}
ports:
- port: 27017
{{ end }}
10 changes: 10 additions & 0 deletions charts/psmdb-db/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -591,3 +591,13 @@ backup:
# PMM_SERVER_API_KEY: apikey
# # PMM_SERVER_USER: admin
# # PMM_SERVER_PASSWORD: admin

networkPolicy:
## Set as psmdb-operator namespace
#operatorNamespace: FIXME
enabled: false

extraObjects: []
# - apiVersion: plop
# spec:
# foo: bar