From e5e2812ed52677d8b54e4ca97d0e74f85263cce8 Mon Sep 17 00:00:00 2001 From: alexlebens Date: Sat, 13 Apr 2024 02:46:38 -0600 Subject: [PATCH] remove chart as functionality is now included in postgres-cluster chart --- charts/postgres-cluster-upgrade/Chart.yaml | 14 ---- charts/postgres-cluster-upgrade/README.md | 19 ------ .../templates/backup.yaml | 17 ----- .../templates/postgresql-cluster.yaml | 68 ------------------- charts/postgres-cluster-upgrade/values.yaml | 37 ---------- 5 files changed, 155 deletions(-) delete mode 100644 charts/postgres-cluster-upgrade/Chart.yaml delete mode 100644 charts/postgres-cluster-upgrade/README.md delete mode 100644 charts/postgres-cluster-upgrade/templates/backup.yaml delete mode 100644 charts/postgres-cluster-upgrade/templates/postgresql-cluster.yaml delete mode 100644 charts/postgres-cluster-upgrade/values.yaml diff --git a/charts/postgres-cluster-upgrade/Chart.yaml b/charts/postgres-cluster-upgrade/Chart.yaml deleted file mode 100644 index d23f341..0000000 --- a/charts/postgres-cluster-upgrade/Chart.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v2 -name: postgres-cluster-upgrade -version: 0.1.2 -description: Chart for upgrading a cloudnative-pg cluster in the same namespace -keywords: - - database - - postgres - - upgrade -sources: - - https://github.com/cloudnative-pg/cloudnative-pg -maintainers: - - name: alexlebens -icon: https://avatars.githubusercontent.com/u/100373852?s=48&v=4 -appVersion: v1.22.2 diff --git a/charts/postgres-cluster-upgrade/README.md b/charts/postgres-cluster-upgrade/README.md deleted file mode 100644 index 033663b..0000000 --- a/charts/postgres-cluster-upgrade/README.md +++ /dev/null @@ -1,19 +0,0 @@ -## Introduction - -[CloudNative PG](https://github.com/cloudnative-pg/cloudnative-pg) - -CloudNativePG is the Kubernetes operator that covers the full lifecycle of a highly available PostgreSQL database cluster with a primary/standby architecture, using native streaming replication. - -This chart bootstraps a [CNPG](https://github.com/cloudnative-pg/cloudnative-pg) cluster upgraade on a [Kubernetes](https://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. - -The process is designed to be used in conjunction with the [postgres-cluster](https://github.com/alexlebens/helm-charts/tree/main/charts/postgres-cluster) chart. The cluster in this chart connects to the orignal cluster, peforms an upgrade, then backups to the objectStore endpoint. Afterwards the upgrade cluster is removed and the orignal cluster bootstraps from the upgrade's backup. - -## Prerequisites - -- Kubernetes -- Helm -- CloudNative PG Operator - -## Parameters - -See the [values files](values.yaml). diff --git a/charts/postgres-cluster-upgrade/templates/backup.yaml b/charts/postgres-cluster-upgrade/templates/backup.yaml deleted file mode 100644 index 60391ae..0000000 --- a/charts/postgres-cluster-upgrade/templates/backup.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- if .Values.backup.inititeBackup }} -apiVersion: postgresql.cnpg.io/v1 -kind: Backup -metadata: - name: "postgresql-{{ .Release.Name }}-cluster-upgrade-backup" - namespace: {{ .Release.Namespace }} - labels: - app.kubernetes.io/name: "postgresql-{{ .Release.Name }}-cluster-upgrade-backup" - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/version: {{ .Chart.AppVersion }} - app.kubernetes.io/component: database - app.kubernetes.io/part-of: {{ .Release.Name }} -spec: - method: barmanObjectStore - cluster: - name: "postgresql-{{ .Release.Name }}-cluster-upgrade" -{{- end }} diff --git a/charts/postgres-cluster-upgrade/templates/postgresql-cluster.yaml b/charts/postgres-cluster-upgrade/templates/postgresql-cluster.yaml deleted file mode 100644 index 927ed95..0000000 --- a/charts/postgres-cluster-upgrade/templates/postgresql-cluster.yaml +++ /dev/null @@ -1,68 +0,0 @@ -apiVersion: postgresql.cnpg.io/v1 -kind: Cluster -metadata: - name: "postgresql-{{ .Release.Name }}-cluster-upgrade" - namespace: {{ .Release.Namespace }} - labels: - app.kubernetes.io/name: "postgresql-{{ .Release.Name }}-cluster-upgrade" - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/version: {{ .Chart.AppVersion }} - app.kubernetes.io/component: database - app.kubernetes.io/part-of: {{ .Release.Name }} -spec: - imageName: "{{ .Values.cluster.image.repository }}:{{ .Values.cluster.image.tag }}" - instances: {{ .Values.cluster.instances }} - affinity: - enablePodAntiAffinity: true - topologyKey: kubernetes.io/hostname - postgresql: - parameters: - {{- toYaml .Values.cluster.parameters | nindent 6 }} - resources: - {{- toYaml .Values.cluster.resources | nindent 4 }} - storage: - storageClass: {{ .Values.cluster.storage.data.storageClass }} - size: {{ .Values.cluster.storage.data.size }} - walStorage: - storageClass: {{ .Values.cluster.storage.wal.storageClass }} - size: {{ .Values.cluster.storage.wal.size }} - monitoring: - enablePodMonitor: true - - bootstrap: - initdb: - import: - type: {{ .Values.upgrade.importType }} - databases: - {{- toYaml .Values.upgrade.importDatabases | nindent 10 }} - source: - externalCluster: "postgresql-{{ .Release.Name }}-cluster" - externalClusters: - - name: "postgresql-{{ .Release.Name }}-cluster" - connectionParameters: - host: "postgresql-{{ .Release.Name }}-cluster-rw" - user: app - dbname: app - password: - name: "postgresql-{{ .Release.Name }}-cluster-app" - key: password - - {{- if .Values.backup.backupEnabled }} - backup: - retentionPolicy: "{{ .Values.backup.retentionPolicy }}" - barmanObjectStore: - destinationPath: "s3://{{ .Values.backup.bucket }}/{{ .Values.cluster.name }}/postgresql/{{ .Release.Name }}-cluster" - endpointURL: {{ .Values.backup.endpointURL }} - serverName: "postgresql-{{ .Release.Name }}-cluster-backup-index-{{ .Values.backup.backupIndex }}" - s3Credentials: - accessKeyId: - name: "postgresql-{{ .Release.Name }}-cluster-backup-secret" - key: ACCESS_KEY_ID - secretAccessKey: - name: "postgresql-{{ .Release.Name }}-cluster-backup-secret" - key: ACCESS_SECRET_KEY - data: - compression: {{ .Values.cluster.compression }} - wal: - compression: {{ .Values.cluster.compression }} - {{- end }} diff --git a/charts/postgres-cluster-upgrade/values.yaml b/charts/postgres-cluster-upgrade/values.yaml deleted file mode 100644 index 4c43b12..0000000 --- a/charts/postgres-cluster-upgrade/values.yaml +++ /dev/null @@ -1,37 +0,0 @@ -cluster: - name: - image: - repository: ghcr.io/cloudnative-pg/postgresql - tag: 16.2 - instances: 1 - parameters: - shared_buffers: 128MB - max_slot_wal_keep_size: 2000MB - hot_standby_feedback: "on" - compression: snappy - resources: - requests: - memory: 512Mi - cpu: 100m - limits: - memory: 2Gi - cpu: 1500m - hugepages-2Mi: 512Mi - storage: - data: - storageClass: - size: 10Gi - wal: - storageClass: - size: 2Gi -upgrade: - importType: microservice - importDatabases: - - app -backup: - backupEnabled: false - inititeBackup: false - retentionPolicy: 3d - backupIndex: 1 - endpointURL: - bucket: