Skip to content

Commit

Permalink
Add multisite feature to operator
Browse files Browse the repository at this point in the history
  • Loading branch information
ants authored Oct 14, 2024
2 parents 24a326c + 5f10037 commit acef3d2
Show file tree
Hide file tree
Showing 52 changed files with 1,516 additions and 241 deletions.
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
The MIT License (MIT)

Copyright (c) 2023 Zalando SE
2024 CYBERTEC PostgreSQL International GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
9 changes: 3 additions & 6 deletions MAINTAINERS
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
Sergey Dudoladov <[email protected]>
Felix Kunde <[email protected]>
Jan Mussler <[email protected]>
Jociele Padilha <[email protected]>
Ida Novindasari <[email protected]>
Polina Bungina <[email protected]>
Matthias Grömmer <[email protected]>
Ants Aasma <[email protected]>
Rafia Sabih <[email protected]>
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ The Operator project is being driven forward by CYBERTEC and is currently in pro

| Release | Postgres versions | pgBackRest versions | Patroni versions | K8s versions | Golang |
| :-------- | :---------------: | :-------------------: | :--------------: | :----------------:| :-----: |
| 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 |
| 0.8.0 | 13 &rarr; 17 | 2.53 | 4.0.2 | 1.21+ | 1.21.7 |

## Getting started

Expand All @@ -73,4 +72,4 @@ There is a browser-friendly version of this documentation at

## Community

Coming soon
Coming soon
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Security

If you have discovered a security vulnerability, please email tech-security@zalando.de.
If you have discovered a security vulnerability, please email security@cybertec.at.
23 changes: 23 additions & 0 deletions charts/postgres-cluster/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
17 changes: 17 additions & 0 deletions charts/postgres-cluster/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v2
name: postgres-cluster
description: Deploys a PostgreSQL cluster using the PostgreSQL operator

type: application
version: 0.8.0

appVersion: "0.8.0-1"

maintainers:
- name: CYBERTEC PostgreSQL International GmbH
email: [email protected]

sources:
- https://github.com/cybertec-postgresql/cybertec-pg-operator

engine: gotpl
19 changes: 19 additions & 0 deletions charts/postgres-cluster/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
entries:
postgres-cluster:
- apiVersion: v2
appVersion: 0.8.0-1
created: "2024-10-14T00:52:56.851410174+03:00"
description: Deploys a PostgreSQL cluster using the PostgreSQL operator
digest: f275636dc39a2db215633cc3d7449e86fd18d1cc29aed7f06af5006137bebad5
maintainers:
- email: [email protected]
name: CYBERTEC PostgreSQL International GmbH
name: postgres-cluster
sources:
- https://github.com/cybertec-postgresql/cybertec-pg-operator
type: application
urls:
- postgres-cluster-0.8.0.tgz
version: 0.8.0
generated: "2024-10-14T00:52:56.850805082+03:00"
Binary file not shown.
5 changes: 5 additions & 0 deletions charts/postgres-cluster/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Database cluster object has been created and the operator should start initializing it now.

To wait for the initialization to complete you can issue the following command:

kubectl wait --for=jsonpath='.status.PostgresClusterStatus'=Running -n {{ .Release.Namespace }} pg/{{ .Release.Name }} --timeout=1h
50 changes: 50 additions & 0 deletions charts/postgres-cluster/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "postgres-cluster.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "postgres-cluster.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "postgres-cluster.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "postgres-cluster.labels" -}}
helm.sh/chart: {{ include "postgres-cluster.chart" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "postgres-cluster.selectorLabels" -}}
app.kubernetes.io/name: {{ include "postgres-cluster.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
17 changes: 17 additions & 0 deletions charts/postgres-cluster/templates/postgresql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: cpo.opensource.cybertec.at/v1
kind: postgresql
metadata:
name: {{ .Values.clusterName | default .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "postgres-cluster.labels" . | nindent 4 }}
{{- with .Values.commonLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.extraAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end}}

spec:
{{- toYaml .Values.cluster | nindent 2 }}
Loading

0 comments on commit acef3d2

Please sign in to comment.