diff --git a/LICENSE.md b/LICENSE.md index 90fe0562e2..f8ebe3dacd 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -176,7 +176,7 @@ END OF TERMS AND CONDITIONS - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Makefile b/Makefile index d4d51e2873..14fb0c4c46 100644 --- a/Makefile +++ b/Makefile @@ -9,9 +9,9 @@ PGO_CMD ?= kubectl PGO_IMAGE_PREFIX ?= crunchydata PGO_IMAGE_TAG ?= $(PGO_BASEOS)-$(PGO_VERSION) PGO_OPERATOR_NAMESPACE ?= pgo -PGO_VERSION ?= 4.4.0 +PGO_VERSION ?= 4.4.3 PGO_PG_VERSION ?= 12 -PGO_PG_FULLVERSION ?= 12.3 +PGO_PG_FULLVERSION ?= 12.6 PGO_BACKREST_VERSION ?= 2.27 RELTMPDIR=/tmp/release.$(PGO_VERSION) diff --git a/README.md b/README.md index 9d14b031ed..3e3a4c5c4b 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,22 @@ -

Crunchy Data PostgreSQL Operator

+

PGO: The Postgres Operator from Crunchy Data

- Crunchy Data + PGO: The Postgres Operator from Crunchy Data

[![Go Report Card](https://goreportcard.com/badge/github.com/CrunchyData/postgres-operator)](https://goreportcard.com/report/github.com/CrunchyData/postgres-operator) -# Run your own production-grade PostgreSQL-as-a-Service on Kubernetes! +# Run Cloud Native PostgreSQL on Kubernetes with PGO: The Postgres Operator from Crunchy Data! -The [Crunchy PostgreSQL Operator](https://access.crunchydata.com/documentation/postgres-operator/) automates and simplifies deploying and managing open source PostgreSQL clusters on Kubernetes and other Kubernetes-enabled Platforms by providing the essential features you need to keep your PostgreSQL clusters up and running, including: +[PGO][documentation], the [Postgres Operator][documentation] developed by +[Crunchy Data](https://crunchydata.com/) and included in [Crunchy PostgreSQL for Kubernetes](https://www.crunchydata.com/products/crunchy-postgresql-for-kubernetes/), automates and simplifies deploying and managing open source +PostgreSQL clusters on Kubernetes. -#### PostgreSQL Cluster Provisioning +Whether you need to get a simple Postgres cluster up and running, need to deploy +a high availability, fault tolerant cluster in production, or are running your +own database-as-a-service, the PostgreSQL Operator provides the essential +features you need to keep your cloud native Postgres clusters healthy, including: + +#### Postgres Cluster [Provisioning][provisioning] [Create, Scale, & Delete PostgreSQL clusters with ease](https://access.crunchydata.com/documentation/postgres-operator/latest/architecture/provisioning/), while fully customizing your Pods and PostgreSQL configuration! @@ -25,7 +32,8 @@ Backups and restores leverage the open source [pgBackRest](https://www.pgbackres #### TLS -Secure communication between your applications and data servers by [enabling TLS for your PostgreSQL servers](https://access.crunchydata.com/documentation/postgres-operator/latest/pgo-client/common-tasks/#enable-tls), including the ability to enforce that all of your connections to use TLS. +Secure communication between your applications and data servers by [enabling TLS for your PostgreSQL servers][pgo-task-tls], +including the ability to enforce all of your connections to use TLS. #### Monitoring @@ -65,16 +73,22 @@ Choose the type of backup (full, incremental, differential) and [how frequently #### Multi-Namespace Support -You can control how the PostgreSQL Operator leverages [Kubernetes Namespaces](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/) with several different deployment models: +You can control how PGO, the Postgres Operator, leverages [Kubernetes Namespaces][k8s-namespaces] with several different deployment models: -- Deploy the PostgreSQL Operator and all PostgreSQL clusters to the same namespace -- Deploy the PostgreSQL Operator to one namespaces, and all PostgreSQL clusters to a different namespace -- Deploy the PostgreSQL Operator to one namespace, and have your PostgreSQL clusters managed acrossed multiple namespaces -- Dynamically add and remove namespaces managed by the PostgreSQL Operator using the `pgo create namespace` and `pgo delete namespace` commands +- Deploy PGO and all PostgreSQL clusters to the same namespace +- Deploy PGO to one namespaces, and all PostgreSQL clusters to a different +namespace +- Deploy PGO to one namespace, and have your PostgreSQL clusters managed across +multiple namespaces +- Dynamically add and remove namespaces managed by the PostgreSQL Operator using +the `pgo` client to run `pgo create namespace` and `pgo delete namespace` #### Full Customizability -The Crunchy PostgreSQL Operator makes it easy to get your own PostgreSQL-as-a-Service up and running on Kubernetes-enabled platforms, but we know that there are further customizations that you can make. As such, the Crunchy PostgreSQL Operator allows you to further customize your deployments, including: +The Postgres Operator (PGO) makes it easy to get Postgres up and running on +Kubernetes-enabled platforms, but we know that there are further customizations +that you can make. As such, PGO allows you to further customize your +deployments, including: - Selecting different storage classes for your primary, replica, and backup storage - Select your own container resources class for each PostgreSQL cluster deployment; differentiate between resources applied for primary and replica clusters! @@ -83,52 +97,84 @@ The Crunchy PostgreSQL Operator makes it easy to get your own PostgreSQL-as-a-Se - Bring your own trusted certificate authority (CA) for use with the Operator API server - Override your PostgreSQL configuration for each cluster +[disaster-recovery]: https://access.crunchydata.com/documentation/postgres-operator/latest/architecture/disaster-recovery/ +[disaster-recovery-s3]: https://access.crunchydata.com/documentation/postgres-operator/latest/architecture/disaster-recovery/#using-s3 +[disaster-recovery-scheduling]: https://access.crunchydata.com/documentation/postgres-operator/latest/architecture/disaster-recovery/#scheduling-backups +[high-availability]: https://access.crunchydata.com/documentation/postgres-operator/latest/architecture/high-availability/ +[high-availability-sync]: https://access.crunchydata.com/documentation/postgres-operator/latest/architecture/high-availability/#synchronous-replication-guarding-against-transactions-loss +[monitoring]: https://access.crunchydata.com/documentation/postgres-operator/latest/architecture/monitoring/ +[multiple-cluster]: https://access.crunchydata.com/documentation/postgres-operator/latest/architecture/high-availability/multi-cluster-kubernetes/ +[pgo-create-cluster]: https://access.crunchydata.com/documentation/postgres-operator/latest/pgo-client/reference/pgo_create_cluster/ +[pgo-task-tls]: https://access.crunchydata.com/documentation/postgres-operator/latest/pgo-client/common-tasks/#enable-tls +[provisioning]: https://access.crunchydata.com/documentation/postgres-operator/latest/architecture/provisioning/ + +[k8s-anti-affinity]: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity +[k8s-namespaces]: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ +[k8s-nodes]: https://kubernetes.io/docs/concepts/architecture/nodes/ + +[pgBackRest]: https://www.pgbackrest.org +[pgBouncer]: https://access.crunchydata.com/documentation/pgbouncer/ +[pgMonitor]: https://github.com/CrunchyData/pgmonitor + + ## Deployment Requirements -The PostgreSQL Operator is validated for deployment on Kubernetes, OpenShift, and VMware Enterprise PKS clusters. Some form of storage is required, NFS, hostPath, and Storage Classes are currently supported. +PGO, the Postgres Operator, is validated for deployment on Kubernetes, +OpenShift, GKE, Anthos, AKS, EKS, and VMware Tanzu clusters. PGO is cloud native +and storage agnostic, working with a wide variety of storage classes, hostPath, +and NFS. -The PostgreSQL Operator includes various components that get deployed to your -Kubernetes cluster as shown in the following diagram and detailed -in the Design section of the documentation for the version you are running. +PGO includes various components that get deployed to your Kubernetes cluster as +shown in the following diagram and detailed in the Design section of the +documentation for the version you are running. ![Reference](https://access.crunchydata.com/documentation/postgres-operator/latest/Operator-Architecture.png) -The PostgreSQL Operator is developed and tested on CentOS and RHEL linux platforms but is known to run on other Linux variants. +PGO is developed and tested on CentOS and RHEL linux platforms but is known to +run on other Linux variants. ### Supported Platforms -The Crunchy PostgreSQL Operator is tested on the following Platforms: +PGO, the Postgres Operator, is Kubernetes-native and maintains backwards +compatibility to Kubernetes 1.11 and is tested is tested against the following +platforms: - Kubernetes 1.13+ - OpenShift 3.11+ - Google Kubernetes Engine (GKE), including Anthos -- VMware Enterprise PKS 1.3+ - -### Storage +- Amazon EKS +- Microsoft AKS +- VMware Tanzu -The Crunchy PostgreSQL Operator is tested with a variety of different types of Kubernetes storage and Storage Classes, including: +This list only includes the platforms that the Postgres Operator is specifically +tested on as part of the release process: PGO works on other Kubernetes +distributions as well. -- Google Compute Engine persistent volumes -- HostPath -- NFS -- Rook -- StorageOS +### Storage -and more. +PGO, the Postgres Operator, is tested with a variety of different types of +Kubernetes storage and Storage Classes, as well as hostPath and NFS. -We know there are a variety of different types of [Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/) available for Kubernetes and we do our best to test each one, but due to the breadth of this area we are unable to verify PostgreSQL Operator functionality in each one. With that said, the PostgreSQL Operator is designed to be storage class agnostic and has been demonstrated to work with additional Storage Classes. +We know there are a variety of different types of [Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/) +available for Kubernetes and we do our best to test each one, but due to the +breadth of this area we are unable to verify Postgres Operator functionality in +each one. With that said, the PostgreSQL Operator is designed to be storage +class agnostic and has been demonstrated to work with additional Storage +Classes. ## Installation -### PostgreSQL Operator Installation +### Postgres Operator (PGO) Installation -The PostgreSQL Operator provides a few different methods for installation based on your use case. +PGO provides a few different methods for installation methods to get up and +running with cloud native Postgres. -Based on your storage settings in your Kubernetes environment, you may be able to start as quickly as: +Based on your storage settings in your Kubernetes environment, you may be able +to start as quickly as: ```shell kubectl create namespace pgo -kubectl apply -f https://raw.githubusercontent.com/CrunchyData/postgres-operator/v4.4.0/installers/kubectl/postgres-operator.yml +kubectl apply -f https://raw.githubusercontent.com/CrunchyData/postgres-operator/v4.4.3/installers/kubectl/postgres-operator.yml ``` Otherwise, we highly recommend following the instructions from our [Quickstart](https://access.crunchydata.com/documentation/postgres-operator/latest/quickstart/). @@ -143,22 +189,61 @@ Installations methods include: ### `pgo` Client Installation -If you have the PostgreSQL Operator installed in your environment, and are interested in installation of the client interface, please start here: +If you have the Postgres Operator installed in your environment, and are interested in installation of the client interface, please start here: - [pgo Client Install](https://access.crunchydata.com/documentation/postgres-operator/latest/installation/pgo-client/) There is also a `pgo-client` container if you wish to deploy the client directly to your Kubernetes environment. -## Using the PostgreSQL Operator +### Included Components + +[PostgreSQL containers](https://github.com/CrunchyData/crunchy-containers) deployed with the PostgreSQL Operator include the following components: + +- [PostgreSQL](https://www.postgresql.org) + - [PostgreSQL Contrib Modules](https://www.postgresql.org/docs/current/contrib.html) + - [PL/Python + PL/Python 3](https://www.postgresql.org/docs/current/plpython.html) + - [pgAudit](https://www.pgaudit.org/) + - [pgAudit Analyze](https://github.com/pgaudit/pgaudit_analyze) + - [set_user](https://github.com/pgaudit/set_user) +- [pgBackRest](https://pgbackrest.org/) +- [pgBouncer](http://pgbouncer.github.io/) +- [pgAdmin 4](https://www.pgadmin.org/) +- [pgMonitor](https://github.com/CrunchyData/pgmonitor) +- [Patroni](https://patroni.readthedocs.io/) +- [LLVM](https://llvm.org/) (for [JIT compilation](https://www.postgresql.org/docs/current/jit.html)) + +In addition to the above, the geospatially enhanced PostgreSQL + PostGIS container adds the following components: + +- [PostGIS](http://postgis.net/) +- [pgRouting](https://pgrouting.org/) +- [PL/R](https://github.com/postgres-plr/plr) -If you have the PostgreSQL and Client Interface installed in your environment and are interested in guidance on the use of the Crunchy PostgreSQL Operator, please start here: +Additional containers that are not directly integrated with the PostgreSQL Operator but can work alongside it include: -- [PostgreSQL Operator Documentation](https://access.crunchydata.com/documentation/postgres-operator/) +- [pgPool II](https://access.crunchydata.com/documentation/crunchy-postgres-containers/latest/container-specifications/crunchy-pgpool/) +- [pg_upgrade](https://access.crunchydata.com/documentation/crunchy-postgres-containers/latest/container-specifications/crunchy-upgrade/) +- [pgBench](https://access.crunchydata.com/documentation/crunchy-postgres-containers/latest/container-specifications/crunchy-pgbench/) + +For more information about which versions of the PostgreSQL Operator include which components, please visit the [compatibility](https://access.crunchydata.com/documentation/postgres-operator/latest/configuration/compatibility/) section of the documentation. + +## Using the PostgreSQL Operator (PGO) + +If you are new to PGO, you can follow along the [tutorial](https://access.crunchydata.com/documentation/postgres-operator/latest/tutorial/) +to learn how to install the PostgreSQL Operator and how to use many of its +features! + +- [PostgreSQL Operator Tutorial](https://access.crunchydata.com/documentation/postgres-operator/latest/tutorial/) + +If you have the PostgreSQL and client interface installed in your environment +and are interested in guidance on the use of the Crunchy PostgreSQL Operator, +please start here: + +- [PostgreSQL Operator (PGO) Documentation](https://access.crunchydata.com/documentation/postgres-operator/) - [`pgo` Client User Guide](https://access.crunchydata.com/documentation/postgres-operator/latest/pgo-client/) ## Contributing to the Project -Want to contribute to the PostgreSQL Operator project? Great! We've put together +Want to contribute to the PGO Project? Great! We've put together as set of contributing guidelines that you can review here: - [Contributing Guidelines](CONTRIBUTING.md) @@ -192,8 +277,7 @@ If you have any question you can submit a Support - Question and Answer issue an ## Complete Documentation For additional information regarding design, configuration and operation of the -PostgreSQL Operator, pleases see the -[Official Project Documentation](https://access.crunchydata.com/documentation/postgres-operator/) +PostgreSQL Operator (PGO), please see the [Official Project Documentation][documentation]. If you are looking for the [nightly builds of the documentation](https://crunchydata.github.io/postgres-operator/latest/), you can view them at: @@ -202,3 +286,18 @@ https://crunchydata.github.io/postgres-operator/latest/ ## Past Versions Documentation for previous releases can be found at the [Crunchy Data Access Portal](https://access.crunchydata.com/documentation/) + +## Releases + +When a PGO general availability (GA) release occurs, the container images are +distributed on the following platforms in order: + +- [Crunchy Data Customer Portal](https://access.crunchydata.com/) +- [Crunchy Data Developer Portal](https://www.crunchydata.com/developers) +- [DockerHub](https://hub.docker.com/u/crunchydata) + +The image rollout can occur over the course of several days. + +To stay up-to-date on when releases are made available in the [Crunchy Data Developer Portal](https://www.crunchydata.com/developers), please sign up for the [Crunchy Data Developer Program Newsletter](https://www.crunchydata.com/developers/newsletter) + +The PGO Postgres Operator project source code is available subject to the [Apache 2.0 license](LICENSE.md) with the PGO logo and branding assets covered by [our trademark guidelines](docs/static/logos/TRADEMARKS.md). diff --git a/apiserver.go b/apiserver.go index 2c3858bb63..3df9608796 100644 --- a/apiserver.go +++ b/apiserver.go @@ -1,7 +1,7 @@ package main /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/bin/get-deps.sh b/bin/get-deps.sh index 8816aa3635..28bc5d4937 100755 --- a/bin/get-deps.sh +++ b/bin/get-deps.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -# Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2017 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/bin/pgo-backrest-repo-sync/pgo-backrest-repo-sync.sh b/bin/pgo-backrest-repo-sync/pgo-backrest-repo-sync.sh index 53e98e3a2e..f4bf1f1709 100644 --- a/bin/pgo-backrest-repo-sync/pgo-backrest-repo-sync.sh +++ b/bin/pgo-backrest-repo-sync/pgo-backrest-repo-sync.sh @@ -1,6 +1,6 @@ #!/bin/bash -x -# Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2019 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/bin/pgo-backrest-repo/pgo-backrest-repo.sh b/bin/pgo-backrest-repo/pgo-backrest-repo.sh index 25fdec5f69..925e5808a3 100755 --- a/bin/pgo-backrest-repo/pgo-backrest-repo.sh +++ b/bin/pgo-backrest-repo/pgo-backrest-repo.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2019 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/bin/pgo-backrest-restore/pgo-backrest-restore.sh b/bin/pgo-backrest-restore/pgo-backrest-restore.sh index 89f3888fff..a0373b7a96 100755 --- a/bin/pgo-backrest-restore/pgo-backrest-restore.sh +++ b/bin/pgo-backrest-restore/pgo-backrest-restore.sh @@ -1,6 +1,6 @@ #!/bin/bash -x -# Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2019 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/bin/pgo-backrest/pgo-backrest.sh b/bin/pgo-backrest/pgo-backrest.sh index fda20af57c..86f758a50a 100755 --- a/bin/pgo-backrest/pgo-backrest.sh +++ b/bin/pgo-backrest/pgo-backrest.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2018 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/bin/pgo-event/pgo-event.sh b/bin/pgo-event/pgo-event.sh index cddcb2e708..1602e56193 100755 --- a/bin/pgo-event/pgo-event.sh +++ b/bin/pgo-event/pgo-event.sh @@ -1,6 +1,6 @@ #!/bin/bash -x -# Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2019 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/bin/pgo-load/start.sh b/bin/pgo-load/start.sh index 894c65a11c..34a2d4d0e1 100755 --- a/bin/pgo-load/start.sh +++ b/bin/pgo-load/start.sh @@ -1,6 +1,6 @@ #!/bin/bash -x -# Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2018 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/bin/pgo-rmdata/start.sh b/bin/pgo-rmdata/start.sh index 95a4903289..228f891694 100755 --- a/bin/pgo-rmdata/start.sh +++ b/bin/pgo-rmdata/start.sh @@ -1,6 +1,6 @@ #!/bin/bash -x -# Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2018 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/bin/pgo-scheduler/start.sh b/bin/pgo-scheduler/start.sh index 4a32cf8bc3..4549d82d57 100755 --- a/bin/pgo-scheduler/start.sh +++ b/bin/pgo-scheduler/start.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2019 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/bin/pgo-sqlrunner/start.sh b/bin/pgo-sqlrunner/start.sh index 0b2eb6d417..01422d26d7 100755 --- a/bin/pgo-sqlrunner/start.sh +++ b/bin/pgo-sqlrunner/start.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2019 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/bin/pre-pull-crunchy-containers.sh b/bin/pre-pull-crunchy-containers.sh index c45c4bfb8f..de30d03554 100755 --- a/bin/pre-pull-crunchy-containers.sh +++ b/bin/pre-pull-crunchy-containers.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2018 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/bin/pull-from-gcr.sh b/bin/pull-from-gcr.sh index 6c2c511aa8..49c611d059 100755 --- a/bin/pull-from-gcr.sh +++ b/bin/pull-from-gcr.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2018 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/bin/push-ccp-to-gcr.sh b/bin/push-ccp-to-gcr.sh index 5928c70bfd..08b9e1e709 100755 --- a/bin/push-ccp-to-gcr.sh +++ b/bin/push-ccp-to-gcr.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2019 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -16,7 +16,7 @@ GCR_IMAGE_PREFIX=gcr.io/crunchy-dev-test CCP_IMAGE_PREFIX=crunchydata -CCP_IMAGE_TAG=centos7-12.3-4.4.0 +CCP_IMAGE_TAG=centos7-12.6-4.4.3 IMAGES=( crunchy-prometheus diff --git a/bin/push-to-gcr.sh b/bin/push-to-gcr.sh index 3ccc0518e2..809d997ef0 100755 --- a/bin/push-to-gcr.sh +++ b/bin/push-to-gcr.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2018 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/bin/uid_daemon.sh b/bin/uid_daemon.sh index 83d8aca5e2..bc988bae79 100755 --- a/bin/uid_daemon.sh +++ b/bin/uid_daemon.sh @@ -1,6 +1,6 @@ #!/usr/bin/bash -# Copyright 2020 Crunchy Data Solutions, Inc. +# Copyright 2020 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/bin/upgrade-secret.sh b/bin/upgrade-secret.sh index ee93af1377..f852008890 100755 --- a/bin/upgrade-secret.sh +++ b/bin/upgrade-secret.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2018 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/conf/postgres-operator/pgo.yaml b/conf/postgres-operator/pgo.yaml index d59a27aff4..4b58df00cd 100644 --- a/conf/postgres-operator/pgo.yaml +++ b/conf/postgres-operator/pgo.yaml @@ -2,7 +2,7 @@ Cluster: CCPImagePrefix: registry.developers.crunchydata.com/crunchydata Metrics: false Badger: false - CCPImageTag: centos7-12.3-4.4.0 + CCPImageTag: centos7-12.6-4.4.3 Port: 5432 PGBadgerPort: 10000 ExporterPort: 9187 @@ -81,4 +81,4 @@ Storage: Pgo: Audit: false PGOImagePrefix: registry.developers.crunchydata.com/crunchydata - PGOImageTag: centos7-4.4.0 + PGOImageTag: centos7-4.4.3 diff --git a/crunchy_logo.png b/crunchy_logo.png deleted file mode 100644 index 2fbf3352c1..0000000000 Binary files a/crunchy_logo.png and /dev/null differ diff --git a/deploy/add-targeted-namespace-reconcile-rbac.sh b/deploy/add-targeted-namespace-reconcile-rbac.sh index d76c25ecdc..2bf780816a 100755 --- a/deploy/add-targeted-namespace-reconcile-rbac.sh +++ b/deploy/add-targeted-namespace-reconcile-rbac.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2020 Crunchy Data Solutions, Inc. +# Copyright 2020 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deploy/add-targeted-namespace.sh b/deploy/add-targeted-namespace.sh index b274f6fe7d..c11eb092a8 100755 --- a/deploy/add-targeted-namespace.sh +++ b/deploy/add-targeted-namespace.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2019 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deploy/cleannamespaces.sh b/deploy/cleannamespaces.sh index 66cd693863..169bae6853 100755 --- a/deploy/cleannamespaces.sh +++ b/deploy/cleannamespaces.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2019 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deploy/cleanup-rbac.sh b/deploy/cleanup-rbac.sh index 50f52bbc5f..df60c14500 100755 --- a/deploy/cleanup-rbac.sh +++ b/deploy/cleanup-rbac.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2018 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deploy/cleanup.sh b/deploy/cleanup.sh index afe13f98c7..711e276823 100755 --- a/deploy/cleanup.sh +++ b/deploy/cleanup.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2017 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deploy/cluster-roles.yaml b/deploy/cluster-roles.yaml index cb0bb85b41..d760492836 100644 --- a/deploy/cluster-roles.yaml +++ b/deploy/cluster-roles.yaml @@ -41,8 +41,6 @@ rules: - endpoints - pods - pods/exec - - pods/log - - replicasets - secrets - services - persistentvolumeclaims @@ -55,10 +53,19 @@ rules: - update - delete - deletecollection + - apiGroups: + - '' + resources: + - pods/log + verbs: + - get + - list + - watch - apiGroups: - apps resources: - deployments + - replicasets verbs: - get - list diff --git a/deploy/deploy.sh b/deploy/deploy.sh index 7d4c3fd997..add3c0d46c 100755 --- a/deploy/deploy.sh +++ b/deploy/deploy.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2017 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deploy/gen-api-keys.sh b/deploy/gen-api-keys.sh index 8aece10000..a5444a9020 100755 --- a/deploy/gen-api-keys.sh +++ b/deploy/gen-api-keys.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2019 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deploy/install-bootstrap-creds.sh b/deploy/install-bootstrap-creds.sh index 1b446824d3..e25253104c 100755 --- a/deploy/install-bootstrap-creds.sh +++ b/deploy/install-bootstrap-creds.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2019 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deploy/install-rbac.sh b/deploy/install-rbac.sh index 9e8cb6d11c..83b4ab833f 100755 --- a/deploy/install-rbac.sh +++ b/deploy/install-rbac.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2018 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deploy/remove-crd.sh b/deploy/remove-crd.sh index f4c422cdb6..0fa326e7bb 100755 --- a/deploy/remove-crd.sh +++ b/deploy/remove-crd.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2017 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deploy/setupnamespaces.sh b/deploy/setupnamespaces.sh index 9d2188a56f..08aade3518 100755 --- a/deploy/setupnamespaces.sh +++ b/deploy/setupnamespaces.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2019 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deploy/show-crd.sh b/deploy/show-crd.sh index 7f40285c5d..091c2b6810 100755 --- a/deploy/show-crd.sh +++ b/deploy/show-crd.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2017 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deploy/upgrade-creds.sh b/deploy/upgrade-creds.sh index eff0cc9700..08e429cbc4 100755 --- a/deploy/upgrade-creds.sh +++ b/deploy/upgrade-creds.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2019 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deploy/upgrade-pgo.sh b/deploy/upgrade-pgo.sh index 66f61639eb..0999cd9b79 100755 --- a/deploy/upgrade-pgo.sh +++ b/deploy/upgrade-pgo.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2020 Crunchy Data Solutions, Inc. +# Copyright 2020 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/docs/config.toml b/docs/config.toml index 63e9eb37e1..5d9c641624 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -2,7 +2,7 @@ baseURL= "" languageCode = "en-us" DefaultContentLanguage = "en" -title = "Crunchy PostgreSQL Operator Documentation" +title = "PGO: PostgreSQL Operator from Crunchy Data Documentation" theme = "crunchy-hugo-theme" pygmentsCodeFences = true pygmentsStyle = "monokailight" @@ -25,8 +25,8 @@ disableNavChevron = false # set true to hide next/prev chevron, default is false highlightClientSide = false # set true to use highlight.pack.js instead of the default hugo chroma highlighter menushortcutsnewtab = true # set true to open shortcuts links to a new tab/window enableGitInfo = true -operatorVersion = "4.4.0" -postgresVersion = "12.3" +operatorVersion = "4.4.3" +postgresVersion = "12.6" postgisVersion = "3.0" centosBase = "centos7" diff --git a/docs/content/Configuration/compatibility.md b/docs/content/Configuration/compatibility.md index 42ec75cfbc..99cde8fa72 100644 --- a/docs/content/Configuration/compatibility.md +++ b/docs/content/Configuration/compatibility.md @@ -12,6 +12,24 @@ version dependencies between the two projects. Below are the operator releases a | Operator Release | Container Release | Postgres | PgBackrest Version |:----------|:-------------|:------------|:-------------- +| 4.4.3 | 4.4.3 | 12.6 | 2.27 | +|||11.11|2.27| +|||10.16|2.27| +|||9.6.21|2.27| +|||9.5.25|2.27| +|||| +| 4.4.2 | 4.4.2 | 12.5 | 2.27 | +|||11.10|2.27| +|||10.15|2.27| +|||9.6.20|2.27| +|||9.5.24|2.27| +|||| +| 4.4.1 | 4.4.1 | 12.4 | 2.27 | +|||11.9|2.27| +|||10.14|2.27| +|||9.6.19|2.27| +|||9.5.23|2.27| +|||| | 4.4.0 | 4.4.0 | 12.3 | 2.27 | |||11.8|2.27| |||10.13|2.27| diff --git a/docs/content/Security/configure-postgres-operator-rbac.md b/docs/content/Security/configure-postgres-operator-rbac.md index 0c810a7bfd..6d44096328 100644 --- a/docs/content/Security/configure-postgres-operator-rbac.md +++ b/docs/content/Security/configure-postgres-operator-rbac.md @@ -74,6 +74,7 @@ The following list shows the current complete list of possible pgo permissions t |Label | allow *pgo label*| |Load | allow *pgo load*| |Reload | allow *pgo reload*| +|Restart | allow *pgo restart*| |Restore | allow *pgo restore*| |RestoreDump | allow *pgo restore* for pgdumps| |ShowBackup | allow *pgo show backup*| diff --git a/docs/content/Upgrade/automatedupgrade.md b/docs/content/Upgrade/automatedupgrade.md index 18b2adde27..31480bc07e 100644 --- a/docs/content/Upgrade/automatedupgrade.md +++ b/docs/content/Upgrade/automatedupgrade.md @@ -35,15 +35,31 @@ The automated upgrade procedure is designed to facilate the quickest and most ef ##### NOTE: As with any upgrade procedure, it is strongly recommended that a full logical backup is taken before any upgrade procedure is started. Please see the [Logical Backups](/pgo-client/common-tasks#logical-backups-pg_dump--pg_dumpall) section of the Common Tasks page for more information. -### Automated Upgrade when using an Ansible installation of the PostgreSQL Operator +### Automated Upgrade when using the PostgreSQL Operator Installer (`pgo-deployer`), Helm or Ansible -For existing PostgreSQL Operator deployments that were installed using Ansible, the upgrade process is straightforward. +For all existing PostgreSQL Operator deployments that were installed using the Ansible installation method, the PostgreSQL Operator Installer or the Helm Chart Installation of the PostgreSQL Operator, the upgrade process is straightforward. -First, you will copy your existing inventory file as a backup for your existing settings. You will reference these settings, but you will need to use the updated version of the inventory file for the current version of PostgreSQL Operator. +First, you will copy your existing configuration file (whether inventory, postgres-operator.yml, values.yaml, etc, depending on method and version) as a backup for your existing settings. You will reference these settings, but you will need to use the updated version of this file for the current version of PostgreSQL Operator. -Once you've checked out the appropriate release tag, please follow the [Update Instructions]({{< relref "installation/other/ansible/updating-operator.md" >}}), being sure to update the new inventory file with your required settings. Please keep the above [Considerations](/upgrade/automatedupgrade#considerations) in mind, particularly with regard to the version and storage requirements listed. +In all three cases, you will need to use the relevant update functionality available with your chosen installation method. For all three options, please keep the above [Considerations](/upgrade/automatedupgrade#considerations) in mind, particularly with regard to the version and storage requirements listed. -Once the update is complete, you should now see the PostgreSQL Operator pods are up and ready. It is strongly recommended that you create a test cluster to validate proper functionality before moving on to the [Automated Cluster Upgrade](/upgrade/automatedupgrade#postgresql-operator-automated-cluster-upgrade) section below. +#### PostgreSQL Operator Installer + +For existing PostgreSQL Operator deployments that were installed using the PostgreSQL Operator Installer, you will check out the appropriate release tag and update your the new configuration files. After this, you will need to update your Operator installation using the `DEPLOY_ACTION` method described in the [Configuring to Update and Uninstall](/installation/postgres-operator#configuring-to-update-and-uninstall) section of the documentation. + +Please note, you will need to ensure that you have executed the [post-installation cleanup](/installation/postgres-operator#post-installation) between each `DEPLOY_ACTION` activity. + +#### Helm + +For existing PostgreSQL Operator deployments that were installed using the Helm installer, you will check out the appropriate release tag and update your the new configuration files. Then you will need to use the `helm upgrade` command as described in the [Helm Upgrade](/installation/other/helm#upgrade) section of the Helm installation documentation. + +#### Ansible + +For existing PostgreSQL Operator deployments that were installed using Ansible, you will first need to check out the appropriate release tag of the Operator. Then please follow the [Update Instructions]({{< relref "installation/other/ansible/updating-operator.md" >}}), being sure to update the new inventory file with your required settings. + +#### Wrapping Up the PostgreSQL Operator Upgrade + +Once the upgrade is complete, you should now see the PostgreSQL Operator pods are up and ready. It is strongly recommended that you create a test cluster to validate proper functionality before moving on to the [Automated Cluster Upgrade](/upgrade/automatedupgrade#postgresql-operator-automated-cluster-upgrade) section below. ### Automated Upgrade when using a Bash installation of the PostgreSQL Operator diff --git a/docs/content/_index.md b/docs/content/_index.md index 5571714be7..096fc13b55 100644 --- a/docs/content/_index.md +++ b/docs/content/_index.md @@ -1,20 +1,30 @@ --- -title: "Crunchy PostgreSQL Operator" +title: "PGO: The Postgres Operator from Crunchy Data" date: draft: false --- -# Crunchy PostgreSQL Operator +# PGO: The Postgres Operator from Crunchy Data - + PGO: The Postgres Operator from Crunchy Data -## Run your own production-grade PostgreSQL-as-a-Service on Kubernetes! +## Run [Cloud Native PostgreSQL on Kubernetes](https://www.crunchydata.com/products/crunchy-postgresql-for-kubernetes/) with PGO: The [Postgres Operator](https://github.com/CrunchyData/postgres-operator) from [Crunchy Data](https://www.crunchydata.com/)! Latest Release: {{< param operatorVersion >}} -The [Crunchy PostgreSQL Operator](https://www.crunchydata.com/developers/download-postgres/containers/postgres-operator) automates and simplifies deploying and managing open source PostgreSQL clusters on Kubernetes and other Kubernetes-enabled Platforms by providing the essential features you need to keep your PostgreSQL clusters up and running, including: +[PGO](https://www.crunchydata.com/developers/download-postgres/containers/postgres-operator), +the [Postgres Operator](https://github.com/CrunchyData/postgres-operator) +developed by [Crunchy Data](https://crunchydata.com/) and included in +[Crunchy PostgreSQL for Kubernetes](https://www.crunchydata.com/products/crunchy-postgresql-for-kubernetes/), +automates and simplifies deploying and managing open source PostgreSQL clusters +on Kubernetes. -#### PostgreSQL Cluster Provisioning +Whether you need to get a simple Postgres cluster up and running, need to deploy +a high availability, fault tolerant cluster in production, or are running your +own database-as-a-service, the PostgreSQL Operator provides the essential +features you need to keep your cloud native Postgres clusters healthy, including: + +#### Postgres Cluster [Provisioning]({{< relref "/architecture/provisioning.md" >}}) [Create, Scale, & Delete PostgreSQL clusters with ease](/architecture/provisioning/), while fully customizing your Pods and PostgreSQL configuration! @@ -30,7 +40,7 @@ Backups and restores leverage the open source [pgBackRest](https://www.pgbackres #### TLS -Secure communication between your applications and data servers by [enabling TLS for your PostgreSQL servers](/pgo-client/common-tasks/#enable-tls), including the ability to enforce that all of your connections to use TLS. +Secure communication between your applications and data servers by [enabling TLS for your PostgreSQL servers](/pgo-client/common-tasks/#enable-tls), including the ability to enforce all of your connections to use TLS. #### Monitoring @@ -70,16 +80,22 @@ Choose the type of backup (full, incremental, differential) and [how frequently #### Multi-Namespace Support -You can control how the PostgreSQL Operator leverages [Kubernetes Namespaces](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/) with several different deployment models: +You can control how PGO, the Postgres Operator, leverages [Kubernetes Namespaces](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/) with several different deployment models: -- Deploy the PostgreSQL Operator and all PostgreSQL clusters to the same namespace -- Deploy the PostgreSQL Operator to one namespaces, and all PostgreSQL clusters to a different namespace -- Deploy the PostgreSQL Operator to one namespace, and have your PostgreSQL clusters managed acrossed multiple namespaces -- Dynamically add and remove namespaces managed by the PostgreSQL Operator using the `pgo create namespace` and `pgo delete namespace` commands +- Deploy PGO and all PostgreSQL clusters to the same namespace +- Deploy PGO to one namespaces, and all PostgreSQL clusters to a different +namespace +- Deploy PGO to one namespace, and have your PostgreSQL clusters managed across +multiple namespaces +- Dynamically add and remove namespaces managed by the PostgreSQL Operator using +the `pgo` client to run `pgo create namespace` and `pgo delete namespace` #### Full Customizability -The Crunchy PostgreSQL Operator makes it easy to get your own PostgreSQL-as-a-Service up and running on Kubernetes-enabled platforms, but we know that there are further customizations that you can make. As such, the Crunchy PostgreSQL Operator allows you to further customize your deployments, including: +The Postgres Operator (PGO) makes it easy to get Postgres up and running on +Kubernetes-enabled platforms, but we know that there are further customizations +that you can make. As such, PGO allows you to further customize your +deployments, including: - Selecting different storage classes for your primary, replica, and backup storage - Select your own container resources class for each PostgreSQL cluster deployment; differentiate between resources applied for primary and replica clusters! @@ -95,25 +111,64 @@ The Crunchy PostgreSQL Operator makes it easy to get your own PostgreSQL-as-a-Se The Crunchy PostgreSQL Operator extends Kubernetes to provide a higher-level abstraction for rapid creation and management of PostgreSQL clusters. The Crunchy PostgreSQL Operator leverages a Kubernetes concept referred to as "[Custom Resources](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/)” to create several [custom resource definitions (CRDs)](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#customresourcedefinitions) that allow for the management of PostgreSQL clusters. +# Included Components + +[PostgreSQL containers](https://github.com/CrunchyData/crunchy-containers) deployed with the PostgreSQL Operator include the following components: + +- [PostgreSQL](https://www.postgresql.org) + - [PostgreSQL Contrib Modules](https://www.postgresql.org/docs/current/contrib.html) + - [PL/Python + PL/Python 3](https://www.postgresql.org/docs/current/plpython.html) + - [pgAudit](https://www.pgaudit.org/) + - [pgAudit Analyze](https://github.com/pgaudit/pgaudit_analyze) + - [set_user](https://github.com/pgaudit/set_user) +- [pgBackRest](https://pgbackrest.org/) +- [pgBouncer](http://pgbouncer.github.io/) +- [pgAdmin 4](https://www.pgadmin.org/) +- [pgMonitor](https://github.com/CrunchyData/pgmonitor) +- [Patroni](https://patroni.readthedocs.io/) +- [LLVM](https://llvm.org/) (for [JIT compilation](https://www.postgresql.org/docs/current/jit.html)) + +In addition to the above, the geospatially enhanced PostgreSQL + PostGIS container adds the following components: + +- [PostGIS](http://postgis.net/) +- [pgRouting](https://pgrouting.org/) +- [PL/R](https://github.com/postgres-plr/plr) + +Additional containers that are not directly integrated with the PostgreSQL Operator but can work alongside it include: + +- [pgPool II](https://access.crunchydata.com/documentation/crunchy-postgres-containers/latest/container-specifications/crunchy-pgpool/) +- [pg_upgrade](https://access.crunchydata.com/documentation/crunchy-postgres-containers/latest/container-specifications/crunchy-upgrade/) +- [pgBench](https://access.crunchydata.com/documentation/crunchy-postgres-containers/latest/container-specifications/crunchy-pgbench/) + +For more information about which versions of the PostgreSQL Operator include which components, please visit the [compatibility]({{< relref "configuration/compatibility.md" >}}) section of the documentation. + # Supported Platforms -The Crunchy PostgreSQL Operator is tested on the following Platforms: +PGO, the Postgres Operator, is Kubernetes-native and maintains backwards +compatibility to Kubernetes 1.11 and is tested is tested against the following +platforms: - Kubernetes 1.13+ - OpenShift 3.11+ - Google Kubernetes Engine (GKE), including Anthos -- VMware Enterprise PKS 1.3+ +- Amazon EKS +- Microsoft AKS +- VMware Tanzu -## Storage +This list only includes the platforms that the Postgres Operator is specifically +tested on as part of the release process: PGO works on other Kubernetes +distributions as well. -The Crunchy PostgreSQL Operator is tested with a variety of different types of Kubernetes storage and Storage Classes, including: +## Storage -- Rook -- StorageOS -- Google Compute Engine persistent volumes -- NFS -- HostPath +PGO, the Postgres Operator, is tested with a variety of different types of +Kubernetes storage and Storage Classes, as well as hostPath and NFS. -and more. We have had reports of people using the PostgreSQL Operator with other [Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/) as well. +We know there are a variety of different types of [Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/) +available for Kubernetes and we do our best to test each one, but due to the +breadth of this area we are unable to verify Postgres Operator functionality in +each one. With that said, the PostgreSQL Operator is designed to be storage +class agnostic and has been demonstrated to work with additional Storage +Classes. -We know there are a variety of different types of [Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/) available for Kubernetes and we do our best to test each one, but due to the breadth of this area we are unable to verify PostgreSQL Operator functionality in each one. With that said, the PostgreSQL Operator is designed to be storage class agnostic and has been demonstrated to work with additional Storage Classes. Storage is a rapidly evolving field in Kubernetes and we will continue to adapt the PostgreSQL Operator to modern Kubernetes storage standards. +The PGO Postgres Operator project source code is available subject to the [Apache 2.0 license](https://raw.githubusercontent.com/CrunchyData/postgres-operator/master/LICENSE.md) with the PGO logo and branding assets covered by [our trademark guidelines](/logos/TRADEMARKS.md). diff --git a/docs/content/architecture/disaster-recovery.md b/docs/content/architecture/disaster-recovery.md index deee66dcc5..7833661e07 100644 --- a/docs/content/architecture/disaster-recovery.md +++ b/docs/content/architecture/disaster-recovery.md @@ -196,7 +196,7 @@ to re-enable autofail if you would like your PostgreSQL cluster to be highly-available. You can re-enable autofail with this command: ```shell -pgo update cluster hacluster --autofail=true +pgo update cluster hacluster --enable-autofail ``` ## Scheduling Backups diff --git a/docs/content/architecture/high-availability/multi-cluster-kubernetes.md b/docs/content/architecture/high-availability/multi-cluster-kubernetes.md index c6043adba4..f2be1e03c5 100644 --- a/docs/content/architecture/high-availability/multi-cluster-kubernetes.md +++ b/docs/content/architecture/high-availability/multi-cluster-kubernetes.md @@ -93,6 +93,14 @@ that matches that of the active cluster it is replicating. - `--pgbackrest-s3-endpoint`: The S3 endpoint to use - `--pgbackrest-s3-region`: The S3 region to use +If you do not want to set the user credentials, you can retrieve them at a later +time by using the [`pgo show user`]({{< relref "/pgo-client/reference/pgo_show_user.md" >}}) +command with the `--show-system-accounts` flag, e.g. + +``` +pgo show user --show-system-accounts hippo +``` + With respect to the credentials, it should be noted that when the standby cluster is being created within the same Kubernetes cluster AND it has access to the Kubernetes Secret created for the active cluster, one can use the @@ -182,6 +190,9 @@ pgo create cluster hippo-standby --standby --pgbouncer --replica-count=2 \ --password=opensourcehippo ``` +(If you are unsure of your credentials, you can use +`pgo show user hippo --show-system-accounts` to retrieve them). + Note the use of the `--pgbackrest-repo-path` flag as it points to the name of the pgBackRest repository that is used for the original `hippo` cluster. diff --git a/docs/content/architecture/namespace.md b/docs/content/architecture/namespace.md index f6b4265723..1a551a8b91 100644 --- a/docs/content/architecture/namespace.md +++ b/docs/content/architecture/namespace.md @@ -34,8 +34,8 @@ settings. Enables full dynamic namespace capabilities, in which the Operator can create, delete and update any namespaces within a Kubernetes cluster. With `dynamic` mode enabled, the PostgreSQL Operator -can respond to namespace events in a Kubernetes cluster, such as when a namespace is created, and -take an appropriate action, such as adding the PostgreSQL Operator controllers for the newly +can respond to namespace events in a Kubernetes cluster, such as when a namespace is created, and +take an appropriate action, such as adding the PostgreSQL Operator controllers for the newly created namespace. The following defines the namespace permissions required for the `dynamic` mode to be enabled: @@ -62,8 +62,8 @@ rules: ### `readonly` -In `readonly` mode, the PostgreSQL Operator is still able to listen to namespace events within a -Kubernetes cluster, but it can no longer modify (create, update, delete) namespaces. For example, +In `readonly` mode, the PostgreSQL Operator is still able to listen to namespace events within a +Kubernetes cluster, but it can no longer modify (create, update, delete) namespaces. For example, if a Kubernetes administrator creates a namespace, the PostgreSQL Operator can respond and create controllers for that namespace. @@ -95,7 +95,7 @@ Operator is unable to dynamically respond to namespace events in the cluster, i target namespaces are deleted or new target namespaces need to be added, the PostgreSQL Operator will need to be re-deployed. -Please note that it is important to redeploy the PostgreSQL Operator following the deletion of a +Please note that it is important to redeploy the PostgreSQL Operator following the deletion of a target namespace to ensure it no longer attempts to listen for events in that namespace. The `disabled` mode is enabled the when the PostgreSQL Operator has not been assigned namespace @@ -103,22 +103,22 @@ permissions. ## RBAC Reconciliation -By default, the PostgreSQL Operator will attempt to reconcile RBAC resources (ServiceAccounts, +By default, the PostgreSQL Operator will attempt to reconcile RBAC resources (ServiceAccounts, Roles and RoleBindings) within each namespace configured for the PostgreSQL Operator installation. This allows the PostgreSQL Operator to create, update and delete the various RBAC resources it requires in order to properly create and manage PostgreSQL clusters within each targeted namespace (this includes self-healing RBAC resources as needed if removed and/or misconfigured). In order for RBAC reconciliation to function properly, the PostgreSQL Operator ServiceAccount must -be assigned a certain set of permissions. While the PostgreSQL Operator is not concerned with +be assigned a certain set of permissions. While the PostgreSQL Operator is not concerned with exactly how it has been assigned the permissions required to reconcile RBAC in each target -namespace, the various [installation methods]({{< relref "installation" >}}) supported by the +namespace, the various [installation methods]({{< relref "installation" >}}) supported by the PostgreSQL Operator install a recommended set permissions based on the specific Namespace Operating Mode enabled (see section [Namespace Operating Modes]({{< relref "#namespace-operating-modes" >}}) above for more information regarding the various Namespace Operating Modes available). -The following section defines the recommended set of permissions that should be assigned to the -PostgreSQL Operator ServiceAccount in order to ensure proper RBAC reconciliation based on the +The following section defines the recommended set of permissions that should be assigned to the +PostgreSQL Operator ServiceAccount in order to ensure proper RBAC reconciliation based on the specific Namespace Operating Mode enabled. Please note that each PostgreSQL Operator installation method handles the initial configuration and setup of the permissions shown below based on the Namespace Operating Mode configured during installation. @@ -127,7 +127,7 @@ Namespace Operating Mode configured during installation. When using the `dynamic` Namespace Operating Mode, it is recommended that the PostgreSQL Operator ServiceAccount be granted permissions to manage RBAC inside any namespace in the Kubernetes cluster -via a ClusterRole. This allows for a fully-hands off approach to managing RBAC within each +via a ClusterRole. This allows for a fully-hands off approach to managing RBAC within each targeted namespace space. In other words, as namespaces are added and removed post-installation of the PostgreSQL Operator (e.g. using `pgo create namespace` or `pgo delete namespace`), the Operator is able to automatically reconcile RBAC in those namespaces without the need for any external @@ -170,8 +170,6 @@ rules: - endpoints - pods - pods/exec - - pods/log - - replicasets - secrets - services - persistentvolumeclaims @@ -184,10 +182,19 @@ rules: - update - delete - deletecollection + - apiGroups: + - '' + resources: + - pods/log + verbs: + - get + - list + - watch - apiGroups: - apps resources: - deployments + - replicasets verbs: - get - list @@ -230,7 +237,7 @@ rules: ### `readonly` & `disabled` Namespace Operating Modes -When using the `readonly` or `disabled` Namespace Operating Modes, it is recommended that the +When using the `readonly` or `disabled` Namespace Operating Modes, it is recommended that the PostgreSQL Operator ServiceAccount be granted permissions to manage RBAC inside of any configured namespaces using local Roles within each targeted namespace. This means that as new namespaces are added and removed post-installation of the PostgreSQL Operator, an administrator must manually diff --git a/docs/content/custom-resources/_index.md b/docs/content/custom-resources/_index.md index abf7bb7c25..9058d8a1da 100644 --- a/docs/content/custom-resources/_index.md +++ b/docs/content/custom-resources/_index.md @@ -260,6 +260,12 @@ export pgbackrest_public_key="${public_key_temp//[$'\n']}" pgbackrest_private_ke # create the backrest-repo-config example file and substitute in the newly # created keys +# +# (Note: that the "config" / "sshd_config" entries contain configuration to +# ensure that PostgreSQL instances are able to communicate with the pgBackRest +# repository, which houses backups and archives, and vice versa. Most of the +# settings follow the sshd defaults, with a few overrides. Edit at your own +# discretion.) cat <<-EOF > "${pgo_cluster_name}-backrest-repo-config.yaml" apiVersion: v1 kind: Secret diff --git a/docs/content/installation/_index.md b/docs/content/installation/_index.md index 909561ce46..036a080a4e 100644 --- a/docs/content/installation/_index.md +++ b/docs/content/installation/_index.md @@ -5,10 +5,10 @@ draft: false weight: 40 --- -There are several different ways to install and deploy the [PostgreSQL Operator](https://www.crunchydata.com/developers/download-postgres/containers/postgres-operator) +There are several different ways to install and deploy the [PGO, the Postgres Operator](https://www.crunchydata.com/developers/download-postgres/containers/postgres-operator) based upon your use case. -For the vast majority of use cases, we recommend using the [PostgreSQL Operator Installer]({{< relref "/installation/postgres-operator.md" >}}), +For the vast majority of use cases, we recommend using the [Postgres Operator Installer]({{< relref "/installation/postgres-operator.md" >}}), which uses the `pgo-deployer` container to set up all of the objects required to run the PostgreSQL Operator. diff --git a/docs/content/installation/configuration.md b/docs/content/installation/configuration.md index 057ee739a3..1fab361907 100644 --- a/docs/content/installation/configuration.md +++ b/docs/content/installation/configuration.md @@ -5,9 +5,9 @@ draft: false weight: 40 --- -# PostgreSQL Operator Installer Configuration +# PGO Installer Configuration -When installing the PostgreSQL Operator you have many configuration options, these +When installing PGO, the Postgres Operator you have many configuration options, these options are listed in this section. ## General Configuration diff --git a/docs/content/installation/other/_index.md b/docs/content/installation/other/_index.md index 9cb7caaef6..8044c3f07c 100644 --- a/docs/content/installation/other/_index.md +++ b/docs/content/installation/other/_index.md @@ -6,6 +6,6 @@ weight: 100 --- Though the years, we have built up several other methods for installing the -PostgreSQL Operator. The next few sections provide some alternative ways of +PGO. The next few sections provide some alternative ways of deploying the PostgreSQL Operator. Some of these methods are deprecated and may be removed in a future release. diff --git a/docs/content/installation/other/ansible/_index.md b/docs/content/installation/other/ansible/_index.md index 0cd09a034d..69a647511e 100644 --- a/docs/content/installation/other/ansible/_index.md +++ b/docs/content/installation/other/ansible/_index.md @@ -5,17 +5,17 @@ draft: false weight: 100 --- -# Crunchy Data PostgreSQL Operator Playbooks +# PGO: Postgres Operator Playbooks -The Crunchy Data PostgreSQL Operator Playbooks contain [Ansible](https://www.ansible.com/) +PGO, the Postgres Operator from Crunchy Data, Playbooks contain [Ansible](https://www.ansible.com/) roles for installing and managing the [Crunchy Data PostgreSQL Operator]({{< relref "/installation/other/ansible/installing-operator.md" >}}). ## Features The playbooks provided allow users to: -* install PostgreSQL Operator on Kubernetes and OpenShift -* install PostgreSQL Operator from a Linux, Mac or Windows (Ubuntu subsystem) host +* install PGO on Kubernetes and OpenShift +* install PGO from a Linux, Mac or Windows (Ubuntu subsystem) host * generate TLS certificates required by the PostgreSQL Operator * support a variety of deployment models diff --git a/docs/content/installation/other/bash.md b/docs/content/installation/other/bash.md index 40b9bd3e76..3a62fd51e5 100644 --- a/docs/content/installation/other/bash.md +++ b/docs/content/installation/other/bash.md @@ -5,18 +5,18 @@ draft: false weight: 200 --- -A full installation of the Operator includes the following steps: +A full installation of PGO includes the following steps: - create a project structure - configure your environment variables - - configure Operator templates + - configure PGO templates - create security resources - deploy the operator - - install pgo CLI (end user command tool) + - install `pgo` client (end user command tool) -Operator end-users are only required to install the pgo CLI client on their host and can skip the server-side installation steps. pgo CLI clients are provided for Linux, Mac, and Windows clients. +PGO end-users are only required to install the `pgo` client on their host and can skip the server-side installation steps. `pgo` clients are provided for Linux, Mac, and Windows clients. -The Operator can be deployed by multiple methods including: +PGO can be deployed by multiple methods including: * default installation * Ansible playbook installation @@ -25,7 +25,7 @@ The Operator can be deployed by multiple methods including: ## Default Installation - Create Project Structure -The Operator follows a golang project structure, you can create a structure as follows on your local Linux host: +PGO follows a golang project structure, you can create a structure as follows on your local Linux host: mkdir -p $HOME/odev/src/github.com/crunchydata $HOME/odev/bin $HOME/odev/pkg cd $HOME/odev/src/github.com/crunchydata @@ -59,9 +59,9 @@ for Kubernetes events. This value is set as follows: This means namespaces called *pgouser1* and *pgouser2* will be created as part of the default installation. -{{% notice warning %}}In Kubernetes versions prior to 1.12 (including Openshift up through 3.11), there is a limitation that requires an extra step during installation for the operator to function properly with watched namespaces. This limitation does not exist when using Kubernetes 1.12+. When a list of namespaces are provided through the NAMESPACE environment variable, the setupnamespaces.sh script handles the limitation properly in both the bash and ansible installation. +{{% notice warning %}}In Kubernetes versions prior to 1.12 (including Openshift up through 3.11), there is a limitation that requires an extra step during installation for PGO to function properly with watched namespaces. This limitation does not exist when using Kubernetes 1.12+. When a list of namespaces are provided through the NAMESPACE environment variable, the setupnamespaces.sh script handles the limitation properly in both the bash and ansible installation. -However, if the user wishes to add a new watched namespace after installation, where the user would normally use pgo create namespace to add the new namespace, they should instead run the add-targeted-namespace.sh script or they may give themselves cluster-admin privileges instead of having to run setupnamespaces.sh script. Again, this is only required when running on a Kubernetes distribution whose version is below 1.12. In Kubernetes version 1.12+ the pgo create namespace command works as expected. +However, if the user wishes to add a new watched namespace after installation, where the user would normally use `pgo create namespace` to add the new namespace, they should instead run the add-targeted-namespace.sh script or they may give themselves cluster-admin privileges instead of having to run setupnamespaces.sh script. Again, this is only required when running on a Kubernetes distribution whose version is below 1.12. In Kubernetes version 1.12+ the pgo create namespace command works as expected. {{% /notice %}} @@ -83,13 +83,13 @@ Create the Operator namespaces using the Makefile target: The [Design](/design) section of this documentation talks further about the use of namespaces within the Operator. -## Default Installation - Configure Operator Templates +## Default Installation - Configure PGO Templates -Within the Operator *conf* directory are several configuration files and templates used by the Operator to determine the various resources that it deploys on your Kubernetes cluster, specifically the PostgreSQL clusters it deploys. +Within PGO's *conf* directory are several configuration files and templates used by PGO to determine the various resources that it deploys on your Kubernetes cluster, specifically the PostgreSQL clusters it deploys. -When you install the Operator you must make choices as to what kind of storage the Operator has to work with for example. Storage varies with each installation. As an installer, you would modify these configuration templates used by the Operator to customize its behavior. +When you install PGO you must make choices as to what kind of storage the Operator has to work with for example. Storage varies with each installation. As an installer, you would modify these configuration templates used by the Operator to customize its behavior. -**Note**: when you want to make changes to these Operator templates and configuration files after your initial installation, you will need to re-deploy the Operator in order for it to pick up any future configuration changes. +**Note**: when you want to make changes to these PGO templates and configuration files after your initial installation, you will need to re-deploy the Operator in order for it to pick up any future configuration changes. Here are some common examples of configuration changes most installers would make: @@ -110,12 +110,10 @@ Listed above are the *pgo.yaml* sections related to storage choices. *PrimarySt This sort of configuration allows for a PostgreSQL primary and replica to use different storage if you want. Other storage settings like *AccessMode*, *Size*, *StorageType*, and *StorageClass* further define the storage configuration. Currently, NFS, HostPath, and Storage Classes are supported in the configuration. -As part of the Operator installation, you will need to adjust these storage settings to suit your deployment requirements. For users wanting to try +As part of PGO installation, you will need to adjust these storage settings to suit your deployment requirements. For users wanting to try out the Operator on Google Kubernetes Engine you would make the following change to the storage configuration in pgo.yaml: - - For NFS Storage, it is assumed that there are sufficient Persistent Volumes (PV) created for the Operator to use when it creates Persistent Volume Claims (PVC). The creation of Persistent Volumes is something a Kubernetes cluster-admin user would typically provide before installing the Operator. There is an example script which can be used to create NFS Persistent Volumes located here: ./pv/create-nfs-pv.sh @@ -135,11 +133,11 @@ Operator. Other settings in *pgo.yaml* are described in the [pgo.yaml Configuration](/configuration/pgo-yaml-configuration) section of the documentation. -## Operator Security +## PGO Security -The Operator implements its own RBAC (Role Based Access Controls) for authenticating Operator users access to the Operator REST API. +PGO implements its own RBAC (Role Based Access Controls) for authenticating Operator users access to the PGO REST API. -A default admin user is created when the operator is deployed. Create a .pgouser in your home directory and insert the text from below: +A default admin user is created when PGO is deployed. Create a .pgouser in your home directory and insert the text from below: ``` admin:examplepassword @@ -157,7 +155,7 @@ To create a unique administrator user on deployment of the operator edit this fi $PGOROOT/deploy/install-bootstrap-creds.sh ``` -After installation users can create optional Operator users as follows: +After installation users can create optional PGO users as follows: ``` pgo create pgouser someuser --pgouser-namespaces="pgouser1,pgouser2" --pgouser-password=somepassword --pgouser-roles="somerole,someotherrole" @@ -166,13 +164,13 @@ pgo create pgouser someuser --pgouser-namespaces="pgouser1,pgouser2" --pgouser-p Note, you can also store the pgouser file in alternate locations, see the Security documentation for details. -Operator security is discussed in the Security section [Security](/security) of the documentation. +PGO security is further discussed in the section [Security]({{< relref "security/_index.md" >}}) section of the documentation. Adjust these settings to meet your local requirements. ## Default Installation - Create Kubernetes RBAC Controls -The Operator installation requires Kubernetes administrators to create Resources required by the Operator. These resources are only allowed to be created by a cluster-admin user. To install on Google Cloud, you will need a user +PGO installation requires Kubernetes administrators to create Resources required by PGO. These resources are only allowed to be created by a cluster-admin user. To install on Google Cloud, you will need a user account with cluster-admin privileges. If you own the GKE cluster you are installing on, you can add cluster-admin role to your account as follows: @@ -185,9 +183,9 @@ Tor create the Kubernetes RBAC used by the Operator, run the following as a clus make installrbac -This set of Resources is created a single time unless a new Operator +This set of Resources is created a single time unless a new PGO release requires these Resources to be recreated. Note that when you -run *make installrbac* the set of keys used by the Operator REST API and +run *make installrbac* the set of keys used by the PGO REST API and also the pgbackrest ssh keys are generated. Verify the Operator Custom Resource Definitions are created as follows: @@ -199,14 +197,15 @@ You should see the *pgclusters* CRD among the listed CRD resource types. See the Security documentation for a description of the various RBAC resources created and used by the Operator. -## Default Installation - Deploy the Operator +## Default Installation - Deploy PGO + At this point, you as a normal Kubernetes user should be able to deploy the Operator. To do this, run the following Makefile target: make deployoperator -This will cause any existing Operator to be removed first, then the configuration to be bundled into a ConfigMap, then the Operator Deployment to be created. +This will cause any existing PGO installation to be removed first, then the configuration to be bundled into a ConfigMap, then the Operator Deployment to be created. -This will create a postgres-operator Deployment and a postgres-operator Service.Operator administrators needing to make changes to the Operator +This will create a postgres-operator Deployment and a postgres-operator Service.Operator administrators needing to make changes to the PGO configuration would run this make target to pick up any changes to pgo.yaml, pgo users/roles, or the Operator templates. @@ -217,17 +216,20 @@ created using the default installation by running the following: make cleannamespaces -This will permanently delete each namespace the Operator installation +This will permanently delete each namespace the PGO installation created previously. -## pgo CLI Installation -Most users will work with the Operator using the *pgo* CLI tool. That tool is downloaded from the GitHub Releases page for the Operator (https://github.com/crunchydata/postgres-operator/releases). Crunchy Enterprise Customer can download the pgo binaries from https://access.crunchydata.com/ on the downloads page. +## `pgo` client Installation -The *pgo* client is provided in Mac, Windows, and Linux binary formats, +Most users will work with the Operator using the `pgo` client. That tool is downloaded from the GitHub Releases page for the Operator (https://github.com/crunchydata/postgres-operator/releases). Crunchy Data customers can download the `pgo` binaries from https://access.crunchydata.com/ on the downloads page. + +The `pgo` client is provided in Mac, Windows, and Linux binary formats, download the appropriate client to your local laptop or workstation to work with a remote Operator. +You can also use the `pgo-client` container. + {{% notice info %}} If TLS authentication was disabled during installation, please see the [TLS Configuration Page] ({{< relref "Configuration/tls.md" >}}) for additional configuration information. @@ -245,9 +247,9 @@ Prior to using *pgo*, users testing the Operator on a single host can specify th pgo version ``` -That URL address needs to be reachable from your local *pgo* client host. Your Kubernetes administrator will likely need to create a network route, ingress, or LoadBalancer service to expose the Operator REST API to applications outside of the Kubernetes cluster. Your Kubernetes administrator might also allow you to run the Kubernetes port-forward command, contact your administrator for details. +That URL address needs to be reachable from your local `pgo` client host. Your Kubernetes administrator will likely need to create a network route, ingress, or LoadBalancer service to expose the PGO REST API to applications outside of the Kubernetes cluster. Your Kubernetes administrator might also allow you to run the Kubernetes port-forward command, contact your administrator for details. -Next, the *pgo* client needs to reference the keys used to secure the Operator REST API: +Next, the `pgo` client needs to reference the keys used to secure the PGO REST API: ``` export PGO_CA_CERT=$PGOROOT/conf/postgres-operator/server.crt @@ -259,7 +261,7 @@ You can also specify these keys on the command line as follows: pgo version --pgo-ca-cert=$PGOROOT/conf/postgres-operator/server.crt --pgo-client-cert=$PGOROOT/conf/postgres-operator/server.crt --pgo-client-key=$PGOROOT/conf/postgres-operator/server.key -{{% notice tip %}} if you are running the Operator on Google Cloud, you would open up another terminal and run *kubectl port-forward ...* to forward the Operator pod port 8443 to your localhost where you can access the Operator API from your local workstation. +{{% notice tip %}} if you are running PGO on Google Cloud, you would open up another terminal and run *kubectl port-forward ...* to forward the Postgres Operator pod port 8443 to your localhost where you can access the PGO API from your local workstation. {{% /notice %}} At this point, you can test connectivity between your laptop or workstation and the Postgres Operator deployed on a Kubernetes cluster as follows: @@ -270,7 +272,7 @@ You should get back a valid response showing the client and server version numbe ## Verify the Installation -Now that you have deployed the Operator, you can verify that it is running correctly. +Now that you have deployed PGO, you can verify that it is running correctly. You should see a pod running that contains the Operator: @@ -281,10 +283,10 @@ You should see a pod running that contains the Operator: That pod should show 3 of 3 containers in *running* state and that the operator is installed into the *pgo* namespace. -The sample environment script, examples/env.sh, if used creates some bash functions that you can use to view the Operator logs. This is useful in case you find one of the Operator containers not in a running status. +The sample environment script, examples/env.sh, if used creates some bash functions that you can use to view the Postgres Operator logs. This is useful in case you find one of the PGO containers not in a running status. -Using the pgo CLI, you can verify the versions of the client and server match as follows: +Using the `pgo` client, you can verify the versions of the client and server match as follows: pgo version -This also tests connectivity between your pgo client host and the Operator server. +This also tests connectivity between your `pgo` client host and Postgres Operator container. diff --git a/docs/content/installation/other/helm.md b/docs/content/installation/other/helm.md index a6698cb309..c940cf38c4 100644 --- a/docs/content/installation/other/helm.md +++ b/docs/content/installation/other/helm.md @@ -5,12 +5,13 @@ draft: false weight: 200 --- -# The PostgreSQL Operator Helm Chart +# PGO: The Postgres Operator Helm Chart ## Overview -The PostgreSQL Operator comes with a container called `pgo-deployer` which -handles a variety of lifecycle actions for the PostgreSQL Operator, including: +PGO, the Postgres Operator from Crunchy Data, comes with a +container called `pgo-deployer` which handles a variety of +lifecycle actions for the PostgreSQL Operator, including: - Installation - Upgrading @@ -205,11 +206,11 @@ helm install metrics -n pgo /path/to/metrics/chart_dir ## Upgrade and Uninstall -Once install has be completed using Helm, it will also be used to upgrade and +Once install has be completed using Helm, it will also be used to upgrade and uninstall your PostgreSQL Operator. {{% notice tip %}} -The `name` and `namespace` in the following sections should match the options +The `name` and `namespace` in the following sections should match the options provided at install. {{% /notice %}} @@ -235,7 +236,7 @@ helm uninstall -n ## Debugging -When the `pgo-deployer` job does not complete successfully, the resources that +When the `pgo-deployer` job does not complete successfully, the resources that are created and normally cleaned up by Helm will be left in your Kubernetes cluster. This will allow you to use the failed job and its logs to debug the issue. The following command will show the logs for the `pgo-deployer` diff --git a/docs/content/installation/pgo-client.md b/docs/content/installation/pgo-client.md index 69dae759e1..6c584168df 100644 --- a/docs/content/installation/pgo-client.md +++ b/docs/content/installation/pgo-client.md @@ -1,5 +1,5 @@ --- -title: "Install `pgo` Client" +title: "Install \"pgo\" Client" date: draft: false weight: 30 @@ -8,23 +8,22 @@ weight: 30 # Install the PostgreSQL Operator (`pgo`) Client The following will install and configure the `pgo` client on all systems. For the -purpose of these instructions it's assumed that the Crunchy PostgreSQL Operator -is already deployed. +purpose of these instructions it's assumed that PGO: the Postgres Operator from Crunchy +Data is already deployed. ## Prerequisites * For Kubernetes deployments: [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) configured to communicate with Kubernetes * For OpenShift deployments: [oc](https://docs.openshift.com/container-platform/3.11/cli_reference/get_started_cli.html) configured to communicate with OpenShift -To authenticate with the Crunchy PostgreSQL Operator API: +To authenticate with the PGO API: * Client CA Certificate * Client TLS Certificate * Client Key * `pgouser` file containing `:` -All of the requirements above should be obtained from an administrator who installed the Crunchy -PostgreSQL Operator. +All of the requirements above should be obtained from an administrator who installed PGO. ## Linux and macOS @@ -288,5 +287,4 @@ properly by simply running the following: pgo version ``` -If the above command outputs versions of both the client and API server, the Crunchy PostgreSQL -Operator client has been installed successfully. +If the above command outputs versions of both the client and API server, the `pgo` client has been installed successfully. diff --git a/docs/content/installation/postgres-operator.md b/docs/content/installation/postgres-operator.md index 62ec599413..8243f9e8e4 100644 --- a/docs/content/installation/postgres-operator.md +++ b/docs/content/installation/postgres-operator.md @@ -1,11 +1,11 @@ --- -title: Install the PostgreSQL Operator +title: Install PGO the Postgres Operator date: draft: false weight: 20 --- -# The PostgreSQL Operator Installer +# Install PGO the Postgres Operator ## Quickstart @@ -23,7 +23,7 @@ the PostgreSQL Operator. ## Overview -The PostgreSQL Operator comes with a container called `pgo-deployer` which +PGO comes with a container called `pgo-deployer` which handles a variety of lifecycle actions for the PostgreSQL Operator, including: - Installation @@ -52,7 +52,7 @@ environmental requirements. By default, the `pgo-deployer` uses a ServiceAccount called `pgo-deployer-sa` that has a ClusterRoleBinding (`pgo-deployer-crb`) with several ClusterRole permissions. This is required to create the [Custom Resource Definitions](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) -that power the PostgreSQL Operator. While the PostgreSQL Operator itself can be +that power PGO. While the PostgreSQL Operator itself can be scoped to a specific namespace, you will need to have `cluster-admin` for the initial deployment, or privileges that allow you to install Custom Resource Definitions. The required list of privileges are available in the [postgres-operator.yml](https://raw.githubusercontent.com/CrunchyData/postgres-operator/v{{< param operatorVersion >}}/installers/kubectl/postgres-operator.yml) file: @@ -120,7 +120,7 @@ PostgreSQL Operator cannot create the RBAC itself. ## Configuration - `postgres-operator.yml` The `postgres-operator.yml` file contains all of the configuration parameters -for deploying the PostgreSQL Operator. The [example file](https://github.com/CrunchyData/postgres-operator/blob/v{{< param operatorVersion >}}/installers/kubectl/postgres-operator.yml) +for deploying PGO. The [example file](https://github.com/CrunchyData/postgres-operator/blob/v{{< param operatorVersion >}}/installers/kubectl/postgres-operator.yml) contains defaults that should work in most Kubernetes environments, but it may require some customization. @@ -174,7 +174,7 @@ oc secrets link --for=pull --namespace=}}) interface -to help with using the PostgreSQL Operator. However, it is also recommend that +The Postgres Operator installer will install the [`pgo` client]({{< relref "/pgo-client/_index.md" >}}) interface +to help with using PGO. However, it is also recommend that you have access to [`kubectl`](https://kubernetes.io/docs/tasks/tools/install-kubectl/) or [`oc`](https://www.okd.io/download.html) and are able to communicate with the Kubernetes or OpenShift cluster that you are working with. @@ -62,7 +62,7 @@ access to these ports. ### Application Ports -The PostgreSQL Operator deploys different services to support a production +PGO deploys different services to support a production PostgreSQL environment. Below is a list of the applications and their default Service ports. diff --git a/docs/content/pgo-client/_index.md b/docs/content/pgo-client/_index.md index f78dc13974..600e951423 100644 --- a/docs/content/pgo-client/_index.md +++ b/docs/content/pgo-client/_index.md @@ -6,11 +6,11 @@ weight: 50 --- The PostgreSQL Operator Client, aka `pgo`, is the most convenient way to -interact with the PostgreSQL Operator. `pgo` provides many convenience methods +interact with the Postgres Operator. `pgo` provides many convenience methods for creating, managing, and deleting PostgreSQL clusters through a series of simple commands. The `pgo` client interfaces with the API that is provided by the PostgreSQL Operator and can leverage the RBAC and TLS systems that are -provided by the PostgreSQL Operator +provided by the PGO: PostgreSQL Operator. ![Architecture](/Operator-Architecture.png) diff --git a/docs/content/pgo-client/common-tasks.md b/docs/content/pgo-client/common-tasks.md index 87f08b2878..6fe881f1cd 100644 --- a/docs/content/pgo-client/common-tasks.md +++ b/docs/content/pgo-client/common-tasks.md @@ -744,7 +744,7 @@ high availability on the PostgreSQL cluster manually. You can re-enable high availability by executing the following command: ``` -pgo update cluster hacluster --autofail=true +pgo update cluster hacluster --enable-autofail ``` ### Logical Backups (`pg_dump` / `pg_dumpall`) @@ -1314,6 +1314,14 @@ pgo create cluster hippo-standby --standby --replica-count=2 \ --password=opensourcehippo ``` +If you are unsure of your user credentials form the original `hippo` cluster, +you can retrieve them using the [`pgo show user`]({{< relref "/pgo-client/reference/pgo_show_user.md" >}}) +command with the `--show-system-accounts` flag: + +``` +pgo show user hippo --show-system-accounts +``` + The standby cluster will take a few moments to bootstrap, but it is now set up! ### Promoting a Standby Cluster diff --git a/docs/content/pgo-client/reference/pgo_update.md b/docs/content/pgo-client/reference/pgo_update.md index 6afaed445c..cc42f9cd62 100644 --- a/docs/content/pgo-client/reference/pgo_update.md +++ b/docs/content/pgo-client/reference/pgo_update.md @@ -9,8 +9,8 @@ Update a pgouser, pgorole, or cluster The update command allows you to update a pgouser, pgorole, or cluster. For example: - pgo update cluster --selector=name=mycluster --autofail=false - pgo update cluster --all --autofail=true + pgo update cluster --selector=name=mycluster --disable-autofail + pgo update cluster --all --enable-autofail pgo update namespace mynamespace pgo update pgbouncer mycluster --rotate-password pgo update pgorole somerole --pgorole-permission="Cat" diff --git a/docs/content/pgo-client/reference/pgo_update_cluster.md b/docs/content/pgo-client/reference/pgo_update_cluster.md index fa3e1b128d..4350d7d073 100644 --- a/docs/content/pgo-client/reference/pgo_update_cluster.md +++ b/docs/content/pgo-client/reference/pgo_update_cluster.md @@ -9,7 +9,7 @@ Update a PostgreSQL cluster Update a PostgreSQL cluster. For example: - pgo update cluster mycluster --autofail=false + pgo update cluster mycluster --disable-autofail pgo update cluster mycluster myothercluster --disable-autofail pgo update cluster --selector=name=mycluster --disable-autofail pgo update cluster --all --enable-autofail diff --git a/docs/content/pgo-client/reference/pgo_upgrade.md b/docs/content/pgo-client/reference/pgo_upgrade.md index 8490a8d13e..7225e6be02 100644 --- a/docs/content/pgo-client/reference/pgo_upgrade.md +++ b/docs/content/pgo-client/reference/pgo_upgrade.md @@ -7,10 +7,10 @@ Perform a cluster upgrade. ### Synopsis -UPGRADE allows you to perform a comprehensive PGCluster upgrade - (for use after performing a Postgres Operator upgrade). +UPGRADE allows you to perform a comprehensive PGCluster upgrade + (for use after performing a Postgres Operator upgrade). For example: - + pgo upgrade mycluster Upgrades the cluster for use with the upgraded Postgres Operator version. @@ -23,12 +23,13 @@ pgo upgrade [flags] ``` -h, --help help for upgrade --ignore-validation Disables version checking against the image tags when performing an cluster upgrade. + --no-prompt No command line confirmation. ``` ### Options inherited from parent commands ``` - --apiserver-url string The URL for the PostgreSQL Operator apiserver that will process the request from the pgo client. + --apiserver-url string The URL for the PostgreSQL Operator apiserver that will process the request from the pgo client. Note that the URL should **not** end in a '/'. --debug Enable additional output for debugging. --disable-tls Disable TLS authentication to the Postgres Operator. --exclude-os-trust Exclude CA certs from OS default trust store @@ -42,4 +43,8 @@ pgo upgrade [flags] * [pgo](/pgo-client/reference/pgo/) - The pgo command line interface. +<<<<<<< HEAD ###### Auto generated by spf13/cobra on 2-Jul-2020 +======= +###### Auto generated by spf13/cobra on 20-Dec-2020 +>>>>>>> c8c29c3d0... Add missing `--no-prompt` flag to `pgo upgrade` diff --git a/docs/content/quickstart/_index.md b/docs/content/quickstart/_index.md index 4eb0572c23..012dbee381 100644 --- a/docs/content/quickstart/_index.md +++ b/docs/content/quickstart/_index.md @@ -5,25 +5,26 @@ draft: false weight: 10 --- -# PostgreSQL Operator Quickstart +# PGO: PostgreSQL Operator Quickstart -Can't wait to try out the PostgreSQL Operator? Let us show you the quickest possible path to getting up and running. +Can't wait to try out PGO, the Postgres Operator from Crunchy Data? Let us show +you the quickest possible path to getting up and running. -There are two paths to quickly get you up and running with the PostgreSQL Operator: +There are two paths to quickly get you up and running with PGO: -- [Installation via the PostgreSQL Operator Installer](#postgresql-operator-installer) +- [Installation via the Postgres Operator Installer](#postgresql-operator-installer) - Installation via a Marketplace - Installation via [Google Cloud Platform Marketplace](#google-cloud-platform-marketplace) Marketplaces can help you get more quickly started in your environment as they provide a mostly automated process, but there are a few steps you will need to take to ensure you can fully utilize your PostgreSQL Operator environment. -# PostgreSQL Operator Installer +# Postgres Operator Installer Below will guide you through the steps for installing and using the PostgreSQL Operator using an installer that works with Ansible. ## The Very, VERY Quickstart -If your environment is set up to use hostpath storage (found in things like [minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) or [OpenShift Code Ready Containers](https://developers.redhat.com/products/codeready-containers/overview), the following command could work for you: +If your environment is set up to use hostpath storage (found in things like [minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) or [OpenShift Code Ready Containers](https://developers.redhat.com/products/codeready-containers/overview), the following command could work for you for installing PGO: ``` kubectl create namespace pgo @@ -80,14 +81,18 @@ kubectl apply -f postgres-operator.yml This will launch the `pgo-deployer` container that will run the various setup and installation jobs. This can take a few minutes to complete depending on your Kubernetes cluster. +<<<<<<< HEAD While the installation is occurring, download the `pgo` client set up script. This will help set up your local environment for using the PostgreSQL Operator: +======= +During or after the installation of PGO: the Postgres Operator, download the `pgo` client set up script. This will help set up your local environment for using the Postgres Operator: +>>>>>>> bcd1d417d... Updates to installation instructions and other guidance ``` curl https://raw.githubusercontent.com/CrunchyData/postgres-operator/v{{< param operatorVersion >}}/installers/kubectl/client-setup.sh > client-setup.sh chmod +x client-setup.sh ``` -When the PostgreSQL Operator is done installing, run the client setup script: +When the Postgres Operator is done installing, run the client setup script: ``` ./client-setup.sh @@ -124,9 +129,13 @@ source ~/.bashrc ## Step 3: Verification -Below are a few steps to check if the PostgreSQL Operator is up and running. +Below are a few steps to check if PGO: the Postgres Operator is up and running. +<<<<<<< HEAD By default, the PostgreSQL Operator installs into a namespace called `pgo`. First, see that the the Kubernetes Deployment of the Operator exists and is healthy: +======= +By default, PGO installs into a namespace called `pgo`. First, see that the Kubernetes Deployment of PGO exists and is healthy: +>>>>>>> bcd1d417d... Updates to installation instructions and other guidance ```shell kubectl -n pgo get deployments @@ -152,7 +161,7 @@ NAME READY STATUS RESTARTS AGE postgres-operator-56d6ccb97-tmz7m 4/4 Running 0 2m ``` -Finally, let's see if we can connect to the PostgreSQL Operator from the `pgo` command-line client. The Ansible installer installs the `pgo` command line client into your environment, along with the username/password file that allows you to access the PostgreSQL Operator. In order to communicate with the PostgreSQL Operator API server, you will first need to set up a [port forward](https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/) to your local environment. +Finally, let's see if we can connect to the Postgres Operator from the `pgo` command-line client. The Ansible installer installs the `pgo` command line client into your environment, along with the username/password file that allows you to access the PostgreSQL Operator. In order to communicate with the PostgreSQL Operator API server, you will first need to set up a [port forward](https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/) to your local environment. In a new console window, run the following command to set up a port forward: @@ -175,7 +184,7 @@ pgo-apiserver version {{< param operatorVersion >}} ## Step 4: Have Some Fun - Create a PostgreSQL Cluster -The quickstart installation method creates a namespace called `pgo` where the PostgreSQL Operator manages PostgreSQL clusters. Try creating a PostgreSQL cluster called `hippo`: +The quickstart installation method creates a namespace called `pgo` where PGO, the Postgres Operator, manages PostgreSQL clusters. Try creating a PostgreSQL cluster called `hippo`: ```shell pgo create cluster -n pgo hippo @@ -196,7 +205,11 @@ created Pgcluster hippo workflow id 1cd0d225-7cd4-4044-b269-aa7bedae219b ``` +<<<<<<< HEAD This will create a PostgreSQL cluster named `hippo`. It may take a few moments for the cluster to be provisioned. You can see the status of this cluster using the `pgo test` command: +======= +This will create a Postgres cluster named `hippo`. It may take a few moments for the cluster to be provisioned. You can see the status of this cluster using the [`pgo test`]({{< relref "pgo-client/reference/pgo_test.md" >}}) command: +>>>>>>> bcd1d417d... Updates to installation instructions and other guidance ```shell pgo test -n pgo hippo @@ -214,7 +227,13 @@ cluster : hippo The `pgo test` command provides you the basic information you need to connect to your PostgreSQL cluster from within your Kubernetes environment. For more detailed information, you can use `pgo show cluster -n pgo hippo`. +<<<<<<< HEAD # Marketplaces +======= +## Connect to a PostgreSQL Cluster + +By default, PGO creates a database inside the cluster with the same name of the cluster, in this case, `hippo`. Below demonstrates how we can connect to `hippo`. +>>>>>>> bcd1d417d... Updates to installation instructions and other guidance Below is the list of the marketplaces where you can find the Crunchy PostgreSQL Operator: @@ -224,7 +243,11 @@ Follow the instructions below for the marketplace that you want to use to deploy ## Google Cloud Platform Marketplace +<<<<<<< HEAD The PostgreSQL Operator is installed as part of the [Crunchy PostgreSQL for GKE](https://console.cloud.google.com/marketplace/details/crunchydata/crunchy-postgresql-operator) project that is available in the Google Cloud Platform Marketplace (GCP Marketplace). Please follow the steps deploy to get the PostgreSQL Operator deployed! +======= +To get the information about all PostgreSQL users that PGO is managing, you will need to use the `--show-system-accounts` flag: +>>>>>>> bcd1d417d... Updates to installation instructions and other guidance ### Step 1: Prerequisites @@ -243,7 +266,11 @@ For this example we are deploying the operator into a namespace called `pgo`. Fi kubectl -n pgo get deployments ``` +<<<<<<< HEAD If successful, you should see output similar to this: +======= +PGO, the Postgres Operator, creates a service with the same name as the cluster. See for yourself! Get a list of all of the Services available in the `pgo` namespace: +>>>>>>> bcd1d417d... Updates to installation instructions and other guidance ``` NAME READY UP-TO-DATE AVAILABLE AGE @@ -330,7 +357,11 @@ chmod +x pgo ### Step 6: Connect to the PostgreSQL Operator +<<<<<<< HEAD Finally, let's see if we can connect to the PostgreSQL Operator from the `pgo` client. In order to communicate with the PostgreSQL Operator API server, you will first need to set up a [port forward](https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/) to your local environment. +======= +If you already attempted to install PGO and that failed, the easiest way to clean up that installation is to delete the [Namespace](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/) that you attempted to install the Postgres Operator into. **Note: This deletes all of the other objects in the Namespace, so please be sure this is OK!** +>>>>>>> bcd1d417d... Updates to installation instructions and other guidance In a new console window, run the following command to set up a port forward: @@ -344,6 +375,7 @@ Back to your original console window, you can verify that you can connect to the pgo version ``` +<<<<<<< HEAD If successful, you should see output similar to this: ``` @@ -352,6 +384,11 @@ pgo-apiserver version {{< param operatorVersion >}} ``` ### Step 7: Create a Namespace +======= +#### Get the Postgres Operator Installer Manifest + +You will need to download the Postgres Operator Installer manifest to your environment, which you can do with the following command: +>>>>>>> bcd1d417d... Updates to installation instructions and other guidance We are almost there! You can optionally add a namespace that can be managed by the PostgreSQL Operator to watch and to deploy a PostgreSQL cluster into. @@ -365,7 +402,11 @@ verify the operator has access to the newly added namespace pgo show namespace --all ``` +<<<<<<< HEAD you should see out put similar to this: +======= +#### Configure the Postgres Operator Installer +>>>>>>> bcd1d417d... Updates to installation instructions and other guidance ```shell pgo username: admin @@ -393,13 +434,21 @@ created Pgcluster hippo workflow id 1cd0d225-7cd4-4044-b269-aa7bedae219b ``` +<<<<<<< HEAD This will create a PostgreSQL cluster named `hippo`. It may take a few moments for the cluster to be provisioned. You can see the status of this cluster using the `pgo test` command: +======= +If you are using either OpenShift or CodeReady Containers and you have a `restricted` Security Context Constraint, you will need to set `disable_fsgroup` to `true` in order to deploy PGO. +>>>>>>> bcd1d417d... Updates to installation instructions and other guidance ```shell pgo test -n wateringhole hippo ``` +<<<<<<< HEAD When everything is up and running, you should see output similar to this: +======= +When you are done editing the file, you can install PGO by running the following commands: +>>>>>>> bcd1d417d... Updates to installation instructions and other guidance ``` cluster : hippo diff --git a/docs/content/releases/4.3.3.md b/docs/content/releases/4.3.3.md new file mode 100644 index 0000000000..c76495049d --- /dev/null +++ b/docs/content/releases/4.3.3.md @@ -0,0 +1,48 @@ +--- +title: "4.3.3" +date: +draft: false +weight: 93 +--- + +Crunchy Data announces the release of the [PostgreSQL Operator](https://www.crunchydata.com/products/crunchy-postgresql-operator/) 4.3.3 on August 17, 2020. + +The PostgreSQL Operator is released in conjunction with the [Crunchy Container Suite](https://github.com/CrunchyData/crunchy-containers/). + +The PostgreSQL Operator 4.3.3 release includes the following software versions upgrades: + +- The PostgreSQL containers now use versions 12.4, 11.9, 10.14, 9.6.19, and 9.5.23 +- pgBouncer is now at version 1.14. + +PostgreSQL Operator is tested with Kubernetes 1.13 - 1.18, OpenShift 3.11+, OpenShift 4.3+, Google Kubernetes Engine (GKE), and VMware Enterprise PKS 1.3+. + + +## Changes + +- Perform a `pg_dump` from a specific database using the `--database` flag when using `pgo backup` with `--backup-type=pgdump`. +- Restore a `pg_dump` to a specific database using the `--pgdump-database` flag using `pgo restore` when `--backup-type=pgdump` is specified. +- Add the `--client` flag to `pgo version` to output the client version of `pgo`. +- The PostgreSQL cluster scope is now utilized to identify and sync the ConfigMap responsible for the DCS for a PostgreSQL cluster. +- The `PGMONITOR_PASSWORD` is now populated by an environmental variable secret. This environmental variable is only set on a primary instance as it is only needed at the time a PostgreSQL cluster is initialized. +- Remove "Operator Start Time" from `pgo status` as it is more convenient and accurate to get this information from `kubectl` and the like, and it was not working due to RBAC privileges. (Reported by @mw-0). +- `pgo-rmdata` container no longer runs as the `root` user, but as `daemon` (UID 2) +- Remove dependency on the `expenv` binary that was included in the PostgreSQL Operator release. All `expenv` calls were either replaced with the native `envsubst` program or removed. + +## Fixes + +- Add validation to ensure that limits for CPU/memory are greater-than-or-equal-to the requests. This applies to any command that can set a limit/request. +- Ensure WAL archives are pushed to all repositories when pgBackRest is set to use both a local and a S3-based repository +- Silence expected error conditions when a pgBackRest repository is being initialized. +- Add the `watch` permissions to the `pgo-deployer` ServiceAccount. +- Ensure `client-setup.sh` works with when there is an existing `pgo` client in the install path +- Ensure the PostgreSQL Operator can be uninstalled by adding `list` verb ClusterRole privileges to several Kubernetes objects. +- Bring up the correct number of pgBouncer replicas when `pgo update cluster --startup` is issued. +- Fixed issue where `pgo scale` would not work after `pgo update cluster --shutdown` and `pgo update cluster --startup` were run. +- Ensure `pgo scaledown` deletes external WAL volumes from the replica that is removed. +- Fix for PostgreSQL cluster startup logic when performing a restore. +- Do not consider non-running Pods as primary Pods when checking for multiple primaries (Reported by @djcooklup). +- Fix race condition that could occur while `pgo upgrade` was running while a HA configuration map attempted to sync. (Reported by Paul Heinen @v3nturetheworld). +- Silence "ConfigMap not found" error messages that occurred during PostgreSQL cluster initialization, as these were not real errors. +- Fix an issue with controller processing, which could manifest in PostgreSQL clusters not being deleted. +- Eliminate `gcc` from the `postgres-ha` and `pgadmin4` containers. +- Fix `pgo label` when applying multiple labels at once. diff --git a/docs/content/releases/4.4.1.md b/docs/content/releases/4.4.1.md new file mode 100644 index 0000000000..7057ee69ae --- /dev/null +++ b/docs/content/releases/4.4.1.md @@ -0,0 +1,23 @@ +--- +title: "4.4.1" +date: +draft: false +weight: 79 +--- + +Crunchy Data announces the release of the [PostgreSQL Operator](https://www.crunchydata.com/products/crunchy-postgresql-operator/) 4.4.1 on August 17, 2020. + +The PostgreSQL Operator is released in conjunction with the [Crunchy Container Suite](https://github.com/CrunchyData/crunchy-containers/). + +The PostgreSQL Operator 4.4.1 release includes the following software versions upgrades: + +- The PostgreSQL containers now use versions 12.4, 11.9, 10.14, 9.6.19, and 9.5.23 + +PostgreSQL Operator is tested with Kubernetes 1.13 - 1.18, OpenShift 3.11+, OpenShift 4.3+, Google Kubernetes Engine (GKE), and VMware Enterprise PKS 1.3+. + +## Fixes + +- The pgBackRest URI style defaults to `host` if it is not set. +- Fix `pgo label` when applying multiple labels at once. +- pgBadger now has a default memory limit of 64Mi, which should help avoid a visit from the OOM killer. +- Fix `pgo create pgorole` so that the expression `--permissions=*` works. diff --git a/docs/content/releases/4.4.2.md b/docs/content/releases/4.4.2.md new file mode 100644 index 0000000000..28e75b3832 --- /dev/null +++ b/docs/content/releases/4.4.2.md @@ -0,0 +1,36 @@ +--- +title: "4.4.2" +date: +draft: false +weight: 78 +--- + +Crunchy Data announces the release of the [PostgreSQL Operator](https://www.crunchydata.com/products/crunchy-postgresql-operator/) 4.4.2 on November 25, 2020. + +The PostgreSQL Operator is released in conjunction with the [Crunchy Container Suite](https://github.com/CrunchyData/crunchy-containers/). + +The PostgreSQL Operator 4.4.3 release includes the following software versions upgrades: + +- The PostgreSQL containers now use versions 12.5, 11.10, 10.15, 9.6.20, and 9.5.24 + +PostgreSQL Operator is tested with Kubernetes 1.13 - 1.18, OpenShift 3.11+, OpenShift 4.3+, Google Kubernetes Engine (GKE), and VMware Enterprise PKS 1.3+. + +## Fixes + +- Proper determination if a `pgcluster` custom resource creation has been processed by its corresponding Postgres Operator controller. This prevents the custom resource from being run by the creation logic multiple times. +- The `pgo scaledown` now allows for the removal of replicas that are not actively running. +- The `pgo scaledown --query` command now shows replicas that may not be in an active state. +- Fix readiness check for a standby leader. Previously, the standby leader would not report as ready, even though it was. Reported by Alec Rooney (@alrooney). +- pgBackRest commands can now be executed even if there are multiple pgBackRest Pods available in a Deployment, so long as there is only one "running" pgBackRest Pod. Reported by Rubin Simons (@rubin55). +- Ensure pgBackRest S3 Secrets can be upgraded from PostgreSQL Operator 4.3. +- Ensure pgBouncer Port is derived from the cluster's port, not the Operator configuration defaults. +- External WAL PVCs are only removed for the replica they are targeted for on a scaledown. Reported by (@dakine1111). +- Ensure `pgo show backup` will work regardless of state of any of the PostgreSQL clusters. This pulls the information directly from the pgBackRest Pod itself. Reported by (@saltenhub). +- When deleting a cluster with the `--keep-backups` flag, ensure that backups that were created via `--backup-type=pgdump` are retained. +- Return an error if a cluster is not found when using `pgo df` instead of timing out. +- The `operator` container will no longer panic if all Deployments are scaled to `0` without using the `pgo update cluster --shutdown` command. +- Ensure that sidecars (e.g. metrics collection, pgAdmin 4, pgBouncer) are deployable when using the PostGIS-enabled PostgreSQL image. Reported by Jean-Denis Giguère (@jdenisgiguere). +- Allow for special characters in pgBackRest environmental variables. Reported by (@SockenSalat). +- Ensure password for the `pgbouncer` administrative user stays synchronized between an existing Kubernetes Secret and PostgreSQL should the pgBouncer be recreated. +- When uninstalling an instance of the Postgres Operator in a Kubernetes cluster that has multiple instances of the Postgres Operator, ensure that only the requested instance to be uninstalled is the one that's uninstalled. +- The logger no longer defaults to using a log level of `DEBUG`. diff --git a/docs/content/releases/4.4.3.md b/docs/content/releases/4.4.3.md new file mode 100644 index 0000000000..8b0a10e0c9 --- /dev/null +++ b/docs/content/releases/4.4.3.md @@ -0,0 +1,46 @@ +--- +title: "4.4.3" +date: +draft: false +weight: 77 +--- + +Crunchy Data announces the release of the [PostgreSQL Operator](https://www.crunchydata.com/products/crunchy-postgresql-operator/) 4.4.3 on March 1, 2021. + +The PostgreSQL Operator is released in conjunction with the [Crunchy Container Suite](https://github.com/CrunchyData/crunchy-containers/). + +The PostgreSQL Operator 4.4.3 release includes the following software versions upgrades: + +- The PostgreSQL containers now use versions 12.6, 11.11, 10.16, 9.6.21, and 9.5.25 + +PostgreSQL Operator is tested against Kubernetes 1.17 - 1.20, OpenShift 3.11, OpenShift 4.4+, Google Kubernetes Engine (GKE), Amazon EKS, Microsoft AKS, and VMware Enterprise PKS 1.3+, and works on other Kubernetes distributions as well. + +## Changes + +- When using the `--restore-from` option on `pgo create cluster` to create a new PostgreSQL cluster, the cluster bootstrap Job is now automatically removed if it completes successfully. +- The `--compress-type` flag is now supported for the backup options (`--backup-opts`) for pgBackRest backups with `pgo backup`. `none`, `gz`, `bz2`, and `lz4` are all supported. Presently `zst` is not supported. +- Add the `--no-prompt` flag to `pgo upgrade`. The mechanism to disable the prompt verification was already in place, but the flag was not exposed. Reported by (@devopsevd). +- Removes certain characters that causes issues in shell environments from consideration when using the random password generator, which is used to create default passwords or with `--rotate-password`. +- Allow for the `--link-map` attribute for a pgBackRest option, which can help with the restore of an existing cluster to a new cluster that adds an external WAL volume. +- Revert setting "UsePAM" to "yes" by default as the bug fix in Docker that required that change was applied roughly one year ago. + +## Fixes + +- Fix issue where `pgo test` would indicate every Service was a replica if the cluster name contained the word `replica` in it. Reported by Jose Joye (@jose-joye). +- Do not consider Evicted Pods as part of `pgo test`. This eliminates a behavior where faux primaries are considered as part of `pgo test`. Reported by Dennis Jacobfeuerborn (@dennisjac). +- Fix `pgo df` to not fail in the event it tries to execute a command within a dangling container from the bootstrap process when `pgo create cluster --restore-from` is used. Reported by Ignacio J.Ortega (@IJOL). +- `pgo df` will now only attempt to execute in running Pods, i.e. it does not attempt to run in evicted Pods. Reported by (@kseswar). +- Ensure the sync replication ConfigMap is removed when a cluster is deleted. +- Fix crash in shutdown logic when attempting to shut down a cluster where no primaries exist. Reported by Jeffrey den Drijver (@JeffreyDD). +- Fix syntax in recovery check command which could lead to failures when manually promoting a standby cluster. Reported by (@SockenSalat). +- Fix issue with pgo backup where it was unable to take a backup from a new primary after pgo failover was called. Reported by (@mesobreira). +- Do not trigger a backup if a standby cluster fails over. Reported by (@aprilito1965). +- Ensure `archive_mode` is forced to `on` when performing using the "restore in place" method. This ensures that the timeline is correctly incremented post-restore, which could manifest itself with various types of WAL archive failures. +- Generally improvements to initialization of a standby cluster. +- Ensure proper label parsing based on Kubernetes rules and that it is consistently applied across all functionality that uses labels. Reported by José Joye (@jose-joye). +- Remove legacy `defaultMode` setting on the volume instructions for the pgBackRest repo Secret as the `readOnly` setting is used on the mount itself. Reported by (@szhang1). +- Only attempts to start scheduled backups in running pgBackRest repository Pods. Reported by Satria Sahputra (@satriashp). +- Allow for `Restart` API server permission to be explicitly set. Reported by Aleksander Roszig (@AleksanderRoszig). +- Update `pgo-target` permissions to match expectations for modern Kubernetes versions. +- During a major upgrade, ensure permissions are correct on the old data directory before running `pg_upgrade`. +- Ensure major upgrades via `crunchy-upgrade` support PostgreSQL 12. Reported by (@lbartnicki92). diff --git a/docs/layouts/partials/flex/body-aftercontent.html b/docs/layouts/partials/flex/body-aftercontent.html new file mode 100644 index 0000000000..8d5f330f56 --- /dev/null +++ b/docs/layouts/partials/flex/body-aftercontent.html @@ -0,0 +1,44 @@ +
+ {{ partial "next-prev-page.html" . }} +
+ + + + +
+ +
+ {{if .Params.tags }} +
+ {{ range $index, $tag := .Params.tags }} + {{ $tag }} + {{ end }} +
+ {{end}} + + {{with .Params.LastModifierDisplayName}} +
+ {{ . }} +
+ {{end}} + +{{ if not .Page.Lastmod.IsZero }} +
+ {{T "last-update-on"}} {{ .Page.Lastmod.Format "02/01/2006" }} +
+ {{end}} + +
+ + +
+
+ +
+

© 2017 - 2021 Crunchy Data Solutions, Inc.

+
+ + +
+ +{{ partial "flex/scripts.html" . }} diff --git a/docs/static/crunchy-logo.jpg b/docs/static/crunchy-logo.jpg deleted file mode 100644 index 01f9c9b1a4..0000000000 Binary files a/docs/static/crunchy-logo.jpg and /dev/null differ diff --git a/docs/static/logos/TRADEMARKS.md b/docs/static/logos/TRADEMARKS.md new file mode 100644 index 0000000000..e97d80757d --- /dev/null +++ b/docs/static/logos/TRADEMARKS.md @@ -0,0 +1,143 @@ +# PGO Trademark Guidelines + +## 1. Introduction + +This document - the "Policy" - outlines the policy of The PGO Project (the "Project") for the use of our trademarks. + +A trademark’s role is to assure consumers about the quality of the associated products or services. Because an open source license allows you to modify the copyrighted software, we cannot be sure your modified software will not mislead recipients if it is distributed under our trademarks. So, this Policy describes when you may or may not use our trademarks. + +In this Policy, we are not trying to limit the lawful use of our trademarks, but rather describe what we consider lawful use. Trademark law can be ambiguous, so we hope to clarify whether we will consider your use permitted or non-infringing. + +The following sections describe the trademarks this Policy covers, as well as trademark uses we permit. If you want to use our trademarks in ways this Policy doesn’t address, please see "Where to get further information" below for contact information. Any use that does not comply with this Policy, or for which we have not separately provided written permission, is not a use we have approved. + +## 2. We are committed to open source principles + +We want to encourage and facilitate community use of our trademarks in a way that ensures the trademarks are meaningful source and quality indicators for our software and the associated goods and services and continue to embody the high reputation of the software and its associated community. This Policy therefore balances our need to ensure our trademarks remain reliable quality indicators and our community members’ desire to be full Project participants. + +## 3. Trademarks subject to the Policy + +Our trademarks + +This Policy covers: + +### 3.1 Our word trademarks and service marks (the "Word Marks"): + +PGO + +### 3.2. Our logo (the "Logo"): + +PGO: The Postgres Operator from Crunchy Data + +### 3.3 And the unique visual styling of our website (the "Trade Dress"). + +This Policy encompasses all Project trademarks and service marks, whether Word Marks, Logos or Trade Dress, which we collectively call the “Marks." We might not have registered some Marks, but this Policy covers our Marks regardless. + +## 4. Universal considerations for all uses + +Whenever you use a Mark, you must not mislead anyone, either directly or by omission, about what they are getting and from whom. The law reflects this requirement in two major ways described below: it prohibits creating a "likelihood of confusion," but allows for "nominative use." + +For example, you cannot say you are distributing PGO software when you're distributing a modified version of it, because you likely would confuse people, since they are not getting the same features and functionality they would get if they downloaded the software from us. You also cannot use our Logo on your website to suggest your website is an official website or we endorse your website. + +You can, though, say, for example, you like the PGO software, you are a PGO community participant, you are providing unmodified PGO software, or you wrote a book describing how to use the PGO software. + +This fundamental requirement - that it is always clear to people what they are getting and from whom - is reflected throughout this Policy. It should guide you if you are unsure about how you are using the Marks. + +In addition: + +You may not use the Marks in association with software use or distribution if you don’t comply with the license for the software. + +You may not use or register the Marks as part of your own trademark, service mark, domain name, company name, trade name, product name or service name. + +Trademark law does not allow you to use names or trademarks that are too similar to ours. You therefore may not use an obvious Mark variant or phonetic equivalent, foreign language equivalent, takeoff, or abbreviation for a similar or compatible product or service. + +You will not acquire rights in the Marks, and any goodwill you generate using the Marks inures solely to our benefit. +## 5. Use for software + +See universal considerations for all uses, above, which also apply. + +### 5.1 Uses we consider non-infringing + +#### 5.1.1 Distributing unmodified source code or unmodified executable code we have compiled + +When you redistribute our unmodified software, you are not changing its quality or nature. Therefore, you may retain the Word Marks and Logos we have placed on the software, to identify your redistributed software whether you redistribute by optical media, memory stick or download of unmodified source and executable code. This only applies if you are redistributing official software from this Project that you have not changed. You can find the Logo files [here](/). + +#### 5.1.2 Distributing executable code you have compiled, or modified code + +You may use the Word Marks, but not the Logos, to describe the software’s origin, that is, that the code you are distributing is a modification of our software. You may say, for example, "this software is derived from the source code from the PGO Project." +Of course, you can place your own trademarks or logos on software to which you have made substantive modifications, because by modifying the software, you have become the origin of the modified software. + +#### 5.1.3 Statements about compatibility, interoperability or derivation + +You may use the Word Marks, but not the Logos, to describe the relationship between your software and ours. You should use Our Mark after a verb or preposition that describes that relationship. So, you may say, for example, "Bob's plug-in for PGO," but may not say "Bob's PGO plug-in." + +#### 5.1.4 Using trademarks to show community affiliation + +This section discusses using our Marks for application themes, skins and personas. We discuss using our Marks on websites below. +You may use the Word Marks and the Logos in themes, personas, or skins to show your Project support, provided the use is non-commercial and clearly decorative, as contrasted with a use that appears to be the branding for a website or application. + +### 5.2 Permitted uses + +#### 5.2.1 Distributing unmodified software + +You may use the Word Marks and Logos to distribute executable code if you make the code from official Project source code using the procedure for creating an executable found at [https://access.crunchydata.com/documentation/postgres-operator/latest/installation/](https://access.crunchydata.com/documentation/postgres-operator/latest/installation/). + +#### 5.3 Unpermitted uses we consider infringing + +We will likely consider it an infringement to use the Marks in software that combines our software with another software program. In addition to creating a single executable for both software programs, we would consider your software "combined" with ours if installing our software automatically installs yours. We would not consider your software "combined" with ours if it is on the same media but requires separate, independent action to install. + +## 6. Use for non-software goods and services + +See universal considerations for all uses, above, which also apply. + +### 6.1 Uses we consider non-infringing + +#### 6.1.1 Websites + +You may use the Word Marks and Logos on your webpage to show your Project support if: + +- Your own branding or naming is more prominent than any Project Marks; +- The Logos hyperlink to the Project website: [https://github.com/CrunchyData/postgres-operator](https://github.com/CrunchyData/postgres-operator); +- The site does not mislead customers into thinking your website, service, or product is our website, service, or product; and +- The site clearly states the Project does not affiliate with or endorse you. + +#### 6.1.2 Publishing and presenting + +You can use the Word Marks in book and article titles, and the Logo in illustrations within a document, if the use does not suggest we published, endorse, or agree with your work. + +#### 6.1.3 Events + +You can use the Logo to promote the software and Project at events. + +### 6.2 Permitted uses + +#### 6.2.1 Meetups and user groups + +You can use the Word Marks as part of your meetup or user group name if: + +- The group’s main focus is the software; +- Any software or services the group provides are without cost; +- The group does not make a profit; +- Any charge to attend meetings is only to cover the cost of the venue, food and drink. + +The universal considerations for all uses, above, still apply: specifically, you may not use or register the Marks as part of your own trademark, service mark, domain name, company name, trade name, product name or service name. + +### 6.3 Unpermitted uses we consider infringing + +We will likely consider it an infringement to use the Marks as part of a domain name or subdomain. +We also would likely consider it an infringement to use the Marks on for-sale promotional goods. + +## 7 General Information + +### 7.1 Trademark legends + +If you are using our Marks in a way described in the sections entitled "Permitted uses," put the following notice at the foot of the page where you have used the Mark (or, if in a book, on the credits page), on packaging or labeling, and on advertising or marketing materials: "The PGO Project is a trademark of Crunchy Data Solutions, Inc., used with permission." + +### 7.2 What to do when you see abuse + +If you are aware of a confusing use or misuse of the Marks, we would appreciate you bringing it to our attention. Please contact us at [trademarks@crunchydata.com](mailto:trademarks@crunchydata.com) so we can investigate it further. + +### 7.3 Where to get further information + +If you have questions, wish to speak about using our Marks in ways the Policy doesn’t address, or see abuse of our Marks, please send an email to [trademarks@crunchydata.com](mailto:trademarks@crunchydata.com). + +We based these guidelines on the Model Trademark Guidelines, available at [http://www.modeltrademarkguidelines.org](http://www.modeltrademarkguidelines.org), used under a Creative Commons Attribution 3.0 Unported license: [https://creativecommons.org/licenses/by/3.0/deed.en_US](https://creativecommons.org/licenses/by/3.0/deed.en_US). diff --git a/docs/static/logos/pgo.png b/docs/static/logos/pgo.png new file mode 100644 index 0000000000..9d38c8f859 Binary files /dev/null and b/docs/static/logos/pgo.png differ diff --git a/docs/static/logos/pgo.svg b/docs/static/logos/pgo.svg new file mode 100644 index 0000000000..d72f9d7810 --- /dev/null +++ b/docs/static/logos/pgo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/create-by-resource/fromcrd.json b/examples/create-by-resource/fromcrd.json index 209401d9b6..f93a7bd406 100644 --- a/examples/create-by-resource/fromcrd.json +++ b/examples/create-by-resource/fromcrd.json @@ -16,7 +16,7 @@ "pg-cluster": "fromcrd", "pg-pod-anti-affinity": "", "pgo-backrest": "true", - "pgo-version": "4.4.0", + "pgo-version": "4.4.3", "pgouser": "pgoadmin", "primary": "true" }, @@ -62,7 +62,7 @@ }, "backrestResources": {}, "ccpimage": "crunchy-postgres-ha", - "ccpimagetag": "centos7-12.3-4.4.0", + "ccpimagetag": "centos7-12.6-4.4.3", "clustername": "fromcrd", "customconfig": "", "database": "userdb", @@ -95,7 +95,7 @@ "userlabels": { "crunchy_collect": "false", "pg-pod-anti-affinity": "", - "pgo-version": "4.4.0", + "pgo-version": "4.4.3", "pgouser": "pgoadmin", "pgo-backrest": "true" }, diff --git a/examples/create-by-resource/run.sh b/examples/create-by-resource/run.sh index 1cdefdda77..f5e0cd5d58 100755 --- a/examples/create-by-resource/run.sh +++ b/examples/create-by-resource/run.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2019 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -18,6 +18,8 @@ ######### DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +# PGO_CMD should either be "kubectl" or "oc" -- defaulting to kubectl +PGO_CMD=${PGO_CMD:-kubectl} # A namespace that exists in NAMESPACE env var - see examples/envs.sh export NS=pgouser1 diff --git a/examples/custom-config/create.sh b/examples/custom-config/create.sh index b0599f1b37..5900132568 100755 --- a/examples/custom-config/create.sh +++ b/examples/custom-config/create.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2018 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -28,11 +28,8 @@ function echo_info() { DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -#Error if PGO_CMD not set -if [[ -z ${PGO_CMD} ]] -then - echo_err "PGO_CMD is not set." -fi +# PGO_CMD should either be "kubectl" or "oc" -- defaulting to kubectl +PGO_CMD=${PGO_CMD:-kubectl} #Error is PGO_NAMESPACE not set if [[ -z ${PGO_NAMESPACE} ]] diff --git a/examples/custom-config/setup.sql b/examples/custom-config/setup.sql index 206005eb8a..1a05bce487 100644 --- a/examples/custom-config/setup.sql +++ b/examples/custom-config/setup.sql @@ -1,5 +1,5 @@ /* - * Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + * Copyright 2017 - 2021 Crunchy Data Solutions, Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/examples/envs.sh b/examples/envs.sh index e9a612077c..e303713464 100644 --- a/examples/envs.sh +++ b/examples/envs.sh @@ -20,7 +20,7 @@ export PGOROOT=$GOPATH/src/github.com/crunchydata/postgres-operator # the version of the Operator you run is set by these vars export PGO_IMAGE_PREFIX=registry.developers.crunchydata.com/crunchydata export PGO_BASEOS=centos7 -export PGO_VERSION=4.4.0 +export PGO_VERSION=4.4.3 export PGO_IMAGE_TAG=$PGO_BASEOS-$PGO_VERSION # for setting the pgo apiserver port, disabling TLS or not verifying TLS diff --git a/examples/load/sample-json-load-config-sc.yaml b/examples/load/sample-json-load-config-sc.yaml index b69fe846d3..255f5d857c 100644 --- a/examples/load/sample-json-load-config-sc.yaml +++ b/examples/load/sample-json-load-config-sc.yaml @@ -1,5 +1,5 @@ PGOImagePrefix: registry.developers.crunchydata.com/crunchydata -PGOImageTag: centos7-4.4.0 +PGOImageTag: centos7-4.4.3 DbDatabase: userdb DbUser: postgres DbPort: 5432 diff --git a/examples/load/sample-json-load-config.yaml b/examples/load/sample-json-load-config.yaml index 530d176958..a29a9ffb9e 100644 --- a/examples/load/sample-json-load-config.yaml +++ b/examples/load/sample-json-load-config.yaml @@ -1,5 +1,5 @@ PGOImagePrefix: registry.developers.crunchydata.com/crunchydata -PGOImageTag: centos7-4.4.0 +PGOImageTag: centos7-4.4.3 DbDatabase: userdb DbUser: postgres DbPort: 5432 diff --git a/examples/load/sample-load-config.yaml b/examples/load/sample-load-config.yaml index 34016c35eb..291dc2e1bd 100644 --- a/examples/load/sample-load-config.yaml +++ b/examples/load/sample-load-config.yaml @@ -1,5 +1,5 @@ PGOImagePrefix: registry.developers.crunchydata.com/crunchydata -PGOImageTag: centos7-4.4.0 +PGOImageTag: centos7-4.4.3 DbDatabase: userdb DbUser: postgres DbPort: 5432 diff --git a/hack/boilerplate.go.txt b/hack/boilerplate.go.txt index 8aabc9a12b..e681957476 100644 --- a/hack/boilerplate.go.txt +++ b/hack/boilerplate.go.txt @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/hack/config_sync.sh b/hack/config_sync.sh new file mode 100755 index 0000000000..06f8ec1498 --- /dev/null +++ b/hack/config_sync.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Copyright 2020 - 2021 Crunchy Data Solutions, Inc. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +test="${PGOROOT:?Need to set PGOROOT env variable}" + +INSTALLER_DIR="$PGOROOT/installers" +MASTER_CONFIG="$PGOROOT/installers/ansible/values.yaml" + +yq write --inplace --doc 2 "$INSTALLER_DIR/kubectl/postgres-operator.yml" 'data"values.yaml"' -- "$(cat $MASTER_CONFIG)" +yq write --inplace --doc 2 "$INSTALLER_DIR/kubectl/postgres-operator-ocp311.yml" 'data"values.yaml"' -- "$(cat $MASTER_CONFIG)" + +cat "$INSTALLER_DIR/helm/postgres-operator/helm_template.yaml" "$MASTER_CONFIG" > "$INSTALLER_DIR/helm/postgres-operator/values.yaml" diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index c9795398ae..97fb0aa383 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright 2020 Crunchy Data Solutions, Inc. +# Copyright 2020 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/hack/verify-codegen.sh b/hack/verify-codegen.sh index c096654ca9..27eccb0eb1 100755 --- a/hack/verify-codegen.sh +++ b/hack/verify-codegen.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright 2020 Crunchy Data Solutions, Inc. +# Copyright 2020 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/installers/ansible/README.md b/installers/ansible/README.md index 6f0464914b..e94a083ebc 100644 --- a/installers/ansible/README.md +++ b/installers/ansible/README.md @@ -1,15 +1,15 @@ -# Crunchy Data PostgreSQL Operator Playbook +# PGO: Postgres Operator Playbook

- Crunchy Data + PGO: The Postgres Operator from Crunchy Data

-Latest Release: 4.4.0 +Latest Release: 4.4.3 ## General -This repository contains Ansible Roles for deploying the Crunchy PostgreSQL Operator -for Kubernetes and OpenShift. +This repository contains Ansible Roles for deploying PGO: the Postgres Operator +from [Crunchy Data](https://www.crunchydata.com) for Kubernetes and OpenShift. See the [official documentation for more information](https://crunchydata.github.io/postgres-operator/stable/) on installing Crunchy PostgreSQL Operator. diff --git a/installers/ansible/roles/pgo-operator/files/pgo-backrest-repo/sshd_config b/installers/ansible/roles/pgo-operator/files/pgo-backrest-repo/sshd_config index a28bd7d5de..d25b24f158 100644 --- a/installers/ansible/roles/pgo-operator/files/pgo-backrest-repo/sshd_config +++ b/installers/ansible/roles/pgo-operator/files/pgo-backrest-repo/sshd_config @@ -80,18 +80,9 @@ ChallengeResponseAuthentication yes #GSSAPIKeyExchange no #GSSAPIEnablek5users no -# Set this to 'yes' to enable PAM authentication, account processing, -# and session processing. If this is enabled, PAM authentication will -# be allowed through the ChallengeResponseAuthentication and -# PasswordAuthentication. Depending on your PAM configuration, -# PAM authentication via ChallengeResponseAuthentication may bypass -# the setting of "PermitRootLogin without-password". -# If you just want the PAM account and session checks to run without -# PAM authentication, then enable this but set PasswordAuthentication -# and ChallengeResponseAuthentication to 'no'. -# WARNING: 'UsePAM no' is not supported in Red Hat Enterprise Linux and may cause several -# problems. -UsePAM yes +# This is set explicitly to *no* as we are only using pubkey authentication and +# because each container is isolated to only an unprivileged user. +UsePAM no #AllowAgentForwarding yes #AllowTcpForwarding yes diff --git a/installers/ansible/roles/pgo-operator/files/pgo-configs/cluster-bootstrap-job.json b/installers/ansible/roles/pgo-operator/files/pgo-configs/cluster-bootstrap-job.json index 231dcb49e1..30a57cc5f6 100644 --- a/installers/ansible/roles/pgo-operator/files/pgo-configs/cluster-bootstrap-job.json +++ b/installers/ansible/roles/pgo-operator/files/pgo-configs/cluster-bootstrap-job.json @@ -163,8 +163,7 @@ }, { "name": "sshd", "secret": { - "secretName": "{{.RestoreFrom}}-backrest-repo-config", - "defaultMode": 511 + "secretName": "{{.RestoreFrom}}-backrest-repo-config" } }, {{if .TLSEnabled}} diff --git a/installers/ansible/roles/pgo-operator/files/pgo-configs/cluster-deployment.json b/installers/ansible/roles/pgo-operator/files/pgo-configs/cluster-deployment.json index efc6e1947a..4a5e0952b6 100644 --- a/installers/ansible/roles/pgo-operator/files/pgo-configs/cluster-deployment.json +++ b/installers/ansible/roles/pgo-operator/files/pgo-configs/cluster-deployment.json @@ -247,8 +247,7 @@ }, { "name": "sshd", "secret": { - "secretName": "{{.ClusterName}}-backrest-repo-config", - "defaultMode": 511 + "secretName": "{{.ClusterName}}-backrest-repo-config" } }, { "name": "root-volume", diff --git a/installers/ansible/roles/pgo-operator/files/pgo-configs/pgbadger.json b/installers/ansible/roles/pgo-operator/files/pgo-configs/pgbadger.json index f39964b5d2..d9b04daa73 100644 --- a/installers/ansible/roles/pgo-operator/files/pgo-configs/pgbadger.json +++ b/installers/ansible/roles/pgo-operator/files/pgo-configs/pgbadger.json @@ -23,7 +23,7 @@ "resources": { "limits": { "cpu": "500m", - "memory": "24Mi" + "memory": "64Mi" } }, "volumeMounts": [ diff --git a/installers/ansible/roles/pgo-operator/files/pgo-configs/pgo-backrest-repo-template.json b/installers/ansible/roles/pgo-operator/files/pgo-configs/pgo-backrest-repo-template.json index 511bbee7a8..0cf67d3f16 100644 --- a/installers/ansible/roles/pgo-operator/files/pgo-configs/pgo-backrest-repo-template.json +++ b/installers/ansible/roles/pgo-operator/files/pgo-configs/pgo-backrest-repo-template.json @@ -99,8 +99,7 @@ "volumes": [{ "name": "sshd", "secret": { - "secretName": "{{.SshdSecretsName}}", - "defaultMode": 511 + "secretName": "{{.SshdSecretsName}}" } }, { "name": "backrestrepo", diff --git a/installers/ansible/roles/pgo-operator/files/pgo-configs/pgo-target-role.json b/installers/ansible/roles/pgo-operator/files/pgo-configs/pgo-target-role.json index 1cb6a31cc5..09b77ef469 100644 --- a/installers/ansible/roles/pgo-operator/files/pgo-configs/pgo-target-role.json +++ b/installers/ansible/roles/pgo-operator/files/pgo-configs/pgo-target-role.json @@ -15,8 +15,6 @@ "endpoints", "pods", "pods/exec", - "pods/log", - "replicasets", "secrets", "services", "persistentvolumeclaims" @@ -32,12 +30,26 @@ "deletecollection" ] }, + { + "apiGroups": [ + "" + ], + "resources": [ + "pods/log" + ], + "verbs":[ + "get", + "list", + "watch" + ] + }, { "apiGroups": [ "apps" ], "resources": [ - "deployments" + "deployments", + "replicasets" ], "verbs":[ "get", diff --git a/installers/ansible/roles/pgo-operator/tasks/cleanup.yml b/installers/ansible/roles/pgo-operator/tasks/cleanup.yml index ffe9626c56..2f7925afd2 100644 --- a/installers/ansible/roles/pgo-operator/tasks/cleanup.yml +++ b/installers/ansible/roles/pgo-operator/tasks/cleanup.yml @@ -6,6 +6,20 @@ - uninstall - update +- name: Get number of Operator instances in this cluster + shell: | + {{ kubectl_or_oc }} get deployment --field-selector=metadata.name=postgres-operator --selector=vendor=crunchydata --all-namespaces -o name | wc -l + register: num_operators + tags: + - uninstall + - update + +- name: Set boolean for multi-operator environment + set_fact: multi_operator_env="{{ 'true' if num_operators.stdout | int > 1 else 'false' }}" + tags: + - uninstall + - update + - name: Find watched namespaces shell: | {{ kubectl_or_oc }} get namespaces -o json --selector=vendor=crunchydata,pgo-installation-name={{ pgo_installation_name }} @@ -152,7 +166,8 @@ tags: - uninstall - update - when: create_rbac|bool + when: not multi_operator_env|bool and + create_rbac|bool - name: Delete cluster-admin Cluster Role Binding for PGO Service Account command: "{{ kubectl_or_oc }} delete clusterrolebinding pgo-cluster-admin" @@ -161,7 +176,8 @@ tags: - uninstall - update - when: create_rbac|bool + when: not multi_operator_env|bool and + create_rbac|bool - name: Delete existing Cluster Roles shell: | @@ -173,7 +189,8 @@ tags: - uninstall - update - when: create_rbac|bool + when: not multi_operator_env|bool and + create_rbac|bool - name: Delete existing PGO Role Bindings (Watched Namespaces) shell: | @@ -233,6 +250,7 @@ pgpolicies.crunchydata.com pgreplicas.crunchydata.com pgtasks.crunchydata.com ignore_errors: yes no_log: false + when: not multi_operator_env|bool tags: uninstall - name: Remove Labels from Watched Namespaces @@ -276,7 +294,8 @@ file: state: absent path: "/usr/local/bin/pgo" - when: pgo_client_install == "true" + when: pgo_client_install == "true" and + not multi_operator_env|bool ignore_errors: yes no_log: false tags: uninstall diff --git a/installers/ansible/roles/pgo-operator/templates/add-targeted-namespace.sh.j2 b/installers/ansible/roles/pgo-operator/templates/add-targeted-namespace.sh.j2 index 380a8a80b7..ec5e9e82d6 100644 --- a/installers/ansible/roles/pgo-operator/templates/add-targeted-namespace.sh.j2 +++ b/installers/ansible/roles/pgo-operator/templates/add-targeted-namespace.sh.j2 @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2017 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/installers/ansible/roles/pgo-operator/templates/cluster-rbac.yaml.j2 b/installers/ansible/roles/pgo-operator/templates/cluster-rbac.yaml.j2 index 771080042e..4212d9107b 100644 --- a/installers/ansible/roles/pgo-operator/templates/cluster-rbac.yaml.j2 +++ b/installers/ansible/roles/pgo-operator/templates/cluster-rbac.yaml.j2 @@ -42,8 +42,6 @@ rules: - endpoints - pods - pods/exec - - pods/log - - replicasets - secrets - services - persistentvolumeclaims @@ -56,10 +54,19 @@ rules: - update - delete - deletecollection + - apiGroups: + - '' + resources: + - pods/log + verbs: + - get + - list + - watch - apiGroups: - apps resources: - deployments + - replicasets verbs: - get - list diff --git a/installers/ansible/roles/pgo-operator/vars/main.yml b/installers/ansible/roles/pgo-operator/vars/main.yml index 5df7eae691..c613bb340b 100644 --- a/installers/ansible/roles/pgo-operator/vars/main.yml +++ b/installers/ansible/roles/pgo-operator/vars/main.yml @@ -1,3 +1,3 @@ --- -pgo_client_url: "https://github.com/CrunchyData/postgres-operator/releases/download/{{ pgo_client_version }}" +pgo_client_url: "https://github.com/CrunchyData/postgres-operator/releases/download/v{{ pgo_client_version }}" pgo_keys_dir: "{{ ansible_env.HOME }}/.pgo/{{ pgo_operator_namespace }}" diff --git a/installers/ansible/values.yaml b/installers/ansible/values.yaml index 5f50ea37b7..eaf6cbdb4e 100644 --- a/installers/ansible/values.yaml +++ b/installers/ansible/values.yaml @@ -1,4 +1,8 @@ ---- +# ===================== +# Configuration Options +# More info for these options can be found in the docs +# https://access.crunchydata.com/documentation/postgres-operator/latest/installation/configuration/ +# ===================== archive_mode: "true" archive_timeout: "60" backrest_aws_s3_bucket: "" @@ -13,7 +17,7 @@ badger: "false" ccp_image_prefix: "registry.developers.crunchydata.com/crunchydata" ccp_image_pull_secret: "" ccp_image_pull_secret_manifest: "" -ccp_image_tag: "centos7-12.3-4.4.0" +ccp_image_tag: "centos7-12.6-4.4.3" create_rbac: "true" crunchy_debug: "false" db_name: "" @@ -54,14 +58,14 @@ pgo_apiserver_url: "https://postgres-operator" pgo_client_cert_secret: "pgo.tls" pgo_client_container_install: "false" pgo_client_install: "true" -pgo_client_version: "v4.4.0" +pgo_client_version: "4.4.3" pgo_cluster_admin: "false" pgo_disable_eventing: "false" pgo_disable_tls: "false" pgo_image_prefix: "registry.developers.crunchydata.com/crunchydata" pgo_image_pull_secret: "" pgo_image_pull_secret_manifest: "" -pgo_image_tag: "centos7-4.4.0" +pgo_image_tag: "centos7-4.4.3" pgo_installation_name: "devtest" pgo_noauth_routes: "" pgo_operator_namespace: "pgo" diff --git a/installers/gcp-marketplace/Makefile b/installers/gcp-marketplace/Makefile index 8f243ca122..3afc84ada9 100644 --- a/installers/gcp-marketplace/Makefile +++ b/installers/gcp-marketplace/Makefile @@ -6,7 +6,7 @@ MARKETPLACE_TOOLS ?= gcr.io/cloud-marketplace-tools/k8s/dev:$(MARKETPLACE_VERSIO MARKETPLACE_VERSION ?= 0.9.4 KUBECONFIG ?= $(HOME)/.kube/config PARAMETERS ?= {} -PGO_VERSION ?= 4.4.0 +PGO_VERSION ?= 4.4.3 IMAGE_BUILD_ARGS = --build-arg MARKETPLACE_VERSION='$(MARKETPLACE_VERSION)' \ --build-arg PGO_VERSION='$(PGO_VERSION)' diff --git a/installers/gcp-marketplace/README.md b/installers/gcp-marketplace/README.md index cb152c04a2..232e68c9c4 100644 --- a/installers/gcp-marketplace/README.md +++ b/installers/gcp-marketplace/README.md @@ -1,11 +1,11 @@ - This directory contains the files that are used to install [Crunchy PostgreSQL for GKE][gcp-details], -which uses the PostgreSQL Operator, from the Google Cloud Marketplace. +which uses PGO: the PostgreSQL Operator from [Crunchy Data][crunchy-data], from the Google Cloud Marketplace. The integration centers around a container [image](./Dockerfile) that contains an installation [schema](./schema.yaml) and an [Application][k8s-app] [manifest](./application.yaml). Consult the [technical requirements][gcp-k8s-requirements] when making changes. +[crunchy-data]: https://www.crunchydata.com [k8s-app]: https://github.com/kubernetes-sigs/application/ [gcp-k8s]: https://cloud.google.com/marketplace/docs/kubernetes-apps/ [gcp-k8s-requirements]: https://cloud.google.com/marketplace/docs/partners/kubernetes-solutions/create-app-package @@ -59,7 +59,7 @@ Google Cloud Marketplace. ```shell IMAGE_REPOSITORY=gcr.io/crunchydata-public/postgres-operator - export PGO_VERSION=4.4.0 + export PGO_VERSION=4.4.3 export INSTALLER_IMAGE=${IMAGE_REPOSITORY}/deployer:${PGO_VERSION} export OPERATOR_IMAGE=${IMAGE_REPOSITORY}:${PGO_VERSION} export OPERATOR_IMAGE_API=${IMAGE_REPOSITORY}/pgo-apiserver:${PGO_VERSION} diff --git a/installers/gcp-marketplace/inventory.ini b/installers/gcp-marketplace/inventory.ini index c3ea1a1000..ab381926c9 100644 --- a/installers/gcp-marketplace/inventory.ini +++ b/installers/gcp-marketplace/inventory.ini @@ -16,11 +16,11 @@ pgo_operator_namespace='${OPERATOR_NAMESPACE}' namespace='' ccp_image_prefix='registry.developers.crunchydata.com/crunchydata' -ccp_image_tag='centos7-12.3-4.4.0' +ccp_image_tag='centos7-12.6-4.4.3' ccp_image_pull_secret='' ccp_image_pull_secret_manifest='' pgo_image_prefix='registry.developers.crunchydata.com/crunchydata' -pgo_image_tag='centos7-4.4.0' +pgo_image_tag='centos7-4.4.3' pgo_image='${OPERATOR_IMAGE}' pgo_event_image='${OPERATOR_IMAGE_EVENT}' @@ -29,7 +29,7 @@ pgo_scheduler_image='${OPERATOR_IMAGE_SCHEDULER}' # PGO Client Install pgo_client_install='false' -pgo_client_version='v4.4.0' +pgo_client_version='v4.4.3' badger='false' metrics='${POSTGRES_METRICS}' diff --git a/installers/helm/metrics/Chart.yaml b/installers/helm/metrics/Chart.yaml index 6efe6c6ab9..ca63681a3f 100644 --- a/installers/helm/metrics/Chart.yaml +++ b/installers/helm/metrics/Chart.yaml @@ -3,6 +3,6 @@ name: postgres-operator-metrics description: Metrics Install for Crunchy PostgreSQL Operator type: application version: 0.1.0 -appVersion: 4.4.0 +appVersion: 4.4.3 home: https://github.com/CrunchyData/postgres-operator -icon: https://github.com/CrunchyData/postgres-operator/raw/master/crunchy_logo.png \ No newline at end of file +icon: https://github.com/CrunchyData/postgres-operator/raw/master/docs/static/logos/pgo.svg diff --git a/installers/helm/metrics/templates/rbac.yaml b/installers/helm/metrics/templates/rbac.yaml index dbef140471..19d6fc06e4 100644 --- a/installers/helm/metrics/templates/rbac.yaml +++ b/installers/helm/metrics/templates/rbac.yaml @@ -73,6 +73,7 @@ rules: - extensions resources: - deployments + - replicasets verbs: - get - list @@ -145,4 +146,4 @@ subjects: - kind: ServiceAccount name: {{ include "postgres-operator.serviceAccountName" . }} namespace: {{ .Release.Namespace }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/installers/helm/metrics/values.yaml b/installers/helm/metrics/values.yaml index df0060caf0..bfb1c8693b 100644 --- a/installers/helm/metrics/values.yaml +++ b/installers/helm/metrics/values.yaml @@ -29,7 +29,7 @@ badger: "false" ccp_image_prefix: "registry.developers.crunchydata.com/crunchydata" ccp_image_pull_secret: "" ccp_image_pull_secret_manifest: "" -ccp_image_tag: "centos7-12.3-4.4.0" +ccp_image_tag: "centos7-12.6-4.4.3" create_rbac: "true" crunchy_debug: "false" db_password_length: "24" @@ -56,11 +56,11 @@ pgo_admin_password: "examplepassword" pgo_admin_perms: "*" pgo_admin_role_name: "pgoadmin" pgo_admin_username: "admin" -pgo_client_version: "4.4.0" +pgo_client_version: "4.4.3" pgo_image_prefix: "registry.developers.crunchydata.com/crunchydata" pgo_image_pull_secret: "" pgo_image_pull_secret_manifest: "" -pgo_image_tag: "centos7-4.4.0" +pgo_image_tag: "centos7-4.4.3" pgo_installation_name: "devtest" pgo_operator_namespace: "pgo" prometheus_install: "false" diff --git a/installers/helm/postgres-operator/.helmignore b/installers/helm/postgres-operator/.helmignore new file mode 100644 index 0000000000..a92ca61289 --- /dev/null +++ b/installers/helm/postgres-operator/.helmignore @@ -0,0 +1 @@ +helm_template.yaml diff --git a/installers/helm/postgres-operator/Chart.yaml b/installers/helm/postgres-operator/Chart.yaml index cf0622add8..138c8da4b3 100644 --- a/installers/helm/postgres-operator/Chart.yaml +++ b/installers/helm/postgres-operator/Chart.yaml @@ -1,11 +1,11 @@ apiVersion: v2 name: postgres-operator -description: Crunchy PostgreSQL Operator Helm chart for Kubernetes +description: PGO: The Postgres Operator from Crunchy Data Helm Chart for Kubernetes type: application version: 0.1.0 -appVersion: 4.4.0 +appVersion: 4.4.3 home: https://github.com/CrunchyData/postgres-operator -icon: https://github.com/CrunchyData/postgres-operator/raw/master/crunchy_logo.png +icon: https://github.com/CrunchyData/postgres-operator/raw/master/docs/static/logos/pgo.svg keywords: - PostgreSQL - Operator diff --git a/installers/helm/postgres-operator/README.md b/installers/helm/postgres-operator/README.md index fd0362516e..b2b7e8e264 100644 --- a/installers/helm/postgres-operator/README.md +++ b/installers/helm/postgres-operator/README.md @@ -1,10 +1,10 @@ -# Crunchy PostgreSQL Operator +# PGO: The Postgres Operator from Crunchy Data -This Helm chart installs the Crunchy PostgreSQL Operator by using its “pgo-deployer” -container. Helm will setup the ServiceAccount, RBAC, and ConfigMap needed to run -the container as a Kubernetes Job. Then a job will be created based on `helm` -`install`, `upgrade`, or `uninstall`. After the job has completed the RBAC will -be cleaned up. +This Helm chart installs PGO: the Postgres Operator from Crunchy Data by using +its “pgo-deployer” container. Helm will setup the ServiceAccount, RBAC, and +ConfigMap needed to run the container as a Kubernetes Job. Then a job will +be created based on `helm` `install`, `upgrade`, or `uninstall`. After the +job has completed the RBAC will be cleaned up. ## Prerequisites @@ -39,10 +39,10 @@ cd postgres-operator/installers/helm/postgres-operator helm uninstall postgres-operator -n pgo ``` -## Configuraiton +## Configuration The following shows the configurable parameters that are relevant to the Helm -Chart. A full list of all Crunchy PostgreSQL Operator configuration options can +Chart. A full list of all PGO configuration options can be found in the [documentation](https://access.crunchydata.com/documentation/postgres-operator/latest/installation/configuration/). | Name | Default | Description | diff --git a/installers/helm/postgres-operator/helm_template.yaml b/installers/helm/postgres-operator/helm_template.yaml new file mode 100644 index 0000000000..408861e463 --- /dev/null +++ b/installers/helm/postgres-operator/helm_template.yaml @@ -0,0 +1,20 @@ +--- +# ====================== +# Installer Controls +# ====================== +fullnameOverride: "" + +# rbac: settings for deployer RBAC creation +rbac: + # rbac.create: if false RBAC resources should be in place + create: true + # rbac.useClusterAdmin: creates a ClusterRoleBinding giving cluster-admin to serviceAccount.name + useClusterAdmin: false + +# serviceAccount: settings for Service Account used by the deployer +serviceAccount: + # serviceAccount.create: Whether to create a Service Account or not + create: true + # serviceAccount.name: The name of the Service Account to create or use + name: "" + diff --git a/installers/helm/postgres-operator/templates/_helpers.tpl b/installers/helm/postgres-operator/templates/_helpers.tpl index b1457b2728..a1027ba8d7 100644 --- a/installers/helm/postgres-operator/templates/_helpers.tpl +++ b/installers/helm/postgres-operator/templates/_helpers.tpl @@ -84,3 +84,14 @@ cluster-admin {{ include "postgres-operator.fullname" . }}-cr {{- end }} {{- end }} + +{{/* +Generate Configmap based on Values defined in values.yaml +*/}} +{{- define "postgres-operator.values" -}} +values.yaml: | + --- +{{- range $index, $value := .Values }} +{{ $index | indent 2 }}: {{ $value | quote }} +{{- end }} +{{- end }} diff --git a/installers/helm/postgres-operator/templates/values_configmap.yaml b/installers/helm/postgres-operator/templates/values_configmap.yaml index f30ff0233c..15ab0b9606 100644 --- a/installers/helm/postgres-operator/templates/values_configmap.yaml +++ b/installers/helm/postgres-operator/templates/values_configmap.yaml @@ -6,119 +6,4 @@ metadata: labels: {{ include "postgres-operator.labels" . | indent 4 }} data: - values.yaml: | - --- - archive_mode: "{{ .Values.archive_mode}}" - archive_timeout: "{{ .Values.archive_timeout}}" - backrest_aws_s3_bucket: "{{ .Values.backrest_aws_s3_bucket}}" - backrest_aws_s3_endpoint: "{{ .Values.backrest_aws_s3_endpoint}}" - backrest_aws_s3_key: "{{ .Values.backrest_aws_s3_key}}" - backrest_aws_s3_region: "{{ .Values.backrest_aws_s3_region}}" - backrest_aws_s3_secret: "{{ .Values.backrest_aws_s3_secret}}" - backrest_aws_s3_uri_style: "{{ .Values.backrest_aws_s3_uri_style }}" - backrest_aws_s3_verify_tls: "{{ .Values.backrest_aws_s3_verify_tls }}" - backrest_port: "{{ .Values.backrest_port}}" - badger: "{{ .Values.badger}}" - ccp_image_prefix: "{{ .Values.ccp_image_prefix}}" - ccp_image_pull_secret: "{{ .Values.ccp_image_pull_secret}}" - ccp_image_pull_secret_manifest: "{{ .Values.ccp_image_pull_secret_manifest}}" - ccp_image_tag: "{{ .Values.ccp_image_tag}}" - create_rbac: "{{ .Values.create_rbac}}" - crunchy_debug: "{{ .Values.crunchy_debug}}" - db_name: "{{ .Values.db_name}}" - db_password_age_days: "{{ .Values.db_password_age_days}}" - db_password_length: "{{ .Values.db_password_length}}" - db_port: "{{ .Values.db_port}}" - db_replicas: "{{ .Values.db_replicas}}" - db_user: "{{ .Values.db_user}}" - default_instance_memory: "{{ .Values.default_instance_memory}}" - default_pgbackrest_memory: "{{ .Values.default_pgbackrest_memory}}" - default_pgbouncer_memory: "{{ .Values.default_pgbouncer_memory}}" - delete_metrics_namespace: "{{ .Values.delete_metrics_namespace}}" - delete_operator_namespace: "{{ .Values.delete_operator_namespace}}" - delete_watched_namespaces: "{{ .Values.delete_watched_namespaces}}" - disable_auto_failover: "{{ .Values.disable_auto_failover}}" - disable_fsgroup: "{{ .Values.disable_fsgroup}}" - reconcile_rbac: "{{ .Values.reconcile_rbac}}" - exporterport: "{{ .Values.exporterport}}" - metrics: "{{ .Values.metrics}}" - namespace: "{{ .Values.namespace}}" - namespace_mode: "{{ .Values.namespace_mode}}" - pgbadgerport: "{{ .Values.pgbadgerport}}" - pgo_add_os_ca_store: "{{ .Values.pgo_add_os_ca_store}}" - pgo_admin_password: "{{ .Values.pgo_admin_password}}" - pgo_admin_perms: "{{ .Values.pgo_admin_perms}}" - pgo_admin_role_name: "{{ .Values.pgo_admin_role_name}}" - pgo_admin_username: "{{ .Values.pgo_admin_username}}" - pgo_apiserver_port: "{{ .Values.pgo_apiserver_port}}" - pgo_apiserver_url: "{{ .Values.pgo_apiserver_url}}" - pgo_client_cert_secret: "{{ .Values.pgo_client_cert_secret}}" - pgo_client_container_install: "{{ .Values.pgo_client_container_install}}" - pgo_client_version: "{{ .Values.pgo_client_version}}" - pgo_cluster_admin: "{{ .Values.pgo_cluster_admin}}" - pgo_disable_eventing: "{{ .Values.pgo_disable_eventing}}" - pgo_disable_tls: "{{ .Values.pgo_disable_tls}}" - pgo_image_prefix: "{{ .Values.pgo_image_prefix}}" - pgo_image_pull_secret: "{{ .Values.pgo_image_pull_secret}}" - pgo_image_pull_secret_manifest: "{{ .Values.pgo_image_pull_secret_manifest}}" - pgo_image_tag: "{{ .Values.pgo_image_tag}}" - pgo_installation_name: "{{ .Values.pgo_installation_name}}" - pgo_noauth_routes: "{{ .Values.pgo_noauth_routes}}" - pgo_operator_namespace: "{{ .Values.pgo_operator_namespace}}" - pgo_tls_ca_store: "{{ .Values.pgo_tls_ca_store}}" - pgo_tls_no_verify: "{{ .Values.pgo_tls_no_verify}}" - pod_anti_affinity: "{{ .Values.pod_anti_affinity}}" - pod_anti_affinity_pgbackrest: "{{ .Values.pod_anti_affinity_pgbackrest}}" - pod_anti_affinity_pgbouncer: "{{ .Values.pod_anti_affinity_pgbouncer}}" - scheduler_timeout: "{{ .Values.scheduler_timeout}}" - service_type: "{{ .Values.service_type}}" - sync_replication: "{{ .Values.sync_replication}}" - backrest_storage: "{{ .Values.backrest_storage}}" - backup_storage: "{{ .Values.backup_storage}}" - primary_storage: "{{ .Values.primary_storage}}" - replica_storage: "{{ .Values.replica_storage}}" - wal_storage: "{{ .Values.wal_storage}}" - storage1_name: "{{ .Values.storage1_name}}" - storage1_access_mode: "{{ .Values.storage1_access_mode}}" - storage1_size: "{{ .Values.storage1_size}}" - storage1_type: "{{ .Values.storage1_type}}" - storage2_name: "{{ .Values.storage2_name}}" - storage2_access_mode: "{{ .Values.storage2_access_mode}}" - storage2_size: "{{ .Values.storage2_size}}" - storage2_type: "{{ .Values.storage2_type}}" - storage3_name: "{{ .Values.storage3_name}}" - storage3_access_mode: "{{ .Values.storage3_access_mode}}" - storage3_size: "{{ .Values.storage3_size}}" - storage3_type: "{{ .Values.storage3_type}}" - storage3_supplemental_groups: "{{ .Values.storage3_supplemental_groups}}" - storage4_name: "{{ .Values.storage4_name}}" - storage4_access_mode: "{{ .Values.storage4_access_mode}}" - storage4_size: "{{ .Values.storage4_size}}" - storage4_match_labels: "{{ .Values.storage4_match_labels}}" - storage4_type: "{{ .Values.storage4_type}}" - storage4_supplemental_groups: "{{ .Values.storage4_supplemental_groups}}" - storage5_name: "{{ .Values.storage5_name}}" - storage5_access_mode: "{{ .Values.storage5_access_mode}}" - storage5_size: "{{ .Values.storage5_size}}" - storage5_type: "{{ .Values.storage5_type}}" - storage5_class: "{{ .Values.storage5_class}}" - storage6_name: "{{ .Values.storage6_name}}" - storage6_access_mode: "{{ .Values.storage6_access_mode}}" - storage6_size: "{{ .Values.storage6_size}}" - storage6_type: "{{ .Values.storage6_type}}" - storage6_class: "{{ .Values.storage6_class}}" - storage7_name: "{{ .Values.storage7_name}}" - storage7_access_mode: "{{ .Values.storage7_access_mode}}" - storage7_size: "{{ .Values.storage7_size}}" - storage7_type: "{{ .Values.storage7_type}}" - storage7_class: "{{ .Values.storage7_class}}" - storage8_name: "{{ .Values.storage8_name}}" - storage8_access_mode: "{{ .Values.storage8_access_mode}}" - storage8_size: "{{ .Values.storage8_size}}" - storage8_type: "{{ .Values.storage8_type}}" - storage8_class: "{{ .Values.storage8_class}}" - storage9_name: "{{ .Values.storage9_name}}" - storage9_access_mode: "{{ .Values.storage9_access_mode}}" - storage9_size: "{{ .Values.storage9_size}}" - storage9_type: "{{ .Values.storage9_type}}" - storage9_class: "{{ .Values.storage9_class}}" +{{ include "postgres-operator.values" . | indent 2}} diff --git a/installers/helm/postgres-operator/values.yaml b/installers/helm/postgres-operator/values.yaml index 4544d5c0d8..6f4faff1cd 100644 --- a/installers/helm/postgres-operator/values.yaml +++ b/installers/helm/postgres-operator/values.yaml @@ -21,7 +21,7 @@ serviceAccount: # ===================== # Configuration Options # More info for these options can be found in the docs -# https://crunchydata.github.io/postgres-operator/latest/installation/configuration/ +# https://access.crunchydata.com/documentation/postgres-operator/latest/installation/configuration/ # ===================== archive_mode: "true" archive_timeout: "60" @@ -37,7 +37,7 @@ badger: "false" ccp_image_prefix: "registry.developers.crunchydata.com/crunchydata" ccp_image_pull_secret: "" ccp_image_pull_secret_manifest: "" -ccp_image_tag: "centos7-12.3-4.4.0" +ccp_image_tag: "centos7-12.6-4.4.3" create_rbac: "true" crunchy_debug: "false" db_name: "" @@ -69,14 +69,15 @@ pgo_apiserver_port: "8443" pgo_apiserver_url: "https://postgres-operator" pgo_client_cert_secret: "pgo.tls" pgo_client_container_install: "false" -pgo_client_version: "4.4.0" +pgo_client_install: "true" +pgo_client_version: "4.4.3" pgo_cluster_admin: "false" pgo_disable_eventing: "false" pgo_disable_tls: "false" pgo_image_prefix: "registry.developers.crunchydata.com/crunchydata" pgo_image_pull_secret: "" pgo_image_pull_secret_manifest: "" -pgo_image_tag: "centos7-4.4.0" +pgo_image_tag: "centos7-4.4.3" pgo_installation_name: "devtest" pgo_noauth_routes: "" pgo_operator_namespace: "pgo" diff --git a/installers/image/bin/pgo-deploy.sh b/installers/image/bin/pgo-deploy.sh index 76a02c6646..c6490a05d7 100755 --- a/installers/image/bin/pgo-deploy.sh +++ b/installers/image/bin/pgo-deploy.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2020 Crunchy Data Solutions, Inc. +# Copyright 2020 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/installers/kubectl/client-setup.sh b/installers/kubectl/client-setup.sh index 6d4c0a84d5..65e3d59b56 100755 --- a/installers/kubectl/client-setup.sh +++ b/installers/kubectl/client-setup.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2020 Crunchy Data Solutions, Inc. +# Copyright 2020 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -14,7 +14,7 @@ # This script should be run after the operator has been deployed PGO_OPERATOR_NAMESPACE="${PGO_OPERATOR_NAMESPACE:-pgo}" PGO_USER_ADMIN="${PGO_USER_ADMIN:-pgouser-admin}" -PGO_CLIENT_VERSION="${PGO_CLIENT_VERSION:-v4.4.0}" +PGO_CLIENT_VERSION="${PGO_CLIENT_VERSION:-v4.4.3}" PGO_CLIENT_URL="https://github.com/CrunchyData/postgres-operator/releases/download/${PGO_CLIENT_VERSION}" PGO_CMD="${PGO_CMD-kubectl}" diff --git a/installers/kubectl/postgres-operator-ocp311.yml b/installers/kubectl/postgres-operator-ocp311.yml index e9abff59d4..30c8ccd776 100644 --- a/installers/kubectl/postgres-operator-ocp311.yml +++ b/installers/kubectl/postgres-operator-ocp311.yml @@ -1,22 +1,22 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: pgo-deployer-sa - namespace: pgo + name: pgo-deployer-sa + namespace: pgo --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: pgo-deployer-crb - namespace: pgo + name: pgo-deployer-crb + namespace: pgo roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: cluster-admin + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: cluster-admin subjects: -- kind: ServiceAccount - name: pgo-deployer-sa - namespace: pgo + - kind: ServiceAccount + name: pgo-deployer-sa + namespace: pgo --- apiVersion: v1 kind: ConfigMap @@ -24,8 +24,12 @@ metadata: name: pgo-deployer-cm namespace: pgo data: - values.yaml: |+ - --- + values.yaml: |- + # ===================== + # Configuration Options + # More info for these options can be found in the docs + # https://access.crunchydata.com/documentation/postgres-operator/latest/installation/configuration/ + # ===================== archive_mode: "true" archive_timeout: "60" backrest_aws_s3_bucket: "" @@ -40,7 +44,7 @@ data: ccp_image_prefix: "registry.developers.crunchydata.com/crunchydata" ccp_image_pull_secret: "" ccp_image_pull_secret_manifest: "" - ccp_image_tag: "centos7-12.3-4.4.0" + ccp_image_tag: "centos7-12.6-4.4.3" create_rbac: "true" crunchy_debug: "false" db_name: "" @@ -80,14 +84,15 @@ data: pgo_apiserver_url: "https://postgres-operator" pgo_client_cert_secret: "pgo.tls" pgo_client_container_install: "false" - pgo_client_version: "4.4.0" + pgo_client_install: "true" + pgo_client_version: "4.4.3" pgo_cluster_admin: "false" pgo_disable_eventing: "false" pgo_disable_tls: "false" pgo_image_prefix: "registry.developers.crunchydata.com/crunchydata" pgo_image_pull_secret: "" pgo_image_pull_secret_manifest: "" - pgo_image_tag: "centos7-4.4.0" + pgo_image_tag: "centos7-4.4.3" pgo_installation_name: "devtest" pgo_noauth_routes: "" pgo_operator_namespace: "pgo" @@ -157,27 +162,27 @@ data: apiVersion: batch/v1 kind: Job metadata: - name: pgo-deploy - namespace: pgo + name: pgo-deploy + namespace: pgo spec: - backoffLimit: 0 - template: - metadata: - name: pgo-deploy - spec: - serviceAccountName: pgo-deployer-sa - restartPolicy: Never - containers: - - name: pgo-deploy - image: registry.developers.crunchydata.com/crunchydata/pgo-deployer:centos7-4.4.0 - imagePullPolicy: IfNotPresent - env: - - name: DEPLOY_ACTION - value: install - volumeMounts: - - name: deployer-conf - mountPath: "/conf" - volumes: - - name: deployer-conf - configMap: - name: pgo-deployer-cm + backoffLimit: 0 + template: + metadata: + name: pgo-deploy + spec: + serviceAccountName: pgo-deployer-sa + restartPolicy: Never + containers: + - name: pgo-deploy + image: registry.developers.crunchydata.com/crunchydata/pgo-deployer:centos7-4.4.3 + imagePullPolicy: IfNotPresent + env: + - name: DEPLOY_ACTION + value: install + volumeMounts: + - name: deployer-conf + mountPath: "/conf" + volumes: + - name: deployer-conf + configMap: + name: pgo-deployer-cm diff --git a/installers/kubectl/postgres-operator.yml b/installers/kubectl/postgres-operator.yml index 716cc3ed6b..d51daa00a1 100644 --- a/installers/kubectl/postgres-operator.yml +++ b/installers/kubectl/postgres-operator.yml @@ -1,8 +1,8 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: pgo-deployer-sa - namespace: pgo + name: pgo-deployer-sa + namespace: pgo --- kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 @@ -60,6 +60,7 @@ rules: - extensions resources: - deployments + - replicasets verbs: - get - list @@ -112,179 +113,184 @@ rules: - delete - list --- - apiVersion: v1 - kind: ConfigMap - metadata: - name: pgo-deployer-cm - namespace: pgo - data: - values.yaml: |+ - --- - archive_mode: "true" - archive_timeout: "60" - backrest_aws_s3_bucket: "" - backrest_aws_s3_endpoint: "" - backrest_aws_s3_key: "" - backrest_aws_s3_region: "" - backrest_aws_s3_secret: "" - backrest_aws_s3_uri_style: "" - backrest_aws_s3_verify_tls: "true" - backrest_port: "2022" - badger: "false" - ccp_image_prefix: "registry.developers.crunchydata.com/crunchydata" - ccp_image_pull_secret: "" - ccp_image_pull_secret_manifest: "" - ccp_image_tag: "centos7-12.3-4.4.0" - create_rbac: "true" - crunchy_debug: "false" - db_name: "" - db_password_age_days: "0" - db_password_length: "24" - db_port: "5432" - db_replicas: "0" - db_user: "testuser" - default_instance_memory: "128Mi" - default_pgbackrest_memory: "48Mi" - default_pgbouncer_memory: "24Mi" - delete_metrics_namespace: "false" - delete_operator_namespace: "false" - delete_watched_namespaces: "false" - disable_auto_failover: "false" - disable_fsgroup: "false" - reconcile_rbac: "true" - exporterport: "9187" - grafana_admin_password: "" - grafana_admin_username: "admin" - grafana_install: "false" - grafana_storage_access_mode: "ReadWriteOnce" - grafana_storage_class_name: "fast" - grafana_supplemental_groups: "65534" - grafana_volume_size: "1G" - metrics: "false" - metrics_namespace: "pgo" - namespace: "pgo" - namespace_mode: "dynamic" - pgbadgerport: "10000" - pgo_add_os_ca_store: "false" - pgo_admin_password: "examplepassword" - pgo_admin_perms: "*" - pgo_admin_role_name: "pgoadmin" - pgo_admin_username: "admin" - pgo_apiserver_port: "8443" - pgo_apiserver_url: "https://postgres-operator" - pgo_client_cert_secret: "pgo.tls" - pgo_client_container_install: "false" - pgo_client_version: "4.4.0" - pgo_cluster_admin: "false" - pgo_disable_eventing: "false" - pgo_disable_tls: "false" - pgo_image_prefix: "registry.developers.crunchydata.com/crunchydata" - pgo_image_pull_secret: "" - pgo_image_pull_secret_manifest: "" - pgo_image_tag: "centos7-4.4.0" - pgo_installation_name: "devtest" - pgo_noauth_routes: "" - pgo_operator_namespace: "pgo" - pgo_tls_ca_store: "" - pgo_tls_no_verify: "false" - pod_anti_affinity: "preferred" - pod_anti_affinity_pgbackrest: "" - pod_anti_affinity_pgbouncer: "" - prometheus_install: "false" - prometheus_storage_access_mode: "ReadWriteOnce" - prometheus_storage_class_name: "fast" - prometheus_supplemental_groups: "65534" - prometheus_volume_size: "1G" - scheduler_timeout: "3600" - service_type: "ClusterIP" - sync_replication: "false" - backrest_storage: "hostpathstorage" - backup_storage: "hostpathstorage" - primary_storage: "hostpathstorage" - replica_storage: "hostpathstorage" - wal_storage: "" - storage1_name: "hostpathstorage" - storage1_access_mode: "ReadWriteMany" - storage1_size: "1G" - storage1_type: "create" - storage2_name: "replicastorage" - storage2_access_mode: "ReadWriteMany" - storage2_size: "1G" - storage2_type: "create" - storage3_name: "nfsstorage" - storage3_access_mode: "ReadWriteMany" - storage3_size: "1G" - storage3_type: "create" - storage3_supplemental_groups: "65534" - storage4_name: "nfsstoragered" - storage4_access_mode: "ReadWriteMany" - storage4_size: "1G" - storage4_match_labels: "crunchyzone=red" - storage4_type: "create" - storage4_supplemental_groups: "65534" - storage5_name: "storageos" - storage5_access_mode: "ReadWriteOnce" - storage5_size: "5Gi" - storage5_type: "dynamic" - storage5_class: "fast" - storage6_name: "primarysite" - storage6_access_mode: "ReadWriteOnce" - storage6_size: "4G" - storage6_type: "dynamic" - storage6_class: "primarysite" - storage7_name: "alternatesite" - storage7_access_mode: "ReadWriteOnce" - storage7_size: "4G" - storage7_type: "dynamic" - storage7_class: "alternatesite" - storage8_name: "gce" - storage8_access_mode: "ReadWriteOnce" - storage8_size: "300M" - storage8_type: "dynamic" - storage8_class: "standard" - storage9_name: "rook" - storage9_access_mode: "ReadWriteOnce" - storage9_size: "1Gi" - storage9_type: "dynamic" - storage9_class: "rook-ceph-block" +apiVersion: v1 +kind: ConfigMap +metadata: + name: pgo-deployer-cm + namespace: pgo +data: + values.yaml: |- + # ===================== + # Configuration Options + # More info for these options can be found in the docs + # https://access.crunchydata.com/documentation/postgres-operator/latest/installation/configuration/ + # ===================== + archive_mode: "true" + archive_timeout: "60" + backrest_aws_s3_bucket: "" + backrest_aws_s3_endpoint: "" + backrest_aws_s3_key: "" + backrest_aws_s3_region: "" + backrest_aws_s3_secret: "" + backrest_aws_s3_uri_style: "" + backrest_aws_s3_verify_tls: "true" + backrest_port: "2022" + badger: "false" + ccp_image_prefix: "registry.developers.crunchydata.com/crunchydata" + ccp_image_pull_secret: "" + ccp_image_pull_secret_manifest: "" + ccp_image_tag: "centos7-12.6-4.4.3" + create_rbac: "true" + crunchy_debug: "false" + db_name: "" + db_password_age_days: "0" + db_password_length: "24" + db_port: "5432" + db_replicas: "0" + db_user: "testuser" + default_instance_memory: "128Mi" + default_pgbackrest_memory: "48Mi" + default_pgbouncer_memory: "24Mi" + delete_metrics_namespace: "false" + delete_operator_namespace: "false" + delete_watched_namespaces: "false" + disable_auto_failover: "false" + disable_fsgroup: "false" + reconcile_rbac: "true" + exporterport: "9187" + grafana_admin_password: "" + grafana_admin_username: "admin" + grafana_install: "false" + grafana_storage_access_mode: "ReadWriteOnce" + grafana_storage_class_name: "fast" + grafana_supplemental_groups: "65534" + grafana_volume_size: "1G" + metrics: "false" + metrics_namespace: "pgo" + namespace: "pgo" + namespace_mode: "dynamic" + pgbadgerport: "10000" + pgo_add_os_ca_store: "false" + pgo_admin_password: "examplepassword" + pgo_admin_perms: "*" + pgo_admin_role_name: "pgoadmin" + pgo_admin_username: "admin" + pgo_apiserver_port: "8443" + pgo_apiserver_url: "https://postgres-operator" + pgo_client_cert_secret: "pgo.tls" + pgo_client_container_install: "false" + pgo_client_install: "true" + pgo_client_version: "4.4.3" + pgo_cluster_admin: "false" + pgo_disable_eventing: "false" + pgo_disable_tls: "false" + pgo_image_prefix: "registry.developers.crunchydata.com/crunchydata" + pgo_image_pull_secret: "" + pgo_image_pull_secret_manifest: "" + pgo_image_tag: "centos7-4.4.3" + pgo_installation_name: "devtest" + pgo_noauth_routes: "" + pgo_operator_namespace: "pgo" + pgo_tls_ca_store: "" + pgo_tls_no_verify: "false" + pod_anti_affinity: "preferred" + pod_anti_affinity_pgbackrest: "" + pod_anti_affinity_pgbouncer: "" + prometheus_install: "false" + prometheus_storage_access_mode: "ReadWriteOnce" + prometheus_storage_class_name: "fast" + prometheus_supplemental_groups: "65534" + prometheus_volume_size: "1G" + scheduler_timeout: "3600" + service_type: "ClusterIP" + sync_replication: "false" + backrest_storage: "hostpathstorage" + backup_storage: "hostpathstorage" + primary_storage: "hostpathstorage" + replica_storage: "hostpathstorage" + wal_storage: "" + storage1_name: "hostpathstorage" + storage1_access_mode: "ReadWriteMany" + storage1_size: "1G" + storage1_type: "create" + storage2_name: "replicastorage" + storage2_access_mode: "ReadWriteMany" + storage2_size: "1G" + storage2_type: "create" + storage3_name: "nfsstorage" + storage3_access_mode: "ReadWriteMany" + storage3_size: "1G" + storage3_type: "create" + storage3_supplemental_groups: "65534" + storage4_name: "nfsstoragered" + storage4_access_mode: "ReadWriteMany" + storage4_size: "1G" + storage4_match_labels: "crunchyzone=red" + storage4_type: "create" + storage4_supplemental_groups: "65534" + storage5_name: "storageos" + storage5_access_mode: "ReadWriteOnce" + storage5_size: "5Gi" + storage5_type: "dynamic" + storage5_class: "fast" + storage6_name: "primarysite" + storage6_access_mode: "ReadWriteOnce" + storage6_size: "4G" + storage6_type: "dynamic" + storage6_class: "primarysite" + storage7_name: "alternatesite" + storage7_access_mode: "ReadWriteOnce" + storage7_size: "4G" + storage7_type: "dynamic" + storage7_class: "alternatesite" + storage8_name: "gce" + storage8_access_mode: "ReadWriteOnce" + storage8_size: "300M" + storage8_type: "dynamic" + storage8_class: "standard" + storage9_name: "rook" + storage9_access_mode: "ReadWriteOnce" + storage9_size: "1Gi" + storage9_type: "dynamic" + storage9_class: "rook-ceph-block" --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: pgo-deployer-crb + name: pgo-deployer-crb roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: pgo-deployer-cr + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: pgo-deployer-cr subjects: -- kind: ServiceAccount - name: pgo-deployer-sa - namespace: pgo + - kind: ServiceAccount + name: pgo-deployer-sa + namespace: pgo --- apiVersion: batch/v1 kind: Job metadata: - name: pgo-deploy - namespace: pgo + name: pgo-deploy + namespace: pgo spec: - backoffLimit: 0 - template: - metadata: - name: pgo-deploy - spec: - serviceAccountName: pgo-deployer-sa - restartPolicy: Never - containers: - - name: pgo-deploy - image: registry.developers.crunchydata.com/crunchydata/pgo-deployer:centos7-4.4.0 - imagePullPolicy: IfNotPresent - env: - - name: DEPLOY_ACTION - value: install - volumeMounts: - - name: deployer-conf - mountPath: "/conf" - volumes: - - name: deployer-conf - configMap: - name: pgo-deployer-cm + backoffLimit: 0 + template: + metadata: + name: pgo-deploy + spec: + serviceAccountName: pgo-deployer-sa + restartPolicy: Never + containers: + - name: pgo-deploy + image: registry.developers.crunchydata.com/crunchydata/pgo-deployer:centos7-4.4.3 + imagePullPolicy: IfNotPresent + env: + - name: DEPLOY_ACTION + value: install + volumeMounts: + - name: deployer-conf + mountPath: "/conf" + volumes: + - name: deployer-conf + configMap: + name: pgo-deployer-cm diff --git a/installers/olm/Makefile b/installers/olm/Makefile index 09ff82042f..3a59c75c36 100644 --- a/installers/olm/Makefile +++ b/installers/olm/Makefile @@ -2,7 +2,7 @@ .SUFFIXES: CCP_IMAGE_PREFIX ?= registry.developers.crunchydata.com/crunchydata -CCP_PG_FULLVERSION ?= 12.3 +CCP_PG_FULLVERSION ?= 12.6 CCP_POSTGIS_VERSION ?= 3.0 KUBECONFIG ?= $(HOME)/.kube/config OLM_SDK_VERSION ?= 0.13.0 @@ -10,7 +10,7 @@ OLM_TOOLS ?= registry.localhost:5000/postgres-operator-olm-tools:$(OLM_SDK_VERSI OLM_VERSION ?= 0.14.2 PGO_BASEOS ?= centos7 PGO_IMAGE_PREFIX ?= registry.developers.crunchydata.com/crunchydata -PGO_VERSION ?= 4.4.0 +PGO_VERSION ?= 4.4.3 PGO_IMAGE_TAG ?= $(PGO_BASEOS)-$(PGO_VERSION) CCP_IMAGE_TAG ?= $(PGO_BASEOS)-$(CCP_PG_FULLVERSION)-$(PGO_VERSION) CCP_POSTGIS_IMAGE_TAG ?= $(PGO_BASEOS)-$(CCP_PG_FULLVERSION)-$(CCP_POSTGIS_VERSION)-$(PGO_VERSION) diff --git a/installers/olm/README.md b/installers/olm/README.md index 207f85daa8..6e31ba4d0b 100644 --- a/installers/olm/README.md +++ b/installers/olm/README.md @@ -1,11 +1,11 @@ - This directory contains the files that are used to install [Crunchy PostgreSQL for Kubernetes][hub-listing], -which uses the PostgreSQL Operator, using [Operator Lifecycle Manager][OLM]. +which includes PGO, the Postgres Operator from [Crunchy Data][crunchy-data], using [Operator Lifecycle Manager][OLM]. The integration centers around a [ClusterServiceVersion][olm-csv] [manifest](./postgresoperator.csv.yaml) that gets packaged for OperatorHub. Changes there are accepted only if they pass all the [scorecard][] tests. Consult the [technical requirements][hub-contrib] when making changes. +[crunchy-data]: https://www.crunchydata.com [hub-contrib]: https://github.com/operator-framework/community-operators/blob/master/docs/contributing.md [hub-listing]: https://operatorhub.io/operator/postgresql [olm-csv]: https://github.com/operator-framework/operator-lifecycle-manager/blob/master/doc/design/building-your-csv.md diff --git a/internal/apiserver/backrestservice/backrestimpl.go b/internal/apiserver/backrestservice/backrestimpl.go index 048b0237cb..c4b172ddde 100644 --- a/internal/apiserver/backrestservice/backrestimpl.go +++ b/internal/apiserver/backrestservice/backrestimpl.go @@ -1,7 +1,7 @@ package backrestservice /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -36,6 +36,7 @@ import ( log "github.com/sirupsen/logrus" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" ) const containername = "database" @@ -202,9 +203,9 @@ func CreateBackup(request *msgs.CreateBackrestBackupRequest, ns, pgouser string) } - //get pod name from cluster + // get pod name from cluster var podname string - podname, err = getPrimaryPodName(&cluster, ns) + podname, err = getBackrestRepoPodName(&cluster, ns) if err != nil { log.Error(err) @@ -213,6 +214,13 @@ func CreateBackup(request *msgs.CreateBackrestBackupRequest, ns, pgouser string) return resp } + // check if primary is ready + if !isPrimaryReady(&cluster) { + resp.Status.Code = msgs.Error + resp.Status.Msg = "primary pod is not in Ready state" + return resp + } + jobName := "backrest-" + crv1.PgtaskBackrestBackup + "-" + clusterName log.Debugf("setting jobName to %s", jobName) @@ -265,33 +273,18 @@ func getBackupParams(identifier, clusterName, taskName, action, podName, contain return newInstance } -func getDeployName(cluster *crv1.Pgcluster, ns string) (string, error) { - var depName string - - selector := config.LABEL_PG_CLUSTER + "=" + cluster.Spec.Name + "," + config.LABEL_SERVICE_NAME + "=" + cluster.Spec.Name - - deps, err := apiserver.Clientset. - AppsV1().Deployments(ns). - List(metav1.ListOptions{LabelSelector: selector}) - if err != nil { - return depName, err - } +// getBackrestRepoPodName goes through the pod list to identify the +// pgBackRest repo pod and then returns the pod name. +func getBackrestRepoPodName(cluster *crv1.Pgcluster, ns string) (string, error) { + //look up the backrest-repo pod name + selector := "pg-cluster=" + cluster.Spec.Name + ",pgo-backrest-repo=true" - if len(deps.Items) != 1 { - return depName, errors.New("error: deployment count is wrong for backrest backup " + cluster.Spec.Name) + options := metav1.ListOptions{ + FieldSelector: fields.OneTermEqualSelector("status.phase", string(v1.PodRunning)).String(), + LabelSelector: selector, } - for _, d := range deps.Items { - return d.Name, err - } - - return depName, errors.New("unknown error in backrest backup") -} - -func getPrimaryPodName(cluster *crv1.Pgcluster, ns string) (string, error) { - //look up the backrest-repo pod name - selector := "pg-cluster=" + cluster.Spec.Name + ",pgo-backrest-repo=true" - repopods, err := apiserver.Clientset.CoreV1().Pods(ns).List(metav1.ListOptions{LabelSelector: selector}) + repopods, err := apiserver.Clientset.CoreV1().Pods(ns).List(options) if len(repopods.Items) != 1 { log.Errorf("pods len != 1 for cluster %s", cluster.Spec.Name) return "", errors.New("backrestrepo pod not found for cluster " + cluster.Spec.Name) @@ -303,50 +296,30 @@ func getPrimaryPodName(cluster *crv1.Pgcluster, ns string) (string, error) { repopodName := repopods.Items[0].Name - primaryReady := false - - //make sure the primary pod is in the ready state - selector = config.LABEL_SERVICE_NAME + "=" + cluster.Spec.Name - - pods, err := apiserver.Clientset.CoreV1().Pods(ns).List(metav1.ListOptions{LabelSelector: selector}) - if err != nil { - return "", err - } - for _, p := range pods.Items { - if isPrimary(&p, cluster.Spec.Name) && isReady(&p) { - primaryReady = true - } - } - - if primaryReady == false { - return "", errors.New("primary pod is not in Ready state") - } - return repopodName, err } -func isPrimary(pod *v1.Pod, clusterName string) bool { - if pod.ObjectMeta.Labels[config.LABEL_SERVICE_NAME] == clusterName { - return true +// isPrimaryReady goes through the pod list to first identify the +// Primary pod and, once identified, determine if it is in a +// ready state. If not, it returns an error, otherwise it returns +// a nil value +func isPrimaryReady(cluster *crv1.Pgcluster) bool { + options := metav1.ListOptions{ + FieldSelector: fields.OneTermEqualSelector("status.phase", string(v1.PodRunning)).String(), + LabelSelector: fields.AndSelectors( + fields.OneTermEqualSelector(config.LABEL_PG_CLUSTER, cluster.Name), + fields.OneTermEqualSelector(config.LABEL_PGHA_ROLE, config.LABEL_PGHA_ROLE_PRIMARY), + ).String(), } - return false -} + pods, err := apiserver.Clientset.CoreV1().Pods(cluster.Namespace).List(options) -func isReady(pod *v1.Pod) bool { - readyCount := 0 - containerCount := 0 - for _, stat := range pod.Status.ContainerStatuses { - containerCount++ - if stat.Ready { - readyCount++ - } - } - if readyCount != containerCount { + if err != nil { + log.Error(err) return false } - return true + return len(pods.Items) > 0 } // ShowBackrest ... @@ -378,7 +351,7 @@ func ShowBackrest(name, selector, ns string) msgs.ShowBackrestResponse { log.Debugf("clusters found len is %d\n", len(clusterList.Items)) for _, c := range clusterList.Items { - podname, err := getPrimaryPodName(&c, ns) + podname, err := getBackrestRepoPodName(&c, ns) if err != nil { log.Error(err) diff --git a/internal/apiserver/backrestservice/backrestservice.go b/internal/apiserver/backrestservice/backrestservice.go index e436afb878..00f4aba481 100644 --- a/internal/apiserver/backrestservice/backrestservice.go +++ b/internal/apiserver/backrestservice/backrestservice.go @@ -1,7 +1,7 @@ package backrestservice /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/backupoptions/backupoptionsutil.go b/internal/apiserver/backupoptions/backupoptionsutil.go index 196d0f1fa1..c8efed16b5 100644 --- a/internal/apiserver/backupoptions/backupoptionsutil.go +++ b/internal/apiserver/backupoptions/backupoptionsutil.go @@ -1,7 +1,7 @@ package backupoptions /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -167,6 +167,13 @@ func isValidCompressLevel(compressLevel int) bool { } } +// isValidCompressType checks that the compression type passed in matches one +// of the ones supported by pgBackRest. However, it presently does not support +// `zst` +func isValidCompressType(compressType string) bool { + return compressType == "gz" || compressType == "bz2" || compressType == "lz4" || compressType == "none" +} + // isValidRetentionRange validates that pgBackrest Full, Diff or Archive // retention option value is set within the allowable range. // allowed: 1-9999999 diff --git a/internal/apiserver/backupoptions/backupoptionsutil_test.go b/internal/apiserver/backupoptions/backupoptionsutil_test.go new file mode 100644 index 0000000000..44048f15d8 --- /dev/null +++ b/internal/apiserver/backupoptions/backupoptionsutil_test.go @@ -0,0 +1,40 @@ +package backupoptions + +/* +Copyright 2021 Crunchy Data Solutions, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "testing" + +func TestIsValidCompressType(t *testing.T) { + tests := []struct { + compressType string + expected bool + }{ + {compressType: "bz2", expected: true}, + {compressType: "gz", expected: true}, + {compressType: "none", expected: true}, + {compressType: "lz4", expected: true}, + {compressType: "zst", expected: false}, + {compressType: "bogus", expected: false}, + } + + for _, test := range tests { + t.Run(test.compressType, func(t *testing.T) { + if isValidCompressType(test.compressType) != test.expected { + t.Fatalf("expected %q to be %t", test.compressType, test.expected) + } + }) + } +} diff --git a/internal/apiserver/backupoptions/pgbackrestoptions.go b/internal/apiserver/backupoptions/pgbackrestoptions.go index 2c7a1e356e..2deb8d2dcf 100644 --- a/internal/apiserver/backupoptions/pgbackrestoptions.go +++ b/internal/apiserver/backupoptions/pgbackrestoptions.go @@ -1,7 +1,7 @@ package backupoptions /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -25,8 +25,6 @@ var pgBackRestOptsDenyList = []string{ "--config", "--config-include-path", "--config-path", - "--link-all", - "--link-map", "--lock-path", "--log-timestamp", "--neutral-umask", @@ -84,6 +82,7 @@ type pgBackRestBackupOptions struct { NoCompress bool `flag:"no-compress"` CompressLevel int `flag:"compress-level"` CompressLevelNetwork int `flag:"compress-level-network"` + CompressType string `flag:"compress-type"` DBTimeout int `flag:"db-timeout"` Delta bool `flag:"no-delta"` ProcessMax int `flag:"process-max"` @@ -148,6 +147,11 @@ func (backRestBackupOpts pgBackRestBackupOptions) validate(setFlagFieldNames []s err := errors.New("Invalid network compress level for pgBackRest backup") errstrings = append(errstrings, err.Error()) } + case "CompressType": + if !isValidCompressType(backRestBackupOpts.CompressType) { + err := errors.New("Invalid compress type for pgBackRest backup") + errstrings = append(errstrings, err.Error()) + } case "LogLevelConsole": if !isValidBackrestLogLevel(backRestBackupOpts.LogLevelConsole) { err := errors.New("Invalid log level for pgBackRest backup") diff --git a/internal/apiserver/backupoptions/pgdumpoptions.go b/internal/apiserver/backupoptions/pgdumpoptions.go index 268aa42412..bfbae16c23 100644 --- a/internal/apiserver/backupoptions/pgdumpoptions.go +++ b/internal/apiserver/backupoptions/pgdumpoptions.go @@ -1,7 +1,7 @@ package backupoptions /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/catservice/catimpl.go b/internal/apiserver/catservice/catimpl.go index b01bc4b618..ddd6a58b12 100644 --- a/internal/apiserver/catservice/catimpl.go +++ b/internal/apiserver/catservice/catimpl.go @@ -1,7 +1,7 @@ package catservice /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/catservice/catservice.go b/internal/apiserver/catservice/catservice.go index 439274271e..9c34db38db 100644 --- a/internal/apiserver/catservice/catservice.go +++ b/internal/apiserver/catservice/catservice.go @@ -1,7 +1,7 @@ package catservice /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/cloneservice/cloneimpl.go b/internal/apiserver/cloneservice/cloneimpl.go index b095f45289..5361300233 100644 --- a/internal/apiserver/cloneservice/cloneimpl.go +++ b/internal/apiserver/cloneservice/cloneimpl.go @@ -1,7 +1,7 @@ package cloneservice /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/cloneservice/cloneservice.go b/internal/apiserver/cloneservice/cloneservice.go index f98a5f439d..7bf035e94f 100644 --- a/internal/apiserver/cloneservice/cloneservice.go +++ b/internal/apiserver/cloneservice/cloneservice.go @@ -1,7 +1,7 @@ package cloneservice /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/clusterservice/clusterimpl.go b/internal/apiserver/clusterservice/clusterimpl.go index 049a23758e..155a0d959d 100644 --- a/internal/apiserver/clusterservice/clusterimpl.go +++ b/internal/apiserver/clusterservice/clusterimpl.go @@ -1,7 +1,7 @@ package clusterservice /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -38,6 +38,7 @@ import ( kerrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/util/validation" "k8s.io/client-go/kubernetes" ) @@ -339,7 +340,7 @@ func getServices(cluster *crv1.Pgcluster, ns string) ([]msgs.ShowClusterService, func TestCluster(name, selector, ns, pgouser string, allFlag bool) msgs.ClusterTestResponse { var err error - log.Debugf("TestCluster(%s,%s,%s,%s,%s): Called", + log.Debugf("TestCluster(%s,%s,%s,%s,%v): Called", name, selector, ns, pgouser, allFlag) response := msgs.ClusterTestResponse{} @@ -355,7 +356,7 @@ func TestCluster(name, selector, ns, pgouser string, allFlag bool) msgs.ClusterT // be used if selector == "" { if allFlag { - log.Debug("selector is : all clusters in %s", ns) + log.Debugf("selector is : all clusters in %s", ns) } else { selector = "name=" + name log.Debugf("selector is: %s", selector) @@ -446,7 +447,7 @@ func TestCluster(name, selector, ns, pgouser string, allFlag bool) msgs.ClusterT case msgs.PodTypeReplica: instance.InstanceType = msgs.ClusterTestInstanceTypeReplica } - log.Debugf("Instance found with attributes: (%s, %s, %s)", + log.Debugf("Instance found with attributes: (%s, %s, %v)", instance.InstanceType, instance.Message, instance.Available) // Add the report on the pods to this set result.Instances = append(result.Instances, instance) @@ -488,7 +489,7 @@ func TestCluster(name, selector, ns, pgouser string, allFlag bool) msgs.ClusterT switch { default: endpoint.InstanceType = msgs.ClusterTestInstanceTypePrimary - case strings.Contains(service.Name, msgs.PodTypeReplica): + case (strings.HasSuffix(service.Name, "-"+msgs.PodTypeReplica) && strings.Count(service.Name, "-"+msgs.PodTypeReplica) == 1): endpoint.InstanceType = msgs.ClusterTestInstanceTypeReplica case service.Pgbouncer: endpoint.InstanceType = msgs.ClusterTestInstanceTypePGBouncer @@ -514,7 +515,7 @@ func TestCluster(name, selector, ns, pgouser string, allFlag bool) msgs.ClusterT } } - log.Debugf("Endpoint found with attributes: (%s, %s, %s)", + log.Debugf("Endpoint found with attributes: (%s, %s, %v)", endpoint.InstanceType, endpoint.Message, endpoint.Available) // append the endpoint to the list @@ -580,18 +581,12 @@ func CreateCluster(request *msgs.CreateClusterRequest, ns, pgouser string) msgs. return resp } - userLabelsMap := make(map[string]string) - if request.UserLabels != "" { - labels := strings.Split(request.UserLabels, ",") - for _, v := range labels { - p := strings.Split(v, "=") - if len(p) < 2 { - resp.Status.Code = msgs.Error - resp.Status.Msg = "invalid labels format" - return resp - } - userLabelsMap[p[0]] = p[1] - } + userLabelsMap, err := apiserver.ValidateLabel(request.UserLabels) + + if err != nil { + resp.Status.Code = msgs.Error + resp.Status.Msg = err.Error() + return resp } // validate any parameters provided to bootstrap the cluster from an existing data source @@ -1699,7 +1694,7 @@ func UpdateCluster(request *msgs.UpdateClusterRequest) msgs.UpdateClusterRespons response.Status = msgs.Status{Code: msgs.Ok, Msg: ""} response.Results = make([]string, 0) - log.Debugf("autofail is [%t]\n", request.Autofail) + log.Debugf("autofail is [%v]\n", request.Autofail) switch { case request.Startup && request.Shutdown: @@ -1801,7 +1796,7 @@ func UpdateCluster(request *msgs.UpdateClusterRequest) msgs.UpdateClusterRespons for _, cluster := range clusterList.Items { - //set autofail=true or false on each pgcluster CRD + // set --enable-autofail / --disable-autofail on each pgcluster CRD // Make the change based on the value of Autofail vis-a-vis UpdateClusterAutofailStatus switch request.Autofail { case msgs.UpdateClusterAutofailEnable: @@ -1933,10 +1928,15 @@ func GetPrimaryAndReplicaPods(cluster *crv1.Pgcluster, ns string) ([]msgs.ShowCl output := make([]msgs.ShowClusterPod, 0) + // find all of the Pods that represent Postgres primary and replicas. + // only consider running Pods selector := config.LABEL_SERVICE_NAME + "=" + cluster.Spec.Name + "," + config.LABEL_DEPLOYMENT_NAME - log.Debugf("selector for GetPrimaryAndReplicaPods is %s", selector) + options := metav1.ListOptions{ + FieldSelector: fields.OneTermEqualSelector("status.phase", string(v1.PodRunning)).String(), + LabelSelector: selector, + } - pods, err := apiserver.Clientset.CoreV1().Pods(ns).List(metav1.ListOptions{LabelSelector: selector}) + pods, err := apiserver.Clientset.CoreV1().Pods(ns).List(options) if err != nil { return output, err } @@ -1956,9 +1956,12 @@ func GetPrimaryAndReplicaPods(cluster *crv1.Pgcluster, ns string) ([]msgs.ShowCl } selector = config.LABEL_SERVICE_NAME + "=" + cluster.Spec.Name + "-replica" + "," + config.LABEL_DEPLOYMENT_NAME - log.Debugf("selector for GetPrimaryAndReplicaPods is %s", selector) + options = metav1.ListOptions{ + FieldSelector: fields.OneTermEqualSelector("status.phase", string(v1.PodRunning)).String(), + LabelSelector: selector, + } - pods, err = apiserver.Clientset.CoreV1().Pods(ns).List(metav1.ListOptions{LabelSelector: selector}) + pods, err = apiserver.Clientset.CoreV1().Pods(ns).List(options) if err != nil { return output, err } diff --git a/internal/apiserver/clusterservice/clusterservice.go b/internal/apiserver/clusterservice/clusterservice.go index e69aae067f..9d1a3a29e5 100644 --- a/internal/apiserver/clusterservice/clusterservice.go +++ b/internal/apiserver/clusterservice/clusterservice.go @@ -1,7 +1,7 @@ package clusterservice /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -131,7 +131,7 @@ func ShowClusterHandler(w http.ResponseWriter, r *http.Request) { namespace := request.Namespace allflag := request.AllFlag - log.Debugf("ShowClusterHandler: parameters name [%s] selector [%s] ccpimagetag [%s] version [%s] namespace [%s] allflag [%s]", clustername, selector, ccpimagetag, clientVersion, namespace, allflag) + log.Debugf("ShowClusterHandler: parameters name [%s] selector [%s] ccpimagetag [%s] version [%s] namespace [%s] allflag [%v]", clustername, selector, ccpimagetag, clientVersion, namespace, allflag) username, err := apiserver.Authn(apiserver.SHOW_CLUSTER_PERM, w, r) if err != nil { @@ -206,7 +206,7 @@ func DeleteClusterHandler(w http.ResponseWriter, r *http.Request) { deleteData := request.DeleteData deleteBackups := request.DeleteBackups - log.Debugf("DeleteClusterHandler: parameters namespace [%s] selector [%s] delete-data [%t] delete-backups [%t]", namespace, selector, clientVersion, deleteData, deleteBackups) + log.Debugf("DeleteClusterHandler: parameters namespace [%s] selector [%s] delete-data [%t] delete-backups [%t]", namespace, selector, deleteData, deleteBackups) username, err := apiserver.Authn(apiserver.DELETE_CLUSTER_PERM, w, r) if err != nil { @@ -306,8 +306,8 @@ func TestClusterHandler(w http.ResponseWriter, r *http.Request) { } // UpdateClusterHandler ... -// pgo update cluster mycluster --autofail=true -// pgo update cluster --selector=env=research --autofail=false +// pgo update cluster mycluster --enable-autofail +// pgo update cluster --selector=env=research --disable-autofail // returns a UpdateClusterResponse func UpdateClusterHandler(w http.ResponseWriter, r *http.Request) { // swagger:operation POST /clustersupdate clusterservice clustersupdate diff --git a/internal/apiserver/clusterservice/scaleimpl.go b/internal/apiserver/clusterservice/scaleimpl.go index 64d631233c..2d108d17ba 100644 --- a/internal/apiserver/clusterservice/scaleimpl.go +++ b/internal/apiserver/clusterservice/scaleimpl.go @@ -1,7 +1,7 @@ package clusterservice /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -216,7 +216,7 @@ func ScaleQuery(name, ns string) msgs.ScaleQueryResponse { ClusterName: name, } - replicationStatusResponse, err := util.ReplicationStatus(replicationStatusRequest, false) + replicationStatusResponse, err := util.ReplicationStatus(replicationStatusRequest, false, true) // if an error is return, log the message, and return the response if err != nil { @@ -291,10 +291,10 @@ func ScaleDown(deleteData bool, clusterName, replicaName, ns string) msgs.ScaleD return response } - // selector in the format "pg-cluster=,pg-ha-scope=" - // which will grab the primary and any/all replicas - selector := fmt.Sprintf("%s=%s,%s=%s", config.LABEL_PG_CLUSTER, clusterName, - config.LABEL_PGHA_ROLE, config.LABEL_PGHA_ROLE_REPLICA) + // selector in the format "pg-cluster=,pgo-pg-database,role!=config.LABEL_PGHA_ROLE_PRIMARY" + // which will grab all the replicas + selector := fmt.Sprintf("%s=%s,%s,%s!=%s", config.LABEL_PG_CLUSTER, clusterName, + config.LABEL_PG_DATABASE, config.LABEL_PGHA_ROLE, config.LABEL_PGHA_ROLE_PRIMARY) replicaList, err := apiserver.Clientset.CoreV1().Pods(ns).List(metav1.ListOptions{LabelSelector: selector}) if err != nil { response.Status.Code = msgs.Error diff --git a/internal/apiserver/clusterservice/scaleservice.go b/internal/apiserver/clusterservice/scaleservice.go index 92db853216..bb742691e7 100644 --- a/internal/apiserver/clusterservice/scaleservice.go +++ b/internal/apiserver/clusterservice/scaleservice.go @@ -1,7 +1,7 @@ package clusterservice /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/common.go b/internal/apiserver/common.go index e1a0e0260f..8fe6ead259 100644 --- a/internal/apiserver/common.go +++ b/internal/apiserver/common.go @@ -1,7 +1,7 @@ package apiserver /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -19,6 +19,7 @@ import ( "errors" "fmt" "strconv" + "strings" "github.com/crunchydata/postgres-operator/internal/config" "github.com/crunchydata/postgres-operator/internal/kubeapi" @@ -27,6 +28,7 @@ import ( kerrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/validation" ) const ( @@ -45,6 +47,8 @@ var ( // ErrDBContainerNotFound is an error that indicates that a "database" container // could not be found in a specific pod ErrDBContainerNotFound = errors.New("\"database\" container not found in pod") + // ErrLabelInvalid indicates that a label is invalid + ErrLabelInvalid = errors.New("invalid label") // ErrStandbyNotAllowed contains the error message returned when an API call is not // permitted because it involves a cluster that is in standby mode ErrStandbyNotAllowed = errors.New("Action not permitted because standby mode is enabled") @@ -110,6 +114,65 @@ func IsValidPVC(pvcName, ns string) bool { return pvc != nil } +// ValidateLabel is derived from a legacy method and validates if the input is a +// valid Kubernetes label. +// +// A label is composed of a key and value. +// +// The key can either be a name or have an optional prefix that i +// terminated by a "/", e.g. "prefix/name" +// +// The name must be a valid DNS 1123 value +// THe prefix must be a valid DNS 1123 subdomain +// +// The value can be validated by machinery provided by Kubenretes +// +// Ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +func ValidateLabel(labelStr string) (map[string]string, error) { + labelMap := map[string]string{} + + // if this is an empty string, return + if strings.TrimSpace(labelStr) == "" { + return labelMap, nil + } + + for _, v := range strings.Split(labelStr, ",") { + pair := strings.Split(v, "=") + if len(pair) != 2 { + return labelMap, fmt.Errorf("%w: label format incorrect, requires key=value", ErrLabelInvalid) + } + + // first handle the key + keyParts := strings.Split(pair[0], "/") + + switch len(keyParts) { + default: + return labelMap, fmt.Errorf("%w: invalid key for "+v, ErrLabelInvalid) + case 2: + if errs := validation.IsDNS1123Subdomain(keyParts[0]); len(errs) > 0 { + return labelMap, fmt.Errorf("%w: invalid key for %s: %s", ErrLabelInvalid, v, strings.Join(errs, ",")) + } + + if errs := validation.IsDNS1123Label(keyParts[1]); len(errs) > 0 { + return labelMap, fmt.Errorf("%w: invalid key for %s: %s", ErrLabelInvalid, v, strings.Join(errs, ",")) + } + case 1: + if errs := validation.IsDNS1123Label(keyParts[0]); len(errs) > 0 { + return labelMap, fmt.Errorf("%w: invalid key for %s: %s", ErrLabelInvalid, v, strings.Join(errs, ",")) + } + } + + // handle the value + if errs := validation.IsValidLabelValue(pair[1]); len(errs) > 0 { + return labelMap, fmt.Errorf("%w: invalid value for %s: %s", ErrLabelInvalid, v, strings.Join(errs, ",")) + } + + labelMap[pair[0]] = pair[1] + } + + return labelMap, nil +} + // ValidateResourceRequestLimit validates that a Kubernetes Requests/Limit pair // is valid, both by validating the values are valid quantity values, and then // by checking that the limit >= request. This also needs to check against the diff --git a/internal/apiserver/common_test.go b/internal/apiserver/common_test.go index da909d2ba6..4119978d46 100644 --- a/internal/apiserver/common_test.go +++ b/internal/apiserver/common_test.go @@ -1,7 +1,7 @@ package apiserver /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -16,11 +16,79 @@ limitations under the License. */ import ( + "errors" + "fmt" + "strings" "testing" "k8s.io/apimachinery/pkg/api/resource" ) +func TestValidateLabel(t *testing.T) { + t.Run("valid", func(t *testing.T) { + inputs := []map[string]string{ + map[string]string{"key": "value"}, + map[string]string{"example.com/key": "value"}, + map[string]string{"key1": "value1", "key2": "value2"}, + map[string]string{"": ""}, + } + + for _, input := range inputs { + labelStr := "" + + for k, v := range input { + if k == "" && v == "" { + continue + } + + labelStr += fmt.Sprintf("%s=%s,", k, v) + } + + labelStr = strings.Trim(labelStr, ",") + + t.Run(labelStr, func(*testing.T) { + labels, err := ValidateLabel(labelStr) + + if err != nil { + t.Fatalf("expected no error, got: %s", err.Error()) + } + + for k := range labels { + if v, ok := input[k]; !(ok || v == labels[k]) { + t.Fatalf("label values do not matched (%s vs. %s)", input[k], labels[k]) + } + } + }) + } + }) + + t.Run("invalid", func(t *testing.T) { + inputs := []string{ + "key", + "key=value=value", + "key=value,", + "b@d=value", + "b@d-prefix/key=value", + "really/bad/prefix/key=value", + "key=v\\alue", + } + + for _, input := range inputs { + t.Run(input, func(t *testing.T) { + _, err := ValidateLabel(input) + + if err == nil { + t.Fatalf("expected an invalid input error.") + } + + if !errors.Is(err, ErrLabelInvalid) { + t.Fatalf("expected an ErrLabelInvalid error.") + } + }) + } + }) +} + func TestValidateResourceRequestLimit(t *testing.T) { t.Run("valid", func(t *testing.T) { resources := []struct{ request, limit, defaultRequest string }{ diff --git a/internal/apiserver/configservice/configimpl.go b/internal/apiserver/configservice/configimpl.go index 76d891d5ed..dc7ec2274c 100644 --- a/internal/apiserver/configservice/configimpl.go +++ b/internal/apiserver/configservice/configimpl.go @@ -1,7 +1,7 @@ package configservice /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/configservice/configservice.go b/internal/apiserver/configservice/configservice.go index 1f70934888..92a296ac3f 100644 --- a/internal/apiserver/configservice/configservice.go +++ b/internal/apiserver/configservice/configservice.go @@ -1,7 +1,7 @@ package configservice /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/dfservice/dfimpl.go b/internal/apiserver/dfservice/dfimpl.go index 08e104dc8c..b3f4ed7c3b 100644 --- a/internal/apiserver/dfservice/dfimpl.go +++ b/internal/apiserver/dfservice/dfimpl.go @@ -1,7 +1,7 @@ package dfservice /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -24,10 +24,12 @@ import ( "github.com/crunchydata/postgres-operator/internal/kubeapi" crv1 "github.com/crunchydata/postgres-operator/pkg/apis/crunchydata.com/v1" msgs "github.com/crunchydata/postgres-operator/pkg/apiservermsgs" + log "github.com/sirupsen/logrus" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" "k8s.io/client-go/kubernetes" ) @@ -133,9 +135,15 @@ func getClaimCapacity(clientset kubernetes.Interface, pvcName, ns string) (strin func getClusterDf(cluster *crv1.Pgcluster, clusterResultsChannel chan msgs.DfDetail, clusterProgressChannel chan bool, errorChannel chan error) { log.Debugf("pod df: %s", cluster.Spec.Name) - selector := fmt.Sprintf("%s=%s", config.LABEL_PG_CLUSTER, cluster.Spec.Name) + selector := fmt.Sprintf("%s=%s,!%s", + config.LABEL_PG_CLUSTER, cluster.Spec.Name, config.LABEL_PGHA_BOOTSTRAP) + + options := metav1.ListOptions{ + FieldSelector: fields.OneTermEqualSelector("status.phase", string(v1.PodRunning)).String(), + LabelSelector: selector, + } - pods, err := apiserver.Clientset.CoreV1().Pods(cluster.Spec.Namespace).List(metav1.ListOptions{LabelSelector: selector}) + pods, err := apiserver.Clientset.CoreV1().Pods(cluster.Spec.Namespace).List(options) // if there is an error attempting to get the pods, just return if err != nil { diff --git a/internal/apiserver/dfservice/dfservice.go b/internal/apiserver/dfservice/dfservice.go index 325e20257a..3a71e9feab 100644 --- a/internal/apiserver/dfservice/dfservice.go +++ b/internal/apiserver/dfservice/dfservice.go @@ -1,7 +1,7 @@ package dfservice /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/failoverservice/failoverimpl.go b/internal/apiserver/failoverservice/failoverimpl.go index e7a2573c94..afec8cabf1 100644 --- a/internal/apiserver/failoverservice/failoverimpl.go +++ b/internal/apiserver/failoverservice/failoverimpl.go @@ -1,7 +1,7 @@ package failoverservice /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -137,7 +137,7 @@ func QueryFailover(name, ns string) msgs.QueryFailoverResponse { ClusterName: name, } - replicationStatusResponse, err := util.ReplicationStatus(replicationStatusRequest, false) + replicationStatusResponse, err := util.ReplicationStatus(replicationStatusRequest, false, false) // if an error is return, log the message, and return the response if err != nil { diff --git a/internal/apiserver/failoverservice/failoverservice.go b/internal/apiserver/failoverservice/failoverservice.go index 164d7b1545..e80d7e05de 100644 --- a/internal/apiserver/failoverservice/failoverservice.go +++ b/internal/apiserver/failoverservice/failoverservice.go @@ -1,7 +1,7 @@ package failoverservice /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/labelservice/labelimpl.go b/internal/apiserver/labelservice/labelimpl.go index 7dd04d4567..5a029a3f8a 100644 --- a/internal/apiserver/labelservice/labelimpl.go +++ b/internal/apiserver/labelservice/labelimpl.go @@ -1,7 +1,7 @@ package labelservice /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -17,8 +17,6 @@ limitations under the License. import ( "encoding/json" - "errors" - "strings" "github.com/crunchydata/postgres-operator/internal/apiserver" "github.com/crunchydata/postgres-operator/internal/config" @@ -32,7 +30,6 @@ import ( "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/validation" ) // Label ... 2 forms ... @@ -52,10 +49,10 @@ func Label(request *msgs.LabelRequest, ns, pgouser string) msgs.LabelResponse { return resp } - labelsMap, err = validateLabel(request.LabelCmdLabel, ns) + labelsMap, err = apiserver.ValidateLabel(request.LabelCmdLabel) if err != nil { resp.Status.Code = msgs.Error - resp.Status.Msg = "labels not formatted correctly" + resp.Status.Msg = err.Error() return resp } @@ -125,7 +122,7 @@ func addLabels(items []crv1.Pgcluster, DryRun bool, LabelCmdLabel string, newLab log.Debug("dry run only") } else { log.Debugf("adding label to cluster %s", items[i].Spec.Name) - err := PatchPgcluster(LabelCmdLabel, items[i], ns) + err := PatchPgcluster(newLabels, items[i], ns) if err != nil { log.Error(err.Error()) } @@ -224,11 +221,8 @@ func updateLabels(deployment *v1.Deployment, clusterName string, newLabels map[s } -func PatchPgcluster(newLabel string, oldCRD crv1.Pgcluster, ns string) error { +func PatchPgcluster(newLabels map[string]string, oldCRD crv1.Pgcluster, ns string) error { - fields := strings.Split(newLabel, "=") - labelKey := fields[0] - labelValue := fields[1] oldData, err := json.Marshal(oldCRD) if err != nil { return err @@ -236,7 +230,9 @@ func PatchPgcluster(newLabel string, oldCRD crv1.Pgcluster, ns string) error { if oldCRD.ObjectMeta.Labels == nil { oldCRD.ObjectMeta.Labels = make(map[string]string) } - oldCRD.ObjectMeta.Labels[labelKey] = labelValue + for key, value := range newLabels { + oldCRD.ObjectMeta.Labels[key] = value + } var newData, patchBytes []byte newData, err = json.Marshal(oldCRD) if err != nil { @@ -260,31 +256,6 @@ func PatchPgcluster(newLabel string, oldCRD crv1.Pgcluster, ns string) error { } -func validateLabel(LabelCmdLabel, ns string) (map[string]string, error) { - var err error - labelMap := make(map[string]string) - userValues := strings.Split(LabelCmdLabel, ",") - for _, v := range userValues { - pair := strings.Split(v, "=") - if len(pair) != 2 { - log.Error("label format incorrect, requires name=value") - return labelMap, errors.New("label format incorrect, requires name=value") - } - - errs := validation.IsDNS1035Label(pair[0]) - if len(errs) > 0 { - return labelMap, errors.New("label format incorrect, requires name=value " + errs[0]) - } - errs = validation.IsDNS1035Label(pair[1]) - if len(errs) > 0 { - return labelMap, errors.New("label format incorrect, requires name=value " + errs[0]) - } - - labelMap[pair[0]] = pair[1] - } - return labelMap, err -} - // DeleteLabel ... // pgo delete label mycluster yourcluster --label=env=prod // pgo delete label --label=env=prod --selector=group=somegroup @@ -302,7 +273,7 @@ func DeleteLabel(request *msgs.DeleteLabelRequest, ns string) msgs.LabelResponse return resp } - labelsMap, err = validateLabel(request.LabelCmdLabel, ns) + labelsMap, err = apiserver.ValidateLabel(request.LabelCmdLabel) if err != nil { resp.Status.Code = msgs.Error resp.Status.Msg = "labels not formatted correctly" @@ -377,7 +348,7 @@ func deleteLabels(items []crv1.Pgcluster, LabelCmdLabel string, labelsMap map[st for i := 0; i < len(items); i++ { log.Debugf("deleting label from %s", items[i].Spec.Name) - err = deletePatchPgcluster(LabelCmdLabel, items[i], ns) + err = deletePatchPgcluster(labelsMap, items[i], ns) if err != nil { log.Error(err.Error()) return err @@ -406,11 +377,8 @@ func deleteLabels(items []crv1.Pgcluster, LabelCmdLabel string, labelsMap map[st return err } -func deletePatchPgcluster(newLabel string, oldCRD crv1.Pgcluster, ns string) error { +func deletePatchPgcluster(labelsMap map[string]string, oldCRD crv1.Pgcluster, ns string) error { - fields := strings.Split(newLabel, "=") - labelKey := fields[0] - //labelValue := fields[1] oldData, err := json.Marshal(oldCRD) if err != nil { return err @@ -418,7 +386,9 @@ func deletePatchPgcluster(newLabel string, oldCRD crv1.Pgcluster, ns string) err if oldCRD.ObjectMeta.Labels == nil { oldCRD.ObjectMeta.Labels = make(map[string]string) } - delete(oldCRD.ObjectMeta.Labels, labelKey) + for k := range labelsMap { + delete(oldCRD.ObjectMeta.Labels, k) + } var newData, patchBytes []byte newData, err = json.Marshal(oldCRD) @@ -483,7 +453,7 @@ func deleteTheLabel(deployment *v1.Deployment, clusterName string, labelsMap map _, err = apiserver.Clientset.AppsV1().Deployments(ns).Patch(deployment.Name, types.MergePatchType, patchBytes, "") if err != nil { - log.Debugf("error patching deployment ", err.Error()) + log.Debugf("error patching deployment: %v", err.Error()) } return err diff --git a/internal/apiserver/labelservice/labelservice.go b/internal/apiserver/labelservice/labelservice.go index f13054fd17..5921a7633b 100644 --- a/internal/apiserver/labelservice/labelservice.go +++ b/internal/apiserver/labelservice/labelservice.go @@ -1,7 +1,7 @@ package labelservice /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/loadservice/loadconfig.go b/internal/apiserver/loadservice/loadconfig.go index c5351796d7..e5de7df536 100644 --- a/internal/apiserver/loadservice/loadconfig.go +++ b/internal/apiserver/loadservice/loadconfig.go @@ -1,7 +1,7 @@ package loadservice /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/loadservice/loadimpl.go b/internal/apiserver/loadservice/loadimpl.go index 0cdf723bd9..20b4632d9d 100644 --- a/internal/apiserver/loadservice/loadimpl.go +++ b/internal/apiserver/loadservice/loadimpl.go @@ -1,7 +1,7 @@ package loadservice /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/loadservice/loadservice.go b/internal/apiserver/loadservice/loadservice.go index 068821ea87..036dd5c66c 100644 --- a/internal/apiserver/loadservice/loadservice.go +++ b/internal/apiserver/loadservice/loadservice.go @@ -1,7 +1,7 @@ package loadservice /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/middleware.go b/internal/apiserver/middleware.go index fc7e60e8e2..58a1fcd77d 100644 --- a/internal/apiserver/middleware.go +++ b/internal/apiserver/middleware.go @@ -1,7 +1,7 @@ package apiserver /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/namespaceservice/namespaceimpl.go b/internal/apiserver/namespaceservice/namespaceimpl.go index 04b6671f26..281bb5d085 100644 --- a/internal/apiserver/namespaceservice/namespaceimpl.go +++ b/internal/apiserver/namespaceservice/namespaceimpl.go @@ -1,7 +1,7 @@ package namespaceservice /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/namespaceservice/namespaceservice.go b/internal/apiserver/namespaceservice/namespaceservice.go index 1e27294c96..1e348218fa 100644 --- a/internal/apiserver/namespaceservice/namespaceservice.go +++ b/internal/apiserver/namespaceservice/namespaceservice.go @@ -1,7 +1,7 @@ package namespaceservice /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/perms.go b/internal/apiserver/perms.go index 74204dfc80..ce7f26cf53 100644 --- a/internal/apiserver/perms.go +++ b/internal/apiserver/perms.go @@ -1,7 +1,7 @@ package apiserver /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -42,7 +42,6 @@ const ( CREATE_CLUSTER_PERM = "CreateCluster" CREATE_DUMP_PERM = "CreateDump" CREATE_FAILOVER_PERM = "CreateFailover" - CREATE_INGEST_PERM = "CreateIngest" CREATE_NAMESPACE_PERM = "CreateNamespace" CREATE_PGADMIN_PERM = "CreatePgAdmin" CREATE_PGBOUNCER_PERM = "CreatePgbouncer" @@ -59,7 +58,6 @@ const ( // DELETE DELETE_BACKUP_PERM = "DeleteBackup" DELETE_CLUSTER_PERM = "DeleteCluster" - DELETE_INGEST_PERM = "DeleteIngest" DELETE_NAMESPACE_PERM = "DeleteNamespace" DELETE_PGADMIN_PERM = "DeletePgAdmin" DELETE_PGBOUNCER_PERM = "DeletePgbouncer" @@ -73,7 +71,6 @@ const ( SHOW_BACKUP_PERM = "ShowBackup" SHOW_CLUSTER_PERM = "ShowCluster" SHOW_CONFIG_PERM = "ShowConfig" - SHOW_INGEST_PERM = "ShowIngest" SHOW_NAMESPACE_PERM = "ShowNamespace" SHOW_PGADMIN_PERM = "ShowPgAdmin" SHOW_PGBOUNCER_PERM = "ShowPgBouncer" @@ -119,6 +116,7 @@ func InitializePerms() { LABEL_PERM: "yes", LOAD_PERM: "yes", RELOAD_PERM: "yes", + RESTART_PERM: "yes", RESTORE_PERM: "yes", STATUS_PERM: "yes", TEST_CLUSTER_PERM: "yes", @@ -129,7 +127,6 @@ func InitializePerms() { CREATE_DUMP_PERM: "yes", CREATE_CLUSTER_PERM: "yes", CREATE_FAILOVER_PERM: "yes", - CREATE_INGEST_PERM: "yes", CREATE_NAMESPACE_PERM: "yes", CREATE_PGADMIN_PERM: "yes", CREATE_PGBOUNCER_PERM: "yes", @@ -146,7 +143,6 @@ func InitializePerms() { // DELETE DELETE_BACKUP_PERM: "yes", DELETE_CLUSTER_PERM: "yes", - DELETE_INGEST_PERM: "yes", DELETE_NAMESPACE_PERM: "yes", DELETE_PGADMIN_PERM: "yes", DELETE_PGBOUNCER_PERM: "yes", @@ -160,7 +156,6 @@ func InitializePerms() { SHOW_BACKUP_PERM: "yes", SHOW_CLUSTER_PERM: "yes", SHOW_CONFIG_PERM: "yes", - SHOW_INGEST_PERM: "yes", SHOW_NAMESPACE_PERM: "yes", SHOW_PGADMIN_PERM: "yes", SHOW_PGBOUNCER_PERM: "yes", diff --git a/internal/apiserver/pgadminservice/pgadminimpl.go b/internal/apiserver/pgadminservice/pgadminimpl.go index a3c0712c68..8c31c7dd34 100644 --- a/internal/apiserver/pgadminservice/pgadminimpl.go +++ b/internal/apiserver/pgadminservice/pgadminimpl.go @@ -1,7 +1,7 @@ package pgadminservice /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/pgadminservice/pgadminservice.go b/internal/apiserver/pgadminservice/pgadminservice.go index 90378868ca..44fe32f6b7 100644 --- a/internal/apiserver/pgadminservice/pgadminservice.go +++ b/internal/apiserver/pgadminservice/pgadminservice.go @@ -1,7 +1,7 @@ package pgadminservice /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/pgbouncerservice/pgbouncerimpl.go b/internal/apiserver/pgbouncerservice/pgbouncerimpl.go index 8f0b17d370..5c3d00269b 100644 --- a/internal/apiserver/pgbouncerservice/pgbouncerimpl.go +++ b/internal/apiserver/pgbouncerservice/pgbouncerimpl.go @@ -1,7 +1,7 @@ package pgbouncerservice /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/pgbouncerservice/pgbouncerservice.go b/internal/apiserver/pgbouncerservice/pgbouncerservice.go index 969aabd205..54fa6b3dae 100644 --- a/internal/apiserver/pgbouncerservice/pgbouncerservice.go +++ b/internal/apiserver/pgbouncerservice/pgbouncerservice.go @@ -1,7 +1,7 @@ package pgbouncerservice /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/pgdumpservice/pgdumpimpl.go b/internal/apiserver/pgdumpservice/pgdumpimpl.go index f234262fe9..df4e5dcf92 100644 --- a/internal/apiserver/pgdumpservice/pgdumpimpl.go +++ b/internal/apiserver/pgdumpservice/pgdumpimpl.go @@ -1,7 +1,7 @@ package pgdumpservice /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -237,7 +237,7 @@ func ShowpgDump(clusterName string, selector string, ns string) msgs.ShowBackupR // nothing found, no error log.Debugf("pgTask %s not found, no erros", pgTaskName) response.Status.Code = msgs.Ok - response.Status.Msg = fmt.Sprintln("pgDump %s not found.", pgTaskName) + response.Status.Msg = fmt.Sprintf("pgDump %s not found.", pgTaskName) } } diff --git a/internal/apiserver/pgdumpservice/pgdumpservice.go b/internal/apiserver/pgdumpservice/pgdumpservice.go index 755a9bbd98..a31a2a788a 100644 --- a/internal/apiserver/pgdumpservice/pgdumpservice.go +++ b/internal/apiserver/pgdumpservice/pgdumpservice.go @@ -1,7 +1,7 @@ package pgdumpservice /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/pgoroleservice/pgoroleimpl.go b/internal/apiserver/pgoroleservice/pgoroleimpl.go index b16453f557..5d9e1c7c2c 100644 --- a/internal/apiserver/pgoroleservice/pgoroleimpl.go +++ b/internal/apiserver/pgoroleservice/pgoroleimpl.go @@ -1,7 +1,7 @@ package pgoroleservice /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -254,7 +254,7 @@ func validPermissions(perms string) error { fields := strings.Split(perms, ",") for _, v := range fields { - if apiserver.PermMap[strings.TrimSpace(v)] == "" { + if apiserver.PermMap[strings.TrimSpace(v)] == "" && strings.TrimSpace(v) != "*" { return errors.New(v + " not a valid Permission") } } diff --git a/internal/apiserver/pgoroleservice/pgoroleimpl_test.go b/internal/apiserver/pgoroleservice/pgoroleimpl_test.go new file mode 100644 index 0000000000..98ad0c61f2 --- /dev/null +++ b/internal/apiserver/pgoroleservice/pgoroleimpl_test.go @@ -0,0 +1,55 @@ +package pgoroleservice + +import ( + "fmt" + "testing" + + "github.com/crunchydata/postgres-operator/internal/apiserver" +) + +func TestValidPermissions(t *testing.T) { + apiserver.PermMap = map[string]string{ + apiserver.CREATE_CLUSTER_PERM: "yes", + apiserver.CREATE_PGBOUNCER_PERM: "yes", + } + + t.Run("with valid permission", func(t *testing.T) { + perms := apiserver.CREATE_CLUSTER_PERM + + if err := validPermissions(perms); err != nil { + t.Errorf("%q should be a valid permission", perms) + } + }) + + t.Run("with multiple valid permissions", func(t *testing.T) { + perms := fmt.Sprintf("%s,%s", apiserver.CREATE_CLUSTER_PERM, apiserver.CREATE_PGBOUNCER_PERM) + + if err := validPermissions(perms); err != nil { + t.Errorf("%v should be a valid permission", perms) + } + }) + + t.Run("with an invalid permission", func(t *testing.T) { + perms := "bogus" + + if err := validPermissions(perms); err == nil { + t.Errorf("%q should raise an error", perms) + } + }) + + t.Run("with a mix of valid and invalid permissions", func(t *testing.T) { + perms := fmt.Sprintf("%s,%s", apiserver.CREATE_CLUSTER_PERM, "bogus") + + if err := validPermissions(perms); err == nil { + t.Errorf("%q should raise an error", perms) + } + }) + + t.Run("with *", func(t *testing.T) { + perms := "*" + + if err := validPermissions(perms); err != nil { + t.Errorf("%q should be a valid permission", perms) + } + }) +} diff --git a/internal/apiserver/pgoroleservice/pgoroleservice.go b/internal/apiserver/pgoroleservice/pgoroleservice.go index b3e3413e09..9b9c70b061 100644 --- a/internal/apiserver/pgoroleservice/pgoroleservice.go +++ b/internal/apiserver/pgoroleservice/pgoroleservice.go @@ -1,7 +1,7 @@ package pgoroleservice /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/pgouserservice/pgouserimpl.go b/internal/apiserver/pgouserservice/pgouserimpl.go index b1f0ef57d2..f7627c47cf 100644 --- a/internal/apiserver/pgouserservice/pgouserimpl.go +++ b/internal/apiserver/pgouserservice/pgouserimpl.go @@ -1,7 +1,7 @@ package pgouserservice /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -244,7 +244,7 @@ func UpdatePgouser(clientset kubernetes.Interface, updatedBy string, request *ms log.Info("Updating secret for: ", request.PgouserName) _, err = clientset.CoreV1().Secrets(apiserver.PgoNamespace).Update(secret) if err != nil { - log.Debug("Error updating pgouser secret: ", err.Error) + log.Debug("Error updating pgouser secret: ", err.Error()) resp.Status.Code = msgs.Error resp.Status.Msg = err.Error() return resp diff --git a/internal/apiserver/pgouserservice/pgouserservice.go b/internal/apiserver/pgouserservice/pgouserservice.go index ccf1b1ce8f..1abaf309d6 100644 --- a/internal/apiserver/pgouserservice/pgouserservice.go +++ b/internal/apiserver/pgouserservice/pgouserservice.go @@ -1,7 +1,7 @@ package pgouserservice /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/policyservice/policyimpl.go b/internal/apiserver/policyservice/policyimpl.go index a7c7fe2180..bed7e1e5ee 100644 --- a/internal/apiserver/policyservice/policyimpl.go +++ b/internal/apiserver/policyservice/policyimpl.go @@ -1,7 +1,7 @@ package policyservice /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -220,7 +220,7 @@ func ApplyPolicy(request *msgs.ApplyPolicyRequest, ns, pgouser string) msgs.Appl return resp } if len(deployments.Items) < 1 { - log.Error("%s did not have a deployment for some reason", c.Name) + log.Errorf("%s did not have a deployment for some reason", c.Name) } else { allDeployments = append(allDeployments, deployments.Items[0]) } @@ -239,7 +239,7 @@ func ApplyPolicy(request *msgs.ApplyPolicyRequest, ns, pgouser string) msgs.Appl for _, d := range allDeployments { if d.ObjectMeta.Labels[config.LABEL_SERVICE_NAME] != d.ObjectMeta.Labels[config.LABEL_PG_CLUSTER] { - log.Debug("skipping apply policy on deployment %s", d.Name) + log.Debugf("skipping apply policy on deployment %s", d.Name) continue //skip non primary deployments } @@ -270,7 +270,7 @@ func ApplyPolicy(request *msgs.ApplyPolicyRequest, ns, pgouser string) msgs.Appl } //update the pgcluster crd labels with the new policy - err = labelservice.PatchPgcluster(request.Name+"="+config.LABEL_PGPOLICY, cl, ns) + err = labelservice.PatchPgcluster(map[string]string{request.Name: config.LABEL_PGPOLICY}, cl, ns) if err != nil { log.Error(err) } diff --git a/internal/apiserver/policyservice/policyservice.go b/internal/apiserver/policyservice/policyservice.go index 35917a64c9..897d2dbff0 100644 --- a/internal/apiserver/policyservice/policyservice.go +++ b/internal/apiserver/policyservice/policyservice.go @@ -1,7 +1,7 @@ package policyservice /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/pvcservice/pvcimpl.go b/internal/apiserver/pvcservice/pvcimpl.go index 734c21fa4c..ca07a3e8d9 100644 --- a/internal/apiserver/pvcservice/pvcimpl.go +++ b/internal/apiserver/pvcservice/pvcimpl.go @@ -1,7 +1,7 @@ package pvcservice /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/pvcservice/pvcservice.go b/internal/apiserver/pvcservice/pvcservice.go index 3143cf183b..de24ab7616 100644 --- a/internal/apiserver/pvcservice/pvcservice.go +++ b/internal/apiserver/pvcservice/pvcservice.go @@ -1,7 +1,7 @@ package pvcservice /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -53,7 +53,7 @@ func ShowPVCHandler(w http.ResponseWriter, r *http.Request) { clientVersion := request.ClientVersion namespace := request.Namespace - log.Debugf("ShowPVCHandler parameters version [%s] namespace [%s] pvcname [%s] nodeLabel [%]", clientVersion, namespace, clusterName) + log.Debugf("ShowPVCHandler parameters version [%s] namespace [%s] pvcname [%s]", clientVersion, namespace, clusterName) switch r.Method { case "GET": diff --git a/internal/apiserver/reloadservice/reloadimpl.go b/internal/apiserver/reloadservice/reloadimpl.go index 5268147602..2023feba21 100644 --- a/internal/apiserver/reloadservice/reloadimpl.go +++ b/internal/apiserver/reloadservice/reloadimpl.go @@ -1,7 +1,7 @@ package reloadservice /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/reloadservice/reloadservice.go b/internal/apiserver/reloadservice/reloadservice.go index 9d1096c3c9..e464a7991e 100644 --- a/internal/apiserver/reloadservice/reloadservice.go +++ b/internal/apiserver/reloadservice/reloadservice.go @@ -1,7 +1,7 @@ package reloadservice /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/restartservice/restartimpl.go b/internal/apiserver/restartservice/restartimpl.go index 9b72f673a1..7e67881c98 100644 --- a/internal/apiserver/restartservice/restartimpl.go +++ b/internal/apiserver/restartservice/restartimpl.go @@ -1,7 +1,7 @@ package restartservice /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -123,7 +123,9 @@ func QueryRestart(clusterName, namespace string) msgs.QueryRestartResponse { ClusterName: clusterName, } - replicationStatusResponse, err := util.ReplicationStatus(replicationStatusRequest, true) + // get a list of all the Pods...note that we can included "busted" pods as + // by including the primary, we're getting all of the database pods anyway. + replicationStatusResponse, err := util.ReplicationStatus(replicationStatusRequest, true, true) if err != nil { log.Error(err.Error()) resp.Status.Code = msgs.Error diff --git a/internal/apiserver/restartservice/restartservice.go b/internal/apiserver/restartservice/restartservice.go index a1bfb97194..460635bec1 100644 --- a/internal/apiserver/restartservice/restartservice.go +++ b/internal/apiserver/restartservice/restartservice.go @@ -1,7 +1,7 @@ package restartservice /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/root.go b/internal/apiserver/root.go index f9dfec42dc..0b1e1004b1 100644 --- a/internal/apiserver/root.go +++ b/internal/apiserver/root.go @@ -1,7 +1,7 @@ package apiserver /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/routing/doc.go b/internal/apiserver/routing/doc.go index e985fd4280..2807dfb978 100644 --- a/internal/apiserver/routing/doc.go +++ b/internal/apiserver/routing/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/routing/routes.go b/internal/apiserver/routing/routes.go index c98848b6c9..9774eec41c 100644 --- a/internal/apiserver/routing/routes.go +++ b/internal/apiserver/routing/routes.go @@ -1,7 +1,7 @@ package routing /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/scheduleservice/scheduleimpl.go b/internal/apiserver/scheduleservice/scheduleimpl.go index 92d0e1fd46..1fa60c974c 100644 --- a/internal/apiserver/scheduleservice/scheduleimpl.go +++ b/internal/apiserver/scheduleservice/scheduleimpl.go @@ -1,7 +1,7 @@ package scheduleservice /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/scheduleservice/scheduleservice.go b/internal/apiserver/scheduleservice/scheduleservice.go index b88fa16d7e..52f00bbe14 100644 --- a/internal/apiserver/scheduleservice/scheduleservice.go +++ b/internal/apiserver/scheduleservice/scheduleservice.go @@ -1,7 +1,7 @@ package scheduleservice /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/statusservice/statusimpl.go b/internal/apiserver/statusservice/statusimpl.go index 87c629470c..2e4f859b74 100644 --- a/internal/apiserver/statusservice/statusimpl.go +++ b/internal/apiserver/statusservice/statusimpl.go @@ -1,7 +1,7 @@ package statusservice /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -174,7 +174,7 @@ func getLabels(ns string) []msgs.KeyValue { } for k, v := range results { - ss = append(ss, msgs.KeyValue{k, v}) + ss = append(ss, msgs.KeyValue{Key: k, Value: v}) } sort.Slice(ss, func(i, j int) bool { diff --git a/internal/apiserver/statusservice/statusservice.go b/internal/apiserver/statusservice/statusservice.go index ecab0047c2..2dd232dc4c 100644 --- a/internal/apiserver/statusservice/statusservice.go +++ b/internal/apiserver/statusservice/statusservice.go @@ -1,7 +1,7 @@ package statusservice /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/upgradeservice/upgradeimpl.go b/internal/apiserver/upgradeservice/upgradeimpl.go index 7b2aabcf2d..d2cbd1f395 100644 --- a/internal/apiserver/upgradeservice/upgradeimpl.go +++ b/internal/apiserver/upgradeservice/upgradeimpl.go @@ -1,7 +1,7 @@ package upgradeservice /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -222,7 +222,7 @@ func supportedOperatorVersion(version string) bool { // then the upgrade cannot continue minor, err := strconv.Atoi(operatorVersion[2]) if err != nil { - log.Errorf("Cannot convert Postgres Operator's minor version to an integer. Error: ", err) + log.Errorf("Cannot convert Postgres Operator's minor version to an integer. Error: %v", err) return false } if minor < MINIMUM_MINOR_PGO_VERSION || minor > MAXIMUM_MINOR_PGO_VERSION { diff --git a/internal/apiserver/upgradeservice/upgradeservice.go b/internal/apiserver/upgradeservice/upgradeservice.go index dee9c68dc2..7f6e1cd350 100644 --- a/internal/apiserver/upgradeservice/upgradeservice.go +++ b/internal/apiserver/upgradeservice/upgradeservice.go @@ -1,7 +1,7 @@ package upgradeservice /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/userservice/userimpl.go b/internal/apiserver/userservice/userimpl.go index 77c89b78e8..b0d51253a4 100644 --- a/internal/apiserver/userservice/userimpl.go +++ b/internal/apiserver/userservice/userimpl.go @@ -1,7 +1,7 @@ package userservice /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/userservice/userimpl_test.go b/internal/apiserver/userservice/userimpl_test.go index 71d3aa5fcf..ba6f378c0d 100644 --- a/internal/apiserver/userservice/userimpl_test.go +++ b/internal/apiserver/userservice/userimpl_test.go @@ -1,7 +1,7 @@ package userservice /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/userservice/userservice.go b/internal/apiserver/userservice/userservice.go index 83994c90fa..709105daae 100644 --- a/internal/apiserver/userservice/userservice.go +++ b/internal/apiserver/userservice/userservice.go @@ -1,7 +1,7 @@ package userservice /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/versionservice/versionimpl.go b/internal/apiserver/versionservice/versionimpl.go index d2341d4e93..959cfae669 100644 --- a/internal/apiserver/versionservice/versionimpl.go +++ b/internal/apiserver/versionservice/versionimpl.go @@ -1,7 +1,7 @@ package versionservice /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/versionservice/versionservice.go b/internal/apiserver/versionservice/versionservice.go index 49735dff1a..5affd301dd 100644 --- a/internal/apiserver/versionservice/versionservice.go +++ b/internal/apiserver/versionservice/versionservice.go @@ -1,7 +1,7 @@ package versionservice /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/workflowservice/workflowimpl.go b/internal/apiserver/workflowservice/workflowimpl.go index 2c588183af..8af15d5a86 100644 --- a/internal/apiserver/workflowservice/workflowimpl.go +++ b/internal/apiserver/workflowservice/workflowimpl.go @@ -1,7 +1,7 @@ package workflowservice /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/apiserver/workflowservice/workflowservice.go b/internal/apiserver/workflowservice/workflowservice.go index 81aea9ff98..168937d31d 100644 --- a/internal/apiserver/workflowservice/workflowservice.go +++ b/internal/apiserver/workflowservice/workflowservice.go @@ -1,7 +1,7 @@ package workflowservice /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/config/annotations.go b/internal/config/annotations.go index ddaa58d4cc..05bea9deac 100644 --- a/internal/config/annotations.go +++ b/internal/config/annotations.go @@ -1,7 +1,7 @@ package config /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/config/defaults.go b/internal/config/defaults.go index 21e0dc417f..ba7648c667 100644 --- a/internal/config/defaults.go +++ b/internal/config/defaults.go @@ -1,7 +1,7 @@ package config /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/config/images.go b/internal/config/images.go index 12405034b1..f09b4784f7 100644 --- a/internal/config/images.go +++ b/internal/config/images.go @@ -1,7 +1,7 @@ package config /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/config/labels.go b/internal/config/labels.go index f2128e207b..f2351ddc7e 100644 --- a/internal/config/labels.go +++ b/internal/config/labels.go @@ -1,7 +1,7 @@ package config /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/config/pgoconfig.go b/internal/config/pgoconfig.go index 833adfc280..04a0e33282 100644 --- a/internal/config/pgoconfig.go +++ b/internal/config/pgoconfig.go @@ -1,7 +1,7 @@ package config /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/config/volumes.go b/internal/config/volumes.go index d21c2d6a4e..4738d682c1 100644 --- a/internal/config/volumes.go +++ b/internal/config/volumes.go @@ -1,7 +1,7 @@ package config /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/controller/configmap/configmapcontroller.go b/internal/controller/configmap/configmapcontroller.go index e07068bfc2..e19744b614 100644 --- a/internal/controller/configmap/configmapcontroller.go +++ b/internal/controller/configmap/configmapcontroller.go @@ -1,7 +1,7 @@ package configmap /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/controller/configmap/synchandler.go b/internal/controller/configmap/synchandler.go index ff45f17048..eae945775c 100644 --- a/internal/controller/configmap/synchandler.go +++ b/internal/controller/configmap/synchandler.go @@ -1,7 +1,7 @@ package configmap /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/controller/controllerutil.go b/internal/controller/controllerutil.go index ce0df82510..31f956b3e7 100644 --- a/internal/controller/controllerutil.go +++ b/internal/controller/controllerutil.go @@ -1,7 +1,7 @@ package controller /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/controller/job/backresthandler.go b/internal/controller/job/backresthandler.go index 1c1cf51802..363009b539 100644 --- a/internal/controller/job/backresthandler.go +++ b/internal/controller/job/backresthandler.go @@ -1,7 +1,7 @@ package job /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -223,6 +223,9 @@ func (c *Controller) handleBackrestStanzaCreateUpdate(job *apiv1.Job) error { log.Debugf("job Controller: standby cluster %s will now be set to an initialized "+ "status", clusterName) controller.SetClusterInitializedStatus(c.JobClient, clusterName, namespace) + + // now initialize the creation of any replica + controller.InitializeReplicaCreation(c.JobClient, clusterName, namespace) return nil } diff --git a/internal/controller/job/bootstraphandler.go b/internal/controller/job/bootstraphandler.go index ad632867de..35af805f2c 100644 --- a/internal/controller/job/bootstraphandler.go +++ b/internal/controller/job/bootstraphandler.go @@ -1,7 +1,7 @@ package job /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -68,7 +68,7 @@ func (c *Controller) handleBootstrapUpdate(job *apiv1.Job) error { // If the job was successful we updated the state of the pgcluster to a "bootstrapped" status. // This will then trigger full initialization of the cluster. We also cleanup any resources - // from the bootstrap job. + // from the bootstrap job and delete the job itself if cluster.Status.State == crv1.PgclusterStateBootstrapping { if err := c.cleanupBootstrapResources(job, cluster); err != nil { @@ -82,6 +82,11 @@ func (c *Controller) handleBootstrapUpdate(job *apiv1.Job) error { log.Error(err) return err } + + // as it is no longer needed, delete the job + deletePropagation := metav1.DeletePropagationBackground + return c.JobClientset.BatchV1().Jobs(namespace).Delete(job.Name, + &metav1.DeleteOptions{PropagationPolicy: &deletePropagation}) } return nil diff --git a/internal/controller/job/jobcontroller.go b/internal/controller/job/jobcontroller.go index 2e2dffcb6b..4684f2c066 100644 --- a/internal/controller/job/jobcontroller.go +++ b/internal/controller/job/jobcontroller.go @@ -1,7 +1,7 @@ package job /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/controller/job/jobevents.go b/internal/controller/job/jobevents.go index ef4f1a1760..05e1d0d0fe 100644 --- a/internal/controller/job/jobevents.go +++ b/internal/controller/job/jobevents.go @@ -1,7 +1,7 @@ package job /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/controller/job/jobutil.go b/internal/controller/job/jobutil.go index 78d6bb6e34..e7a3113469 100644 --- a/internal/controller/job/jobutil.go +++ b/internal/controller/job/jobutil.go @@ -1,7 +1,7 @@ package job /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/controller/job/loadhandler.go b/internal/controller/job/loadhandler.go index d83a643c4a..47183ee240 100644 --- a/internal/controller/job/loadhandler.go +++ b/internal/controller/job/loadhandler.go @@ -6,7 +6,7 @@ import ( ) /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/controller/job/pgdumphandler.go b/internal/controller/job/pgdumphandler.go index 9025426491..c723cf407f 100644 --- a/internal/controller/job/pgdumphandler.go +++ b/internal/controller/job/pgdumphandler.go @@ -1,7 +1,7 @@ package job /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/controller/job/reposynchandler.go b/internal/controller/job/reposynchandler.go index dbf56f89a1..cc885f1733 100644 --- a/internal/controller/job/reposynchandler.go +++ b/internal/controller/job/reposynchandler.go @@ -1,7 +1,7 @@ package job /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/controller/job/rmdatahandler.go b/internal/controller/job/rmdatahandler.go index bfc7874a11..6187d015e1 100644 --- a/internal/controller/job/rmdatahandler.go +++ b/internal/controller/job/rmdatahandler.go @@ -1,7 +1,7 @@ package job /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/controller/manager/controllermanager.go b/internal/controller/manager/controllermanager.go index 6d3789d3e9..e1822bbbaa 100644 --- a/internal/controller/manager/controllermanager.go +++ b/internal/controller/manager/controllermanager.go @@ -1,7 +1,7 @@ package manager /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -304,7 +304,7 @@ func (c *ControllerManager) addControllerGroup(namespace string) error { pgoInformerFactory.Crunchydata().V1().Pgclusters(), *c.pgoConfig.Pgo.ConfigMapWorkerCount) if err != nil { - log.Errorf("Unable to create ConfigMap controller: %w", err) + log.Errorf("Unable to create ConfigMap controller: %v", err) return err } diff --git a/internal/controller/manager/rbac.go b/internal/controller/manager/rbac.go index 4e960e1cd5..d7865722a5 100644 --- a/internal/controller/manager/rbac.go +++ b/internal/controller/manager/rbac.go @@ -1,7 +1,7 @@ package manager /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/controller/namespace/namespacecontroller.go b/internal/controller/namespace/namespacecontroller.go index 6fc85f644f..20db2e9534 100644 --- a/internal/controller/namespace/namespacecontroller.go +++ b/internal/controller/namespace/namespacecontroller.go @@ -1,7 +1,7 @@ package namespace /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/controller/pgcluster/pgclustercontroller.go b/internal/controller/pgcluster/pgclustercontroller.go index 5a3e2f9c33..56d059e334 100644 --- a/internal/controller/pgcluster/pgclustercontroller.go +++ b/internal/controller/pgcluster/pgclustercontroller.go @@ -1,7 +1,7 @@ package pgcluster /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -30,7 +30,6 @@ import ( informers "github.com/crunchydata/postgres-operator/pkg/generated/informers/externalversions/crunchydata.com/v1" log "github.com/sirupsen/logrus" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/cache" @@ -49,22 +48,11 @@ type Controller struct { // onAdd is called when a pgcluster is added func (c *Controller) onAdd(obj interface{}) { - cluster := obj.(*crv1.Pgcluster) - log.Debugf("[pgcluster Controller] ns %s onAdd %s", cluster.ObjectMeta.Namespace, cluster.ObjectMeta.SelfLink) - - //handle the case when the operator restarts and don't - //process already processed pgclusters - if cluster.Status.State == crv1.PgclusterStateProcessed { - log.Debug("pgcluster " + cluster.ObjectMeta.Name + " already processed") - return - } - key, err := cache.MetaNamespaceKeyFunc(obj) if err == nil { log.Debugf("cluster putting key in queue %s", key) c.Queue.Add(key) } - } // RunWorker is a long-running function that will continually call the @@ -107,17 +95,6 @@ func (c *Controller) processNextItem() bool { // parallel. defer c.Queue.Done(key) - // Invoke the method containing the business logic - // in this case, the de-dupe logic is to test whether a cluster - // deployment exists , if so, then we don't create another - _, err := c.PgclusterClientset.AppsV1().Deployments(keyNamespace).Get(keyResourceName, metav1.GetOptions{}) - - if err == nil { - log.Debugf("cluster add - dep already found, not creating again") - c.Queue.Forget(key) - return true - } - //get the pgcluster cluster := crv1.Pgcluster{} found, err := kubeapi.Getpgcluster(c.PgclusterClient, &cluster, keyResourceName, keyNamespace) @@ -126,6 +103,16 @@ func (c *Controller) processNextItem() bool { c.Queue.Forget(key) // NB(cbandy): This should probably be a retry. return true } + log.Debugf("[pgcluster Controller] ns %s onAdd %s", cluster.ObjectMeta.Namespace, cluster.ObjectMeta.SelfLink) + + if cluster.Spec.Status == crv1.CompletedStatus || + cluster.Status.State == crv1.PgclusterStateBootstrapping || + cluster.Status.State == crv1.PgclusterStateInitialized { + log.Debugf("pgcluster Contoller: onAdd event received for cluster %s but "+ + "will not process because it either has a 'completed' status or is currently in an "+ + "'initialized' or 'bootstrapping' state", cluster.GetName()) + return true + } addIdentifier(&cluster) diff --git a/internal/controller/pgpolicy/pgpolicycontroller.go b/internal/controller/pgpolicy/pgpolicycontroller.go index ba699c579c..a6ee5c7f29 100644 --- a/internal/controller/pgpolicy/pgpolicycontroller.go +++ b/internal/controller/pgpolicy/pgpolicycontroller.go @@ -1,7 +1,7 @@ package pgpolicy /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/controller/pgreplica/pgreplicacontroller.go b/internal/controller/pgreplica/pgreplicacontroller.go index 43ae0878fe..7325d714b0 100644 --- a/internal/controller/pgreplica/pgreplicacontroller.go +++ b/internal/controller/pgreplica/pgreplicacontroller.go @@ -1,7 +1,7 @@ package pgreplica /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/controller/pgtask/pgtaskcontroller.go b/internal/controller/pgtask/pgtaskcontroller.go index 9a5b524dc9..ceca886899 100644 --- a/internal/controller/pgtask/pgtaskcontroller.go +++ b/internal/controller/pgtask/pgtaskcontroller.go @@ -1,7 +1,7 @@ package pgtask /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -117,7 +117,7 @@ func (c *Controller) processNextItem() bool { if !dupeFailover(c.PgtaskClient, &tmpTask, keyNamespace) { clusteroperator.FailoverBase(keyNamespace, c.PgtaskClientset, c.PgtaskClient, &tmpTask, c.PgtaskConfig) } else { - log.Debug("skipping duplicate onAdd failover task %s/%s", keyNamespace, keyResourceName) + log.Debugf("skipping duplicate onAdd failover task %s/%s", keyNamespace, keyResourceName) } case crv1.PgtaskDeleteData: @@ -125,7 +125,7 @@ func (c *Controller) processNextItem() bool { if !dupeDeleteData(c.PgtaskClient, &tmpTask, keyNamespace) { taskoperator.RemoveData(keyNamespace, c.PgtaskClientset, c.PgtaskClient, &tmpTask) } else { - log.Debug("skipping duplicate onAdd delete data task %s/%s", keyNamespace, keyResourceName) + log.Debugf("skipping duplicate onAdd delete data task %s/%s", keyNamespace, keyResourceName) } case crv1.PgtaskDeleteBackups: log.Debug("delete backups task added") @@ -150,7 +150,7 @@ func (c *Controller) processNextItem() bool { log.Debugf("workflow task added [%s] ID [%s]", keyResourceName, tmpTask.Spec.Parameters[crv1.PgtaskWorkflowID]) case crv1.PgtaskCloneStep1, crv1.PgtaskCloneStep2, crv1.PgtaskCloneStep3: - log.Debug("clone task added [%s]", keyResourceName) + log.Debugf("clone task added [%s]", keyResourceName) clusteroperator.Clone(c.PgtaskClientset, c.PgtaskClient, c.PgtaskConfig, keyNamespace, &tmpTask) default: diff --git a/internal/controller/pod/inithandler.go b/internal/controller/pod/inithandler.go index 5335653bce..802e1fae3f 100644 --- a/internal/controller/pod/inithandler.go +++ b/internal/controller/pod/inithandler.go @@ -1,7 +1,7 @@ package pod /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/controller/pod/podcontroller.go b/internal/controller/pod/podcontroller.go index 0ae1342188..92cf7ae085 100644 --- a/internal/controller/pod/podcontroller.go +++ b/internal/controller/pod/podcontroller.go @@ -1,7 +1,7 @@ package pod /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/controller/pod/podevents.go b/internal/controller/pod/podevents.go index dc0b53766b..7aa3c8da3a 100644 --- a/internal/controller/pod/podevents.go +++ b/internal/controller/pod/podevents.go @@ -1,7 +1,7 @@ package pod /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/controller/pod/promotionhandler.go b/internal/controller/pod/promotionhandler.go index 17a8b368f8..fd3feea7c5 100644 --- a/internal/controller/pod/promotionhandler.go +++ b/internal/controller/pod/promotionhandler.go @@ -1,7 +1,7 @@ package pod /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -34,9 +34,14 @@ import ( "k8s.io/client-go/rest" ) +const ( + // recoverySQL is just the SQL to figure out if Postgres is in recovery mode + recoverySQL = "SELECT pg_is_in_recovery();" +) + var ( // isInRecoveryCommand is the command run to determine if postgres is in recovery - isInRecoveryCMD []string = []string{"psql", "-t", "-c", "'SELECT pg_is_in_recovery();'", "-p"} + isInRecoveryCMD []string = []string{"psql", "-t", "-c", recoverySQL, "-p"} // leaderStatusCMD is the command run to get the Patroni status for the primary leaderStatusCMD []string = []string{"curl", fmt.Sprintf("localhost:%s/master", @@ -62,7 +67,8 @@ func (c *Controller) handlePostgresPodPromotion(newPod *apiv1.Pod, cluster crv1. } } - if cluster.Status.State == crv1.PgclusterStateInitialized { + // create a post-failover backup if not a standby cluster + if !cluster.Spec.Standby && cluster.Status.State == crv1.PgclusterStateInitialized { if err := cleanAndCreatePostFailoverBackup(c.PodClient, c.PodClientset, cluster.Name, newPod.Namespace); err != nil { log.Error(err) diff --git a/internal/kubeapi/client_config.go b/internal/kubeapi/client_config.go index 64a544c3bc..f91a8cfb1f 100644 --- a/internal/kubeapi/client_config.go +++ b/internal/kubeapi/client_config.go @@ -1,7 +1,7 @@ package kubeapi /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/kubeapi/deployment.go b/internal/kubeapi/deployment.go index ec13795e09..5e9a665480 100644 --- a/internal/kubeapi/deployment.go +++ b/internal/kubeapi/deployment.go @@ -1,7 +1,7 @@ package kubeapi /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/kubeapi/endpoints.go b/internal/kubeapi/endpoints.go index b4cd8ece62..d655ba1484 100644 --- a/internal/kubeapi/endpoints.go +++ b/internal/kubeapi/endpoints.go @@ -1,7 +1,7 @@ package kubeapi /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/kubeapi/errors.go b/internal/kubeapi/errors.go index 829ca9f097..ab5e9c07aa 100644 --- a/internal/kubeapi/errors.go +++ b/internal/kubeapi/errors.go @@ -1,7 +1,7 @@ package kubeapi /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/kubeapi/exec.go b/internal/kubeapi/exec.go index b2e994d84d..c154ba1fa3 100644 --- a/internal/kubeapi/exec.go +++ b/internal/kubeapi/exec.go @@ -1,7 +1,7 @@ package kubeapi /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/kubeapi/pgcluster.go b/internal/kubeapi/pgcluster.go index 983138fdd4..5d554ed747 100644 --- a/internal/kubeapi/pgcluster.go +++ b/internal/kubeapi/pgcluster.go @@ -1,7 +1,7 @@ package kubeapi /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/kubeapi/pgpolicy.go b/internal/kubeapi/pgpolicy.go index 5d9bc30029..f2d92c679d 100644 --- a/internal/kubeapi/pgpolicy.go +++ b/internal/kubeapi/pgpolicy.go @@ -1,7 +1,7 @@ package kubeapi /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/kubeapi/pgreplica.go b/internal/kubeapi/pgreplica.go index 62095f4f78..c4e4c6c474 100644 --- a/internal/kubeapi/pgreplica.go +++ b/internal/kubeapi/pgreplica.go @@ -1,7 +1,7 @@ package kubeapi /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/kubeapi/pgtask.go b/internal/kubeapi/pgtask.go index d5468495fa..7e06f91028 100644 --- a/internal/kubeapi/pgtask.go +++ b/internal/kubeapi/pgtask.go @@ -1,7 +1,7 @@ package kubeapi /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/kubeapi/pod.go b/internal/kubeapi/pod.go index 1dc5539089..bedae52adf 100644 --- a/internal/kubeapi/pod.go +++ b/internal/kubeapi/pod.go @@ -1,7 +1,7 @@ package kubeapi /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/kubeapi/pointer.go b/internal/kubeapi/pointer.go index 21109e61f1..dbf5d6db27 100644 --- a/internal/kubeapi/pointer.go +++ b/internal/kubeapi/pointer.go @@ -1,7 +1,7 @@ package kubeapi /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/logging/loglib.go b/internal/logging/loglib.go index c109d435f5..6205760a4e 100644 --- a/internal/logging/loglib.go +++ b/internal/logging/loglib.go @@ -2,7 +2,7 @@ package logging /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -88,7 +88,4 @@ func CrunchyLogger(logDetails LogValues) { // Output to stdout instead of the default stderr // Can be any io.Writer, see below for File example log.SetOutput(os.Stdout) - - // Only log the debug severity or above. - log.SetLevel(log.DebugLevel) } diff --git a/internal/ns/nslogic.go b/internal/ns/nslogic.go index e579b6d47b..b9bb8da878 100644 --- a/internal/ns/nslogic.go +++ b/internal/ns/nslogic.go @@ -1,7 +1,7 @@ package ns /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/backrest/backup.go b/internal/operator/backrest/backup.go index 006ee81d03..e4cc827fad 100644 --- a/internal/operator/backrest/backup.go +++ b/internal/operator/backrest/backup.go @@ -1,7 +1,7 @@ package backrest /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/backrest/repo.go b/internal/operator/backrest/repo.go index 3bc75ea074..8e003f020c 100644 --- a/internal/operator/backrest/repo.go +++ b/internal/operator/backrest/repo.go @@ -1,7 +1,7 @@ package backrest /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -191,8 +191,8 @@ func setBootstrapRepoOverrides(clientset kubernetes.Interface, cluster *crv1.Pgc s3Restore := S3RepoTypeCLIOptionExists(cluster.Spec.PGDataSource.RestoreOpts) if s3Restore { // Now override any backrest S3 env vars for the bootstrap job - repoFields.PgbackrestS3EnvVars = operator.GetPgbackrestBootstrapS3EnvVars(cluster, - restoreFromSecret) + repoFields.PgbackrestS3EnvVars = operator.GetPgbackrestBootstrapS3EnvVars( + cluster.Spec.PGDataSource.RestoreFrom, restoreFromSecret) } else { repoFields.PgbackrestS3EnvVars = "" } diff --git a/internal/operator/backrest/restore.go b/internal/operator/backrest/restore.go index 882a249e26..9318e7bb98 100644 --- a/internal/operator/backrest/restore.go +++ b/internal/operator/backrest/restore.go @@ -1,7 +1,7 @@ package backrest /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/backrest/stanza.go b/internal/operator/backrest/stanza.go index 1ec57f0ee5..de770b84cd 100644 --- a/internal/operator/backrest/stanza.go +++ b/internal/operator/backrest/stanza.go @@ -1,7 +1,7 @@ package backrest /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/cluster/clone.go b/internal/operator/cluster/clone.go index 7014c26b86..fd98071eb9 100644 --- a/internal/operator/cluster/clone.go +++ b/internal/operator/cluster/clone.go @@ -1,7 +1,7 @@ package cluster /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/cluster/cluster.go b/internal/operator/cluster/cluster.go index f5cf72bdbc..f283f6b4ad 100644 --- a/internal/operator/cluster/cluster.go +++ b/internal/operator/cluster/cluster.go @@ -4,7 +4,7 @@ package cluster /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -67,13 +67,6 @@ const ( func AddClusterBase(clientset kubernetes.Interface, client *rest.RESTClient, cl *crv1.Pgcluster, namespace string) { var err error - if cl.Spec.Status == crv1.CompletedStatus { - errorMsg := "crv1 pgcluster " + cl.Spec.ClusterName + " is already marked complete, will not recreate" - log.Warn(errorMsg) - publishClusterCreateFailure(cl, errorMsg) - return - } - dataVolume, walVolume, tablespaceVolumes, err := pvc.CreateMissingPostgreSQLVolumes( clientset, cl, namespace, cl.Annotations[config.ANNOTATION_CURRENT_PRIMARY], cl.Spec.PrimaryStorage) if err != nil { diff --git a/internal/operator/cluster/clusterlogic.go b/internal/operator/cluster/clusterlogic.go index 69c35cd961..03bde13213 100644 --- a/internal/operator/cluster/clusterlogic.go +++ b/internal/operator/cluster/clusterlogic.go @@ -4,7 +4,7 @@ package cluster /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -98,15 +98,16 @@ func addClusterBootstrapJob(clientset kubernetes.Interface, client *rest.RESTCli return err } + if operator.CRUNCHY_DEBUG { + _ = config.BootstrapTemplate.Execute(os.Stdout, bootstrapFields) + } + var bootstrapSpec bytes.Buffer + if err := config.BootstrapTemplate.Execute(&bootstrapSpec, bootstrapFields); err != nil { return err } - if operator.CRUNCHY_DEBUG { - config.DeploymentTemplate.Execute(os.Stdout, bootstrapFields) - } - job := &batchv1.Job{} if err := json.Unmarshal(bootstrapSpec.Bytes(), job); err != nil { return err @@ -246,8 +247,8 @@ func getBootstrapJobFields(clientset kubernetes.Interface, client *rest.RESTClie s3Restore := backrest.S3RepoTypeCLIOptionExists(cluster.Spec.PGDataSource.RestoreOpts) if s3Restore { // Now override any backrest S3 env vars for the bootstrap job - bootstrapFields.PgbackrestS3EnvVars = operator.GetPgbackrestBootstrapS3EnvVars(cluster, - restoreFromSecret) + bootstrapFields.PgbackrestS3EnvVars = operator.GetPgbackrestBootstrapS3EnvVars( + cluster.Spec.PGDataSource.RestoreFrom, restoreFromSecret) } else { bootstrapFields.PgbackrestS3EnvVars = "" } @@ -624,7 +625,10 @@ func ShutdownCluster(clientset kubernetes.Interface, restclient *rest.RESTClient return err } - if len(pods.Items) > 1 { + if len(pods.Items) == 0 { + return fmt.Errorf("Cluster Operator: Could not find primary pod for shutdown of "+ + "cluster %s", cluster.Name) + } else if len(pods.Items) > 1 { return fmt.Errorf("Cluster Operator: Invalid number of primary pods (%d) found when "+ "shutting down cluster %s", len(pods.Items), cluster.Name) } diff --git a/internal/operator/cluster/failover.go b/internal/operator/cluster/failover.go index f3dfc17a2b..cb77f66bd3 100644 --- a/internal/operator/cluster/failover.go +++ b/internal/operator/cluster/failover.go @@ -4,7 +4,7 @@ package cluster /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/cluster/failoverlogic.go b/internal/operator/cluster/failoverlogic.go index a25c90802c..97a65e9665 100644 --- a/internal/operator/cluster/failoverlogic.go +++ b/internal/operator/cluster/failoverlogic.go @@ -4,7 +4,7 @@ package cluster /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/cluster/pgadmin.go b/internal/operator/cluster/pgadmin.go index 8013b38e21..31a421dbb8 100644 --- a/internal/operator/cluster/pgadmin.go +++ b/internal/operator/cluster/pgadmin.go @@ -1,7 +1,7 @@ package cluster /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -354,7 +354,7 @@ func createPgAdminDeployment(clientset kubernetes.Interface, cluster *crv1.Pgclu Name: pgAdminDeploymentName, ClusterName: cluster.Name, CCPImagePrefix: operator.Pgo.Cluster.CCPImagePrefix, - CCPImageTag: cluster.Spec.CCPImageTag, + CCPImageTag: util.GetStandardImageTag(cluster.Spec.CCPImage, cluster.Spec.CCPImageTag), DisableFSGroup: operator.Pgo.Cluster.DisableFSGroup, Port: defPgAdminPort, InitUser: defSetupUsername, diff --git a/internal/operator/cluster/pgbouncer.go b/internal/operator/cluster/pgbouncer.go index 2b8e1cc207..bde5efc7ce 100644 --- a/internal/operator/cluster/pgbouncer.go +++ b/internal/operator/cluster/pgbouncer.go @@ -1,7 +1,7 @@ package cluster /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -154,15 +154,30 @@ func AddPgbouncer(clientset kubernetes.Interface, restclient *rest.RESTClient, r } } - // set the password that will be used for the "pgbouncer" PostgreSQL account - pgBouncerPassword, err := generatePassword() - - if err != nil { - return err - } - // only attempt to set the password if the cluster is not in standby mode + // and the secret does not already exist. If GetPasswordFromSecret returns + // no errors, then we can assume that the Secret does not exist if !cluster.Spec.Standby { + secretName := util.GeneratePgBouncerSecretName(cluster.Name) + pgBouncerPassword, err := util.GetPasswordFromSecret(clientset, cluster.Namespace, secretName) + + if err != nil { + // set the password that will be used for the "pgbouncer" PostgreSQL account + newPassword, err := generatePassword() + + if err != nil { + return err + } + + pgBouncerPassword = newPassword + + // create the secret that pgbouncer will include the pgBouncer + // credentials + if err := createPgbouncerSecret(clientset, cluster, pgBouncerPassword); err != nil { + return err + } + } + // attempt to update the password in PostgreSQL, as this is how pgBouncer // will properly interface with PostgreSQL if err := setPostgreSQLPassword(clientset, restconfig, pod, cluster.Spec.Port, pgBouncerPassword); err != nil { @@ -170,11 +185,6 @@ func AddPgbouncer(clientset kubernetes.Interface, restclient *rest.RESTClient, r } } - // next, create the secret that pgbouncer will use to be properly configure - if err := createPgbouncerSecret(clientset, cluster, pgBouncerPassword); err != nil { - return err - } - // next, create the pgBouncer deployment if err := createPgBouncerDeployment(clientset, cluster); err != nil { return err @@ -218,7 +228,8 @@ func DeletePgbouncer(clientset kubernetes.Interface, restclient *rest.RESTClient } // next, delete the various Kubernetes objects associated with the pgbouncer - // these include the Service, Deployment, and the pgBouncer secret + // these include the Service, Deployment, Secret and ConfigMap associated with + // pgbouncer // If these fail, we'll just pass through // // First, delete the Service and Deployment, which share the same naem @@ -459,8 +470,8 @@ func createPgBouncerDeployment(clientset kubernetes.Interface, cluster *crv1.Pgc Name: pgbouncerDeploymentName, ClusterName: cluster.Name, CCPImagePrefix: util.GetValueOrDefault(cluster.Spec.CCPImagePrefix, operator.Pgo.Cluster.CCPImagePrefix), - CCPImageTag: cluster.Spec.CCPImageTag, - Port: operator.Pgo.Cluster.Port, + CCPImageTag: util.GetStandardImageTag(cluster.Spec.CCPImage, cluster.Spec.CCPImageTag), + Port: cluster.Spec.Port, PGBouncerSecret: util.GeneratePgBouncerSecretName(cluster.Name), ContainerResources: operator.GetResourcesJSON(cluster.Spec.PgBouncer.Resources, cluster.Spec.PgBouncer.Limits), diff --git a/internal/operator/cluster/pgbouncer_test.go b/internal/operator/cluster/pgbouncer_test.go index 06ff30d8b6..2407da50a0 100644 --- a/internal/operator/cluster/pgbouncer_test.go +++ b/internal/operator/cluster/pgbouncer_test.go @@ -1,7 +1,7 @@ package cluster /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/cluster/rmdata.go b/internal/operator/cluster/rmdata.go index b25d260ca4..bf0a8ce365 100644 --- a/internal/operator/cluster/rmdata.go +++ b/internal/operator/cluster/rmdata.go @@ -4,7 +4,7 @@ package cluster /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/cluster/service.go b/internal/operator/cluster/service.go index 2812a88389..f192be92cf 100644 --- a/internal/operator/cluster/service.go +++ b/internal/operator/cluster/service.go @@ -4,7 +4,7 @@ package cluster /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/cluster/standby.go b/internal/operator/cluster/standby.go index 224431df40..0515cdafef 100644 --- a/internal/operator/cluster/standby.go +++ b/internal/operator/cluster/standby.go @@ -1,7 +1,7 @@ package cluster /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/cluster/upgrade.go b/internal/operator/cluster/upgrade.go index d7675ce97e..991e02c5ed 100644 --- a/internal/operator/cluster/upgrade.go +++ b/internal/operator/cluster/upgrade.go @@ -1,7 +1,7 @@ package cluster /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -36,6 +36,7 @@ import ( "k8s.io/apimachinery/pkg/fields" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" + "sigs.k8s.io/yaml" ) // Store image names as constants to use later @@ -312,9 +313,6 @@ func deleteBeforeUpgrade(clientset kubernetes.Interface, restclient *rest.RESTCl // delete the '-pgha-default-config' configmap, if it exists so the config syncer // will not try to use it instead of '-pgha-config' clientset.CoreV1().ConfigMaps(namespace).Delete(clusterName+"-pgha-default-config", &metav1.DeleteOptions{}) - - // delete the backrest repo config secret, since key encryption has been updated from RSA to EdDSA - clientset.CoreV1().Secrets(namespace).Delete(clusterName+"-backrest-repo-config", &metav1.DeleteOptions{}) } // deploymentWait is modified from cluster.waitForDeploymentDelete. It simply waits for the current primary deployment @@ -405,17 +403,52 @@ func createUpgradePGHAConfigMap(clientset kubernetes.Interface, cluster *crv1.Pg return nil } -// recreateBackrestRepoSecret deletes and recreates the secret for the pgBackRest repo. This is needed +// recreateBackrestRepoSecret overwrites the secret for the pgBackRest repo. This is needed // because the key encryption algorithm has been updated from RSA to EdDSA func recreateBackrestRepoSecret(clientset kubernetes.Interface, clustername, namespace, operatorNamespace string) { - if err := util.CreateBackrestRepoSecrets(clientset, - util.BackrestRepoConfig{ - BackrestS3Key: "", // these are set to empty so that it can be generated - BackrestS3KeySecret: "", - ClusterName: clustername, - ClusterNamespace: namespace, - OperatorNamespace: operatorNamespace, - }); err != nil { + config := util.BackrestRepoConfig{ + ClusterName: clustername, + ClusterNamespace: namespace, + OperatorNamespace: operatorNamespace, + } + + secretName := clustername + "-backrest-repo-config" + secret, err := clientset.CoreV1().Secrets(namespace).Get(secretName, metav1.GetOptions{}) + + // 4.1, 4.2 + if err == nil { + if b, ok := secret.Data["aws-s3-ca.crt"]; ok { + config.BackrestS3CA = b + } + if b, ok := secret.Data["aws-s3-credentials.yaml"]; ok { + var parsed struct { + Key string `yaml:"aws-s3-key"` + KeySecret string `yaml:"aws-s3-key-secret"` + } + if err = yaml.Unmarshal(b, &parsed); err == nil { + config.BackrestS3Key = parsed.Key + config.BackrestS3KeySecret = parsed.KeySecret + } + } + } + + // >= 4.3 + if err == nil { + if b, ok := secret.Data["aws-s3-ca.crt"]; ok { + config.BackrestS3CA = b + } + if b, ok := secret.Data["aws-s3-key"]; ok { + config.BackrestS3Key = string(b) + } + if b, ok := secret.Data["aws-s3-key-secret"]; ok { + config.BackrestS3KeySecret = string(b) + } + } + + if err == nil { + err = util.CreateBackrestRepoSecrets(clientset, config) + } + if err != nil { log.Errorf("error generating new backrest repo secrets during pgcluster upgrade: %v", err) } } @@ -490,6 +523,22 @@ func preparePgclusterForUpgrade(pgcluster *crv1.Pgcluster, parameters map[string // cluster operations in this version of the Postgres Operator pgcluster.ObjectMeta.Labels[config.LABEL_BACKREST] = "true" + // added in 4.2 and copied from configuration in 4.4 + if pgcluster.Spec.BackrestS3Bucket == "" { + pgcluster.Spec.BackrestS3Bucket = operator.Pgo.Cluster.BackrestS3Bucket + } + if pgcluster.Spec.BackrestS3Endpoint == "" { + pgcluster.Spec.BackrestS3Endpoint = operator.Pgo.Cluster.BackrestS3Endpoint + } + if pgcluster.Spec.BackrestS3Region == "" { + pgcluster.Spec.BackrestS3Region = operator.Pgo.Cluster.BackrestS3Region + } + + // added in 4.4 + if pgcluster.Spec.BackrestS3VerifyTLS == "" { + pgcluster.Spec.BackrestS3VerifyTLS = operator.Pgo.Cluster.BackrestS3VerifyTLS + } + // add a label with the PGO version upgraded from and to pgcluster.Annotations[config.ANNOTATION_UPGRADE_INFO] = "From_" + oldpgoversion + "_to_" + parameters[config.LABEL_PGO_VERSION] // update the "is upgraded" label to indicate cluster has been upgraded diff --git a/internal/operator/clusterutilities.go b/internal/operator/clusterutilities.go index 1efdc4ee1b..df2160013f 100644 --- a/internal/operator/clusterutilities.go +++ b/internal/operator/clusterutilities.go @@ -1,7 +1,7 @@ package operator /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -57,6 +57,10 @@ const ( PGHAConfigReplicaBootstrapRepoType = "replica-bootstrap-repo-type" ) +// defaultPGBackRestS3URIStyle is the default pgBackRest S3 URI style to use if a specific style is +// not provided +const defaultPGBackRestS3URIStyle = "host" + // affinityType represents the two affinity types provided by Kubernetes, specifically // either preferredDuringSchedulingIgnoredDuringExecution or // requiredDuringSchedulingIgnoredDuringExecution @@ -281,7 +285,7 @@ func GetBadgerAddon(clientset kubernetes.Interface, namespace string, cluster *c if cluster.Labels[config.LABEL_BADGER] == "true" { log.Debug("crunchy_badger was found as a label on cluster create") badgerTemplateFields := badgerTemplateFields{} - badgerTemplateFields.CCPImageTag = spec.CCPImageTag + badgerTemplateFields.CCPImageTag = util.GetStandardImageTag(spec.CCPImage, spec.CCPImageTag) badgerTemplateFields.BadgerTarget = pgbadger_target badgerTemplateFields.PGBadgerPort = spec.PGBadgerPort badgerTemplateFields.CCPImagePrefix = util.GetValueOrDefault(spec.CCPImagePrefix, Pgo.Cluster.CCPImagePrefix) @@ -779,7 +783,7 @@ func GetPgbackrestS3EnvVars(cluster crv1.Pgcluster, clientset kubernetes.Interfa // if the URI style is not configured, set to the default value if s3EnvVars.PgbackrestS3URIStyle == "" { - s3EnvVars.PgbackrestS3URIStyle = "host" + s3EnvVars.PgbackrestS3URIStyle = defaultPGBackRestS3URIStyle } // if set, pgBackRest URI style must be set to either 'path' or 'host'. If it is neither, // log an error and stop the cluster from being created. @@ -828,18 +832,23 @@ func GetS3VerifyTLSSetting(cluster *crv1.Pgcluster) string { // pgBackRest environment variables required to enable S3 support for the boostrap job. After // the template has been executed with the proper values, the result is then returned a string // for inclusion in the PG and pgBackRest deployments. -func GetPgbackrestBootstrapS3EnvVars(cluster *crv1.Pgcluster, restoreFromSecret *v1.Secret) string { +func GetPgbackrestBootstrapS3EnvVars(pgDataSourceRestoreFrom string, + restoreFromSecret *v1.Secret) string { s3EnvVars := PgbackrestS3EnvVarsTemplateFields{ - PgbackrestS3Key: util.BackRestRepoSecretKeyAWSS3KeyAWSS3Key, - PgbackrestS3KeySecret: util.BackRestRepoSecretKeyAWSS3KeyAWSS3KeySecret, - PgbackrestS3Bucket: restoreFromSecret.Annotations[config.ANNOTATION_S3_BUCKET], - PgbackrestS3Endpoint: restoreFromSecret.Annotations[config.ANNOTATION_S3_ENDPOINT], - PgbackrestS3Region: restoreFromSecret.Annotations[config.ANNOTATION_S3_REGION], - PgbackrestS3URIStyle: restoreFromSecret.Annotations[config.ANNOTATION_S3_URI_STYLE], - PgbackrestS3VerifyTLS: restoreFromSecret.Annotations[config.ANNOTATION_S3_VERIFY_TLS], - PgbackrestS3SecretName: fmt.Sprintf(util.BackrestRepoSecretName, - cluster.Spec.PGDataSource.RestoreFrom), + PgbackrestS3Key: util.BackRestRepoSecretKeyAWSS3KeyAWSS3Key, + PgbackrestS3KeySecret: util.BackRestRepoSecretKeyAWSS3KeyAWSS3KeySecret, + PgbackrestS3Bucket: restoreFromSecret.Annotations[config.ANNOTATION_S3_BUCKET], + PgbackrestS3Endpoint: restoreFromSecret.Annotations[config.ANNOTATION_S3_ENDPOINT], + PgbackrestS3Region: restoreFromSecret.Annotations[config.ANNOTATION_S3_REGION], + PgbackrestS3SecretName: fmt.Sprintf(util.BackrestRepoSecretName, pgDataSourceRestoreFrom), + } + + // if the URI style annotation is empty then set the proper default + if restoreFromSecret.Annotations[config.ANNOTATION_S3_URI_STYLE] != "" { + s3EnvVars.PgbackrestS3URIStyle = restoreFromSecret.Annotations[config.ANNOTATION_S3_URI_STYLE] + } else { + s3EnvVars.PgbackrestS3URIStyle = defaultPGBackRestS3URIStyle } verifyTLS := restoreFromSecret.Annotations[config.ANNOTATION_S3_VERIFY_TLS] diff --git a/internal/operator/clusterutilities_test.go b/internal/operator/clusterutilities_test.go index 499719343e..2b9bf8e427 100644 --- a/internal/operator/clusterutilities_test.go +++ b/internal/operator/clusterutilities_test.go @@ -1,7 +1,7 @@ package operator /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/common.go b/internal/operator/common.go index 15adae0f1f..03d69d5329 100644 --- a/internal/operator/common.go +++ b/internal/operator/common.go @@ -1,7 +1,7 @@ package operator /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -369,7 +369,7 @@ func SetupNamespaces(clientset kubernetes.Interface) ([]string, error) { // First set the proper namespace operating mode for the Operator install. The mode identified // determines whether or not certain namespace capabilities are enabled. if err := setNamespaceOperatingMode(clientset); err != nil { - log.Errorf("Error detecting namespace operating mode: %w", err) + log.Errorf("Error detecting namespace operating mode: %v", err) return nil, err } log.Debugf("Namespace operating mode is '%s'", NamespaceOperatingMode()) @@ -383,7 +383,7 @@ func SetupNamespaces(clientset kubernetes.Interface) ([]string, error) { // proceed with creating and/or updating any namespaces provided for the installation if err := ns.ConfigureInstallNamespaces(clientset, InstallationName, PgoNamespace, namespaceList, NamespaceOperatingMode()); err != nil { - log.Errorf("Unable to setup namespaces: %w", err) + log.Errorf("Unable to setup namespaces: %v", err) return nil, err } diff --git a/internal/operator/config/configutil.go b/internal/operator/config/configutil.go index af6bc62f35..0b4d594f27 100644 --- a/internal/operator/config/configutil.go +++ b/internal/operator/config/configutil.go @@ -1,7 +1,7 @@ package config /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/config/dcs.go b/internal/operator/config/dcs.go index 7b5c721c5f..99c383d904 100644 --- a/internal/operator/config/dcs.go +++ b/internal/operator/config/dcs.go @@ -1,7 +1,7 @@ package config /* - Copyright 2020 Crunchy Data Solutions, Ind. + Copyright 2020 - 2021 Crunchy Data Solutions, Ind. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/config/localdb.go b/internal/operator/config/localdb.go index c825d0baee..8c6391ee4b 100644 --- a/internal/operator/config/localdb.go +++ b/internal/operator/config/localdb.go @@ -1,7 +1,7 @@ package config /* - Copyright 2020 Crunchy Data Solutions, Inl. + Copyright 2020 - 2021 Crunchy Data Solutions, Inl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -217,10 +217,10 @@ func (l *LocalDB) Update(configName string, localDBConfig LocalDBConfig) error { return nil } -// apply applies the configuration stored in the CusterConig's configMap for a -// specific database server to that server. This is done by updating the contents of that -// database server's local configuration with the configuration for that cluster stored in -// the LocalDB's configMap, and the issuing a Patroni "reload" for that specific server. +// apply applies the configuration stored in the cluster ConfigMap for a specific database server +// to that server. This is done by updating the contents of that database server's local +// configuration with the configuration for that cluster stored in the LocalDB's configMap, and +// then issuing a Patroni "reload" for that specific server. func (l *LocalDB) apply(configName string) error { clusterName := l.configMap.GetObjectMeta().GetLabels()[config.LABEL_PG_CLUSTER] @@ -243,6 +243,11 @@ func (l *LocalDB) apply(configName string) error { if err != nil { return err } + // if the pod list is empty, also return an error + if len(dbPodList.Items) == 0 { + return fmt.Errorf("no pod found for %q", clusterName) + } + dbPod := &dbPodList.Items[0] // add the config name and patroni port as params for the call to the apply & reload script diff --git a/internal/operator/operatorupgrade/version-check.go b/internal/operator/operatorupgrade/version-check.go index 034999469c..2bcb53491f 100644 --- a/internal/operator/operatorupgrade/version-check.go +++ b/internal/operator/operatorupgrade/version-check.go @@ -1,7 +1,7 @@ package operatorupgrade /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/pgdump/dump.go b/internal/operator/pgdump/dump.go index 8aa2ae1094..b25327e4d9 100644 --- a/internal/operator/pgdump/dump.go +++ b/internal/operator/pgdump/dump.go @@ -1,7 +1,7 @@ package pgdump /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/pgdump/restore.go b/internal/operator/pgdump/restore.go index 93b362b1d2..897ae5c931 100644 --- a/internal/operator/pgdump/restore.go +++ b/internal/operator/pgdump/restore.go @@ -1,7 +1,7 @@ package pgdump /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/pvc/pvc.go b/internal/operator/pvc/pvc.go index 0c37e8d27c..b557514511 100644 --- a/internal/operator/pvc/pvc.go +++ b/internal/operator/pvc/pvc.go @@ -1,7 +1,7 @@ package pvc /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/storage.go b/internal/operator/storage.go index da06087deb..2b1e3053b4 100644 --- a/internal/operator/storage.go +++ b/internal/operator/storage.go @@ -1,7 +1,7 @@ package operator /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/storage_test.go b/internal/operator/storage_test.go index 280b1c6cd0..dacaaf78d3 100644 --- a/internal/operator/storage_test.go +++ b/internal/operator/storage_test.go @@ -1,7 +1,7 @@ package operator /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/task/applypolicies.go b/internal/operator/task/applypolicies.go index 550e681b9c..086bdbe740 100644 --- a/internal/operator/task/applypolicies.go +++ b/internal/operator/task/applypolicies.go @@ -1,7 +1,7 @@ package task /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/task/rmbackups.go b/internal/operator/task/rmbackups.go index 928a8cb977..8c9744181c 100644 --- a/internal/operator/task/rmbackups.go +++ b/internal/operator/task/rmbackups.go @@ -1,7 +1,7 @@ package task /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/task/rmdata.go b/internal/operator/task/rmdata.go index 79250c8592..9664dec8d5 100644 --- a/internal/operator/task/rmdata.go +++ b/internal/operator/task/rmdata.go @@ -1,7 +1,7 @@ package task /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -56,7 +56,7 @@ func RemoveData(namespace string, clientset kubernetes.Interface, restclient *re //create marker (clustername, namespace) err := PatchpgtaskDeleteDataStatus(restclient, task, namespace) if err != nil { - log.Error("could not set delete data started marker for task %s cluster %s", task.Spec.Name, task.Spec.Parameters[config.LABEL_PG_CLUSTER]) + log.Errorf("could not set delete data started marker for task %s cluster %s", task.Spec.Name, task.Spec.Parameters[config.LABEL_PG_CLUSTER]) return } diff --git a/internal/operator/task/workflow.go b/internal/operator/task/workflow.go index 1b5b51ad52..71b8808fe6 100644 --- a/internal/operator/task/workflow.go +++ b/internal/operator/task/workflow.go @@ -1,7 +1,7 @@ package task /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/operator/wal.go b/internal/operator/wal.go index 1b679755fb..b9a14c3219 100644 --- a/internal/operator/wal.go +++ b/internal/operator/wal.go @@ -1,7 +1,7 @@ package operator /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/patroni/doc.go b/internal/patroni/doc.go index 63a42c84d3..6311d1e653 100644 --- a/internal/patroni/doc.go +++ b/internal/patroni/doc.go @@ -4,7 +4,7 @@ package patroni /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/patroni/patroni.go b/internal/patroni/patroni.go index e1bc58a01a..83d2772839 100644 --- a/internal/patroni/patroni.go +++ b/internal/patroni/patroni.go @@ -1,7 +1,7 @@ package patroni /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/pgadmin/backoff.go b/internal/pgadmin/backoff.go index d1df68c80d..7fe83c72b6 100644 --- a/internal/pgadmin/backoff.go +++ b/internal/pgadmin/backoff.go @@ -1,7 +1,7 @@ package pgadmin /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/pgadmin/backoff_test.go b/internal/pgadmin/backoff_test.go index aeae16f7a5..ec24f360fe 100644 --- a/internal/pgadmin/backoff_test.go +++ b/internal/pgadmin/backoff_test.go @@ -1,7 +1,7 @@ package pgadmin /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/pgadmin/crypto.go b/internal/pgadmin/crypto.go index 55ebc8b771..e2db5beb5d 100644 --- a/internal/pgadmin/crypto.go +++ b/internal/pgadmin/crypto.go @@ -1,7 +1,7 @@ package pgadmin /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/pgadmin/crypto_test.go b/internal/pgadmin/crypto_test.go index 36f8468379..8c78611501 100644 --- a/internal/pgadmin/crypto_test.go +++ b/internal/pgadmin/crypto_test.go @@ -1,7 +1,7 @@ package pgadmin /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/pgadmin/doc.go b/internal/pgadmin/doc.go index 97900b0227..58bf983ab5 100644 --- a/internal/pgadmin/doc.go +++ b/internal/pgadmin/doc.go @@ -4,7 +4,7 @@ database which powers pgadmin */ package pgadmin /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/pgadmin/hash.go b/internal/pgadmin/hash.go index b73222fb8b..64bc3df471 100644 --- a/internal/pgadmin/hash.go +++ b/internal/pgadmin/hash.go @@ -1,7 +1,7 @@ package pgadmin /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/pgadmin/logic.go b/internal/pgadmin/logic.go index 2a3fdf0c30..5481f69dc6 100644 --- a/internal/pgadmin/logic.go +++ b/internal/pgadmin/logic.go @@ -1,7 +1,7 @@ package pgadmin /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/pgadmin/runner.go b/internal/pgadmin/runner.go index 233dc092be..e4cb8a8ece 100644 --- a/internal/pgadmin/runner.go +++ b/internal/pgadmin/runner.go @@ -1,7 +1,7 @@ package pgadmin /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/pgadmin/server.go b/internal/pgadmin/server.go index 26568e8806..b5ab3b6ef5 100644 --- a/internal/pgadmin/server.go +++ b/internal/pgadmin/server.go @@ -1,7 +1,7 @@ package pgadmin /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/postgres/doc.go b/internal/postgres/doc.go index 974cb7c8df..2a2155a2cd 100644 --- a/internal/postgres/doc.go +++ b/internal/postgres/doc.go @@ -5,7 +5,7 @@ package postgres /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/postgres/password/doc.go b/internal/postgres/password/doc.go index 6ea6563873..b0e22372f6 100644 --- a/internal/postgres/password/doc.go +++ b/internal/postgres/password/doc.go @@ -4,7 +4,7 @@ package password /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/postgres/password/md5.go b/internal/postgres/password/md5.go index ae93d2cc56..7541d05a70 100644 --- a/internal/postgres/password/md5.go +++ b/internal/postgres/password/md5.go @@ -1,7 +1,7 @@ package password /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/postgres/password/md5_test.go b/internal/postgres/password/md5_test.go index c77c8abf43..5f810d884d 100644 --- a/internal/postgres/password/md5_test.go +++ b/internal/postgres/password/md5_test.go @@ -1,7 +1,7 @@ package password /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/postgres/password/password.go b/internal/postgres/password/password.go index b70112a4c3..c0ad603a14 100644 --- a/internal/postgres/password/password.go +++ b/internal/postgres/password/password.go @@ -1,7 +1,7 @@ package password /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/postgres/password/password_test.go b/internal/postgres/password/password_test.go index b9b7094dbc..1cf7e6f09f 100644 --- a/internal/postgres/password/password_test.go +++ b/internal/postgres/password/password_test.go @@ -1,7 +1,7 @@ package password /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/postgres/password/scram.go b/internal/postgres/password/scram.go index aa6eee3df8..a28b187b90 100644 --- a/internal/postgres/password/scram.go +++ b/internal/postgres/password/scram.go @@ -1,7 +1,7 @@ package password /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/postgres/password/scram_test.go b/internal/postgres/password/scram_test.go index f7c74f8483..070c12e46f 100644 --- a/internal/postgres/password/scram_test.go +++ b/internal/postgres/password/scram_test.go @@ -1,7 +1,7 @@ package password /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/tlsutil/primitives.go b/internal/tlsutil/primitives.go index 03fb73f744..a2c8da3187 100644 --- a/internal/tlsutil/primitives.go +++ b/internal/tlsutil/primitives.go @@ -1,7 +1,7 @@ package tlsutil /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/tlsutil/primitives_test.go b/internal/tlsutil/primitives_test.go index 22676e9fbc..0805621f57 100644 --- a/internal/tlsutil/primitives_test.go +++ b/internal/tlsutil/primitives_test.go @@ -1,7 +1,7 @@ package tlsutil /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/util/backrest.go b/internal/util/backrest.go index 66e3a2dec6..eae2e62bfb 100644 --- a/internal/util/backrest.go +++ b/internal/util/backrest.go @@ -1,7 +1,7 @@ package util /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/util/clone.go b/internal/util/clone.go index a1d563262c..e01e34e670 100644 --- a/internal/util/clone.go +++ b/internal/util/clone.go @@ -1,7 +1,7 @@ package util /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/util/cluster.go b/internal/util/cluster.go index d9c8cc2091..ed81d27cad 100644 --- a/internal/util/cluster.go +++ b/internal/util/cluster.go @@ -1,7 +1,7 @@ package util /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -176,6 +176,9 @@ func CreateBackrestRepoSecrets(clientset kubernetes.Interface, } _, err = clientset.CoreV1().Secrets(backrestRepoConfig.ClusterNamespace).Create(&secret) + if kubeapi.IsAlreadyExists(err) { + _, err = clientset.CoreV1().Secrets(backrestRepoConfig.ClusterNamespace).Update(&secret) + } return err } diff --git a/internal/util/failover.go b/internal/util/failover.go index 643407b737..98d34fea66 100644 --- a/internal/util/failover.go +++ b/internal/util/failover.go @@ -1,7 +1,7 @@ package util /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -79,6 +79,14 @@ const ( // instanceReplicationInfoTypePrimaryStandby is the label used by Patroni to indicate that an // instance is indeed a primary PostgreSQL instance, specifically within a standby cluster instanceReplicationInfoTypePrimaryStandby = "Standby Leader" + // instanceRolePrimary indicates that an instance is a primary + instanceRolePrimary = "primary" + // instanceRoleReplica indicates that an instance is a replica + instanceRoleReplica = "replica" + // instanceRoleUnknown indicates taht an instance is of an unknown typ + instanceRoleUnknown = "unknown" + // instanceStatusUnavailable indicates an instance is unavailable + instanceStatusUnavailable = "unavailable" ) var ( @@ -137,20 +145,34 @@ func GetPod(clientset kubernetes.Interface, deploymentName, namespace string) (* // By default information is only returned for replicas within the cluster. However, // if primary information is also needed, the inlcudePrimary flag can set set to true // and primary information will will also be included in the ReplicationStatusResponse. -func ReplicationStatus(request ReplicationStatusRequest, includePrimary bool) (ReplicationStatusResponse, error) { +// +// Also by default we do not include any "busted" Pods, e.g. a Pod that is not +// in a happy phase. That Pod may be lacking a "role" label. From there, we zero +// out the statistics and apply an error +func ReplicationStatus(request ReplicationStatusRequest, includePrimary, includeBusted bool) (ReplicationStatusResponse, error) { response := ReplicationStatusResponse{ Instances: make([]InstanceReplicationInfo, 0), } - // First, get replica pods using selector pg-cluster=clusterName,role=replica if not including the primary, - // or pg-cluster=clusterName,pg-database if including the primary - var roleSelector string + // Build up the selector. First, create the base, which restricts to the + // current cluster + // pg-cluster=clusterName,pgo-pg-database + selector := fmt.Sprintf("%s=%s,%s", + config.LABEL_PG_CLUSTER, request.ClusterName, config.LABEL_PG_DATABASE) + + // if we are not including the primary, determine if we are including busted + // replicas or not if !includePrimary { - roleSelector = fmt.Sprintf("%s=%s", config.LABEL_PGHA_ROLE, config.LABEL_PGHA_ROLE_REPLICA) - } else { - roleSelector = config.LABEL_PG_DATABASE + if includeBusted { + // include all Pods that identify as a database, but **not** a primary + // pg-cluster=clusterName,pgo-pg-database,role!=config.LABEL_PGHA_ROLE_PRIMARY + selector += fmt.Sprintf(",%s!=%s", config.LABEL_PGHA_ROLE, config.LABEL_PGHA_ROLE_PRIMARY) + } else { + // include all Pods that identify as a database and have a replica label + // pg-cluster=clusterName,pgo-pg-database,role=replica + selector += fmt.Sprintf(",%s=%s", config.LABEL_PGHA_ROLE, config.LABEL_PGHA_ROLE_REPLICA) + } } - selector := fmt.Sprintf("%s=%s,%s", config.LABEL_PG_CLUSTER, request.ClusterName, roleSelector) log.Debugf(`searching for pods with "%s"`, selector) pods, err := request.Clientset.CoreV1().Pods(request.Namespace).List(metav1.ListOptions{LabelSelector: selector}) @@ -176,8 +198,36 @@ func ReplicationStatus(request ReplicationStatusRequest, includePrimary bool) (R // Now get the statistics about the current state of the replicas, which we // can delegate to Patroni vis-a-vis the information that it collects // We can get the statistics about the current state of the managed instance - // From executing and running a command in the first pod - pod := pods.Items[0] + // From executing and running a command in the first active pod + var pod *v1.Pod + + for _, p := range pods.Items { + if p.Status.Phase == v1.PodRunning { + pod = &p + break + } + } + + // if no active Pod can be found, we can only assume that all of the instances + // are unavailable, and we should indicate as such + if pod == nil { + for _, p := range pods.Items { + // set up the instance that will be returned + instance := InstanceReplicationInfo{ + Name: instanceInfoMap[p.Name].name, + Node: instanceInfoMap[p.Name].node, + ReplicationLag: -1, + Role: instanceRoleUnknown, + Status: instanceStatusUnavailable, + Timeline: -1, + } + + // append this newly created instance to the list that will be returned + response.Instances = append(response.Instances, instance) + } + + return response, nil + } // Execute the command that will retrieve the replica information from Patroni commandStdOut, _, err := kubeapi.ExecToPodThroughAPI( @@ -198,17 +248,25 @@ func ReplicationStatus(request ReplicationStatusRequest, includePrimary bool) (R // We need to iterate through this list to format the information for the // response for _, rawInstance := range rawInstances { - var role string + // skip the primary unless explicitly enabled - if rawInstance.Type == instanceReplicationInfoTypePrimary || - rawInstance.Type == instanceReplicationInfoTypePrimaryStandby { - if !includePrimary { - continue - } - role = "primary" - } else { - role = "replica" + if !includePrimary && (rawInstance.Type == instanceReplicationInfoTypePrimary || + rawInstance.Type == instanceReplicationInfoTypePrimaryStandby) { + continue + } + + // if this is a busted instance and we are not including it, skip + if !includeBusted && rawInstance.State == "" { + continue + } + + // determine the role of the instnace + switch rawInstance.Type { + default: + role = instanceRoleReplica + case instanceReplicationInfoTypePrimary, instanceReplicationInfoTypePrimaryStandby: + role = instanceRolePrimary } // set up the instance that will be returned @@ -219,11 +277,14 @@ func ReplicationStatus(request ReplicationStatusRequest, includePrimary bool) (R Role: role, Name: instanceInfoMap[rawInstance.PodName].name, Node: instanceInfoMap[rawInstance.PodName].node, + PendingRestart: rawInstance.PendingRestart == "*", } - // indicate whether or not the instance has a pending restart - if rawInstance.PendingRestart == "*" { - instance.PendingRestart = true + // update the instance info if the instance is busted + if rawInstance.State == "" { + instance.Status = instanceStatusUnavailable + instance.ReplicationLag = -1 + instance.Timeline = -1 } // append this newly created instance to the list that will be returned diff --git a/internal/util/pgbouncer.go b/internal/util/pgbouncer.go index a31ecd3a9c..96d6c23bb5 100644 --- a/internal/util/pgbouncer.go +++ b/internal/util/pgbouncer.go @@ -1,7 +1,7 @@ package util /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/util/policy.go b/internal/util/policy.go index 867c5706aa..633398a0a8 100644 --- a/internal/util/policy.go +++ b/internal/util/policy.go @@ -1,7 +1,7 @@ package util /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/util/secrets.go b/internal/util/secrets.go index 16bb5758d9..43300706a1 100644 --- a/internal/util/secrets.go +++ b/internal/util/secrets.go @@ -1,7 +1,7 @@ package util /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -45,6 +45,10 @@ const ( // passwordCharUpper is the highest ASCII character to use for generating a // password, which is 126 passwordCharUpper = 126 + // passwordCharExclude is a map of characters that we choose to exclude from + // the password to simplify usage in the shell. There is still enough entropy + // that exclusion of these characters is OK. + passwordCharExclude = "`\\" ) // passwordCharSelector is a "big int" that we need to select the random ASCII @@ -76,22 +80,28 @@ func CreateSecret(clientset kubernetes.Interface, db, secretName, username, pass // GeneratePassword generates a password of a given length out of the acceptable // ASCII characters suitable for a password func GeneratePassword(length int) (string, error) { - // for "length" times, we are going to get a random ASCII character, and - // append it to the "password" string - password := "" - - for i := 0; i < length; i++ { - char, err := rand.Int(rand.Reader, passwordCharSelector) + password := make([]byte, length) + i := 0 + for i < length { + val, err := rand.Int(rand.Reader, passwordCharSelector) // if there is an error generating the random integer, return if err != nil { return "", err } - password += string(passwordCharLower + char.Int64()) + char := byte(passwordCharLower + val.Int64()) + + // if the character is in the exclusion list, continue + if idx := strings.IndexAny(string(char), passwordCharExclude); idx > -1 { + continue + } + + password[i] = char + i++ } - return password, nil + return string(password), nil } // GeneratedPasswordLength returns the value for what the length of a diff --git a/internal/util/secrets_test.go b/internal/util/secrets_test.go new file mode 100644 index 0000000000..8dca7649bb --- /dev/null +++ b/internal/util/secrets_test.go @@ -0,0 +1,64 @@ +package util + +/* + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +import ( + "strings" + "testing" + "unicode" +) + +func TestGeneratePassword(t *testing.T) { + // different lengths + for _, length := range []int{1, 2, 3, 5, 20, 200} { + password, err := GeneratePassword(length) + if err != nil { + t.Fatalf("expected no error, got %v", err) + } + if expected, actual := length, len(password); expected != actual { + t.Fatalf("expected length %v, got %v", expected, actual) + } + if i := strings.IndexFunc(password, func(r rune) bool { return !unicode.IsPrint(r) }); i > -1 { + t.Fatalf("expected only printable characters, got %q in %q", password[i], password) + } + if i := strings.IndexAny(password, passwordCharExclude); i > -1 { + t.Fatalf("expected no exclude characters, got %q in %q", password[i], password) + } + } + + // random contents + previous := []string{} + + for i := 0; i < 10; i++ { + password, err := GeneratePassword(5) + if err != nil { + t.Fatalf("expected no error, got %v", err) + } + if i := strings.IndexFunc(password, func(r rune) bool { return !unicode.IsPrint(r) }); i > -1 { + t.Fatalf("expected only printable characters, got %q in %q", password[i], password) + } + if i := strings.IndexAny(password, passwordCharExclude); i > -1 { + t.Fatalf("expected no exclude characters, got %q in %q", password[i], password) + } + + for i := range previous { + if password == previous[i] { + t.Fatalf("expected passwords to not repeat, got %q after %q", password, previous) + } + } + previous = append(previous, password) + } +} diff --git a/internal/util/ssh.go b/internal/util/ssh.go index aa886bbca7..e72eb77cdd 100644 --- a/internal/util/ssh.go +++ b/internal/util/ssh.go @@ -1,7 +1,7 @@ package util /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/internal/util/util.go b/internal/util/util.go index 40991290d8..db8bdb8852 100644 --- a/internal/util/util.go +++ b/internal/util/util.go @@ -1,7 +1,7 @@ package util /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -20,6 +20,7 @@ import ( "errors" "fmt" "math/rand" + "regexp" "strings" "time" @@ -44,6 +45,10 @@ type JSONPatchOperation struct { Value interface{} `json:"value"` } +// gisImageTagRegex is a regular expression designed to match the standard image tag for +// the crunchy-postgres-gis-ha container +var gisImageTagRegex = regexp.MustCompile(`(.+-[\d|\.]+)-[\d|\.]+?(-[\d|\.]+.*)`) + func init() { rand.Seed(time.Now().UnixNano()) @@ -208,6 +213,20 @@ func GetSecretPassword(clientset kubernetes.Interface, db, suffix, Namespace str } +// GetStandardImageTag takes the current image name and the image tag value +// stored in the pgcluster CRD and, if the image being used is the +// crunchy-postgres-gis-ha container with the corresponding tag, it returns +// the tag without the addition of the GIS version. This tag value can then +// be used when provisioning containers using the standard containers tag. +func GetStandardImageTag(imageName, imageTag string) string { + + if imageName == "crunchy-postgres-gis-ha" && strings.Count(imageTag, "-") > 2 { + return gisImageTagRegex.ReplaceAllString(imageTag, "$1$2") + } + + return imageTag +} + // RandStringBytesRmndr ... func RandStringBytesRmndr(n int) string { b := make([]byte, n) diff --git a/internal/util/util_test.go b/internal/util/util_test.go new file mode 100644 index 0000000000..d548ad4eff --- /dev/null +++ b/internal/util/util_test.go @@ -0,0 +1,75 @@ +package util + +import "testing" + +func TestGetStandardImageTag(t *testing.T) { + + assertCorrectMessage := func(t testing.TB, got, want string) { + t.Helper() + if got != want { + t.Errorf("got %q want %q", got, want) + } + } + + imageTagTests := []struct { + description string + imageName string + imageTag string + expected string + }{ + { + "image: crunchy-postgres-ha, tag: centos7-12.6-4.5.0", + "crunchy-postgres-ha", + "centos7-12.6-4.5.0", + "centos7-12.6-4.5.0", + }, { + "image: crunchy-postgres-gis-ha, tag: centos7-12.6-3.0-4.5.0", + "crunchy-postgres-gis-ha", + "centos7-12.6-3.0-4.5.0", + "centos7-12.6-4.5.0", + }, { + "image: crunchy-postgres-ha, tag: centos7-12.6-4.5.0-beta.1", + "crunchy-postgres-ha", + "centos7-12.6-4.5.0-beta.1", + "centos7-12.6-4.5.0-beta.1", + }, { + "image: crunchy-postgres-gis-ha, tag: centos7-12.6-3.0-4.5.0-beta.2", + "crunchy-postgres-gis-ha", + "centos7-12.6-3.0-4.5.0-beta.2", + "centos7-12.6-4.5.0-beta.2", + }, { + "image: crunchy-postgres-ha, tag: centos8-9.5.23-4.5.0-rc.1", + "crunchy-postgres-ha", + "centos8-9.5.23-4.5.0-rc.1", + "centos8-9.5.23-4.5.0-rc.1", + }, { + "image: crunchy-postgres-gis-ha, tag: centos8-9.5.23-2.4-4.5.0-rc.1", + "crunchy-postgres-gis-ha", + "centos8-9.5.23-2.4-4.5.0-rc.1", + "centos8-9.5.23-4.5.0-rc.1", + }, { + "image: crunchy-postgres-gis-ha, tag: centos8-13.0-3.0-4.5.0-rc.1", + "crunchy-postgres-gis-ha", + "centos8-13.0-3.0-4.5.0-rc.1", + "centos8-13.0-4.5.0-rc.1", + }, { + "image: crunchy-postgres-gis-ha, tag: centos8-custom123", + "crunchy-postgres-gis-ha", + "centos8-custom123", + "centos8-custom123", + }, { + "image: crunchy-postgres-gis-ha, tag: centos8-custom123-moreinfo-789", + "crunchy-postgres-gis-ha", + "centos8-custom123-moreinfo-789", + "centos8-custom123-moreinfo-789", + }, + } + + for _, itt := range imageTagTests { + t.Run(itt.description, func(t *testing.T) { + got := GetStandardImageTag(itt.imageName, itt.imageTag) + want := itt.expected + assertCorrectMessage(t, got, want) + }) + } +} diff --git a/pgo-backrest/pgo-backrest.go b/pgo-backrest/pgo-backrest.go index aeb688be31..882def5a1e 100644 --- a/pgo-backrest/pgo-backrest.go +++ b/pgo-backrest/pgo-backrest.go @@ -1,7 +1,7 @@ package main /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo-rmdata/pgo-rmdata.go b/pgo-rmdata/pgo-rmdata.go index c8f70894bf..097cd7685d 100644 --- a/pgo-rmdata/pgo-rmdata.go +++ b/pgo-rmdata/pgo-rmdata.go @@ -1,7 +1,7 @@ package main /* -Copyright 2019 - 2020 Crunchy Data +Copyright 2019 - 2021 Crunchy Data Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo-rmdata/rmdata/process.go b/pgo-rmdata/rmdata/process.go index f18430f5f6..3164440e87 100644 --- a/pgo-rmdata/rmdata/process.go +++ b/pgo-rmdata/rmdata/process.go @@ -1,7 +1,7 @@ package rmdata /* -Copyright 2019 - 2020 Crunchy Data +Copyright 2019 - 2021 Crunchy Data Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -23,7 +23,6 @@ import ( "github.com/crunchydata/postgres-operator/internal/config" "github.com/crunchydata/postgres-operator/internal/kubeapi" - "github.com/crunchydata/postgres-operator/internal/util" crv1 "github.com/crunchydata/postgres-operator/pkg/apis/crunchydata.com/v1" log "github.com/sirupsen/logrus" @@ -35,32 +34,24 @@ const ( MAX_TRIES = 16 pgBackRestPathFormat = "/backrestrepo/%s" pgBackRestRepoPVC = "%s-pgbr-repo" - pgDumpPVC = "backup-%s-pgdump-pvc" + pgDumpPVCPrefix = "backup-%s-pgdump" pgDataPathFormat = "/pgdata/%s" tablespacePathFormat = "/tablespaces/%s/%s" // the tablespace on a replcia follows the pattern "" + walReplicaPVCPattern = "%s-wal" // the following constants define the suffixes for the various configMaps created by Patroni configConfigMapSuffix = "config" leaderConfigMapSuffix = "leader" failoverConfigMapSuffix = "failover" + syncConfigMapSuffix = "sync" ) func Delete(request Request) { log.Infof("rmdata.Process %v", request) - // if, check to see if this is a full cluster removal...i.e. "IsReplica" - // and "IsBackup" is set to false - // - // if this is a full cluster removal, first disable autofailover - if !(request.IsReplica || request.IsBackup) { - log.Debug("disabling autofailover for cluster removal") - util.ToggleAutoFailover(request.Clientset, false, request.ClusterPGHAScope, request.Namespace) - } - //the case of 'pgo scaledown' if request.IsReplica { log.Info("rmdata.Process scaledown replica use case") @@ -231,7 +222,7 @@ func removeBackupSecrets(request Request) { // -pgha-config (stores a Patroni config file in YAML format) func removeClusterConfigmaps(request Request) { // Store the derived names of the three configmaps in an array - clusterConfigmaps := [4]string{ + clusterConfigmaps := []string{ // first, derive the name of the PG HA default configmap, which is // "`clusterName`-`LABEL_PGHA_CONFIGMAP`" fmt.Sprintf("%s-%s", request.ClusterName, config.LABEL_PGHA_CONFIGMAP), @@ -241,6 +232,8 @@ func removeClusterConfigmaps(request Request) { // next, the name of the general configuration settings configmap, which is // "`clusterName`-config" fmt.Sprintf("%s-%s", request.ClusterName, configConfigMapSuffix), + // next, if there is a synchronous replication configmap, clean that up + fmt.Sprintf("%s-%s", request.ClusterName, syncConfigMapSuffix), // finally, the name of the failover configmap, which is // "`clusterName`-failover" fmt.Sprintf("%s-%s", request.ClusterName, failoverConfigMapSuffix), @@ -474,7 +467,7 @@ func removePgtasks(request Request) { func getInstancePVCs(request Request) ([]string, error) { pvcList := make([]string, 0) selector := fmt.Sprintf("%s=%s", config.LABEL_PG_CLUSTER, request.ClusterName) - pgDump, pgBackRest := fmt.Sprintf(pgDumpPVC, request.ClusterName), + pgDump, pgBackRest := fmt.Sprintf(pgDumpPVCPrefix, request.ClusterName), fmt.Sprintf(pgBackRestRepoPVC, request.ClusterName) log.Debugf("instance pvcs overall selector: [%s]", selector) @@ -502,7 +495,7 @@ func getInstancePVCs(request Request) ([]string, error) { log.Debugf("found pvc: [%s]", pvcName) - if pvcName == pgDump || pvcName == pgBackRest { + if strings.HasPrefix(pvcName, pgDump) || pvcName == pgBackRest { log.Debug("skipping...") continue } @@ -544,13 +537,16 @@ func getReplicaPVC(request Request) ([]string, error) { // ...and where the fun begins tablespaceReplicaPVCPrefix := fmt.Sprintf(tablespaceReplicaPVCPattern, request.ReplicaName) + walReplicaPVCName := fmt.Sprintf(walReplicaPVCPattern, request.ReplicaName) // iterate over the PVC list and append the tablespace PVCs for _, pvc := range pvcs.Items { pvcName := pvc.ObjectMeta.Name - // it does not start with the tablespace replica PVC pattern, continue - if !(strings.HasPrefix(pvcName, tablespaceReplicaPVCPrefix) || strings.HasSuffix(pvcName, walPVCSuffix)) { + // if it does not start with the tablespace replica PVC pattern and does not equal the WAL + // PVC pattern then continue + if !(strings.HasPrefix(pvcName, tablespaceReplicaPVCPrefix) || + pvcName == walReplicaPVCName) { continue } @@ -652,14 +648,35 @@ func removeBackupJobs(request Request) { // "rm -rf" like in other commands). Well, we could...we could write a job to do // this, but that will be saved for future work func removeLogicalBackupPVCs(request Request) { - // get the name of the PVC, which uses a format that is fixed - pvcName := fmt.Sprintf(pgDumpPVC, request.ClusterName) - log.Debugf("remove pgdump pvc name [%s]", pvcName) + pvcList := make([]string, 0) + selector := fmt.Sprintf("%s=%s", config.LABEL_PG_CLUSTER, request.ClusterName) + dumpPrefix := fmt.Sprintf(pgDumpPVCPrefix, request.ClusterName) + + // get all of the PVCs to analyze (see the step below) + pvcs, err := request.Clientset. + CoreV1().PersistentVolumeClaims(request.Namespace). + List(metav1.ListOptions{LabelSelector: selector}) + if err != nil { + log.Error(err) + return + } + + // Now iterate through all the PVCs to identify those that are for a logical backup and add + // them to the PVC list for deletion. This pattern matching will be utilized until better + // labeling is in place to uniquely identify logical backup PVCs. + for _, pvc := range pvcs.Items { + pvcName := pvc.GetName() + + if !strings.HasPrefix(pvcName, dumpPrefix) { + continue + } + + pvcList = append(pvcList, pvcName) + } + + log.Debugf("logical backup pvcs found: [%v]", pvcList) - // make a simple list of the PVCs that can be applied to the "removePVC" - // command - pvcList := []string{pvcName} removePVCs(pvcList, request) } diff --git a/pgo-rmdata/rmdata/types.go b/pgo-rmdata/rmdata/types.go index a7e0ea14de..39bbb147ae 100644 --- a/pgo-rmdata/rmdata/types.go +++ b/pgo-rmdata/rmdata/types.go @@ -1,7 +1,7 @@ package rmdata /* -Copyright 2019 - 2020 Crunchy Data +Copyright 2019 - 2021 Crunchy Data Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo-scheduler/pgo-scheduler.go b/pgo-scheduler/pgo-scheduler.go index 0a8162fb78..94552c4470 100644 --- a/pgo-scheduler/pgo-scheduler.go +++ b/pgo-scheduler/pgo-scheduler.go @@ -1,7 +1,7 @@ package main /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo-scheduler/scheduler/configmapcontroller.go b/pgo-scheduler/scheduler/configmapcontroller.go index f8e08dfa0c..0b20e2a9dc 100644 --- a/pgo-scheduler/scheduler/configmapcontroller.go +++ b/pgo-scheduler/scheduler/configmapcontroller.go @@ -1,7 +1,7 @@ package scheduler /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo-scheduler/scheduler/controllermanager.go b/pgo-scheduler/scheduler/controllermanager.go index f95ee67679..dabd98c468 100644 --- a/pgo-scheduler/scheduler/controllermanager.go +++ b/pgo-scheduler/scheduler/controllermanager.go @@ -1,7 +1,7 @@ package scheduler /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo-scheduler/scheduler/pgbackrest.go b/pgo-scheduler/scheduler/pgbackrest.go index 9b16865295..98f6c4cbd6 100644 --- a/pgo-scheduler/scheduler/pgbackrest.go +++ b/pgo-scheduler/scheduler/pgbackrest.go @@ -1,7 +1,7 @@ package scheduler /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -23,8 +23,10 @@ import ( "github.com/crunchydata/postgres-operator/internal/kubeapi" crv1 "github.com/crunchydata/postgres-operator/pkg/apis/crunchydata.com/v1" log "github.com/sirupsen/logrus" + v1 "k8s.io/api/core/v1" kerrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/util/wait" ) @@ -134,17 +136,20 @@ func (b BackRestBackupJob) Run() { return } - selector := fmt.Sprintf("%s=%s,pgo-backrest-repo=true", config.LABEL_PG_CLUSTER, b.cluster) - pods, err := kubeClient.CoreV1().Pods(b.namespace).List(metav1.ListOptions{LabelSelector: selector}) + selector := fmt.Sprintf("%s=%s,%s", config.LABEL_PG_CLUSTER, b.cluster, config.LABEL_PGO_BACKREST_REPO) + options := metav1.ListOptions{ + FieldSelector: fields.OneTermEqualSelector("status.phase", string(v1.PodRunning)).String(), + LabelSelector: selector, + } + + pods, err := kubeClient.CoreV1().Pods(b.namespace).List(options) if err != nil { contextLogger.WithFields(log.Fields{ "selector": selector, "error": err, }).Error("error getting pods from selector") return - } - - if len(pods.Items) != 1 { + } else if len(pods.Items) != 1 { contextLogger.WithFields(log.Fields{ "selector": selector, "error": err, diff --git a/pgo-scheduler/scheduler/policy.go b/pgo-scheduler/scheduler/policy.go index dd53e5d3c9..f5e1409f23 100644 --- a/pgo-scheduler/scheduler/policy.go +++ b/pgo-scheduler/scheduler/policy.go @@ -1,7 +1,7 @@ package scheduler /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo-scheduler/scheduler/scheduler.go b/pgo-scheduler/scheduler/scheduler.go index f86299bbcc..e8043fada7 100644 --- a/pgo-scheduler/scheduler/scheduler.go +++ b/pgo-scheduler/scheduler/scheduler.go @@ -1,7 +1,7 @@ package scheduler /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo-scheduler/scheduler/tasks.go b/pgo-scheduler/scheduler/tasks.go index a2c715d3be..a8374bfbe7 100644 --- a/pgo-scheduler/scheduler/tasks.go +++ b/pgo-scheduler/scheduler/tasks.go @@ -1,7 +1,7 @@ package scheduler /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo-scheduler/scheduler/types.go b/pgo-scheduler/scheduler/types.go index 13f6feaaa9..e23a14e78d 100644 --- a/pgo-scheduler/scheduler/types.go +++ b/pgo-scheduler/scheduler/types.go @@ -1,7 +1,7 @@ package scheduler /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo-scheduler/scheduler/validate.go b/pgo-scheduler/scheduler/validate.go index 37c24dc7ab..29e923c716 100644 --- a/pgo-scheduler/scheduler/validate.go +++ b/pgo-scheduler/scheduler/validate.go @@ -1,7 +1,7 @@ package scheduler /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo-scheduler/scheduler/validate_test.go b/pgo-scheduler/scheduler/validate_test.go index 6abe1a7396..9cc7b4864e 100644 --- a/pgo-scheduler/scheduler/validate_test.go +++ b/pgo-scheduler/scheduler/validate_test.go @@ -1,7 +1,7 @@ package scheduler /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/backrest.go b/pgo/api/backrest.go index 13e2ff702b..08c74e1ac5 100644 --- a/pgo/api/backrest.go +++ b/pgo/api/backrest.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/cat.go b/pgo/api/cat.go index 00d17c7fb6..9e06936153 100644 --- a/pgo/api/cat.go +++ b/pgo/api/cat.go @@ -1,7 +1,7 @@ package api /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/clone.go b/pgo/api/clone.go index 2e7ebfccba..ae09c01553 100644 --- a/pgo/api/clone.go +++ b/pgo/api/clone.go @@ -1,7 +1,7 @@ package api /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/cluster.go b/pgo/api/cluster.go index 74407c0dbc..d3d543ba08 100644 --- a/pgo/api/cluster.go +++ b/pgo/api/cluster.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/common.go b/pgo/api/common.go index 6fcd876ebf..327bbce98e 100644 --- a/pgo/api/common.go +++ b/pgo/api/common.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/config.go b/pgo/api/config.go index 90848edcfd..c3c580cc4c 100644 --- a/pgo/api/config.go +++ b/pgo/api/config.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/df.go b/pgo/api/df.go index fa993051aa..6ed90c9643 100644 --- a/pgo/api/df.go +++ b/pgo/api/df.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/failover.go b/pgo/api/failover.go index 4ebbab9471..1ee9bf3694 100644 --- a/pgo/api/failover.go +++ b/pgo/api/failover.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/label.go b/pgo/api/label.go index e083f998a8..9ce0456812 100644 --- a/pgo/api/label.go +++ b/pgo/api/label.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/load.go b/pgo/api/load.go index 8d8f1a8bd8..4c7a373964 100644 --- a/pgo/api/load.go +++ b/pgo/api/load.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/namespace.go b/pgo/api/namespace.go index 96f10ba8d7..391fb75816 100644 --- a/pgo/api/namespace.go +++ b/pgo/api/namespace.go @@ -1,7 +1,7 @@ package api /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/pgadmin.go b/pgo/api/pgadmin.go index 0d410355cd..56858a6be4 100644 --- a/pgo/api/pgadmin.go +++ b/pgo/api/pgadmin.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/pgbouncer.go b/pgo/api/pgbouncer.go index efee86ca53..58ae62d7ee 100644 --- a/pgo/api/pgbouncer.go +++ b/pgo/api/pgbouncer.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/pgdump.go b/pgo/api/pgdump.go index 3bc0804c7b..2d6e0f3fd7 100644 --- a/pgo/api/pgdump.go +++ b/pgo/api/pgdump.go @@ -1,7 +1,7 @@ package api /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/pgorole.go b/pgo/api/pgorole.go index 804f0c1eb2..c9d9716b0b 100644 --- a/pgo/api/pgorole.go +++ b/pgo/api/pgorole.go @@ -1,7 +1,7 @@ package api /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/pgouser.go b/pgo/api/pgouser.go index e0026d20ca..a17804d61e 100644 --- a/pgo/api/pgouser.go +++ b/pgo/api/pgouser.go @@ -1,7 +1,7 @@ package api /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/policy.go b/pgo/api/policy.go index b7e9cf5d6f..9e56993dc9 100644 --- a/pgo/api/policy.go +++ b/pgo/api/policy.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/pvc.go b/pgo/api/pvc.go index f4fac4ceb4..0498967561 100644 --- a/pgo/api/pvc.go +++ b/pgo/api/pvc.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/reload.go b/pgo/api/reload.go index 9235cc1ea9..9dbe07a5f4 100644 --- a/pgo/api/reload.go +++ b/pgo/api/reload.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/restart.go b/pgo/api/restart.go index 13dc205972..3fba6f112f 100644 --- a/pgo/api/restart.go +++ b/pgo/api/restart.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/restore.go b/pgo/api/restore.go index e22cea904b..f8816e3c6c 100644 --- a/pgo/api/restore.go +++ b/pgo/api/restore.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/restoreDump.go b/pgo/api/restoreDump.go index bd911c1b75..cb7aa573d7 100644 --- a/pgo/api/restoreDump.go +++ b/pgo/api/restoreDump.go @@ -1,7 +1,7 @@ package api /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/scale.go b/pgo/api/scale.go index 6defb09127..b64133653f 100644 --- a/pgo/api/scale.go +++ b/pgo/api/scale.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/scaledown.go b/pgo/api/scaledown.go index 1cc6691b72..f4c8de0f6e 100644 --- a/pgo/api/scaledown.go +++ b/pgo/api/scaledown.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/schedule.go b/pgo/api/schedule.go index 4007e77e1b..02de41ba2d 100644 --- a/pgo/api/schedule.go +++ b/pgo/api/schedule.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/status.go b/pgo/api/status.go index ad70bd2f96..31ee0f7c70 100644 --- a/pgo/api/status.go +++ b/pgo/api/status.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/test.go b/pgo/api/test.go index 887d67b056..30bbeafd69 100644 --- a/pgo/api/test.go +++ b/pgo/api/test.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/upgrade.go b/pgo/api/upgrade.go index 6079a29023..9f00a2c2d5 100644 --- a/pgo/api/upgrade.go +++ b/pgo/api/upgrade.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/user.go b/pgo/api/user.go index 38424ab17b..4334acd186 100644 --- a/pgo/api/user.go +++ b/pgo/api/user.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/version.go b/pgo/api/version.go index 9ca743add1..bef166c93a 100644 --- a/pgo/api/version.go +++ b/pgo/api/version.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/api/workflow.go b/pgo/api/workflow.go index 3289329aa1..6b4ef05f67 100644 --- a/pgo/api/workflow.go +++ b/pgo/api/workflow.go @@ -1,7 +1,7 @@ package api /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/auth.go b/pgo/cmd/auth.go index 322e5f5e9c..7b1b54ca04 100644 --- a/pgo/cmd/auth.go +++ b/pgo/cmd/auth.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/backrest.go b/pgo/cmd/backrest.go index a0a183fa86..c4c39a3af7 100644 --- a/pgo/cmd/backrest.go +++ b/pgo/cmd/backrest.go @@ -2,7 +2,7 @@ package cmd /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/backup.go b/pgo/cmd/backup.go index 61225cc3ea..719ea55712 100644 --- a/pgo/cmd/backup.go +++ b/pgo/cmd/backup.go @@ -2,7 +2,7 @@ package cmd /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/cat.go b/pgo/cmd/cat.go index e97301d40d..b213777843 100644 --- a/pgo/cmd/cat.go +++ b/pgo/cmd/cat.go @@ -2,7 +2,7 @@ package cmd /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/clone.go b/pgo/cmd/clone.go index 5f544e52e3..463ccfca96 100644 --- a/pgo/cmd/clone.go +++ b/pgo/cmd/clone.go @@ -2,7 +2,7 @@ package cmd /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/cluster.go b/pgo/cmd/cluster.go index 3ba9ca373b..ebbff8e6e7 100644 --- a/pgo/cmd/cluster.go +++ b/pgo/cmd/cluster.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/common.go b/pgo/cmd/common.go index daa268484c..da977a2661 100644 --- a/pgo/cmd/common.go +++ b/pgo/cmd/common.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/config.go b/pgo/cmd/config.go index 16a29d0603..0a1a4ba773 100644 --- a/pgo/cmd/config.go +++ b/pgo/cmd/config.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/create.go b/pgo/cmd/create.go index 507b77f9a1..1d747a97b0 100644 --- a/pgo/cmd/create.go +++ b/pgo/cmd/create.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/delete.go b/pgo/cmd/delete.go index d29341355e..eae34e471c 100644 --- a/pgo/cmd/delete.go +++ b/pgo/cmd/delete.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/df.go b/pgo/cmd/df.go index 576376d1bc..ec4bdc81b1 100644 --- a/pgo/cmd/df.go +++ b/pgo/cmd/df.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/failover.go b/pgo/cmd/failover.go index 4a667429a7..f55c98d8a8 100644 --- a/pgo/cmd/failover.go +++ b/pgo/cmd/failover.go @@ -2,7 +2,7 @@ package cmd /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/flags.go b/pgo/cmd/flags.go index bb831e4006..89d55e4f97 100644 --- a/pgo/cmd/flags.go +++ b/pgo/cmd/flags.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/label.go b/pgo/cmd/label.go index 3a888663b6..f06e8fdac6 100644 --- a/pgo/cmd/label.go +++ b/pgo/cmd/label.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/load.go b/pgo/cmd/load.go index 3cf808835f..a0df076fec 100644 --- a/pgo/cmd/load.go +++ b/pgo/cmd/load.go @@ -2,7 +2,7 @@ package cmd /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/namespace.go b/pgo/cmd/namespace.go index 1065193ad8..5dd1fdc81e 100644 --- a/pgo/cmd/namespace.go +++ b/pgo/cmd/namespace.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/pgadmin.go b/pgo/cmd/pgadmin.go index 52412324d4..336ab4ab40 100644 --- a/pgo/cmd/pgadmin.go +++ b/pgo/cmd/pgadmin.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/pgbouncer.go b/pgo/cmd/pgbouncer.go index 9d302a8cdb..3771047e9d 100644 --- a/pgo/cmd/pgbouncer.go +++ b/pgo/cmd/pgbouncer.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/pgdump.go b/pgo/cmd/pgdump.go index 744ebe7274..e34036005c 100644 --- a/pgo/cmd/pgdump.go +++ b/pgo/cmd/pgdump.go @@ -2,7 +2,7 @@ package cmd /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/pgorole.go b/pgo/cmd/pgorole.go index 171b03e401..144f1fb108 100644 --- a/pgo/cmd/pgorole.go +++ b/pgo/cmd/pgorole.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/pgouser.go b/pgo/cmd/pgouser.go index 2ccc72d970..ff4b535a1c 100644 --- a/pgo/cmd/pgouser.go +++ b/pgo/cmd/pgouser.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/policy.go b/pgo/cmd/policy.go index 3afa306923..805bef66fd 100644 --- a/pgo/cmd/policy.go +++ b/pgo/cmd/policy.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/pvc.go b/pgo/cmd/pvc.go index 47bc481cb0..6fc4c5cdd7 100644 --- a/pgo/cmd/pvc.go +++ b/pgo/cmd/pvc.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/reload.go b/pgo/cmd/reload.go index cf6c5b647c..f006f1a7dd 100644 --- a/pgo/cmd/reload.go +++ b/pgo/cmd/reload.go @@ -2,7 +2,7 @@ package cmd /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/restart.go b/pgo/cmd/restart.go index c3274e96f2..d01e6dab80 100644 --- a/pgo/cmd/restart.go +++ b/pgo/cmd/restart.go @@ -2,7 +2,7 @@ package cmd /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -32,13 +32,13 @@ var restartCmd = &cobra.Command{ Use: "restart", Short: "Restarts the PostgrSQL database within a PostgreSQL cluster", Long: `Restarts one or more PostgreSQL databases within a PostgreSQL cluster. - + For example, to restart the primary and all replicas: pgo restart mycluster Or target a specific instance within the cluster: pgo restart mycluster --target=mycluster-abcd - + And use the 'query' flag obtain a list of all instances within the cluster: pgo restart mycluster --query`, Run: func(cmd *cobra.Command, args []string) { @@ -169,9 +169,15 @@ func queryRestart(args []string, namespace string) { log.Debugf("postgresql instance: %v", instance) - fmt.Printf("%-20s\t%-10s\t%-10s\t%-10s\t%12d %-7s\t%15t\n", - instance.Name, instance.Role, instance.Status, instance.Node, instance.ReplicationLag, "MB", - instance.PendingRestart) + if instance.ReplicationLag != -1 { + fmt.Printf("%-20s\t%-10s\t%-10s\t%-10s\t%12d %-7s\t%15t\n", + instance.Name, instance.Role, instance.Status, instance.Node, instance.ReplicationLag, "MB", + instance.PendingRestart) + } else { + fmt.Printf("%-20s\t%-10s\t%-10s\t%-10s\t%15s\t%23t\n", + instance.Name, instance.Role, instance.Status, instance.Node, "unknown", + instance.PendingRestart) + } } } } diff --git a/pgo/cmd/restore.go b/pgo/cmd/restore.go index ced111cd21..85174ef6a7 100644 --- a/pgo/cmd/restore.go +++ b/pgo/cmd/restore.go @@ -2,7 +2,7 @@ package cmd /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/root.go b/pgo/cmd/root.go index 075a9f13e8..3a233b484a 100644 --- a/pgo/cmd/root.go +++ b/pgo/cmd/root.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/scale.go b/pgo/cmd/scale.go index 831ec2ddf9..f6a5e10518 100644 --- a/pgo/cmd/scale.go +++ b/pgo/cmd/scale.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/scaledown.go b/pgo/cmd/scaledown.go index fbea9523be..57b869a6a8 100644 --- a/pgo/cmd/scaledown.go +++ b/pgo/cmd/scaledown.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -120,9 +120,15 @@ func queryCluster(args []string, ns string) { log.Debugf("postgresql instance: %v", instance) - fmt.Printf("%-20s\t%-10s\t%-10s\t%12d %-7s\t%15t\n", - instance.Name, instance.Status, instance.Node, instance.ReplicationLag, "MB", - instance.PendingRestart) + if instance.ReplicationLag != -1 { + fmt.Printf("%-20s\t%-10s\t%-10s\t%12d %-7s\t%15t\n", + instance.Name, instance.Status, instance.Node, instance.ReplicationLag, "MB", + instance.PendingRestart) + } else { + fmt.Printf("%-20s\t%-10s\t%-10s\t%15s\t%23t\n", + instance.Name, instance.Status, instance.Node, "unknown", + instance.PendingRestart) + } } } } diff --git a/pgo/cmd/schedule.go b/pgo/cmd/schedule.go index 5413001efb..018a5fdb52 100644 --- a/pgo/cmd/schedule.go +++ b/pgo/cmd/schedule.go @@ -2,7 +2,7 @@ package cmd /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/show.go b/pgo/cmd/show.go index b42ba2a7d9..9636f7615f 100644 --- a/pgo/cmd/show.go +++ b/pgo/cmd/show.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/status.go b/pgo/cmd/status.go index 681ad08d6c..f93c4a93bf 100644 --- a/pgo/cmd/status.go +++ b/pgo/cmd/status.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/test.go b/pgo/cmd/test.go index 111475fbed..38b2df6146 100644 --- a/pgo/cmd/test.go +++ b/pgo/cmd/test.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/update.go b/pgo/cmd/update.go index f24bf8b9d2..c120f23a5d 100644 --- a/pgo/cmd/update.go +++ b/pgo/cmd/update.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -143,8 +143,8 @@ var UpdateCmd = &cobra.Command{ Short: "Update a pgouser, pgorole, or cluster", Long: `The update command allows you to update a pgouser, pgorole, or cluster. For example: - pgo update cluster --selector=name=mycluster --autofail=false - pgo update cluster --all --autofail=true + pgo update cluster --selector=name=mycluster --disable-autofail + pgo update cluster --all --enable-autofail pgo update namespace mynamespace pgo update pgbouncer mycluster --rotate-password pgo update pgorole somerole --pgorole-permission="Cat" @@ -189,7 +189,7 @@ var UpdateClusterCmd = &cobra.Command{ Short: "Update a PostgreSQL cluster", Long: `Update a PostgreSQL cluster. For example: - pgo update cluster mycluster --autofail=false + pgo update cluster mycluster --disable-autofail pgo update cluster mycluster myothercluster --disable-autofail pgo update cluster --selector=name=mycluster --disable-autofail pgo update cluster --all --enable-autofail`, diff --git a/pgo/cmd/upgrade.go b/pgo/cmd/upgrade.go index e6672f1aa8..24b10998d7 100644 --- a/pgo/cmd/upgrade.go +++ b/pgo/cmd/upgrade.go @@ -2,7 +2,7 @@ package cmd /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -41,10 +41,10 @@ var UpgradeCCPImageTag string var UpgradeCmd = &cobra.Command{ Use: "upgrade", Short: "Perform a cluster upgrade.", - Long: `UPGRADE allows you to perform a comprehensive PGCluster upgrade - (for use after performing a Postgres Operator upgrade). + Long: `UPGRADE allows you to perform a comprehensive PGCluster upgrade + (for use after performing a Postgres Operator upgrade). For example: - + pgo upgrade mycluster Upgrades the cluster for use with the upgraded Postgres Operator version.`, Run: func(cmd *cobra.Command, args []string) { @@ -69,8 +69,8 @@ func init() { RootCmd.AddCommand(UpgradeCmd) // flags for "pgo upgrade" - UpgradeCmd.Flags().BoolVarP(&IgnoreValidation, "ignore-validation", "", false, "Disables version checking against the image tags when performing an cluster upgrade.") UpgradeCmd.Flags().StringVarP(&UpgradeCCPImageTag, "ccp-image-tag", "", "", "The image tag to use for cluster creation. If specified, it overrides the default configuration setting and disables tag validation checking.") + UpgradeCmd.Flags().BoolVar(&NoPrompt, "no-prompt", false, "No command line confirmation.") } func createUpgrade(args []string, ns string) { @@ -90,7 +90,6 @@ func createUpgrade(args []string, ns string) { request.UpgradeCCPImageTag = UpgradeCCPImageTag response, err := api.CreateUpgrade(httpclient, &SessionCredentials, &request) - if err != nil { fmt.Println("Error: " + err.Error()) os.Exit(2) @@ -104,5 +103,4 @@ func createUpgrade(args []string, ns string) { fmt.Println("Error: " + response.Status.Msg) os.Exit(2) } - } diff --git a/pgo/cmd/user.go b/pgo/cmd/user.go index 7216ce9e1d..a952aef402 100644 --- a/pgo/cmd/user.go +++ b/pgo/cmd/user.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/version.go b/pgo/cmd/version.go index 25e6253767..a5934cfb88 100644 --- a/pgo/cmd/version.go +++ b/pgo/cmd/version.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/watch.go b/pgo/cmd/watch.go index 69d288a1d8..9dd9d5cd41 100644 --- a/pgo/cmd/watch.go +++ b/pgo/cmd/watch.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/cmd/workflow.go b/pgo/cmd/workflow.go index 239fcd6ef2..c0fb0b8ca5 100644 --- a/pgo/cmd/workflow.go +++ b/pgo/cmd/workflow.go @@ -1,7 +1,7 @@ package cmd /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/generatedocs.go b/pgo/generatedocs.go index daafa3224c..8d2b2a2833 100644 --- a/pgo/generatedocs.go +++ b/pgo/generatedocs.go @@ -1,7 +1,7 @@ package main /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/pgo.go b/pgo/pgo.go index 6895b7863a..49bdb9fde5 100644 --- a/pgo/pgo.go +++ b/pgo/pgo.go @@ -1,7 +1,7 @@ package main /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/util/confirmation.go b/pgo/util/confirmation.go index c227055cb1..4d15e0ae83 100644 --- a/pgo/util/confirmation.go +++ b/pgo/util/confirmation.go @@ -1,7 +1,7 @@ package util /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/util/pad.go b/pgo/util/pad.go index 276469471a..fee08615ed 100644 --- a/pgo/util/pad.go +++ b/pgo/util/pad.go @@ -1,7 +1,7 @@ package util /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pgo/util/validation.go b/pgo/util/validation.go index 7d90f6a6ac..17d29b8eac 100644 --- a/pgo/util/validation.go +++ b/pgo/util/validation.go @@ -1,7 +1,7 @@ package util /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apis/crunchydata.com/v1/cluster.go b/pkg/apis/crunchydata.com/v1/cluster.go index 120cc15f5c..89e6697a83 100644 --- a/pkg/apis/crunchydata.com/v1/cluster.go +++ b/pkg/apis/crunchydata.com/v1/cluster.go @@ -1,7 +1,7 @@ package v1 /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apis/crunchydata.com/v1/common.go b/pkg/apis/crunchydata.com/v1/common.go index 541c3ff426..90e9427fe8 100644 --- a/pkg/apis/crunchydata.com/v1/common.go +++ b/pkg/apis/crunchydata.com/v1/common.go @@ -1,7 +1,7 @@ package v1 /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apis/crunchydata.com/v1/common_test.go b/pkg/apis/crunchydata.com/v1/common_test.go index 8ad909e64f..cde6832420 100644 --- a/pkg/apis/crunchydata.com/v1/common_test.go +++ b/pkg/apis/crunchydata.com/v1/common_test.go @@ -1,7 +1,7 @@ package v1 /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apis/crunchydata.com/v1/doc.go b/pkg/apis/crunchydata.com/v1/doc.go index d4040f582a..425a2bd9b8 100644 --- a/pkg/apis/crunchydata.com/v1/doc.go +++ b/pkg/apis/crunchydata.com/v1/doc.go @@ -53,7 +53,7 @@ cluster. curl --cacert $PGO_CA_CERT --key $PGO_CLIENT_KEY --cert $PGO_CA_CERT -u \ admin:examplepassword -H "Content-Type:application/json" --insecure -X \ POST --data \ - '{"ClientVersion":"4.4.0", + '{"ClientVersion":"4.4.3", "Namespace":"pgouser1", "Name":"mycluster", $PGO_APISERVER_URL/clusters @@ -72,7 +72,7 @@ show all of the clusters that are in the given namespace. curl --cacert $PGO_CA_CERT --key $PGO_CLIENT_KEY --cert $PGO_CA_CERT -u \ admin:examplepassword -H "Content-Type:application/json" --insecure -X \ POST --data \ - '{"ClientVersion":"4.4.0", + '{"ClientVersion":"4.4.3", "Namespace":"pgouser1", "Clustername":"mycluster"}' \ $PGO_APISERVER_URL/showclusters @@ -82,7 +82,7 @@ $PGO_APISERVER_URL/showclusters curl --cacert $PGO_CA_CERT --key $PGO_CLIENT_KEY --cert $PGO_CA_CERT -u \ admin:examplepassword -H "Content-Type:application/json" --insecure -X \ POST --data \ - '{"ClientVersion":"4.4.0", + '{"ClientVersion":"4.4.3", "Namespace":"pgouser1", "Clustername":"mycluster"}' \ $PGO_APISERVER_URL/clustersdelete @@ -90,7 +90,7 @@ $PGO_APISERVER_URL/clustersdelete Schemes: http, https BasePath: / - Version: 4.4.0 + Version: 4.4.3 License: Apache 2.0 http://www.apache.org/licenses/LICENSE-2.0 Contact: Crunchy Data https://www.crunchydata.com/ @@ -108,7 +108,7 @@ package v1 // +k8s:deepcopy-gen=package,register /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apis/crunchydata.com/v1/policy.go b/pkg/apis/crunchydata.com/v1/policy.go index 28347f9950..f3ac077cf4 100644 --- a/pkg/apis/crunchydata.com/v1/policy.go +++ b/pkg/apis/crunchydata.com/v1/policy.go @@ -1,7 +1,7 @@ package v1 /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apis/crunchydata.com/v1/register.go b/pkg/apis/crunchydata.com/v1/register.go index 00db119bda..10e79dc7fc 100644 --- a/pkg/apis/crunchydata.com/v1/register.go +++ b/pkg/apis/crunchydata.com/v1/register.go @@ -1,7 +1,7 @@ package v1 /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/apis/crunchydata.com/v1/replica.go b/pkg/apis/crunchydata.com/v1/replica.go index 386fa033d0..c5e17f4697 100644 --- a/pkg/apis/crunchydata.com/v1/replica.go +++ b/pkg/apis/crunchydata.com/v1/replica.go @@ -1,7 +1,7 @@ package v1 /* - Copyright 2018 - 2020 Crunchy Data Solutions, Inc. + Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apis/crunchydata.com/v1/task.go b/pkg/apis/crunchydata.com/v1/task.go index 5e54d97ab3..e898b548fd 100644 --- a/pkg/apis/crunchydata.com/v1/task.go +++ b/pkg/apis/crunchydata.com/v1/task.go @@ -1,7 +1,7 @@ package v1 /* - Copyright 2017 - 2020 Crunchy Data Solutions, Inc. + Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apis/crunchydata.com/v1/zz_generated.deepcopy.go b/pkg/apis/crunchydata.com/v1/zz_generated.deepcopy.go index ba5b0af842..418d4d3979 100644 --- a/pkg/apis/crunchydata.com/v1/zz_generated.deepcopy.go +++ b/pkg/apis/crunchydata.com/v1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/backrestmsgs.go b/pkg/apiservermsgs/backrestmsgs.go index 8944df9186..0e48475c49 100644 --- a/pkg/apiservermsgs/backrestmsgs.go +++ b/pkg/apiservermsgs/backrestmsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/catmsgs.go b/pkg/apiservermsgs/catmsgs.go index ded313371f..15f7d5cf85 100644 --- a/pkg/apiservermsgs/catmsgs.go +++ b/pkg/apiservermsgs/catmsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/clonemsgs.go b/pkg/apiservermsgs/clonemsgs.go index 7f78139af1..c8ff454904 100644 --- a/pkg/apiservermsgs/clonemsgs.go +++ b/pkg/apiservermsgs/clonemsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/clustermsgs.go b/pkg/apiservermsgs/clustermsgs.go index 65f32eddd1..240abaacc5 100644 --- a/pkg/apiservermsgs/clustermsgs.go +++ b/pkg/apiservermsgs/clustermsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/common.go b/pkg/apiservermsgs/common.go index d8407415bc..614358ffc0 100644 --- a/pkg/apiservermsgs/common.go +++ b/pkg/apiservermsgs/common.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -const PGO_VERSION = "4.4.0" +const PGO_VERSION = "4.4.3" // Ok status const Ok = "ok" diff --git a/pkg/apiservermsgs/configmsgs.go b/pkg/apiservermsgs/configmsgs.go index 06ed680008..325e2281e5 100644 --- a/pkg/apiservermsgs/configmsgs.go +++ b/pkg/apiservermsgs/configmsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/dfmsgs.go b/pkg/apiservermsgs/dfmsgs.go index 22541840e7..8d947768ef 100644 --- a/pkg/apiservermsgs/dfmsgs.go +++ b/pkg/apiservermsgs/dfmsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/failovermsgs.go b/pkg/apiservermsgs/failovermsgs.go index bfeefcb49a..b51b11c3e4 100644 --- a/pkg/apiservermsgs/failovermsgs.go +++ b/pkg/apiservermsgs/failovermsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/labelmsgs.go b/pkg/apiservermsgs/labelmsgs.go index eabf3e8ecf..d0a914840e 100644 --- a/pkg/apiservermsgs/labelmsgs.go +++ b/pkg/apiservermsgs/labelmsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/loadmsgs.go b/pkg/apiservermsgs/loadmsgs.go index ddfcde3af5..ececc01229 100644 --- a/pkg/apiservermsgs/loadmsgs.go +++ b/pkg/apiservermsgs/loadmsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/namespacemsgs.go b/pkg/apiservermsgs/namespacemsgs.go index 3921604a00..5fc4665a9b 100644 --- a/pkg/apiservermsgs/namespacemsgs.go +++ b/pkg/apiservermsgs/namespacemsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/pgadminmsgs.go b/pkg/apiservermsgs/pgadminmsgs.go index 5d68b9352d..73e4475294 100644 --- a/pkg/apiservermsgs/pgadminmsgs.go +++ b/pkg/apiservermsgs/pgadminmsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/pgbouncermsgs.go b/pkg/apiservermsgs/pgbouncermsgs.go index 0feab5f15e..2c575b8f0c 100644 --- a/pkg/apiservermsgs/pgbouncermsgs.go +++ b/pkg/apiservermsgs/pgbouncermsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/pgdumpmsgs.go b/pkg/apiservermsgs/pgdumpmsgs.go index e247fca304..34bc123127 100644 --- a/pkg/apiservermsgs/pgdumpmsgs.go +++ b/pkg/apiservermsgs/pgdumpmsgs.go @@ -5,7 +5,7 @@ import ( ) /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/pgorolemsgs.go b/pkg/apiservermsgs/pgorolemsgs.go index 1f62efa1ab..6aae3494d0 100644 --- a/pkg/apiservermsgs/pgorolemsgs.go +++ b/pkg/apiservermsgs/pgorolemsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/pgousermsgs.go b/pkg/apiservermsgs/pgousermsgs.go index 815f8f1fdf..4690c1f888 100644 --- a/pkg/apiservermsgs/pgousermsgs.go +++ b/pkg/apiservermsgs/pgousermsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/policymsgs.go b/pkg/apiservermsgs/policymsgs.go index ec3e7cf2f9..54fb12d52a 100644 --- a/pkg/apiservermsgs/policymsgs.go +++ b/pkg/apiservermsgs/policymsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/pvcmsgs.go b/pkg/apiservermsgs/pvcmsgs.go index f59ddd7983..da902da96b 100644 --- a/pkg/apiservermsgs/pvcmsgs.go +++ b/pkg/apiservermsgs/pvcmsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/reloadmsgs.go b/pkg/apiservermsgs/reloadmsgs.go index 34a3738399..11c4293980 100644 --- a/pkg/apiservermsgs/reloadmsgs.go +++ b/pkg/apiservermsgs/reloadmsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/restartmsgs.go b/pkg/apiservermsgs/restartmsgs.go index c0b32d3d00..bf6b9faa1d 100644 --- a/pkg/apiservermsgs/restartmsgs.go +++ b/pkg/apiservermsgs/restartmsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/schedulemsgs.go b/pkg/apiservermsgs/schedulemsgs.go index 4b037a5992..47e9f90ca8 100644 --- a/pkg/apiservermsgs/schedulemsgs.go +++ b/pkg/apiservermsgs/schedulemsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/statusmsgs.go b/pkg/apiservermsgs/statusmsgs.go index 94994c75b9..72a6c79aab 100644 --- a/pkg/apiservermsgs/statusmsgs.go +++ b/pkg/apiservermsgs/statusmsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/upgrademsgs.go b/pkg/apiservermsgs/upgrademsgs.go index ab7fecc47a..a360c036c7 100644 --- a/pkg/apiservermsgs/upgrademsgs.go +++ b/pkg/apiservermsgs/upgrademsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/usermsgs.go b/pkg/apiservermsgs/usermsgs.go index 1f0ba56295..bf67358abe 100644 --- a/pkg/apiservermsgs/usermsgs.go +++ b/pkg/apiservermsgs/usermsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/usermsgs_test.go b/pkg/apiservermsgs/usermsgs_test.go index d2f70388fc..0f6d39b754 100644 --- a/pkg/apiservermsgs/usermsgs_test.go +++ b/pkg/apiservermsgs/usermsgs_test.go @@ -1,7 +1,7 @@ package apiservermsgs /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/versionmsgs.go b/pkg/apiservermsgs/versionmsgs.go index 7685221c44..38ab640cdb 100644 --- a/pkg/apiservermsgs/versionmsgs.go +++ b/pkg/apiservermsgs/versionmsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +Copyright 2017 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/watchmsgs.go b/pkg/apiservermsgs/watchmsgs.go index 9d50a81ccd..02c1472b90 100644 --- a/pkg/apiservermsgs/watchmsgs.go +++ b/pkg/apiservermsgs/watchmsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2019 - 2020 Crunchy Data Solutions, Inc. +Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/apiservermsgs/workflowmsgs.go b/pkg/apiservermsgs/workflowmsgs.go index 2908d75347..3d4c44353a 100644 --- a/pkg/apiservermsgs/workflowmsgs.go +++ b/pkg/apiservermsgs/workflowmsgs.go @@ -1,7 +1,7 @@ package apiservermsgs /* -Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +Copyright 2018 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/events/eventing.go b/pkg/events/eventing.go index 66fc353117..3ea0e68044 100644 --- a/pkg/events/eventing.go +++ b/pkg/events/eventing.go @@ -1,7 +1,7 @@ package events /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/events/eventtype.go b/pkg/events/eventtype.go index 18f0e78ab9..cf632191ae 100644 --- a/pkg/events/eventtype.go +++ b/pkg/events/eventtype.go @@ -1,7 +1,7 @@ package events /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/events/pgoeventtype.go b/pkg/events/pgoeventtype.go index 75c076b311..4e4f114868 100644 --- a/pkg/events/pgoeventtype.go +++ b/pkg/events/pgoeventtype.go @@ -1,7 +1,7 @@ package events /* - Copyright 2019 - 2020 Crunchy Data Solutions, Inc. + Copyright 2019 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/clientset/versioned/clientset.go b/pkg/generated/clientset/versioned/clientset.go index 7c5e89774a..bc2b61e5e0 100644 --- a/pkg/generated/clientset/versioned/clientset.go +++ b/pkg/generated/clientset/versioned/clientset.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/clientset/versioned/doc.go b/pkg/generated/clientset/versioned/doc.go index e2534c0fe7..f862afa1b0 100644 --- a/pkg/generated/clientset/versioned/doc.go +++ b/pkg/generated/clientset/versioned/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/clientset/versioned/fake/clientset_generated.go b/pkg/generated/clientset/versioned/fake/clientset_generated.go index 384d0e7737..5f9ec9bbbb 100644 --- a/pkg/generated/clientset/versioned/fake/clientset_generated.go +++ b/pkg/generated/clientset/versioned/fake/clientset_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/clientset/versioned/fake/doc.go b/pkg/generated/clientset/versioned/fake/doc.go index 6318a06f3c..e9300efbfe 100644 --- a/pkg/generated/clientset/versioned/fake/doc.go +++ b/pkg/generated/clientset/versioned/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/clientset/versioned/fake/register.go b/pkg/generated/clientset/versioned/fake/register.go index 26c69c1594..7d57cf4437 100644 --- a/pkg/generated/clientset/versioned/fake/register.go +++ b/pkg/generated/clientset/versioned/fake/register.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/clientset/versioned/scheme/doc.go b/pkg/generated/clientset/versioned/scheme/doc.go index 462fec5e30..49cfafd10d 100644 --- a/pkg/generated/clientset/versioned/scheme/doc.go +++ b/pkg/generated/clientset/versioned/scheme/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/clientset/versioned/scheme/register.go b/pkg/generated/clientset/versioned/scheme/register.go index 4850f74045..2ce45ab80b 100644 --- a/pkg/generated/clientset/versioned/scheme/register.go +++ b/pkg/generated/clientset/versioned/scheme/register.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/crunchydata.com_client.go b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/crunchydata.com_client.go index aac71b2aa3..4c862528fa 100644 --- a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/crunchydata.com_client.go +++ b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/crunchydata.com_client.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/doc.go b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/doc.go index b7311c21af..21c249ea20 100644 --- a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/doc.go +++ b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/doc.go b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/doc.go index 759d8fff95..14f506a6fb 100644 --- a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/doc.go +++ b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/fake_crunchydata.com_client.go b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/fake_crunchydata.com_client.go index f8d6b6b350..33ad7a5550 100644 --- a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/fake_crunchydata.com_client.go +++ b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/fake_crunchydata.com_client.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/fake_pgcluster.go b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/fake_pgcluster.go index 516955d577..01bb2a2f00 100644 --- a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/fake_pgcluster.go +++ b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/fake_pgcluster.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/fake_pgpolicy.go b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/fake_pgpolicy.go index f44e8a4ebb..43a0a0a1fc 100644 --- a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/fake_pgpolicy.go +++ b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/fake_pgpolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/fake_pgreplica.go b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/fake_pgreplica.go index d6dc4fbd40..b1a3ea105e 100644 --- a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/fake_pgreplica.go +++ b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/fake_pgreplica.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/fake_pgtask.go b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/fake_pgtask.go index 2db70f152f..d4c2e511a1 100644 --- a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/fake_pgtask.go +++ b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/fake/fake_pgtask.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/generated_expansion.go index 066f811e51..5ea3a63db1 100644 --- a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/generated_expansion.go +++ b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/pgcluster.go b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/pgcluster.go index 035712a6ef..d87c091f29 100644 --- a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/pgcluster.go +++ b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/pgcluster.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/pgpolicy.go b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/pgpolicy.go index 402b99f523..31d0ddd8b7 100644 --- a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/pgpolicy.go +++ b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/pgpolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/pgreplica.go b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/pgreplica.go index 88fb060a69..5df06c39a4 100644 --- a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/pgreplica.go +++ b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/pgreplica.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/pgtask.go b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/pgtask.go index 25b2cd1055..cbed3e2468 100644 --- a/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/pgtask.go +++ b/pkg/generated/clientset/versioned/typed/crunchydata.com/v1/pgtask.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/informers/externalversions/crunchydata.com/interface.go b/pkg/generated/informers/externalversions/crunchydata.com/interface.go index dfe44a0fcb..698763aff3 100644 --- a/pkg/generated/informers/externalversions/crunchydata.com/interface.go +++ b/pkg/generated/informers/externalversions/crunchydata.com/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/informers/externalversions/crunchydata.com/v1/interface.go b/pkg/generated/informers/externalversions/crunchydata.com/v1/interface.go index c34a37f8e7..b30e24b239 100644 --- a/pkg/generated/informers/externalversions/crunchydata.com/v1/interface.go +++ b/pkg/generated/informers/externalversions/crunchydata.com/v1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/informers/externalversions/crunchydata.com/v1/pgcluster.go b/pkg/generated/informers/externalversions/crunchydata.com/v1/pgcluster.go index 92f0d9a6a9..3be680bc29 100644 --- a/pkg/generated/informers/externalversions/crunchydata.com/v1/pgcluster.go +++ b/pkg/generated/informers/externalversions/crunchydata.com/v1/pgcluster.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/informers/externalversions/crunchydata.com/v1/pgpolicy.go b/pkg/generated/informers/externalversions/crunchydata.com/v1/pgpolicy.go index ea70fa720d..4383e0914c 100644 --- a/pkg/generated/informers/externalversions/crunchydata.com/v1/pgpolicy.go +++ b/pkg/generated/informers/externalversions/crunchydata.com/v1/pgpolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/informers/externalversions/crunchydata.com/v1/pgreplica.go b/pkg/generated/informers/externalversions/crunchydata.com/v1/pgreplica.go index 99332793ac..840efd6b0a 100644 --- a/pkg/generated/informers/externalversions/crunchydata.com/v1/pgreplica.go +++ b/pkg/generated/informers/externalversions/crunchydata.com/v1/pgreplica.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/informers/externalversions/crunchydata.com/v1/pgtask.go b/pkg/generated/informers/externalversions/crunchydata.com/v1/pgtask.go index bf1cbd60a8..c25536e459 100644 --- a/pkg/generated/informers/externalversions/crunchydata.com/v1/pgtask.go +++ b/pkg/generated/informers/externalversions/crunchydata.com/v1/pgtask.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/informers/externalversions/factory.go b/pkg/generated/informers/externalversions/factory.go index 56886a005a..65c18752b4 100644 --- a/pkg/generated/informers/externalversions/factory.go +++ b/pkg/generated/informers/externalversions/factory.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/informers/externalversions/generic.go b/pkg/generated/informers/externalversions/generic.go index 130dd5ad37..48e7491d80 100644 --- a/pkg/generated/informers/externalversions/generic.go +++ b/pkg/generated/informers/externalversions/generic.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go index 4086ab3a09..130bc043a8 100644 --- a/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/listers/crunchydata.com/v1/expansion_generated.go b/pkg/generated/listers/crunchydata.com/v1/expansion_generated.go index ca6b77b1a3..369c56b717 100644 --- a/pkg/generated/listers/crunchydata.com/v1/expansion_generated.go +++ b/pkg/generated/listers/crunchydata.com/v1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/listers/crunchydata.com/v1/pgcluster.go b/pkg/generated/listers/crunchydata.com/v1/pgcluster.go index 10db1c63a2..eb059beb06 100644 --- a/pkg/generated/listers/crunchydata.com/v1/pgcluster.go +++ b/pkg/generated/listers/crunchydata.com/v1/pgcluster.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/listers/crunchydata.com/v1/pgpolicy.go b/pkg/generated/listers/crunchydata.com/v1/pgpolicy.go index d996df08ee..d73fef8e45 100644 --- a/pkg/generated/listers/crunchydata.com/v1/pgpolicy.go +++ b/pkg/generated/listers/crunchydata.com/v1/pgpolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/listers/crunchydata.com/v1/pgreplica.go b/pkg/generated/listers/crunchydata.com/v1/pgreplica.go index 23632d1ee4..db450cee51 100644 --- a/pkg/generated/listers/crunchydata.com/v1/pgreplica.go +++ b/pkg/generated/listers/crunchydata.com/v1/pgreplica.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/generated/listers/crunchydata.com/v1/pgtask.go b/pkg/generated/listers/crunchydata.com/v1/pgtask.go index 94a405754c..2042db9581 100644 --- a/pkg/generated/listers/crunchydata.com/v1/pgtask.go +++ b/pkg/generated/listers/crunchydata.com/v1/pgtask.go @@ -1,5 +1,5 @@ /* -Copyright 2020 Crunchy Data Solutions, Inc. +Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/postgres-operator.go b/postgres-operator.go index 37cda4bde4..2bd877d973 100644 --- a/postgres-operator.go +++ b/postgres-operator.go @@ -1,7 +1,7 @@ package main /* -Copyright 2017 - 2020 Crunchy Data +Copyright 2017 - 2021 Crunchy Data Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pv/create-pv-nfs-label.sh b/pv/create-pv-nfs-label.sh index a77e3e68e3..a347a907fd 100755 --- a/pv/create-pv-nfs-label.sh +++ b/pv/create-pv-nfs-label.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2018 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2018 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/pv/create-pv-nfs-legacy.sh b/pv/create-pv-nfs-legacy.sh index 4850e73652..96d698e159 100644 --- a/pv/create-pv-nfs-legacy.sh +++ b/pv/create-pv-nfs-legacy.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2017 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/pv/create-pv-nfs.sh b/pv/create-pv-nfs.sh index 3b5b96b31b..5381548160 100755 --- a/pv/create-pv-nfs.sh +++ b/pv/create-pv-nfs.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2017 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/pv/create-pv.sh b/pv/create-pv.sh index 46bbf4dbe8..6d9ede0b71 100755 --- a/pv/create-pv.sh +++ b/pv/create-pv.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2017 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/pv/delete-pv.sh b/pv/delete-pv.sh index cd653a1778..b3d7422ff2 100755 --- a/pv/delete-pv.sh +++ b/pv/delete-pv.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2017 - 2020 Crunchy Data Solutions, Inc. +# Copyright 2017 - 2021 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/redhat/atomic/help.1 b/redhat/atomic/help.1 index 20abae2707..3786f27fa4 100644 --- a/redhat/atomic/help.1 +++ b/redhat/atomic/help.1 @@ -56,4 +56,4 @@ The Red Hat Enterprise Linux version from which the container was built. For exa \fB\fCRelease=\fR .PP -The specific release number of the container. For example, Release="4.4.0" +The specific release number of the container. For example, Release="4.4.3" diff --git a/redhat/atomic/help.md b/redhat/atomic/help.md index 77a3d7920f..ccb71f370e 100644 --- a/redhat/atomic/help.md +++ b/redhat/atomic/help.md @@ -45,4 +45,4 @@ The Red Hat Enterprise Linux version from which the container was built. For exa `Release=` -The specific release number of the container. For example, Release="4.4.0" +The specific release number of the container. For example, Release="4.4.3" diff --git a/testing/pgo_cli/cluster_backup_test.go b/testing/pgo_cli/cluster_backup_test.go index a5f0ae33ff..ca434ae218 100644 --- a/testing/pgo_cli/cluster_backup_test.go +++ b/testing/pgo_cli/cluster_backup_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/cluster_cat_test.go b/testing/pgo_cli/cluster_cat_test.go index 4cb159be8d..aea958fb15 100644 --- a/testing/pgo_cli/cluster_cat_test.go +++ b/testing/pgo_cli/cluster_cat_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/cluster_clone_test.go b/testing/pgo_cli/cluster_clone_test.go index 606139e820..24154c2f05 100644 --- a/testing/pgo_cli/cluster_clone_test.go +++ b/testing/pgo_cli/cluster_clone_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/cluster_create_test.go b/testing/pgo_cli/cluster_create_test.go index 26f0c2be4f..f0579de8cd 100644 --- a/testing/pgo_cli/cluster_create_test.go +++ b/testing/pgo_cli/cluster_create_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/cluster_delete_test.go b/testing/pgo_cli/cluster_delete_test.go index cba99408f7..1285b6026e 100644 --- a/testing/pgo_cli/cluster_delete_test.go +++ b/testing/pgo_cli/cluster_delete_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/cluster_df_test.go b/testing/pgo_cli/cluster_df_test.go index 8171a7aa45..91ae0b8092 100644 --- a/testing/pgo_cli/cluster_df_test.go +++ b/testing/pgo_cli/cluster_df_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/cluster_failover_test.go b/testing/pgo_cli/cluster_failover_test.go index d35a6d87f5..ac4f2a40c6 100644 --- a/testing/pgo_cli/cluster_failover_test.go +++ b/testing/pgo_cli/cluster_failover_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/cluster_label_test.go b/testing/pgo_cli/cluster_label_test.go index 0f54f7af93..ccf4a17461 100644 --- a/testing/pgo_cli/cluster_label_test.go +++ b/testing/pgo_cli/cluster_label_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/cluster_pgbouncer_test.go b/testing/pgo_cli/cluster_pgbouncer_test.go index 9c5b72ba66..b0f9199881 100644 --- a/testing/pgo_cli/cluster_pgbouncer_test.go +++ b/testing/pgo_cli/cluster_pgbouncer_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/cluster_policy_test.go b/testing/pgo_cli/cluster_policy_test.go index df7197deb4..66db7c6080 100644 --- a/testing/pgo_cli/cluster_policy_test.go +++ b/testing/pgo_cli/cluster_policy_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/cluster_pvc_test.go b/testing/pgo_cli/cluster_pvc_test.go index bd91b28435..0009225e4a 100644 --- a/testing/pgo_cli/cluster_pvc_test.go +++ b/testing/pgo_cli/cluster_pvc_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/cluster_reload_test.go b/testing/pgo_cli/cluster_reload_test.go index e2900ee4fb..02cf63a479 100644 --- a/testing/pgo_cli/cluster_reload_test.go +++ b/testing/pgo_cli/cluster_reload_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/cluster_restart_test.go b/testing/pgo_cli/cluster_restart_test.go index 3f438b6570..2a106fbd41 100644 --- a/testing/pgo_cli/cluster_restart_test.go +++ b/testing/pgo_cli/cluster_restart_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/cluster_scale_test.go b/testing/pgo_cli/cluster_scale_test.go index 11ce9a9c21..219e44f582 100644 --- a/testing/pgo_cli/cluster_scale_test.go +++ b/testing/pgo_cli/cluster_scale_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/cluster_scaledown_test.go b/testing/pgo_cli/cluster_scaledown_test.go index f1926a4d4d..5e9dc16b28 100644 --- a/testing/pgo_cli/cluster_scaledown_test.go +++ b/testing/pgo_cli/cluster_scaledown_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/cluster_test_test.go b/testing/pgo_cli/cluster_test_test.go index 153d47f467..76100eb9f0 100644 --- a/testing/pgo_cli/cluster_test_test.go +++ b/testing/pgo_cli/cluster_test_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/cluster_user_test.go b/testing/pgo_cli/cluster_user_test.go index 9e59757a9a..964bb6b58c 100644 --- a/testing/pgo_cli/cluster_user_test.go +++ b/testing/pgo_cli/cluster_user_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/operator_namespace_test.go b/testing/pgo_cli/operator_namespace_test.go index ef327c2ece..57bc685ea2 100644 --- a/testing/pgo_cli/operator_namespace_test.go +++ b/testing/pgo_cli/operator_namespace_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/operator_rbac_test.go b/testing/pgo_cli/operator_rbac_test.go index 8fa4609894..569f1bd090 100644 --- a/testing/pgo_cli/operator_rbac_test.go +++ b/testing/pgo_cli/operator_rbac_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/operator_test.go b/testing/pgo_cli/operator_test.go index 743b872614..09e8148c68 100644 --- a/testing/pgo_cli/operator_test.go +++ b/testing/pgo_cli/operator_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/suite_helpers_test.go b/testing/pgo_cli/suite_helpers_test.go index b714ce6107..77aa53c05e 100644 --- a/testing/pgo_cli/suite_helpers_test.go +++ b/testing/pgo_cli/suite_helpers_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/suite_pgo_cmd_test.go b/testing/pgo_cli/suite_pgo_cmd_test.go index 91aec62228..245d314aa7 100644 --- a/testing/pgo_cli/suite_pgo_cmd_test.go +++ b/testing/pgo_cli/suite_pgo_cmd_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/testing/pgo_cli/suite_test.go b/testing/pgo_cli/suite_test.go index 4f2056d08e..9429f28278 100644 --- a/testing/pgo_cli/suite_test.go +++ b/testing/pgo_cli/suite_test.go @@ -1,7 +1,7 @@ package pgo_cli_test /* - Copyright 2020 Crunchy Data Solutions, Inc. + Copyright 2020 - 2021 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at