Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
88735a7
Resize volume by changing pvc size if enabled in config. (#958)
yanchenko-igor Jul 3, 2020
c10d309
bump pgBouncer image (#1050)
FxKu Jul 8, 2020
b80f976
test coverage (#1055)
yanchenko-igor Jul 10, 2020
3759634
delete secrets the right way (#1054)
FxKu Jul 10, 2020
ec932f8
Port-forward service instead of pod (#1040)
toonsevrin Jul 15, 2020
002b47e
Use scram-sha-256 hash if postgresql parameter password_encryption se…
yanchenko-igor Jul 16, 2020
102a353
update dependencies (#1080)
FxKu Jul 29, 2020
ece341d
Allow pod environment variables to also be sourced from a secret (#946)
frittentheke Jul 30, 2020
aab9b0a
chart ui: fix target namespace to allow '*' (#1082)
arichardet Jul 30, 2020
3bee590
fix index in TestGenerateSpiloPodEnvVarswq (#1084)
FxKu Jul 30, 2020
47b11f7
change Clone attribute of PostgresSpec to *CloneDescription (#1020)
hlihhovac Jul 30, 2020
f3ddce8
fix random order for pod environment tests (#1085)
FxKu Jul 30, 2020
7cf2fae
[WIP] Extend infrastructure roles handling (#1064)
erthalion Aug 5, 2020
43163cf
allow using both infrastructure_roles_options (#1090)
FxKu Aug 10, 2020
0508266
Remove all secrets on delete incl. pooler (#1091)
FxKu Aug 10, 2020
dfd0dd9
set search_path for default roles (#1065)
FxKu Aug 11, 2020
fc9ee76
UI Service port forwarding internal port is updated to 80 from 8081. …
sonaysevik Aug 11, 2020
808030a
update go modules (#1097)
FxKu Aug 12, 2020
0d81f97
Added build and node directory to gitignore file. (#1102)
Jan-M Aug 12, 2020
3ddc56e
allow delete only if annotations meet configured criteria (#1069)
FxKu Aug 13, 2020
dab704c
Add kustomize support to Postgres UI. (#1086)
hoangelos Aug 26, 2020
248ce9f
Update to go 1.14.7 (#1122)
FxKu Aug 26, 2020
30c8675
update kind and use with old storage class (#1121)
FxKu Aug 28, 2020
5e93aab
improve e2e test debugging (#1107)
FxKu Aug 28, 2020
e03e9f9
add missing omitempty directive to the attributes of PostgresSpec (#1…
hlihhovac Aug 31, 2020
03437b6
Update issue templates (#1051)
FxKu Sep 3, 2020
d8884a4
Allow to overwrite default ExternalTrafficPolicy for the service (#1136)
yanchenko-igor Sep 15, 2020
d09e418
Set user and group in security context (#1083)
ricoberger Sep 15, 2020
ab95eaa
Fixes #1130 (#1139)
neelasha-09 Sep 22, 2020
2a21cc4
Compare Postgres pod priority on Sync (#1144)
sdudoladov Sep 23, 2020
ffdb47f
remove outdated GSOC info (#1148)
sdudoladov Sep 25, 2020
3b6dc4f
Improve e2e tests (#1111)
sdudoladov Sep 25, 2020
21475f4
Cleanup config examples (#1151)
FxKu Sep 30, 2020
38e1518
update kind (#1156)
sdudoladov Oct 2, 2020
692c721
Introduce ENABLE_JSON_LOGGING env variable (#1158)
dajudge Oct 8, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/postgres-operator-issue-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Postgres Operator issue template
about: How are you using the operator?
title: ''
labels: ''
assignees: ''

---

Please, answer some short questions which should help us to understand your problem / question better?

- **Which image of the operator are you using?** e.g. registry.opensource.zalan.do/acid/postgres-operator:v1.5.0
- **Where do you run it - cloud or metal? Kubernetes or OpenShift?** [AWS K8s | GCP ... | Bare Metal K8s]
- **Are you running Postgres Operator in production?** [yes | no]
- **Type of issue?** [Bug report, question, feature request, etc.]

Some general remarks when posting a bug report:
- Please, check the operator, pod (Patroni) and postgresql logs first. When copy-pasting many log lines please do it in a separate GitHub gist together with your Postgres CRD and configuration manifest.
- If you feel this issue might be more related to the [Spilo](https://github.com/zalando/spilo/issues) docker image or [Patroni](https://github.com/zalando/patroni/issues), consider opening issues in the respective repos.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ _testmain.go
/docker/build/
/github.com/
.idea
.vscode

scm-source.json

Expand All @@ -47,6 +48,8 @@ __pycache__/

# Distribution / packaging
.Python
ui/app/node_modules
ui/operator_ui/static/build
build/
develop-eggs/
dist/
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ install:

script:
- hack/verify-codegen.sh
- travis_wait 20 goveralls -service=travis-ci -package ./pkg/... -v
- travis_wait 20 go test -race -covermode atomic -coverprofile=profile.cov ./pkg/... -v
- goveralls -coverprofile=profile.cov -service=travis-ci -v
- make e2e
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ scm-source.json: .git

tools:
GO111MODULE=on go get -u honnef.co/go/tools/cmd/staticcheck
GO111MODULE=on go get k8s.io/client-go@kubernetes-1.16.3
GO111MODULE=on go get k8s.io/client-go@kubernetes-1.18.8
GO111MODULE=on go mod tidy

fmt:
Expand All @@ -97,4 +97,4 @@ test:
GO111MODULE=on go test ./...

e2e: docker # build operator image to be tested
cd e2e; make tools e2etest clean
cd e2e; make e2etest
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@ There is a browser-friendly version of this documentation at
* [Postgres manifest reference](docs/reference/cluster_manifest.md)
* [Command-line options and environment variables](docs/reference/command_line_and_environment.md)

## Google Summer of Code

The Postgres Operator made it to the [Google Summer of Code 2019](https://summerofcode.withgoogle.com/organizations/5429926902104064/)!
Check [our ideas](docs/gsoc-2019/ideas.md#google-summer-of-code-2019)
and start discussions in [the issue tracker](https://github.com/zalando/postgres-operator/issues).

## Community

There are two places to get in touch with the community:
Expand Down
2 changes: 1 addition & 1 deletion charts/postgres-operator-ui/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ spec:
- name: "RESOURCES_VISIBLE"
value: "{{ .Values.envs.resourcesVisible }}"
- name: "TARGET_NAMESPACE"
value: {{ .Values.envs.targetNamespace }}
value: "{{ .Values.envs.targetNamespace }}"
- name: "TEAMS"
value: |-
[
Expand Down
41 changes: 41 additions & 0 deletions charts/postgres-operator/crds/operatorconfigurations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ spec:
type: object
additionalProperties:
type: string
delete_annotation_date_key:
type: string
delete_annotation_name_key:
type: string
downscaler_annotations:
type: array
items:
Expand All @@ -131,6 +135,32 @@ spec:
type: boolean
infrastructure_roles_secret_name:
type: string
infrastructure_roles_secrets:
type: array
nullable: true
items:
type: object
required:
- secretname
- userkey
- passwordkey
properties:
secretname:
type: string
userkey:
type: string
passwordkey:
type: string
rolekey:
type: string
defaultuservalue:
type: string
defaultrolevalue:
type: string
details:
type: string
template:
type: boolean
inherited_labels:
type: array
items:
Expand All @@ -149,6 +179,8 @@ spec:
type: string
pod_environment_configmap:
type: string
pod_environment_secret:
type: string
pod_management_policy:
type: string
enum:
Expand All @@ -168,6 +200,10 @@ spec:
type: string
secret_name_template:
type: string
spilo_runasuser:
type: integer
spilo_runasgroup:
type: integer
spilo_fsgroup:
type: integer
spilo_privileged:
Expand Down Expand Up @@ -227,6 +263,11 @@ spec:
type: boolean
enable_replica_load_balancer:
type: boolean
external_traffic_policy:
type: string
enum:
- "Cluster"
- "Local"
master_dns_name_format:
type: string
replica_dns_name_format:
Expand Down
4 changes: 4 additions & 0 deletions charts/postgres-operator/crds/postgresqls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,10 @@ spec:
items:
type: object
additionalProperties: true
spiloRunAsUser:
type: integer
spiloRunAsGroup:
type: integer
spiloFSGroup:
type: integer
standby:
Expand Down
3 changes: 3 additions & 0 deletions charts/postgres-operator/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
data:
{{- if .Values.podPriorityClassName }}
pod_priority_class_name: {{ .Values.podPriorityClassName }}
{{- end }}
pod_service_account_name: {{ include "postgres-pod.serviceAccountName" . }}
{{ toYaml .Values.configGeneral | indent 2 }}
{{ toYaml .Values.configUsers | indent 2 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/postgres-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ spec:
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
{{- if .Values.enableJsonLogging }}
- name: ENABLE_JSON_LOGGING
value: "true"
{{- end }}
{{- if eq .Values.configTarget "ConfigMap" }}
- name: CONFIG_MAP_NAME
value: {{ template "postgres-operator.fullname" . }}
Expand Down
3 changes: 3 additions & 0 deletions charts/postgres-operator/templates/operatorconfiguration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ configuration:
users:
{{ toYaml .Values.configUsers | indent 4 }}
kubernetes:
{{- if .Values.podPriorityClassName }}
pod_priority_class_name: {{ .Values.podPriorityClassName }}
{{- end }}
pod_service_account_name: {{ include "postgres-pod.serviceAccountName" . }}
oauth_token_secret_name: {{ template "postgres-operator.fullname" . }}
{{ toYaml .Values.configKubernetes | indent 4 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if .Values.podPriorityClassName }}
apiVersion: scheduling.k8s.io/v1
description: 'Use only for databases controlled by Postgres operator'
kind: PriorityClass
metadata:
labels:
app.kubernetes.io/name: {{ template "postgres-operator.name" . }}
helm.sh/chart: {{ template "postgres-operator.chart" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
name: {{ .Values.podPriorityClassName }}
preemptionPolicy: PreemptLowerPriority
globalDefault: false
value: 1000000
{{- end }}
21 changes: 20 additions & 1 deletion charts/postgres-operator/values-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ configKubernetes:
# keya: valuea
# keyb: valueb

# key name for annotation that compares manifest value with current date
# delete_annotation_date_key: "delete-date"

# key name for annotation that compares manifest value with cluster name
# delete_annotation_name_key: "delete-clustername"

# list of annotations propagated from cluster manifest to statefulset and deployment
# downscaler_annotations:
# - deployment-time
Expand Down Expand Up @@ -104,6 +110,8 @@ configKubernetes:
pod_antiaffinity_topology_key: "kubernetes.io/hostname"
# namespaced name of the ConfigMap with environment variables to populate on every pod
# pod_environment_configmap: "default/my-custom-config"
# name of the Secret (in cluster namespace) with environment variables to populate on every pod
# pod_environment_secret: "my-custom-secret"

# specify the pod management policy of stateful sets of Postgres clusters
pod_management_policy: "ordered_ready"
Expand All @@ -119,11 +127,16 @@ configKubernetes:
pod_terminate_grace_period: 5m
# template for database user secrets generated by the operator
secret_name_template: "{username}.{cluster}.credentials.{tprkind}.{tprgroup}"
# set user and group for the spilo container (required to run Spilo as non-root process)
# spilo_runasuser: "101"
# spilo_runasgroup: "103"
# group ID with write-access to volumes (required to run Spilo as non-root process)
# spilo_fsgroup: 103

# whether the Spilo container should run in privileged mode
spilo_privileged: false
# storage resize strategy, available options are: ebs, pvc, off
storage_resize_mode: ebs
# operator watches for postgres objects in the given namespace
watched_namespace: "*" # listen to all namespaces

Expand Down Expand Up @@ -170,6 +183,8 @@ configLoadBalancer:
enable_master_load_balancer: false
# toggles service type load balancer pointing to the replica pod of the cluster
enable_replica_load_balancer: false
# define external traffic policy for the load balancer
external_traffic_policy: "Cluster"
# defines the DNS name string template for the master load balancer cluster
master_dns_name_format: "{cluster}.{team}.{hostedzone}"
# defines the DNS name string template for the replica load balancer cluster
Expand Down Expand Up @@ -271,7 +286,7 @@ configConnectionPooler:
# db user for pooler to use
connection_pooler_user: "pooler"
# docker image
connection_pooler_image: "registry.opensource.zalan.do/acid/pgbouncer:master-8"
connection_pooler_image: "registry.opensource.zalan.do/acid/pgbouncer:master-9"
# max db connections the pooler should hold
connection_pooler_max_db_connections: 60
# default pooling mode
Expand Down Expand Up @@ -305,8 +320,12 @@ podServiceAccount:
# If not set a name is generated using the fullname template and "-pod" suffix
name: "postgres-pod"

# priority class for operator pod
priorityClassName: ""

# priority class for database pods
podPriorityClassName: ""

resources:
limits:
cpu: 500m
Expand Down
24 changes: 23 additions & 1 deletion charts/postgres-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ podLabels: {}

configTarget: "ConfigMap"

# JSON logging format
enableJsonLogging: false

# general configuration parameters
configGeneral:
# choose if deployment creates/updates CRDs with OpenAPIV3Validation
Expand Down Expand Up @@ -63,6 +66,12 @@ configKubernetes:
# annotations attached to each database pod
# custom_pod_annotations: "keya:valuea,keyb:valueb"

# key name for annotation that compares manifest value with current date
# delete_annotation_date_key: "delete-date"

# key name for annotation that compares manifest value with cluster name
# delete_annotation_name_key: "delete-clustername"

# list of annotations propagated from cluster manifest to statefulset and deployment
# downscaler_annotations: "deployment-time,downscaler/*"

Expand Down Expand Up @@ -95,6 +104,8 @@ configKubernetes:
pod_antiaffinity_topology_key: "kubernetes.io/hostname"
# namespaced name of the ConfigMap with environment variables to populate on every pod
# pod_environment_configmap: "default/my-custom-config"
# name of the Secret (in cluster namespace) with environment variables to populate on every pod
# pod_environment_secret: "my-custom-secret"

# specify the pod management policy of stateful sets of Postgres clusters
pod_management_policy: "ordered_ready"
Expand All @@ -110,11 +121,16 @@ configKubernetes:
pod_terminate_grace_period: 5m
# template for database user secrets generated by the operator
secret_name_template: "{username}.{cluster}.credentials.{tprkind}.{tprgroup}"
# set user and group for the spilo container (required to run Spilo as non-root process)
# spilo_runasuser: "101"
# spilo_runasgroup: "103"
# group ID with write-access to volumes (required to run Spilo as non-root process)
# spilo_fsgroup: "103"

# whether the Spilo container should run in privileged mode
spilo_privileged: "false"
# storage resize strategy, available options are: ebs, pvc, off
storage_resize_mode: ebs
# operator watches for postgres objects in the given namespace
watched_namespace: "*" # listen to all namespaces

Expand Down Expand Up @@ -159,6 +175,8 @@ configLoadBalancer:
enable_master_load_balancer: "false"
# toggles service type load balancer pointing to the replica pod of the cluster
enable_replica_load_balancer: "false"
# define external traffic policy for the load balancer
external_traffic_policy: "Cluster"
# defines the DNS name string template for the master load balancer cluster
master_dns_name_format: '{cluster}.{team}.{hostedzone}'
# defines the DNS name string template for the replica load balancer cluster
Expand Down Expand Up @@ -263,7 +281,7 @@ configConnectionPooler:
# db user for pooler to use
connection_pooler_user: "pooler"
# docker image
connection_pooler_image: "registry.opensource.zalan.do/acid/pgbouncer:master-8"
connection_pooler_image: "registry.opensource.zalan.do/acid/pgbouncer:master-9"
# max db connections the pooler should hold
connection_pooler_max_db_connections: "60"
# default pooling mode
Expand Down Expand Up @@ -297,8 +315,12 @@ podServiceAccount:
# If not set a name is generated using the fullname template and "-pod" suffix
name: "postgres-pod"

# priority class for operator pod
priorityClassName: ""

# priority class for database pods
podPriorityClassName: ""

resources:
limits:
cpu: 500m
Expand Down
7 changes: 6 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"flag"
"log"
log "github.com/sirupsen/logrus"
"os"
"os/signal"
"sync"
Expand Down Expand Up @@ -36,6 +36,8 @@ func init() {
flag.BoolVar(&config.NoTeamsAPI, "noteamsapi", false, "Disable all access to the teams API")
flag.Parse()

config.EnableJsonLogging = os.Getenv("ENABLE_JSON_LOGGING") == "true"

configMapRawName := os.Getenv("CONFIG_MAP_NAME")
if configMapRawName != "" {

Expand Down Expand Up @@ -63,6 +65,9 @@ func init() {
func main() {
var err error

if config.EnableJsonLogging {
log.SetFormatter(&log.JSONFormatter{})
}
log.SetOutput(os.Stdout)
log.Printf("Spilo operator %s\n", version)

Expand Down
Loading