diff --git a/cluster-tutorials/configure_users_and_databases/postgres.yaml b/cluster-tutorials/configure_users_and_databases/postgres.yaml index 42778b6..881cc3b 100644 --- a/cluster-tutorials/configure_users_and_databases/postgres.yaml +++ b/cluster-tutorials/configure_users_and_databases/postgres.yaml @@ -3,7 +3,7 @@ kind: postgresql metadata: name: cluster-1 spec: - dockerImage: 'docker.io/cybertecpostgresql/cybertec-pg-container:postgres-16.2-2-rc1' + dockerImage: 'docker.io/cybertecpostgresql/cybertec-pg-container:postgres-16.3-1-rc2' numberOfInstances: 1 postgresql: version: '16' @@ -17,8 +17,11 @@ spec: teamId: acid volume: size: 5Gi - users: - matrix: + users: + db_owner: - login - databases: - matrixdb: matrix + - createdb + appl_user: + - login + databases; + app_db: appl_user diff --git a/cluster-tutorials/high-availability-cluster/ha-postgres.yaml b/cluster-tutorials/high-availability-cluster/ha-postgres.yaml index 3f09934..a4a42c8 100644 --- a/cluster-tutorials/high-availability-cluster/ha-postgres.yaml +++ b/cluster-tutorials/high-availability-cluster/ha-postgres.yaml @@ -3,7 +3,7 @@ kind: postgresql metadata: name: ha-cluster-1 spec: - dockerImage: 'docker.io/cybertecpostgresql/cybertec-pg-container:postgres-16.2-2-rc1' + dockerImage: 'docker.io/cybertecpostgresql/cybertec-pg-container:postgres-16.3-1-rc2' numberOfInstances: 2 postgresql: version: '16' @@ -12,8 +12,8 @@ spec: cpu: 500m memory: 500Mi requests: - cpu: 100m - memory: 100Mi + cpu: 500m + memory: 500Mi teamId: acid volume: size: 5Gi diff --git a/cluster-tutorials/monitored_cluster/postgres.yaml b/cluster-tutorials/monitored_cluster/postgres.yaml index 5b870ca..65550f3 100644 --- a/cluster-tutorials/monitored_cluster/postgres.yaml +++ b/cluster-tutorials/monitored_cluster/postgres.yaml @@ -3,7 +3,7 @@ kind: postgresql metadata: name: cluster-1 spec: - dockerImage: 'docker.io/cybertecpostgresql/cybertec-pg-container:postgres-16.2-2-rc1' + dockerImage: 'docker.io/cybertecpostgresql/cybertec-pg-container:postgres-16.3-1-rc2' numberOfInstances: 1 postgresql: version: '16' @@ -12,11 +12,11 @@ spec: cpu: 500m memory: 500Mi requests: - cpu: 100m - memory: 100Mi + cpu: 500m + memory: 500Mi teamId: acid volume: size: 5Gi #storageClass: default-provisioner monitor: - image: docker.io/cybertecpostgresql/cybertec-pg-container:exporter-16.2-2-rc1 + image: docker.io/cybertecpostgresql/cybertec-pg-container:exporter-16.3-1-rc2' diff --git a/cluster-tutorials/pgbackrest_with_s3/postgres.yaml b/cluster-tutorials/pgbackrest_with_s3/postgres.yaml index d59c3c9..f55bf05 100644 --- a/cluster-tutorials/pgbackrest_with_s3/postgres.yaml +++ b/cluster-tutorials/pgbackrest_with_s3/postgres.yaml @@ -3,34 +3,34 @@ kind: postgresql metadata: name: cluster-1 spec: - dockerImage: 'docker.io/cybertecpostgresql/cybertec-pg-container:postgres-16.2-2-rc1' + dockerImage: 'docker.io/cybertecpostgresql/cybertec-pg-container:postgres-16.3-1-rc2' numberOfInstances: 1 postgresql: version: '16' resources: - limits: - cpu: 500m - memory: 500Mi - requests: - cpu: 100m - memory: 100Mi - teamId: acid - volume: - size: 5Gi + limits: + cpu: 500m + memory: 500Mi + requests: + cpu: 500m + memory: 500Mi + teamId: acid + volume: + size: 5Gi backup: - pgbackrest: - configuration: - secret: cluster-1-s3-credentials - global: - repo1-path: /YOUR_PATH_INSIDE_THE_BUCKET/repo1/ - repo1-retention-full: '7' - repo1-retention-full-type: count - image: docker.io/cybertecpostgresql/cybertec-pg-container:pgbackrest-16.2-2-rc1 - repos: - - endpoint: YOUR_S3_ENDPOINT - name: repo1 - region: YOUR_S3_REGION - resource: YOUR_BUCKET_NAME - schedule: - full: 30 2 * * * - storage: s3 \ No newline at end of file + pgbackrest: + configuration: + secret: cluster-1-s3-credentials + global: + repo1-path: /YOUR_PATH_INSIDE_THE_BUCKET/repo1/ + repo1-retention-full: '7' + repo1-retention-full-type: count + image: docker.io/cybertecpostgresql/cybertec-pg-container:pgbackrest-16.3-1-rc2 + repos: + - endpoint: YOUR_S3_ENDPOINT + name: repo1 + region: YOUR_S3_REGION + resource: YOUR_BUCKET_NAME + schedule: + full: 30 2 * * * + storage: s3 \ No newline at end of file diff --git a/cluster-tutorials/prepared_databases/postgres.yaml b/cluster-tutorials/prepared_databases/postgres.yaml index 56dc9e9..9539b11 100644 --- a/cluster-tutorials/prepared_databases/postgres.yaml +++ b/cluster-tutorials/prepared_databases/postgres.yaml @@ -3,21 +3,10 @@ kind: postgresql metadata: name: cluster-1 spec: - dockerImage: 'docker.io/cybertecpostgresql/cybertec-pg-container:postgres-16.2-2-rc1' + dockerImage: 'docker.io/cybertecpostgresql/cybertec-pg-container:postgres-16.3-1-rc2' numberOfInstances: 1 postgresql: version: '16' - preparedDatabases: - bar: - defaultUsers: true - extensions: - pg_partman: public - pgcrypto: public - schemas: - data: {} - history: - defaultRoles: true - defaultUsers: false resources: limits: cpu: 500m @@ -29,3 +18,13 @@ spec: volume: size: 5Gi #storageClass: default-provisioner + preparedDatabases: + appl_db: + defaultUsers: true + extensions: + dblink: public + schemas: + data: {} + history: + defaultRoles: true + defaultUsers: false diff --git a/cluster-tutorials/restore/postgres.yaml b/cluster-tutorials/restore/postgres.yaml new file mode 100644 index 0000000..232e0b4 --- /dev/null +++ b/cluster-tutorials/restore/postgres.yaml @@ -0,0 +1,40 @@ +apiVersion: cpo.opensource.cybertec.at/v1 +kind: postgresql +metadata: + name: cluster-1 +spec: + dockerImage: 'docker.io/cybertecpostgresql/cybertec-pg-container:postgres-16.3-1-rc2' + numberOfInstances: 1 + postgresql: + version: '16' + resources: + limits: + cpu: 500m + memory: 500Mi + requests: + cpu: 500m + memory: 500Mi + teamId: acid + volume: + size: 5Gi + backup: + pgbackrest: + configuration: + secret: cluster-1-pvc-configuration + global: + repo1-retention-full: '7' + repo1-retention-full-type: count + image: docker.io/cybertecpostgresql/cybertec-pg-container:pgbackrest-16.3-1-rc2 + repos: + - name: repo1 + schedule: + full: 30 2 * * * + storage: pvc + volume: + size: 10Gi + restore: + id: '1' + options: + type: 'immediate' + set: '20231215-111802F' + repo: '1' \ No newline at end of file diff --git a/cluster-tutorials/single-cluster/postgres.yaml b/cluster-tutorials/single-cluster/postgres.yaml index 7315789..2e3b602 100644 --- a/cluster-tutorials/single-cluster/postgres.yaml +++ b/cluster-tutorials/single-cluster/postgres.yaml @@ -3,7 +3,7 @@ kind: postgresql metadata: name: cluster-1 spec: - dockerImage: 'docker.io/cybertecpostgresql/cybertec-pg-container:postgres-16.2-2-rc1' + dockerImage: 'docker.io/cybertecpostgresql/cybertec-pg-container:postgres-16.3-1-rc2' numberOfInstances: 1 postgresql: version: '16' diff --git a/pgbackrest_with_pvc/kustomization.yaml b/pgbackrest_with_pvc/kustomization.yaml new file mode 100644 index 0000000..d097741 --- /dev/null +++ b/pgbackrest_with_pvc/kustomization.yaml @@ -0,0 +1,10 @@ +secretGenerator: +- name: cluster-1-pvc-configuration + files: + - pvc.configuration + +generatorOptions: + disableNameSuffixHash: true + +resources: +- postgres.yaml diff --git a/pgbackrest_with_pvc/postgres.yaml b/pgbackrest_with_pvc/postgres.yaml new file mode 100644 index 0000000..1255a86 --- /dev/null +++ b/pgbackrest_with_pvc/postgres.yaml @@ -0,0 +1,34 @@ +apiVersion: cpo.opensource.cybertec.at/v1 +kind: postgresql +metadata: + name: cluster-1 +spec: + dockerImage: 'docker.io/cybertecpostgresql/cybertec-pg-container:postgres-16.3-1-rc2' + numberOfInstances: 1 + postgresql: + version: '16' + resources: + limits: + cpu: 500m + memory: 500Mi + requests: + cpu: 500m + memory: 500Mi + teamId: acid + volume: + size: 5Gi + backup: + pgbackrest: + configuration: + secret: cluster-1-pvc-configuration + global: + repo1-retention-full: '7' + repo1-retention-full-type: count + image: docker.io/cybertecpostgresql/cybertec-pg-container:pgbackrest-16.3-1-rc2 + repos: + - name: repo1 + schedule: + full: 30 2 * * * + storage: pvc + volume: + size: 10Gi \ No newline at end of file diff --git a/pgbackrest_with_pvc/pvc.configuration b/pgbackrest_with_pvc/pvc.configuration new file mode 100644 index 0000000..cd10607 --- /dev/null +++ b/pgbackrest_with_pvc/pvc.configuration @@ -0,0 +1,2 @@ +[global] +repo1-cipher-pass=YOUR_ENCRYPTION_PASSPHRASE \ No newline at end of file diff --git a/setup/helm/operator/Chart.yaml b/setup/helm/operator/Chart.yaml index d86f9f3..c834a9b 100644 --- a/setup/helm/operator/Chart.yaml +++ b/setup/helm/operator/Chart.yaml @@ -4,5 +4,5 @@ name: postgres-operator description: Helm-Chart for setting up an instance of CYBERTEC's Postgres operator (CPO). appVersion: 0.7.0 -version: 0.7.0-rc1 +version: 0.7.0-rc2 # Note: Make sure you have defined the correct version, based on the crd used \ No newline at end of file diff --git a/setup/helm/operator/crds/postgresql.crd.yaml b/setup/helm/operator/crds/postgresql.crd.yaml index eb86c6b..b30932a 100644 --- a/setup/helm/operator/crds/postgresql.crd.yaml +++ b/setup/helm/operator/crds/postgresql.crd.yaml @@ -340,12 +340,6 @@ spec: type: object additionalProperties: type: string - monitor: - nullable: true - properties: - image: - type: string - type: object nodeAffinity: type: object properties: @@ -490,9 +484,6 @@ spec: version: type: string enum: - - "10" - - "11" - - "12" - "13" - "14" - "15" @@ -554,7 +545,7 @@ spec: memory: type: string # You can express memory as a plain integer or as a fixed-point - # integer using one of these + # integer using one of these suffixes: E, P, T, G, M, k. You can # also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki # # https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-memory @@ -621,6 +612,8 @@ spec: type: integer database: type: string + enableRecovery: + type: boolean filter: type: object additionalProperties: @@ -638,12 +631,8 @@ spec: type: string payloadColumn: type: string - tde: - nullable: true - properties: - enable: - type: boolean - type: object + recoveryEventType: + type: string teamId: type: string tls: @@ -789,28 +778,29 @@ spec: properties: secret: type: string - parameters: - additionalProperties: - type: string - type: object protection: type: object properties: restore: type: boolean + global: + type: object + additionalProperties: + type: string repos: type: array items: properties: name: type: string - pattern: ^repo[1-4] + pattern: ^repo[1-4]$ storage: type: string enum: - "s3" - "gcs" - "azure" + - "pvc" resource: type: string endpoint: @@ -826,6 +816,8 @@ spec: type: string diff: type: string + Pvcsize: + type: string required: - name - storage @@ -842,9 +834,10 @@ spec: type: string repo: type: string + pattern: ^repo[1-4]$ options: - type: array - items: + type: object + additionalProperties: type: string resources: type: object @@ -867,10 +860,10 @@ spec: memory: type: string pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$' - required: + required: - image - repos status: type: object additionalProperties: - type: string \ No newline at end of file + type: string diff --git a/setup/helm/operator/templates/operator-service-account-rbac-openshift.yaml b/setup/helm/operator/templates/operator-service-account-rbac-openshift.yaml index 22a2fc3..bb92db3 100644 --- a/setup/helm/operator/templates/operator-service-account-rbac-openshift.yaml +++ b/setup/helm/operator/templates/operator-service-account-rbac-openshift.yaml @@ -251,6 +251,12 @@ rules: - patch - update - watch +- apiGroups: + - "" + resources: + - pods/exec + verbs: + - create # to let Patroni create a headless service - apiGroups: - "" diff --git a/setup/helm/operator/templates/postgresql-operator-configuration.yaml b/setup/helm/operator/templates/postgresql-operator-configuration.yaml index 4e0cdd7..314e412 100644 --- a/setup/helm/operator/templates/postgresql-operator-configuration.yaml +++ b/setup/helm/operator/templates/postgresql-operator-configuration.yaml @@ -178,7 +178,7 @@ configuration: enable_team_superuser: false enable_teams_api: false # pam_configuration: "" - pam_role_name: zalandos + pam_role_name: cpo_pam # postgres_superuser_teams: # - postgres_superusers protected_role_names: diff --git a/setup/helm/operator/values.yaml b/setup/helm/operator/values.yaml index f58a968..16a7666 100644 --- a/setup/helm/operator/values.yaml +++ b/setup/helm/operator/values.yaml @@ -15,8 +15,8 @@ imagePullSecretNames: [] # Define the operator settings to add to the configmap operatorSettings: - operatorImage: 'docker.io/cybertecpostgresql/cybertec-pg-operator:v0.7.0-2-rc1' - postgresImage: 'docker.io/cybertecpostgresql/cybertec-pg-container:postgres-16.2-2-rc1' + operatorImage: 'docker.io/cybertecpostgresql/cybertec-pg-operator:v0.7.0-1-rc2' + postgresImage: 'docker.io/cybertecpostgresql/cybertec-pg-container:postgres-16.3-1-rc2' watched_namespace: '*' enable_pod_antiaffinity: 'true' operator_namespace: 'cpo' diff --git a/setup/monitoring.zip b/setup/monitoring.zip new file mode 100644 index 0000000..5e177cd Binary files /dev/null and b/setup/monitoring.zip differ