Skip to content

Commit

Permalink
Merge pull request #329 from percona/K8SPG-585-namespace
Browse files Browse the repository at this point in the history
K8SPG-585 - PG - Add namespace to templates
  • Loading branch information
tplavcic authored May 29, 2024
2 parents aff2f58 + 69f840f commit 4d24385
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/pg-db/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: pg-db
description: 'A Helm chart to deploy the PostgreSQL database with the Percona Operator for PostgreSQL'
type: application
version: 2.3.17
version: 2.3.18
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-db/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ metadata:
finalizers:
{{ .Values.finalizers | toYaml | indent 4 }}
name: {{ include "pg-database.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
crVersion: {{ .Values.crVersion }}
image: {{ include "pg-database.postgres-image" . }}
Expand Down
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 4d24385

Please sign in to comment.