Skip to content

Commit

Permalink
K8SPG-585 - pg-operator - Add namespace into templates
Browse files Browse the repository at this point in the history
  • Loading branch information
tplavcic committed May 29, 2024
1 parent aff2f58 commit ca585ca
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/pg-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: pg-operator
description: 'A Helm chart to deploy the Percona Operator for PostgreSQL'
type: application
version: 2.3.4
version: 2.3.5
appVersion: 2.3.1
home: https://docs.percona.com/percona-operator-for-postgresql/2.0/
maintainers:
Expand Down
1 change: 1 addition & 0 deletions charts/pg-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "postgres-operator.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "postgres-operator.labels" . | indent 4 }}
pgv2.percona.com/control-plane: postgres-operator
Expand Down
9 changes: 5 additions & 4 deletions charts/pg-operator/templates/role-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "postgres-operator.fullname" . }}
namespace: {{ .Release.Namespace }}
---
{{- if or .Values.watchNamespace .Values.watchAllNamespaces }}
kind: ClusterRoleBinding
Expand All @@ -11,9 +12,9 @@ kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "postgres-operator.fullname" . }}
{{- if .Values.watchNamespace }}
namespace: {{ .Values.watchNamespace }}
{{- end }}
{{- if not (or .Values.watchNamespace .Values.watchAllNamespaces) }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels:
{{ include "postgres-operator.labels" . | indent 4 }}
subjects:
Expand All @@ -29,4 +30,4 @@ roleRef:
kind: Role
{{- end }}
name: {{ include "postgres-operator.fullname" . }}
apiGroup: rbac.authorization.k8s.io
apiGroup: rbac.authorization.k8s.io
3 changes: 3 additions & 0 deletions charts/pg-operator/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "postgres-operator.fullname" . }}
{{- if not (or .Values.watchNamespace .Values.watchAllNamespaces) }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels:
{{ include "postgres-operator.labels" . | indent 4 }}
rules:
Expand Down

0 comments on commit ca585ca

Please sign in to comment.