Skip to content

Commit

Permalink
feat: support PG4K namespaces installations
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Cecchi <[email protected]>
  • Loading branch information
leonardoce committed Mar 25, 2024
1 parent d676968 commit fc723eb
Show file tree
Hide file tree
Showing 5 changed files with 410 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,25 @@ edb-pg4k-edb-postgres-for-kubernetes 1/1 1 1 11s
Once it is ready, you can verify that you can deploy the sample cluster
suggested by the helm chart.

### TODO: document how to restrict the permissions to just one namespace

```console
helm upgrade --install edb-pg4k \
--namespace postgresql-operator-system \
--create-namespace \
./charts/edb-postgres-for-kubernetes
```


```console
helm upgrade --install edb-pg4k \
--namespace postgresql-operator-system \
--create-namespace \
--set config.scope.clusterWide=false \
./charts/edb-postgres-for-kubernetes
```


### Deploying EDB Postgres for Kubernetes (PG4K) operator from EDB's private registry

By default, PG4K will be deployed using [images publicly hosted on Quay.io](https://quay.io/repository/enterprisedb/cloud-native-postgresql),
Expand Down
6 changes: 6 additions & 0 deletions charts/edb-postgres-for-kubernetes/templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
data:
{{- if .Values.config.scope.clusterWide -}}
{{- toYaml .Values.config.data | nindent 2 }}
{{- else -}}
{{- $watchNamespaceMap := dict "WATCH_NAMESPACE" .Release.Namespace -}}
{{- $fullConfiguration := merge .Values.config.data $watchNamespaceMap -}}
{{- toYaml $fullConfiguration | nindent 2 }}
{{- end -}}
{{- end }}
{{- else -}}
apiVersion: v1
Expand Down
4 changes: 4 additions & 0 deletions charts/edb-postgres-for-kubernetes/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ spec:
fieldPath: metadata.namespace
- name: MONITORING_QUERIES_CONFIGMAP
value: "{{ .Values.monitoringQueriesConfigMap.name }}"
{{ if not .Values.config.scope.clusterWide -}}
- name: WATCH_NAMESPACE
value: "{{ .Release.Namespace }}"
{{- end }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
livenessProbe:
Expand Down
Loading

0 comments on commit fc723eb

Please sign in to comment.