Skip to content

Commit 09c09fc

Browse files
committed
Update-Helm-Chart
1 parent cf5ec6f commit 09c09fc

9 files changed

Lines changed: 351 additions & 14 deletions

File tree

setup/helm/operator/templates/postgres-operator.yaml renamed to setup/helm/operator/templates/deployment_postgres-operator.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,8 @@ spec:
3939
readOnlyRootFilesystem: true
4040
allowPrivilegeEscalation: false
4141
env:
42-
# provided additional ENV vars can overwrite individual config map entries
43-
#- name: CONFIG_MAP_NAME
44-
# value: "postgres-operator"
45-
# In order to use the CRD OperatorConfiguration instead, uncomment these lines and comment out the two lines above
4642
- name: POSTGRES_OPERATOR_CONFIGURATION_OBJECT
4743
value: postgresql-operator-configuration
48-
# Define an ID to isolate controllers from each other
49-
# - name: CONTROLLER_ID
50-
# value: "second-operator"
5144
{{- if .Values.operatorSettings.enableJsonLogging }}
5245
- name: ENABLE_JSON_LOGGING
5346
value: "true"

setup/helm/operator/templates/postgresql-operator-configuration.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ configuration:
111111
'
112112
{{- end }}
113113
# pod_service_account_role_binding_definition: ""
114-
pod_terminate_grace_period: {{ .Values.configKubernetes.pod_terminate_grace_period }}
114+
pod_terminate_grace_period: "{{ .Values.configKubernetes.pod_terminate_grace_period }}"
115115
secret_name_template: "{username}.{cluster}.credentials.{tprkind}.{tprgroup}"
116116
spilo_allow_privilege_escalation: {{ .Values.securityContext.allow_privilege_escalation }}
117117
container_readonly_root_filesystem: {{ .Values.securityContext.readonly_root_filesystem }}
@@ -124,7 +124,7 @@ configuration:
124124
# key: db-only
125125
# operator: Exists
126126
# effect: NoSchedule
127-
watched_namespace: {{ .Values.operatorSettings.watched_namespace }}
127+
watched_namespace: '{{ .Values.operatorSettings.watched_namespace }}'
128128
postgres_pod_resources:
129129
default_cpu_limit: "1"
130130
default_cpu_request: 100m
@@ -152,9 +152,9 @@ configuration:
152152
enable_master_pooler_load_balancer: {{ .Values.configLoadBalancer.enable_master_pooler_load_balancer }}
153153
enable_replica_load_balancer: {{ .Values.configLoadBalancer.enable_replica_load_balancer }}
154154
enable_replica_pooler_load_balancer: {{ .Values.configLoadBalancer.enable_replica_pooler_load_balancer }}
155-
external_traffic_policy: {{ .Values.configLoadBalancer.external_traffic_policy }}
156-
master_dns_name_format: {{ .Values.configLoadBalancer.master_dns_name_format }}
157-
replica_dns_name_format: {{ .Values.configLoadBalancer.replica_dns_name_format }}
155+
external_traffic_policy: '{{ .Values.configLoadBalancer.external_traffic_policy }}'
156+
master_dns_name_format: '{{ .Values.configLoadBalancer.master_dns_name_format }}'
157+
replica_dns_name_format: '{{ .Values.configLoadBalancer.replica_dns_name_format }}'
158158
aws_or_gcp:
159159
# additional_secret_mount: "some-secret-name"
160160
# additional_secret_mount_path: "/some/dir"

setup/helm/operator/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ imagePullSecretNames: []
77

88
# Define the operator settings to add to the configmap
99
operatorSettings:
10-
operatorImage: 'docker.io/cybertecpostgresql/cybertec-pg-operator:v0.9.0-1'
10+
operatorImage: 'docker.io/cybertecpostgresql/cybertec-pg-operator:v0.9.1-1'
1111
postgresImage: 'containers.cybertec.at/cybertec-pg-container/postgres:rocky9-18.1-2'
1212
poolerImage: 'containers.cybertec.at/cybertec-pg-container/pgbouncer:rocky9-1.25.0-2'
1313
watched_namespace: '*' # Defines whether cpo monitors all namespaces (“*”) or a specific one (for example, “cpo”).
@@ -24,7 +24,7 @@ configKubernetes:
2424
enable_pod_antiaffinity: 'true'
2525
enable_pod_disruption_budget: 'true'
2626
enable_readiness_probe: 'true'
27-
enable_liveness_probe: 'true'
27+
enable_liveness_probe: 'false'
2828
pod_terminate_grace_period: '5m'
2929

3030
configLoadBalancer:
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v2
2+
name: postgres-cluster
3+
description: Deploys a PostgreSQL cluster using the PostgreSQL operator
4+
5+
type: application
6+
version: 0.9.1
7+
8+
appVersion: "0.9.1"
9+
10+
maintainers:
11+
- name: CYBERTEC PostgreSQL International GmbH
12+
email: info@cybertec.at
13+
14+
sources:
15+
- https://github.com/cybertec-postgresql/cybertec-pg-operator
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Database cluster object has been created and the operator should start initializing it now.
2+
3+
To wait for the initialization to complete you can issue the following command:
4+
5+
kubectl wait --for=jsonpath='.status.PostgresClusterStatus'=Running -n {{ .Release.Namespace }} pg/{{ .Release.Name }} --timeout=1h
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "postgres-cluster.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "postgres-cluster.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "postgres-cluster.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "postgres-cluster.labels" -}}
37+
helm.sh/chart: {{ include "postgres-cluster.chart" . }}
38+
{{- if .Chart.AppVersion }}
39+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
40+
{{- end }}
41+
app.kubernetes.io/managed-by: {{ .Release.Service }}
42+
{{- end }}
43+
44+
{{/*
45+
Selector labels
46+
*/}}
47+
{{- define "postgres-cluster.selectorLabels" -}}
48+
app.kubernetes.io/name: {{ include "postgres-cluster.name" . }}
49+
app.kubernetes.io/instance: {{ .Release.Name }}
50+
{{- end }}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: cpo.opensource.cybertec.at/v1
2+
kind: postgresql
3+
metadata:
4+
name: {{ .Values.clusterName | default .Release.Name }}
5+
namespace: {{ .Release.Namespace }}
6+
labels:
7+
{{- include "postgres-cluster.labels" . | nindent 4 }}
8+
{{- with .Values.commonLabels }}
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
11+
{{- with .Values.extraAnnotations }}
12+
annotations:
13+
{{- toYaml . | nindent 4 }}
14+
{{- end}}
15+
16+
spec:
17+
{{- toYaml .Values.cluster | nindent 2 }}

0 commit comments

Comments
 (0)