Skip to content

Commit

Permalink
Merge pull request #47 from cybertec-postgresql/v0.7.0-dev
Browse files Browse the repository at this point in the history
Merge whole release into main
  • Loading branch information
Schmaetz authored Jul 12, 2024
2 parents 8ff9e84 + dfe68f2 commit 8ce6b79
Show file tree
Hide file tree
Showing 186 changed files with 4,388 additions and 2,805 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
push:
branches:
- master
- main

jobs:
tests:
Expand All @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-go@v2
with:
go-version: "^1.19.8"
go-version: "^1.21.7"
- name: Make dependencies
run: make deps mocks
- name: Code generation
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
push:
branches:
- master
- main

jobs:
tests:
Expand All @@ -14,15 +14,15 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "^1.19.8"
go-version: "^1.21.7"
- name: Make dependencies
run: make deps mocks
- name: Compile
run: make linux
- name: Run unit tests
run: go test -race -covermode atomic -coverprofile=coverage.out ./...
- name: Convert coverage to lcov
uses: jandelgado/[email protected].8
uses: jandelgado/[email protected].9
- name: Coveralls
uses: coverallsapp/github-action@master
with:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Before filing an issue, if you have a question about Postgres Operator or have
a problem using it, please read the [concepts](docs/index.md) page or use the
different guides that we provide for [users](docs/user.md),
[developers](docs/developer.md) or [admins](docs/administrator). Also double
check with the current issues on our [Issues Tracker](https://github.com/zalando/postgres-operator/issues).
check with the current issues on our [Issues Tracker](https://github.com/cybertec-postgresql/cybertec-pg-operator/issues).

## Contributing a pull request

Expand Down
46 changes: 32 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: clean local test linux macos mocks docker push e2e

BINARY ?= postgres-operator
BINARY ?= cybertec-pg-operator
BUILD_FLAGS ?= -v
CGO_ENABLED ?= 0
ifeq ($(RACE),1)
Expand All @@ -12,7 +12,7 @@ LOCAL_BUILD_FLAGS ?= $(BUILD_FLAGS)
LDFLAGS ?= -X=main.version=$(VERSION)
DOCKERDIR = docker

IMAGE ?= registry.opensource.zalan.do/acid/$(BINARY)
IMAGE ?= docker.io/cybertecpostgresql/$(BINARY)
TAG ?= $(VERSION)
GITHEAD = $(shell git rev-parse --short HEAD)
GITURL = $(shell git config --get remote.origin.url)
Expand All @@ -22,6 +22,17 @@ VERSION ?= $(shell git describe --tags --always --dirty)
DIRS := cmd pkg
PKG := `go list ./... | grep -v /vendor/`

BASE_IMAGE ?= rockylinux:9
PACKAGER ?= dnf
BUILD ?= 1
ROOTPATH = $(GOPATH)/src/github.com/cybertec/cybertec-pg-operator
VERIFY_CODEGEN ?= 1
ifndef ROOTPATH
export ROOTPATH=$(GOPATH)/src/github.com/cybertec/cybertec-pg-operator
endif

ALL_SOURCES = $(shell find pkg/ -name '*.go')

ifeq ($(DEBUG),1)
DOCKERFILE = DebugDockerfile
DEBUG_POSTFIX := -debug-$(shell date hhmmss)
Expand Down Expand Up @@ -50,27 +61,34 @@ default: local
clean:
rm -rf build

local: ${SOURCES}
hack/verify-codegen.sh
CGO_ENABLED=${CGO_ENABLED} go build -o build/${BINARY} $(LOCAL_BUILD_FLAGS) -ldflags "$(LDFLAGS)" $^
local: build/cybertec-pg-operator

build/cybertec-pg-operator: ${SOURCES} ${ALL_SOURCES}
if [ "$(VERIFY_CODEGEN)" = "1" ]; then hack/verify-codegen.sh; fi
CGO_ENABLED=${CGO_ENABLED} go build -o build/${BINARY} $(LOCAL_BUILD_FLAGS) -ldflags "$(LDFLAGS)" $<

linux: ${SOURCES}
GOOS=linux GOARCH=amd64 CGO_ENABLED=${CGO_ENABLED} go build -o build/linux/${BINARY} ${BUILD_FLAGS} -ldflags "$(LDFLAGS)" $^

macos: ${SOURCES}
GOOS=darwin GOARCH=amd64 CGO_ENABLED=${CGO_ENABLED} go build -o build/macos/${BINARY} ${BUILD_FLAGS} -ldflags "$(LDFLAGS)" $^

docker: ${DOCKERDIR}/${DOCKERFILE}
docker: ${DOCKERDIR}/${DOCKERFILE}

docker build --rm -t "$(IMAGE):$(TAG)$(CDP_TAG)$(DEBUG_FRESH)$(DEBUG_POSTFIX)" -f "${DOCKERDIR}/${DOCKERFILE}" --build-arg VERSION="${VERSION}" --build-arg BASE_IMAGE="${BASE_IMAGE}" --build-arg PACKAGER="${PACKAGER}" .

# docker build --rm --build-arg VERSION="${VERSION}" .

# docker build --rm -t "$(IMAGE):$(TAG)$(CDP_TAG)$(DEBUG_FRESH)$(DEBUG_POSTFIX)" -f "${DOCKERDIR}/${DOCKERFILE}" --build-arg VERSION="${VERSION}" .

# ${VERSION}

docker-local: build/cybertec-pg-operator
docker build --rm -t "$(IMAGE):$(TAG)$(CDP_TAG)$(DEBUG_FRESH)$(DEBUG_POSTFIX)" -f "${DOCKERDIR}/Dockerfile-dev" --build-arg VERSION="${VERSION}" --build-arg BASE_IMAGE="${BASE_IMAGE}" --build-arg PACKAGER="${PACKAGER}" .

echo `(env)`
echo "Tag ${TAG}"
echo "Version ${VERSION}"
echo "CDP tag ${CDP_TAG}"
echo "git describe $(shell git describe --tags --always --dirty)"
docker build --rm -t "$(IMAGE):$(TAG)$(CDP_TAG)$(DEBUG_FRESH)$(DEBUG_POSTFIX)" -f "${DOCKERDIR}/${DOCKERFILE}" --build-arg VERSION="${VERSION}" .

indocker-race:
docker run --rm -v "${GOPATH}":"${GOPATH}" -e GOPATH="${GOPATH}" -e RACE=1 -w ${PWD} golang:1.19.8 bash -c "make linux"
docker run --rm -v "${GOPATH}":"${GOPATH}" -e GOPATH="${GOPATH}" -e RACE=1 -w ${PWD} golang:1.21.7 bash -c "make linux"

push:
docker push "$(IMAGE):$(TAG)$(CDP_TAG)"
Expand All @@ -79,7 +97,7 @@ mocks:
GO111MODULE=on go generate ./...

tools:
GO111MODULE=on go get -d k8s.io/client-go@kubernetes-1.25.9
GO111MODULE=on go get -d k8s.io/client-go@kubernetes-1.28.7
GO111MODULE=on go install github.com/golang/mock/[email protected]
GO111MODULE=on go mod tidy

Expand Down
52 changes: 18 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# CYBERTEC PG Operator

CPO (CYBERTEC PG Operator) allows you to create and run PostgreSQL clusters on Kubernetes.

The operator reduces your efforts and simplifies the administration of your PostgreSQL clusters so that you can concentrate on other things.
# CYBERTEC PG Operator

CPO (CYBERTEC PG Operator) allows you to create and run PostgreSQL clusters on Kubernetes.

The operator reduces your efforts and simplifies the administration of your PostgreSQL clusters so that you can concentrate on other things.
<img src="docs/diagrams/logo.png" width="200">
<img src="docs/diagrams/cpo_logo.svg" width="350">

The Postgres Operator delivers an easy to run highly-available [PostgreSQL](https://www.postgresql.org/)
clusters on Kubernetes (K8s) powered by [Patroni](https://github.com/zalando/patroni).
Expand All @@ -22,7 +18,6 @@ pipelines with no access to Kubernetes API directly, promoting infrastructure as
* Database connection pooling with PGBouncer
* Support fast in place major version upgrade. Supports global upgrade of all clusters.
* Restore and cloning Postgres clusters on PVC, AWS, GCS and Azure
* Additionally logical backups to S3 or GCS bucket can be configured
* Standby cluster
* Configurable for non-cloud environments
* Basic credential and user management on K8s, eases application deployments
Expand All @@ -33,47 +28,36 @@ pipelines with no access to Kubernetes API directly, promoting infrastructure as

### PostgreSQL features

* Supports PostgreSQL 15, starting from 10+
* Supports PostgreSQL 16, starting from 10+
* Streaming replication cluster via Patroni
* Integrated backup solution, automatic backups and very easy restore (Backup & PITR)
* Rolling update procedure for adjustments to the pods and minor updates
* Major upgrade with minimum interruption time
* Reduction of downtime thanks to redundancy, pod anti-affinity, auto-failover and self-healing
* Supports PostgreSQL 16, starting from 10+
* Streaming replication cluster via Patroni
* Point-In-Time-Recovery with
[pg_basebackup](https://www.postgresql.org/docs/16/app-pgbasebackup.html) /
[pgBackRest](https://pgbackrest.org/) via [CYBERTEC-pg-container](https://github.com/cybertec-postgresql/CYBERTEC-pg-container)
[pg_stat_statements](https://www.postgresql.org/docs/15/pgstatstatements.html),
[pg_stat_statements](https://www.postgresql.org/docs/16/pgstatstatements.html),
* Incl. popular Postgres extensions such as
[pg_cron](https://github.com/citusdata/pg_cron),
[pg_partman](https://github.com/pgpartman/pg_partman),
[pgaudit](https://github.com/pgaudit/pgaudit),
[pgauditlogtofile](https://github.com/fmbiete/pgauditlogtofile),
<!-- [pg_partman](https://github.com/pgpartman/pg_partman), -->
[postgis](https://postgis.net/),
[set_user](https://github.com/pgaudit/set_user) and
[set_user](https://github.com/pgaudit/set_user)
[pg_cron](https://github.com/citusdata/pg_cron),
[timescaledb](https://github.com/timescale/timescaledb)
[credcheck](https://github.com/MigOpsRepos/credcheck)

The Postgres Operator has been developed at Zalando and is being used in
production for over five years.
The Operator project is being driven forward by CYBERTEC and is currently in production at various locations.

## Supported Postgres & K8s versions

| Release | Postgres versions | pgBackRest versions | Patroni versions | K8s versions | Golang |
| Release | Postgres versions | pgBackRest versions | Patroni versions | K8s versions | Golang |
| :-------- | :---------------: | :-------------------: | :--------------: | :----------------:| :-----: |
| latest | 13 &rarr; 16 | 2.51 | 3.2.2 | 1.21+ | 1.19.8 |
| next rc | 13 &rarr; 16 | 2.51 | 3.2.2 | 1.21+ | 1.22.1 |

* Integrated backup solution, automatic backups and very easy restore (snapshot & PITR)
* Rolling update procedure for adjustments to the pods and minor updates
* Major upgrade with minimum interruption time
* Reduction of downtime thanks to redundancy, pod anti-affinity, auto-failover and self-healing
* Supports PostgreSQL 16, starting from 13+
* Streaming replication cluster via Patroni
* Point-In-Time-Recovery with
[pg_basebackup](https://www.postgresql.org/docs/11/app-pgbasebackup.html) /
[pgBackRest](https://pgbackrest.org/) via [CYBERTEC-pg-container](https://github.com/cybertec-postgresql/CYBERTEC-pg-container)
[pg_stat_statements](https://www.postgresql.org/docs/15/pgstatstatements.html),
* Incl. popular Postgres extensions such as
[pg_cron](https://github.com/citusdata/pg_cron),
[pg_partman](https://github.com/pgpartman/pg_partman),
[postgis](https://postgis.net/),
[set_user](https://github.com/pgaudit/set_user) and
[timescaledb](https://github.com/timescale/timescaledb)
[credcheck](https://github.com/MigOpsRepos/credcheck)
| 0.7.0 | 12 &rarr; 16 | 2.52.1 | 3.3.1 | 1.21+ | 1.21.7 |
| next rc | 13 &rarr; 16 | 2.51 | 3.3.1 | 1.21+ | 1.21.7 |

## Getting started

Expand Down
4 changes: 2 additions & 2 deletions charts/postgres-operator-ui/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: postgres-operator-ui
version: 1.10.1
appVersion: 1.10.1
home: https://github.com/zalando/postgres-operator
home: https://github.com/cybertec-postgresql/cybertec-pg-operator
description: Postgres Operator UI provides a graphical interface for a convenient database-as-a-service user experience
keywords:
- postgres
Expand All @@ -15,5 +15,5 @@ maintainers:
- name: Zalando
email: [email protected]
sources:
- https://github.com/zalando/postgres-operator
- https://github.com/cybertec-postgresql/cybertec-pg-operator
engine: gotpl
32 changes: 16 additions & 16 deletions charts/postgres-operator-ui/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ entries:
description: Postgres Operator UI provides a graphical interface for a convenient
database-as-a-service user experience
digest: 2e5e7a82aebee519ec57c6243eb8735124aa4585a3a19c66ffd69638fbeb11ce
home: https://github.com/zalando/postgres-operator
home: https://github.com/cybertec-postgresql/cybertec-pg-operator
keywords:
- postgres
- operator
Expand All @@ -20,7 +20,7 @@ entries:
name: Zalando
name: postgres-operator-ui
sources:
- https://github.com/zalando/postgres-operator
- https://github.com/cybertec-postgresql/cybertec-pg-operator
urls:
- postgres-operator-ui-1.10.1.tgz
version: 1.10.1
Expand All @@ -30,7 +30,7 @@ entries:
description: Postgres Operator UI provides a graphical interface for a convenient
database-as-a-service user experience
digest: 47413650e3188539ae778a601998efa2c4f80b8aa16e3668a2fc7b72e014b605
home: https://github.com/zalando/postgres-operator
home: https://github.com/cybertec-postgresql/cybertec-pg-operator
keywords:
- postgres
- operator
Expand All @@ -43,7 +43,7 @@ entries:
name: Zalando
name: postgres-operator-ui
sources:
- https://github.com/zalando/postgres-operator
- https://github.com/cybertec-postgresql/cybertec-pg-operator
urls:
- postgres-operator-ui-1.10.0.tgz
version: 1.10.0
Expand All @@ -53,7 +53,7 @@ entries:
description: Postgres Operator UI provides a graphical interface for a convenient
database-as-a-service user experience
digest: df434af6c8b697fe0631017ecc25e3c79e125361ae6622347cea41a545153bdc
home: https://github.com/zalando/postgres-operator
home: https://github.com/cybertec-postgresql/cybertec-pg-operator
keywords:
- postgres
- operator
Expand All @@ -66,7 +66,7 @@ entries:
name: Zalando
name: postgres-operator-ui
sources:
- https://github.com/zalando/postgres-operator
- https://github.com/cybertec-postgresql/cybertec-pg-operator
urls:
- postgres-operator-ui-1.9.0.tgz
version: 1.9.0
Expand All @@ -76,7 +76,7 @@ entries:
description: Postgres Operator UI provides a graphical interface for a convenient
database-as-a-service user experience
digest: fbfc90fa8fd007a08a7c02e0ec9108bb8282cbb42b8c976d88f2193d6edff30c
home: https://github.com/zalando/postgres-operator
home: https://github.com/cybertec-postgresql/cybertec-pg-operator
keywords:
- postgres
- operator
Expand All @@ -89,7 +89,7 @@ entries:
name: Zalando
name: postgres-operator-ui
sources:
- https://github.com/zalando/postgres-operator
- https://github.com/cybertec-postgresql/cybertec-pg-operator
urls:
- postgres-operator-ui-1.8.2.tgz
version: 1.8.2
Expand All @@ -99,7 +99,7 @@ entries:
description: Postgres Operator UI provides a graphical interface for a convenient
database-as-a-service user experience
digest: d26342e385ea51a0fbfbe23477999863e9489664ae803ea5c56da8897db84d24
home: https://github.com/zalando/postgres-operator
home: https://github.com/cybertec-postgresql/cybertec-pg-operator
keywords:
- postgres
- operator
Expand All @@ -112,7 +112,7 @@ entries:
name: Zalando
name: postgres-operator-ui
sources:
- https://github.com/zalando/postgres-operator
- https://github.com/cybertec-postgresql/cybertec-pg-operator
urls:
- postgres-operator-ui-1.8.1.tgz
version: 1.8.1
Expand All @@ -122,7 +122,7 @@ entries:
description: Postgres Operator UI provides a graphical interface for a convenient
database-as-a-service user experience
digest: d4a7b40c23fd167841cc28342afdbd5ecc809181913a5c31061c83139187f148
home: https://github.com/zalando/postgres-operator
home: https://github.com/cybertec-postgresql/cybertec-pg-operator
keywords:
- postgres
- operator
Expand All @@ -135,7 +135,7 @@ entries:
name: Zalando
name: postgres-operator-ui
sources:
- https://github.com/zalando/postgres-operator
- https://github.com/cybertec-postgresql/cybertec-pg-operator
urls:
- postgres-operator-ui-1.8.0.tgz
version: 1.8.0
Expand All @@ -145,7 +145,7 @@ entries:
description: Postgres Operator UI provides a graphical interface for a convenient
database-as-a-service user experience
digest: 97aed1a1d37cd5f8441eea9522f38e56cc829786ad2134c437a5e6a15c995869
home: https://github.com/zalando/postgres-operator
home: https://github.com/cybertec-postgresql/cybertec-pg-operator
keywords:
- postgres
- operator
Expand All @@ -158,7 +158,7 @@ entries:
name: Zalando
name: postgres-operator-ui
sources:
- https://github.com/zalando/postgres-operator
- https://github.com/cybertec-postgresql/cybertec-pg-operator
urls:
- postgres-operator-ui-1.7.1.tgz
version: 1.7.1
Expand All @@ -168,7 +168,7 @@ entries:
description: Postgres Operator UI provides a graphical interface for a convenient
database-as-a-service user experience
digest: 37fba1968347daad393dbd1c6ee6e5b6a24d1095f972c0102197531c62dcada8
home: https://github.com/zalando/postgres-operator
home: https://github.com/cybertec-postgresql/cybertec-pg-operator
keywords:
- postgres
- operator
Expand All @@ -181,7 +181,7 @@ entries:
name: Zalando
name: postgres-operator-ui
sources:
- https://github.com/zalando/postgres-operator
- https://github.com/cybertec-postgresql/cybertec-pg-operator
urls:
- postgres-operator-ui-1.7.0.tgz
version: 1.7.0
Expand Down
Loading

0 comments on commit 8ce6b79

Please sign in to comment.