Skip to content

Commit

Permalink
Adds an overwrite flag to force annotation updates
Browse files Browse the repository at this point in the history
Issue: PGO-39
  • Loading branch information
Anthony Landreth committed Oct 24, 2023
1 parent 8267ab1 commit e58053e
Show file tree
Hide file tree
Showing 66 changed files with 8,358 additions and 5 deletions.
Binary file not shown.
1 change: 1 addition & 0 deletions docs/content/reference/pgo_backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pgo backup CLUSTER_NAME [flags]
```
-h, --help help for backup
--options stringArray options for taking a backup; can be used multiple times
--overwrite overwrite the backup label
--repoName string repoName to backup to
```

Expand Down
70 changes: 70 additions & 0 deletions hippo/configmaps/hippo-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
Object:
apiVersion: v1
data:
patroni.yaml: |
# Generated by postgres-operator. DO NOT EDIT.
# Your changes will not be saved.
ctl:
cacert: /etc/patroni/~postgres-operator/patroni.ca-roots
certfile: /etc/patroni/~postgres-operator/patroni.crt+key
insecure: false
keyfile: null
kubernetes:
labels:
postgres-operator.crunchydata.com/cluster: hippo
namespace: postgres-operator
role_label: postgres-operator.crunchydata.com/role
scope_label: postgres-operator.crunchydata.com/patroni
use_endpoints: true
postgresql:
authentication:
replication:
sslcert: /tmp/replication/tls.crt
sslkey: /tmp/replication/tls.key
sslmode: verify-ca
sslrootcert: /tmp/replication/ca.crt
username: _crunchyrepl
rewind:
sslcert: /tmp/replication/tls.crt
sslkey: /tmp/replication/tls.key
sslmode: verify-ca
sslrootcert: /tmp/replication/ca.crt
username: _crunchyrepl
restapi:
cafile: /etc/patroni/~postgres-operator/patroni.ca-roots
certfile: /etc/patroni/~postgres-operator/patroni.crt+key
keyfile: null
verify_client: optional
scope: hippo-ha
watchdog:
mode: "off"
kind: ConfigMap
metadata:
creationTimestamp: "2023-10-24T14:46:06Z"
labels:
postgres-operator.crunchydata.com/cluster: hippo
managedFields:
- apiVersion: v1
fieldsType: FieldsV1
fieldsV1:
f:data:
f:patroni.yaml: {}
f:metadata:
f:labels:
f:postgres-operator.crunchydata.com/cluster: {}
f:ownerReferences:
k:{"uid":"a31f2445-8830-4fd2-9349-189b07307cd2"}: {}
manager: postgrescluster-controller
operation: Apply
time: "2023-10-24T14:46:15Z"
name: hippo-config
namespace: postgres-operator
ownerReferences:
- apiVersion: postgres-operator.crunchydata.com/v1beta1
blockOwnerDeletion: true
controller: true
kind: PostgresCluster
name: hippo
uid: a31f2445-8830-4fd2-9349-189b07307cd2
resourceVersion: "2956368"
uid: ad4d594b-d1e1-4ea6-97f1-37a0d15def4b
58 changes: 58 additions & 0 deletions hippo/configmaps/hippo-instance1-v7r2-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Object:
apiVersion: v1
data:
patroni.yaml: |
# Generated by postgres-operator. DO NOT EDIT.
# Your changes will not be saved.
kubernetes: {}
postgresql:
basebackup:
- waldir=/pgdata/pg15_wal
create_replica_methods:
- pgbackrest
- basebackup
pgbackrest:
command: '''bash'' ''-ceu'' ''--'' ''install --directory --mode=0700 "${PGDATA?}"
&& exec "$@"'' ''-'' ''pgbackrest'' ''restore'' ''--delta'' ''--stanza=db''
''--repo=1'' ''--link-map=pg_wal=/pgdata/pg15_wal'' ''--type=standby'''
keep_data: true
no_master: true
no_params: true
pgpass: /tmp/.pgpass
use_unix_socket: true
restapi: {}
tags: {}
kind: ConfigMap
metadata:
creationTimestamp: "2023-10-24T14:46:06Z"
labels:
postgres-operator.crunchydata.com/cluster: hippo
postgres-operator.crunchydata.com/instance: hippo-instance1-v7r2
postgres-operator.crunchydata.com/instance-set: instance1
managedFields:
- apiVersion: v1
fieldsType: FieldsV1
fieldsV1:
f:data:
f:patroni.yaml: {}
f:metadata:
f:labels:
f:postgres-operator.crunchydata.com/cluster: {}
f:postgres-operator.crunchydata.com/instance: {}
f:postgres-operator.crunchydata.com/instance-set: {}
f:ownerReferences:
k:{"uid":"a31f2445-8830-4fd2-9349-189b07307cd2"}: {}
manager: postgrescluster-controller
operation: Apply
time: "2023-10-24T14:49:05Z"
name: hippo-instance1-v7r2-config
namespace: postgres-operator
ownerReferences:
- apiVersion: postgres-operator.crunchydata.com/v1beta1
blockOwnerDeletion: true
controller: true
kind: PostgresCluster
name: hippo
uid: a31f2445-8830-4fd2-9349-189b07307cd2
resourceVersion: "2956513"
uid: 8603fa7b-44a3-4086-8382-ca0d1067196b
92 changes: 92 additions & 0 deletions hippo/configmaps/hippo-pgbackrest-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
Object:
apiVersion: v1
data:
config-hash: 65bb57b6b5
pgbackrest-server.conf: |
# Generated by postgres-operator. DO NOT EDIT.
# Your changes will not be saved.
[global]
tls-server-address = 0.0.0.0
tls-server-auth = pgbackrest@a31f2445-8830-4fd2-9349-189b07307cd2=*
tls-server-ca-file = /etc/pgbackrest/conf.d/~postgres-operator/tls-ca.crt
tls-server-cert-file = /etc/pgbackrest/server/server-tls.crt
tls-server-key-file = /etc/pgbackrest/server/server-tls.key
[global:server]
log-level-console = detail
log-level-file = off
log-level-stderr = error
log-timestamp = n
pgbackrest_instance.conf: |
# Generated by postgres-operator. DO NOT EDIT.
# Your changes will not be saved.
[global]
log-path = /pgdata/pgbackrest/log
repo1-host = hippo-repo-host-0.hippo-pods.postgres-operator.svc.cluster.local.
repo1-host-ca-file = /etc/pgbackrest/conf.d/~postgres-operator/tls-ca.crt
repo1-host-cert-file = /etc/pgbackrest/conf.d/~postgres-operator/client-tls.crt
repo1-host-key-file = /etc/pgbackrest/conf.d/~postgres-operator/client-tls.key
repo1-host-type = tls
repo1-host-user = postgres
repo1-path = /pgbackrest/repo1
[db]
pg1-path = /pgdata/pg15
pg1-port = 5432
pg1-socket-path = /tmp/postgres
pgbackrest_repo.conf: |
# Generated by postgres-operator. DO NOT EDIT.
# Your changes will not be saved.
[global]
log-path = /pgbackrest/repo1/log
repo1-path = /pgbackrest/repo1
[db]
pg1-host = hippo-instance1-v7r2-0.hippo-pods.postgres-operator.svc.cluster.local.
pg1-host-ca-file = /etc/pgbackrest/conf.d/~postgres-operator/tls-ca.crt
pg1-host-cert-file = /etc/pgbackrest/conf.d/~postgres-operator/client-tls.crt
pg1-host-key-file = /etc/pgbackrest/conf.d/~postgres-operator/client-tls.key
pg1-host-type = tls
pg1-path = /pgdata/pg15
pg1-port = 5432
pg1-socket-path = /tmp/postgres
kind: ConfigMap
metadata:
creationTimestamp: "2023-10-24T14:46:06Z"
labels:
postgres-operator.crunchydata.com/cluster: hippo
postgres-operator.crunchydata.com/pgbackrest: ""
postgres-operator.crunchydata.com/pgbackrest-config: ""
managedFields:
- apiVersion: v1
fieldsType: FieldsV1
fieldsV1:
f:data:
f:config-hash: {}
f:pgbackrest-server.conf: {}
f:pgbackrest_instance.conf: {}
f:pgbackrest_repo.conf: {}
f:metadata:
f:labels:
f:postgres-operator.crunchydata.com/cluster: {}
f:postgres-operator.crunchydata.com/pgbackrest: {}
f:postgres-operator.crunchydata.com/pgbackrest-config: {}
f:ownerReferences:
k:{"uid":"a31f2445-8830-4fd2-9349-189b07307cd2"}: {}
manager: postgrescluster-controller
operation: Apply
time: "2023-10-24T14:46:06Z"
name: hippo-pgbackrest-config
namespace: postgres-operator
ownerReferences:
- apiVersion: postgres-operator.crunchydata.com/v1beta1
blockOwnerDeletion: true
controller: true
kind: PostgresCluster
name: hippo
uid: a31f2445-8830-4fd2-9349-189b07307cd2
resourceVersion: "2956277"
uid: 37b72e74-d4eb-4c5b-8a67-aa91a44f532a
4 changes: 4 additions & 0 deletions hippo/configmaps/list
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NAME AGE
hippo-pgbackrest-config 5h43m
hippo-config 5h43m
hippo-instance1-v7r2-config 5h43m
1 change: 1 addition & 0 deletions hippo/current-context
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default
29 changes: 29 additions & 0 deletions hippo/current-namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"v1","kind":"Namespace","metadata":{"annotations":{},"name":"postgres-operator"}}
creationTimestamp: "2023-10-24T14:46:03Z"
labels:
kubernetes.io/metadata.name: postgres-operator
managedFields:
- apiVersion: v1
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
.: {}
f:kubectl.kubernetes.io/last-applied-configuration: {}
f:labels:
.: {}
f:kubernetes.io/metadata.name: {}
manager: kubectl-client-side-apply
operation: Update
time: "2023-10-24T14:46:03Z"
name: postgres-operator
resourceVersion: "2956184"
uid: 53364f6e-c823-4769-99a1-e5a6b5635427
spec:
finalizers:
- kubernetes
status:
phase: Active
36 changes: 36 additions & 0 deletions hippo/endpoints/hippo-ha-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Object:
apiVersion: v1
kind: Endpoints
metadata:
annotations:
config: '{"loop_wait":10,"postgresql":{"parameters":{"archive_command":"pgbackrest
--stanza=db archive-push \"%p\"","archive_mode":"on","archive_timeout":"60s","huge_pages":"off","jit":"off","password_encryption":"scram-sha-256","restore_command":"pgbackrest
--stanza=db archive-get %f \"%p\"","shared_preload_libraries":"pgaudit","ssl":"on","ssl_ca_file":"/pgconf/tls/ca.crt","ssl_cert_file":"/pgconf/tls/tls.crt","ssl_key_file":"/pgconf/tls/tls.key","unix_socket_directories":"/tmp/postgres","wal_level":"logical"},"pg_hba":["local
all \"postgres\" peer","hostssl replication \"_crunchyrepl\" all cert","hostssl
\"postgres\" \"_crunchyrepl\" all cert","host all \"_crunchyrepl\" all reject","hostssl
all all all md5"],"use_pg_rewind":true,"use_slots":false},"ttl":30}'
initialize: "7293536393753555028"
creationTimestamp: "2023-10-24T14:46:12Z"
labels:
postgres-operator.crunchydata.com/cluster: hippo
postgres-operator.crunchydata.com/patroni: hippo-ha
managedFields:
- apiVersion: v1
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
.: {}
f:config: {}
f:initialize: {}
f:labels:
.: {}
f:postgres-operator.crunchydata.com/cluster: {}
f:postgres-operator.crunchydata.com/patroni: {}
manager: Patroni
operation: Update
time: "2023-10-24T14:46:14Z"
name: hippo-ha-config
namespace: postgres-operator
resourceVersion: "2956362"
uid: 4d436f2e-c8c8-4658-b090-750f761e0fee
55 changes: 55 additions & 0 deletions hippo/endpoints/hippo-ha.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Object:
apiVersion: v1
kind: Endpoints
metadata:
annotations:
acquireTime: "2023-10-24T14:46:14.971316+00:00"
leader: hippo-instance1-v7r2-0
optime: "452984928"
renewTime: "2023-10-24T20:29:44.876736+00:00"
transitions: "0"
ttl: "30"
creationTimestamp: "2023-10-24T14:46:15Z"
labels:
postgres-operator.crunchydata.com/cluster: hippo
postgres-operator.crunchydata.com/patroni: hippo-ha
managedFields:
- apiVersion: v1
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
.: {}
f:acquireTime: {}
f:leader: {}
f:optime: {}
f:renewTime: {}
f:transitions: {}
f:ttl: {}
f:labels:
.: {}
f:postgres-operator.crunchydata.com/cluster: {}
f:postgres-operator.crunchydata.com/patroni: {}
f:subsets: {}
manager: Patroni
operation: Update
time: "2023-10-24T20:29:44Z"
name: hippo-ha
namespace: postgres-operator
resourceVersion: "2990074"
uid: 45f99079-86ac-491d-b036-987a89fe9499
subsets:
- addresses:
- hostname: hippo-instance1-v7r2-0
ip: 10.42.0.22
nodeName: phi-machina
targetRef:
kind: Pod
name: hippo-instance1-v7r2-0
namespace: postgres-operator
resourceVersion: "2956365"
uid: 34c0c081-7864-4e93-a539-6c6790e08343
ports:
- name: postgres
port: 5432
protocol: TCP
Loading

0 comments on commit e58053e

Please sign in to comment.