diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3a40a700b..b2688318a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,7 +5,7 @@ Wanna contribute to the Postgres Operator? Yay - here is how! ## Reporting issues If you have a question about patroni or have a problem using it, please read the`README` before filing an issue. -Also double check with the current issues on our [Issues Tracker](https://github.com/zalando/postgres-operator/issues). +Also double check with the current issues on our [Issues Tracker](https://github.com/pocorschi/postgres-operator/issues). ## Contributing a pull request diff --git a/README.md b/README.md index d7505477d..c5e774c53 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,15 @@ [![Build Status](https://travis-ci.org/zalando/postgres-operator.svg?branch=master)](https://travis-ci.org/zalando/postgres-operator) [![Coverage Status](https://coveralls.io/repos/github/zalando/postgres-operator/badge.svg)](https://coveralls.io/github/zalando/postgres-operator) -[![Go Report Card](https://goreportcard.com/badge/github.com/zalando/postgres-operator)](https://goreportcard.com/report/github.com/zalando/postgres-operator) -[![GoDoc](https://godoc.org/github.com/zalando/postgres-operator?status.svg)](https://godoc.org/github.com/zalando/postgres-operator) -[![golangci](https://golangci.com/badges/github.com/zalando/postgres-operator.svg)](https://golangci.com/r/github.com/zalando/postgres-operator) +[![Go Report Card](https://goreportcard.com/badge/github.com/pocorschi/postgres-operator)](https://goreportcard.com/report/github.com/pocorschi/postgres-operator) +[![GoDoc](https://godoc.org/github.com/pocorschi/postgres-operator?status.svg)](https://godoc.org/github.com/pocorschi/postgres-operator) +[![golangci](https://golangci.com/badges/github.com/pocorschi/postgres-operator.svg)](https://golangci.com/r/github.com/pocorschi/postgres-operator) # Google Summer of Code -The Postgres Operator made it to the [Google Summer of Code 2019](https://summerofcode.withgoogle.com/)! As a brand new mentoring organization, we are now looking for our first mentees. Check [our ideas](https://github.com/zalando/postgres-operator/blob/master/docs/gsoc-2019/ideas.md#google-summer-of-code-2019) and start discussion in [the issue tracker](https://github.com/zalando/postgres-operator/issues). And don't forget to spread a word about our GSoC participation to attract even more students. +The Postgres Operator made it to the [Google Summer of Code 2019](https://summerofcode.withgoogle.com/)! As a brand new mentoring organization, we are now looking for our first mentees. Check [our ideas](https://github.com/pocorschi/postgres-operator/blob/master/docs/gsoc-2019/ideas.md#google-summer-of-code-2019) and start discussion in [the issue tracker](https://github.com/pocorschi/postgres-operator/issues). And don't forget to spread a word about our GSoC participation to attract even more students. ## Introduction @@ -67,7 +67,7 @@ the rest of the document is a tutorial to get you up and running with the operat ## Community There are two places to get in touch with the community: -1. The [GitHub issue tracker](https://github.com/zalando/postgres-operator/issues) +1. The [GitHub issue tracker](https://github.com/pocorschi/postgres-operator/issues) 2. The #postgres-operator slack channel under [Postgres Slack](https://postgres-slack.herokuapp.com) ## Quickstart @@ -85,7 +85,7 @@ built-in Kubernetes support. ### Local execution ```bash -git clone https://github.com/zalando/postgres-operator.git +git clone https://github.com/pocorschi/postgres-operator.git cd postgres-operator minikube start diff --git a/cmd/main.go b/cmd/main.go index 7fadd611a..4b82784d3 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -9,9 +9,9 @@ import ( "syscall" "time" - "github.com/zalando/postgres-operator/pkg/controller" - "github.com/zalando/postgres-operator/pkg/spec" - "github.com/zalando/postgres-operator/pkg/util/k8sutil" + "github.com/pocorschi/postgres-operator/pkg/controller" + "github.com/pocorschi/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/util/k8sutil" ) var ( @@ -65,6 +65,7 @@ func main() { log.SetOutput(os.Stdout) log.Printf("Spilo operator %s\n", version) + log.Printf("my operator %s\n", "6") sigs := make(chan os.Signal, 1) stop := make(chan struct{}) diff --git a/docs/developer.md b/docs/developer.md index 8132be018..a341ccb79 100644 --- a/docs/developer.md +++ b/docs/developer.md @@ -93,14 +93,14 @@ would create a directory for the GOPATH (i.e. ~/go) and place the source code under the ~/go/src subdirectories. Given the schema above, the postgres operator source code located at -`github.com/zalando/postgres-operator` should be put at --`~/go/src/github.com/zalando/postgres-operator`. +`github.com/pocorschi/postgres-operator` should be put at +-`~/go/src/github.com/pocorschi/postgres-operator`. ```bash $ export GOPATH=~/go $ mkdir -p ${GOPATH}/src/github.com/zalando/ $ cd ${GOPATH}/src/github.com/zalando/ - $ git clone https://github.com/zalando/postgres-operator.git + $ git clone https://github.com/pocorschi/postgres-operator.git ``` ## Building the operator @@ -157,7 +157,7 @@ The operator employs k8s-provided code generation to obtain deep copy methods an the `verify-codegen.sh` checks if the generated code is up-to-date (to be used within CI). The `/pkg/generated/` contains the resultant code. To make these scripts work, you may need to `export GOPATH=$(go env GOPATH)` References for code generation are: -* [Relevant pull request](https://github.com/zalando/postgres-operator/pull/369) +* [Relevant pull request](https://github.com/pocorschi/postgres-operator/pull/369) See comments there for minor issues that can sometimes broke the generation process. * [Code generator source code](https://github.com/kubernetes/code-generator) * [Code Generation for CustomResources](https://blog.openshift.com/kubernetes-deep-dive-code-generation-customresources/) - intro post on the topic diff --git a/docs/gsoc-2019/ideas.md b/docs/gsoc-2019/ideas.md index 23a3e3eb7..b8523948e 100644 --- a/docs/gsoc-2019/ideas.md +++ b/docs/gsoc-2019/ideas.md @@ -6,7 +6,7 @@ 1. Please carefully read the official [Google Summer of Code Student Guide](https://google.github.io/gsocguides/student/) 2. Join the #postgres-operator slack channel under [Postgres Slack](https://postgres-slack.herokuapp.com) to introduce yourself to the community and get quick feedback on your application. 3. Select a project from the list of ideas below or propose your own. -4. Write a proposal draft. Please open an issue with the label `gsoc2019_application` in the [operator repository](https://github.com/zalando/postgres-operator/issues) so that the community members can publicly review it. See proposal instructions below for details. +4. Write a proposal draft. Please open an issue with the label `gsoc2019_application` in the [operator repository](https://github.com/pocorschi/postgres-operator/issues) so that the community members can publicly review it. See proposal instructions below for details. 5. Submit proposal and the proof of enrollment before April 9 2019 18:00 UTC through the web site of the Program. ## Project ideas @@ -34,7 +34,7 @@ It will be helpful to reject erroneous manifests before they reach the operator * **Recommended skills**: golang, JSON schema * **Difficulty**: medium * **Mentor(s)**: Sergey Dudoladov [@sdudoladov](https://github.com/sdudoladov) -* **Issue**: [#388](https://github.com/zalando/postgres-operator/issues/388) +* **Issue**: [#388](https://github.com/pocorschi/postgres-operator/issues/388) ### Design a solution for the local testing of the operator @@ -45,7 +45,7 @@ A promising option is the Kubernetes own [kind](https://github.com/kubernetes-si * **Recommended skills**: Docker, shell scripting, basic Kubernetes abstractions * **Difficulty**: medium to hard depending on the selected desing * **Mentor(s)**: Dmitry Dolgov [@erthalion](https://github.com/erthalion), Sergey Dudoladov [@sdudoladov](https://github.com/sdudoladov) -* **Issue**: [#475](https://github.com/zalando/postgres-operator/issues/475) +* **Issue**: [#475](https://github.com/pocorschi/postgres-operator/issues/475) ### Detach a Postgres cluster from the operator for maintenance @@ -54,11 +54,11 @@ A promising option is the Kubernetes own [kind](https://github.com/kubernetes-si * **Recommended skills**: golang, architecture of a Kubernetes operator * **Difficulty**: hard - requires significant modification of the operator's internals and careful consideration of the corner cases. * **Mentor(s)**: Dmitry Dolgov [@erthalion](https://github.com/erthalion), Sergey Dudoladov [@sdudoladov](https://github.com/sdudoladov) -* **Issue**: [#421](https://github.com/zalando/postgres-operator/issues/421) +* **Issue**: [#421](https://github.com/pocorschi/postgres-operator/issues/421) ### Propose your own idea Feel free to come up with your own ideas. For inspiration, -see [our bug tracker](https://github.com/zalando/postgres-operator/issues), +see [our bug tracker](https://github.com/pocorschi/postgres-operator/issues), the [official `CustomResouceDefinition` docs](https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/) and [other operators](https://github.com/operator-framework/awesome-operators). \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 5b8479a91..8639513fe 100644 --- a/docs/index.md +++ b/docs/index.md @@ -8,10 +8,10 @@ manages PostgreSQL clusters on Kubernetes: user submits a new manifest, the operator fetches that manifest and spawns a new Postgres cluster along with all necessary entities such as Kubernetes StatefulSets and Postgres roles. See this - [Postgres cluster manifest](https://github.com/zalando/postgres-operator/blob/master/manifests/complete-postgres-manifest.yaml) + [Postgres cluster manifest](https://github.com/pocorschi/postgres-operator/blob/master/manifests/complete-postgres-manifest.yaml) for settings that a manifest may contain. -2. The operator also watches updates to [its own configuration](https://github.com/zalando/postgres-operator/blob/master/manifests/configmap.yaml) +2. The operator also watches updates to [its own configuration](https://github.com/pocorschi/postgres-operator/blob/master/manifests/configmap.yaml) and alters running Postgres clusters if necessary. For instance, if a pod docker image is changed, the operator carries out the rolling update. That is, the operator re-spawns one-by-one pods of each StatefulSet it manages @@ -47,7 +47,7 @@ the operator is deployed to multiple Kubernetes clusters, where users deploy manifests via our CI/CD infrastructure or rely on a slim user interface to create manifests. -Please, report any issues discovered to https://github.com/zalando/postgres-operator/issues. +Please, report any issues discovered to https://github.com/pocorschi/postgres-operator/issues. ## Talks diff --git a/docs/quickstart.md b/docs/quickstart.md index 7b662e420..4c0a8ce2d 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -13,7 +13,7 @@ built-in Kubernetes support. ## Local execution ```bash -git clone https://github.com/zalando/postgres-operator.git +git clone https://github.com/pocorschi/postgres-operator.git cd postgres-operator minikube start diff --git a/docs/reference/cluster_manifest.md b/docs/reference/cluster_manifest.md index f1491525d..dad209ef3 100644 --- a/docs/reference/cluster_manifest.md +++ b/docs/reference/cluster_manifest.md @@ -3,9 +3,9 @@ Individual postgres clusters are described by the Kubernetes *cluster manifest* that has the structure defined by the `postgres CRD` (custom resource definition). The following section describes the structure of the manifest and the purpose of individual keys. You can take a look at the examples of the -[minimal](https://github.com/zalando/postgres-operator/blob/master/manifests/minimal-postgres-manifest.yaml) +[minimal](https://github.com/pocorschi/postgres-operator/blob/master/manifests/minimal-postgres-manifest.yaml) and the -[complete](https://github.com/zalando/postgres-operator/blob/master/manifests/complete-postgres-manifest.yaml) +[complete](https://github.com/pocorschi/postgres-operator/blob/master/manifests/complete-postgres-manifest.yaml) cluster manifests. When Kubernetes resources, such as memory, CPU or volumes, are configured, diff --git a/docs/reference/operator_parameters.md b/docs/reference/operator_parameters.md index 5b5f33199..b5d8a352d 100644 --- a/docs/reference/operator_parameters.md +++ b/docs/reference/operator_parameters.md @@ -1,37 +1,39 @@ There are two mutually-exclusive methods to set the Postgres Operator configuration. -* ConfigMaps-based, the legacy one. The configuration is supplied in a +- ConfigMaps-based, the legacy one. The configuration is supplied in a key-value configmap, defined by the `CONFIG_MAP_NAME` environment variable. Non-scalar values, i.e. lists or maps, are encoded in the value strings using the comma-based syntax for lists and coma-separated `key:value` syntax for maps. String values containing ':' should be enclosed in quotes. The configuration is flat, parameter group names below are not reflected in the configuration structure. There is an - [example](https://github.com/zalando/postgres-operator/blob/master/manifests/configmap.yaml) + [example](https://github.com/pocorschi/postgres-operator/blob/master/manifests/configmap.yaml) -* CRD-based configuration. The configuration is stored in a custom YAML +- CRD-based configuration. The configuration is stored in a custom YAML manifest. The manifest is an instance of the custom resource definition (CRD) called `OperatorConfiguration`. The operator registers this CRD - during the start and uses it for configuration if the [operator deployment manifest ](https://github.com/zalando/postgres-operator/blob/master/manifests/postgres-operator.yaml#L21) sets the `POSTGRES_OPERATOR_CONFIGURATION_OBJECT` env variable to a non-empty value. The variable should point to the + during the start and uses it for configuration if the [operator deployment manifest ](https://github.com/pocorschi/postgres-operator/blob/master/manifests/postgres-operator.yaml#L21) sets the `POSTGRES_OPERATOR_CONFIGURATION_OBJECT` env variable to a non-empty value. The variable should point to the `postgresql-operator-configuration` object in the operator's namespace. The CRD-based configuration is a regular YAML document; non-scalar keys are simply represented in the usual YAML way. There are no default values built-in in the operator, each parameter that is - not supplied in the configuration receives an empty value. In order to + not supplied in the configuration receives an empty value. In order to create your own configuration just copy the [default - one](https://github.com/zalando/postgres-operator/blob/master/manifests/postgresql-operator-default-configuration.yaml) + one](https://github.com/pocorschi/postgres-operator/blob/master/manifests/postgresql-operator-default-configuration.yaml) and change it. To test the CRD-based configuration locally, use the following + ```bash kubectl create -f manifests/operator-service-account-rbac.yaml kubectl create -f manifests/postgres-operator.yaml # set the env var as mentioned above kubectl create -f manifests/postgresql-operator-default-configuration.yaml kubectl get operatorconfigurations postgresql-operator-default-configuration -o yaml ``` - Note that the operator first registers the definition of the CRD `OperatorConfiguration` and then waits for an instance of the CRD to be created. In between these two event the operator pod may be failing since it cannot fetch the not-yet-existing `OperatorConfiguration` instance. + + Note that the operator first registers the definition of the CRD `OperatorConfiguration` and then waits for an instance of the CRD to be created. In between these two event the operator pod may be failing since it cannot fetch the not-yet-existing `OperatorConfiguration` instance. The CRD-based configuration is more powerful than the one based on ConfigMaps and should be used unless there is a compatibility requirement to @@ -53,45 +55,44 @@ They will be deprecated and removed in the future. Variable names are underscore-separated words. - ## General Those are top-level keys, containing both leaf keys and groups. -* **etcd_host** +- **etcd_host** Etcd connection string for Patroni defined as `host:port`. Not required when Patroni native Kubernetes support is used. The default is empty (use Kubernetes-native DCS). -* **docker_image** +- **docker_image** Spilo docker image for postgres instances. For production, don't rely on the default image, as it might be not the most up-to-date one. Instead, build your own Spilo image from the [github repository](https://github.com/zalando/spilo). -* **sidecar_docker_images** +- **sidecar_docker_images** a map of sidecar names to docker images for the containers to run alongside Spilo. In case of the name conflict with the definition in the cluster manifest the cluster-specific one is preferred. -* **workers** +- **workers** number of working routines the operator spawns to process requests to create/update/delete/sync clusters concurrently. The default is `4`. -* **max_instances** +- **max_instances** operator will cap the number of instances in any managed postgres cluster up to the value of this parameter. When `-1` is specified, no limits are applied. The default is `-1`. -* **min_instances** +- **min_instances** operator will run at least the number of instances for any given postgres cluster equal to the value of this parameter. When `-1` is specified, no limits are applied. The default is `-1`. -* **resync_period** +- **resync_period** period between consecutive sync requests. The default is `30m`. -* **repair_period** +- **repair_period** period between consecutive repair requests. The default is `5m`. ## Postgres users @@ -99,11 +100,11 @@ Those are top-level keys, containing both leaf keys and groups. Parameters describing Postgres users. In a CRD-configuration, they are grouped under the `users` key. -* **super_username** +- **super_username** postgres `superuser` name to be created by `initdb`. The default is `postgres`. -* **replication_username** +- **replication_username** postgres username used for replication between instances. The default is `standby`. @@ -113,18 +114,18 @@ Parameters to configure cluster-related Kubernetes objects created by the operator, as well as some timeouts associated with them. In a CRD-based configuration they are grouped under the `kubernetes` key. -* **pod_service_account_name** +- **pod_service_account_name** service account used by Patroni running on individual Pods to communicate with the operator. Required even if native Kubernetes support in Patroni is not used, because Patroni keeps pod labels in sync with the instance role. The default is `operator`. -* **pod_service_account_definition** +- **pod_service_account_definition** The operator tries to create the pod Service Account in the namespace that doesn't define such an account using the YAML definition provided by this option. If not defined, a simple definition that contains only the name will be used. The default is empty. -* **pod_service_account_role_binding_definition** +- **pod_service_account_role_binding_definition** This definition must bind pod service account to a role with permission sufficient for the pods to start and for Patroni to access k8s endpoints; service account on its own lacks any such rights starting with k8s v1.8. If @@ -132,24 +133,24 @@ configuration they are grouped under the `kubernetes` key. account to the operator's own 'zalando-postgres-operator' cluster role will be used. The default is empty. -* **pod_terminate_grace_period** +- **pod_terminate_grace_period** Postgres pods are [terminated forcefully](https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods) after this timeout. The default is `5m`. -* **watched_namespace** +- **watched_namespace** The operator watches for postgres objects in the given namespace. If not specified, the value is taken from the operator namespace. A special `*` value makes it watch all namespaces. The default is empty (watch the operator pod namespace). -* **pdb_name_format** +- **pdb_name_format** defines the template for PDB (Pod Disruption Budget) names created by the operator. The default is `postgres-{cluster}-pdb`, where `{cluster}` is replaced by the cluster name. Only the `{cluster}` placeholders is allowed in the template. -* **secret_name_template** +- **secret_name_template** a template for the name of the database user secrets generated by the operator. `{username}` is replaced with name of the secret, `{cluster}` with the name of the cluster, `{tprkind}` with the kind of CRD (formerly known as @@ -157,22 +158,22 @@ configuration they are grouped under the `kubernetes` key. allowed. The default is `{username}.{cluster}.credentials.{tprkind}.{tprgroup}`. -* **oauth_token_secret_name** +- **oauth_token_secret_name** a name of the secret containing the `OAuth2` token to pass to the teams API. The default is `postgresql-operator`. -* **infrastructure_roles_secret_name** +- **infrastructure_roles_secret_name** name of the secret containing infrastructure roles names and passwords. -* **pod_role_label** +- **pod_role_label** name of the label assigned to the Postgres pods (and services/endpoints) by the operator. The default is `spilo-role`. -* **cluster_labels** +- **cluster_labels** list of `name:value` pairs for additional labels assigned to the cluster objects. The default is `application:spilo`. -* **inherited_labels** +- **inherited_labels** list of labels that can be inherited from the cluster manifest, and added to each child objects (`StatefulSet`, `Pod`, `Service` and `Endpoints`) created by the opertor. @@ -180,12 +181,12 @@ configuration they are grouped under the `kubernetes` key. postgres cluster, in order to implement `NetworkPolicy`. The default is empty. -* **cluster_name_label** +- **cluster_name_label** name of the label assigned to Kubernetes objects created by the operator that indicates which cluster a given object belongs to. The default is `cluster-name`. -* **node_readiness_label** +- **node_readiness_label** a set of labels that a running and active node should possess to be considered `ready`. The operator uses values of those labels to detect the start of the Kubernetes cluster upgrade procedure and move master pods off @@ -193,35 +194,35 @@ configuration they are grouped under the `kubernetes` key. assigns the `Affinity` clause to the Postgres pods to be scheduled only on `ready` nodes. The default is empty. -* **toleration** +- **toleration** a dictionary that should contain `key`, `operator`, `value` and `effect` keys. In that case, the operator defines a pod toleration according to the values of those keys. See [kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) for details on taints and tolerations. The default is empty. -* **pod_environment_configmap** +- **pod_environment_configmap** a name of the ConfigMap with environment variables to populate on every pod. Right now this ConfigMap is searched in the namespace of the postgres cluster. All variables from that ConfigMap are injected to the pod's environment, on conflicts they are overridden by the environment variables generated by the operator. The default is empty. -* **pod_priority_class_name** +- **pod_priority_class_name** a name of the [priority class](https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass) that should be assigned to the Postgres pods. The priority class itself must be defined in advance. Default is empty (use the default priority class). - - * **master_pod_move_timeout** - The period of time to wait for the success of migration of master pods from an unschedulable node. - The migration includes Patroni switchovers to respective replicas on healthy nodes. The situation where master pods still exist on the old node after this timeout expires has to be fixed manually. The default is 20 minutes. -* **enable_pod_antiaffinity** +- **master_pod_move_timeout** + The period of time to wait for the success of migration of master pods from an unschedulable node. + The migration includes Patroni switchovers to respective replicas on healthy nodes. The situation where master pods still exist on the old node after this timeout expires has to be fixed manually. The default is 20 minutes. + +- **enable_pod_antiaffinity** toggles [pod anti affinity](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/) on the Postgres pods, to avoid multiple pods of the same Postgres cluster in the same topology , e.g. node. The default is `false`. -* **pod_antiaffinity_topology_key** +- **pod_antiaffinity_topology_key** override [topology key](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#interlude-built-in-node-labels) for pod anti affinity. The default is `kubernetes.io/hostname`. @@ -232,26 +233,26 @@ This group allows you to configure resource requests for the Postgres pods. Those parameters are grouped under the `postgres_pod_resources` key in a CRD-based configuration. -* **default_cpu_request** +- **default_cpu_request** CPU request value for the postgres containers, unless overridden by cluster-specific settings. The default is `100m`. -* **default_memory_request** +- **default_memory_request** memory request value for the postgres containers, unless overridden by cluster-specific settings. The default is `100Mi`. -* **default_cpu_limit** +- **default_cpu_limit** CPU limits for the postgres containers, unless overridden by cluster-specific settings. The default is `3`. -* **default_memory_limit** +- **default_memory_limit** memory limits for the postgres containers, unless overridden by cluster-specific settings. The default is `1Gi`. -* **set_memory_request_to_limit** - Set `memory_request` to `memory_limit` for all Postgres clusters (the default value is also increased). This prevents certain cases of memory overcommitment at the cost of overprovisioning memory and potential scheduling problems for containers with high memory limits due to the lack of memory on Kubernetes cluster nodes. This affects all containers created by the operator (Postgres, Scalyr sidecar, and other sidecars); to set resources for the operator's own container, change the [operator deployment manually](https://github.com/zalando/postgres-operator/blob/master/manifests/postgres-operator.yaml#L13). The default is `false`. +- **set_memory_request_to_limit** + Set `memory_request` to `memory_limit` for all Postgres clusters (the default value is also increased). This prevents certain cases of memory overcommitment at the cost of overprovisioning memory and potential scheduling problems for containers with high memory limits due to the lack of memory on Kubernetes cluster nodes. This affects all containers created by the operator (Postgres, Scalyr sidecar, and other sidecars); to set resources for the operator's own container, change the [operator deployment manually](https://github.com/pocorschi/postgres-operator/blob/master/manifests/postgres-operator.yaml#L13). The default is `false`. -* **enable_shm_volume** +- **enable_shm_volume** Instruct operator to start any new database pod without limitations on shm memory. If this option is enabled, to the target database pod will be mounted a new tmpfs volume to remove shm memory limitation (see e.g. the [docker @@ -267,30 +268,30 @@ configuration `resource_check_interval` and `resource_check_timeout` have no effect, and the parameters are grouped under the `timeouts` key in the CRD-based configuration. -* **resource_check_interval** +- **resource_check_interval** interval to wait between consecutive attempts to check for the presence of some Kubernetes resource (i.e. `StatefulSet` or `PodDisruptionBudget`). The default is `3s`. -* **resource_check_timeout** +- **resource_check_timeout** timeout when waiting for the presence of a certain Kubernetes resource (i.e. `StatefulSet` or `PodDisruptionBudget`) before declaring the operation unsuccessful. The default is `10m`. -* **pod_label_wait_timeout** +- **pod_label_wait_timeout** timeout when waiting for the pod role and cluster labels. Bigger value gives Patroni more time to start the instance; smaller makes the operator detect possible issues faster. The default is `10m`. -* **pod_deletion_wait_timeout** +- **pod_deletion_wait_timeout** timeout when waiting for the Postgres pods to be deleted when removing the cluster or recreating pods. The default is `10m`. -* **ready_wait_interval** +- **ready_wait_interval** the interval between consecutive attempts waiting for the postgres CRD to be created. The default is `5s`. -* **ready_wait_timeout** +- **ready_wait_timeout** the timeout for the complete postgres CRD creation. The default is `30s`. ## Load balancer related options @@ -298,40 +299,40 @@ CRD-based configuration. Those options affect the behavior of load balancers created by the operator. In the CRD-based configuration they are grouped under the `load_balancer` key. -* **db_hosted_zone** +- **db_hosted_zone** DNS zone for the cluster DNS name when the load balancer is configured for the cluster. Only used when combined with [external-dns](https://github.com/kubernetes-incubator/external-dns) and with the cluster that has the load balancer enabled. The default is `db.example.com`. -* **enable_master_load_balancer** +- **enable_master_load_balancer** toggles service type load balancer pointing to the master pod of the cluster. Can be overridden by individual cluster settings. The default is `true`. -* **enable_replica_load_balancer** +- **enable_replica_load_balancer** toggles service type load balancer pointing to the replica pod of the - cluster. Can be overridden by individual cluster settings. The default is + cluster. Can be overridden by individual cluster settings. The default is `false`. -* **custom_service_annotations** +- **custom_service_annotations** when load balancing is enabled, LoadBalancer service is created and this parameter takes service annotations that are applied to service. Optional. -* **master_dns_name_format** defines the DNS name string template for the - master load balancer cluster. The default is +- **master_dns_name_format** defines the DNS name string template for the + master load balancer cluster. The default is `{cluster}.{team}.{hostedzone}`, where `{cluster}` is replaced by the cluster name, `{team}` is replaced with the team name and `{hostedzone}` is replaced with the hosted zone (the value of the `db_hosted_zone` parameter). No other placeholders are allowed. -** **replica_dns_name_format** defines the DNS name string template for the - replica load balancer cluster. The default is - `{cluster}-repl.{team}.{hostedzone}`, where `{cluster}` is replaced by the - cluster name, `{team}` is replaced with the team name and `{hostedzone}` is - replaced with the hosted zone (the value of the `db_hosted_zone` parameter). - No other placeholders are allowed. +\*\* **replica_dns_name_format** defines the DNS name string template for the +replica load balancer cluster. The default is +`{cluster}-repl.{team}.{hostedzone}`, where `{cluster}` is replaced by the +cluster name, `{team}` is replaced with the team name and `{hostedzone}` is +replaced with the hosted zone (the value of the `db_hosted_zone` parameter). +No other placeholders are allowed. ## AWS or GCP interaction @@ -340,33 +341,42 @@ objects from Amazon Web Services (AWS) or Google Cloud Platform (GCP). They have either. In the CRD-based configuration those options are grouped under the `aws_or_gcp` key. Note the GCP integration is not yet officially supported. -* **wal_s3_bucket** +- **wal_s3_bucket** S3 bucket to use for shipping WAL segments with WAL-E. A bucket has to be present and accessible by Postgres pods. At the moment, supported services by Spilo are S3 and GCS. The default is empty. -* **log_s3_bucket** +- **wal_gs_bucket** + GCS bucket to use for shipping WAL segments with WAL-E. A bucket has to be + present and accessible by Postgres pods. At the moment, supported services by + Spilo are S3 and GCS. The default is empty. + +- **log_s3_bucket** S3 bucket to use for shipping postgres daily logs. Works only with S3 on AWS. The bucket has to be present and accessible by Postgres pods. The default is empty. -* **kube_iam_role** +- **log_gs_bucket** + GCS bucket to use for shipping postgres daily logs. Works only with S3 on AWS. + The bucket has to be present and accessible by Postgres pods. The default is empty. + +- **kube_iam_role** AWS IAM role to supply in the `iam.amazonaws.com/role` annotation of Postgres pods. Only used when combined with [kube2iam](https://github.com/jtblin/kube2iam) project on AWS. The default is empty. -* **aws_region** +- **aws_region** AWS region used to store ESB volumes. The default is `eu-central-1`. ## Debugging the operator Options to aid debugging of the operator itself. Grouped under the `debug` key. -* **debug_logging** +- **debug_logging** boolean parameter that toggles verbose debug logs from the operator. The default is `true`. -* **enable_database_access** +- **enable_database_access** boolean parameter that toggles the functionality of the operator that require access to the postgres database, i.e. creating databases and users. The default is `true`. @@ -377,67 +387,67 @@ Options to automate creation of human users with the aid of the teams API service. In the CRD-based configuration those are grouped under the `teams_api` key. -* **enable_teams_api** +- **enable_teams_api** boolean parameter that toggles usage of the Teams API by the operator. The default is `true`. -* **teams_api_url** +- **teams_api_url** contains the URL of the Teams API service. There is a [demo implementation](https://github.com/ikitiki/fake-teams-api). The default is `https://teams.example.com/api/`. -* **team_api_role_configuration** +- **team_api_role_configuration** postgres parameters to apply to each team member role. The default is - '*log_statement:all*'. It is possible to supply multiple options, separating + '_log_statement:all_'. It is possible to supply multiple options, separating them by commas. Options containing commas within the value are not supported, with the exception of the `search_path`. For instance: ```yaml teams_api_role_configuration: "log_statement:all,search_path:'data,public'" ``` + The default is `"log_statement:all"` -* **enable_team_superuser** +- **enable_team_superuser** whether to grant superuser to team members created from the Teams API. The default is `false`. -* **team_admin_role** +- **team_admin_role** role name to grant to team members created from the Teams API. The default is `admin`, that role is created by Spilo as a `NOLOGIN` role. -* **enable_admin_role_for_users** - if `true`, the `team_admin_role` will have the rights to grant roles coming from PG manifests. Such roles will be created as in "CREATE ROLE 'role_from_manifest' ... ADMIN 'team_admin_role'". The default is `true`. +- **enable_admin_role_for_users** + if `true`, the `team_admin_role` will have the rights to grant roles coming from PG manifests. Such roles will be created as in "CREATE ROLE 'role_from_manifest' ... ADMIN 'team_admin_role'". The default is `true`. -* **pam_role_name** +- **pam_role_name** when set, the operator will add all team member roles to this group and add a `pg_hba` line to authenticate members of that role via `pam`. The default is `zalandos`. -* **pam_configuration** +- **pam_configuration** when set, should contain a URL to use for authentication against the username - and the token supplied as the password. Used in conjunction with + and the token supplied as the password. Used in conjunction with [pam_oauth2](https://github.com/CyberDem0n/pam-oauth2) module. The default is - `https://info.example.com/oauth2/tokeninfo?access_token= uid - realm=/employees`. + `https://info.example.com/oauth2/tokeninfo?access_token= uid realm=/employees`. -* **protected_roles** +- **protected_roles** List of roles that cannot be overwritten by an application, team or infrastructure role. The default is `admin`. -* **postgres_superuser_teams** +- **postgres_superuser_teams** List of teams which members need the superuser role in each PG database cluster to administer Postgres and maintain infrastructure built around it. The default is empty. ## Logging and REST API Parameters affecting logging and REST API listener. In the CRD-based configuration they are grouped under the `logging_rest_api` key. -* **api_port** +- **api_port** REST API listener listens to this port. The default is `8080`. -* **ring_log_lines** +- **ring_log_lines** number of lines in the ring buffer used to store cluster logs. The default is `100`. -* **cluster_history_entries** +- **cluster_history_entries** number of entries in the cluster history ring buffer. The default is `1000`. ## Scalyr options @@ -446,26 +456,25 @@ Those parameters define the resource requests/limits and properties of the scalyr sidecar. In the CRD-based configuration they are grouped under the `scalyr` key. -* **scalyr_api_key** +- **scalyr_api_key** API key for the Scalyr sidecar. The default is empty. -* **scalyr_image** +- **scalyr_image** Docker image for the Scalyr sidecar. The default is empty. -* **scalyr_server_url** +- **scalyr_server_url** server URL for the Scalyr sidecar. The default is `https://upload.eu.scalyr.com`. -* **scalyr_cpu_request** +- **scalyr_cpu_request** CPU request value for the Scalyr sidecar. The default is `100m`. -* **scalyr_memory_request** +- **scalyr_memory_request** Memory request value for the Scalyr sidecar. The default is `50Mi`. -* **scalyr_cpu_limit** +- **scalyr_cpu_limit** CPU limit value for the Scalyr sidecar. The default is `1`. -* **scalyr_memory_limit** +- **scalyr_memory_limit** Memory limit value for the Scalyr sidecar. The default is `1Gi`. - -For the configmap operator configuration, the [default parameter values](https://github.com/zalando/postgres-operator/blob/master/pkg/util/config/config.go#L14) mentioned here are likely to be overwritten in your local operator installation via your local version of the operator configmap. In the case you use the operator CRD, all the CRD defaults are provided in the [operator's default configuration manifest](https://github.com/zalando/postgres-operator/blob/master/manifests/postgresql-operator-default-configuration.yaml) +For the configmap operator configuration, the [default parameter values](https://github.com/pocorschi/postgres-operator/blob/master/pkg/util/config/config.go#L14) mentioned here are likely to be overwritten in your local operator installation via your local version of the operator configmap. In the case you use the operator CRD, all the CRD defaults are provided in the [operator's default configuration manifest](https://github.com/pocorschi/postgres-operator/blob/master/manifests/postgresql-operator-default-configuration.yaml) diff --git a/docs/user.md b/docs/user.md index a0569fe2b..ad87524b5 100644 --- a/docs/user.md +++ b/docs/user.md @@ -1,7 +1,7 @@ ## Create a manifest for a new PostgreSQL cluster As an example you can take this -[minimal example](https://github.com/zalando/postgres-operator/blob/master/manifests/minimal-postgres-manifest.yaml): +[minimal example](https://github.com/pocorschi/postgres-operator/blob/master/manifests/minimal-postgres-manifest.yaml): ```yaml apiVersion: "acid.zalan.do/v1" @@ -68,7 +68,7 @@ In the next sections, we will cover those use cases in more details. ## Manifest roles Manifest roles are defined directly in the cluster manifest. See -[minimal postgres manifest](https://github.com/zalando/postgres-operator/blob/master/manifests/minimal-postgres-manifest.yaml) +[minimal postgres manifest](https://github.com/pocorschi/postgres-operator/blob/master/manifests/minimal-postgres-manifest.yaml) for an example of `zalando` role, defined with `superuser` and `createdb` flags. @@ -158,8 +158,8 @@ Since an infrastructure role is created uniformly on all clusters managed by the operator, it makes no sense to define it without the password. Such definitions will be ignored with a prior warning. -See [infrastructure roles secret](https://github.com/zalando/postgres-operator/blob/master/manifests/infrastructure-roles.yaml) -and [infrastructure roles configmap](https://github.com/zalando/postgres-operator/blob/master/manifests/infrastructure-roles-configmap.yaml) for the examples. +See [infrastructure roles secret](https://github.com/pocorschi/postgres-operator/blob/master/manifests/infrastructure-roles.yaml) +and [infrastructure roles configmap](https://github.com/pocorschi/postgres-operator/blob/master/manifests/infrastructure-roles-configmap.yaml) for the examples. ## Use taints and tolerations for dedicated PostgreSQL nodes diff --git a/glide.yaml b/glide.yaml index 986970887..938c758b2 100644 --- a/glide.yaml +++ b/glide.yaml @@ -1,4 +1,4 @@ -package: github.com/zalando/postgres-operator +package: github.com/pocorschi/postgres-operator import: - package: github.com/sirupsen/logrus version: ^1.0.1 diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 70f041d07..c9f3c8024 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -8,6 +8,6 @@ SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/.. CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ${GOPATH}/src/k8s.io/code-generator)} vendor/k8s.io/code-generator/generate-groups.sh all \ - github.com/zalando/postgres-operator/pkg/generated github.com/zalando/postgres-operator/pkg/apis \ + github.com/pocorschi/postgres-operator/pkg/generated github.com/pocorschi/postgres-operator/pkg/apis \ acid.zalan.do:v1 \ --go-header-file ${SCRIPT_ROOT}/hack/custom-boilerplate.go.txt diff --git a/manifests/postgresql-operator-default-configuration.yaml b/manifests/postgresql-operator-default-configuration.yaml index 5b9de1073..fbb90e4ce 100644 --- a/manifests/postgresql-operator-default-configuration.yaml +++ b/manifests/postgresql-operator-default-configuration.yaml @@ -57,9 +57,11 @@ configuration: aws_or_gcp: # db_hosted_zone: "" # wal_s3_bucket: "" + # wal_gs_bucket: "" # log_s3_bucket: "" + # log_gs_bucket: "" # kube_iam_role: "" - aws_region: eu-central-1 + # aws_region: eu-central-1 debug: debug_logging: true enable_database_access: true diff --git a/mkdocs.yml b/mkdocs.yml index 635f08816..133518d8f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,5 +1,5 @@ site_name: Postgres Operator -repo_url: https://github.com/zalando/postgres-operator +repo_url: https://github.com/pocorschi/postgres-operator theme: readthedocs pages: diff --git a/pkg/.DS_Store b/pkg/.DS_Store new file mode 100644 index 000000000..f0ee82ead Binary files /dev/null and b/pkg/.DS_Store differ diff --git a/pkg/apis/acid.zalan.do/v1/crds.go b/pkg/apis/acid.zalan.do/v1/crds.go index a77f490f0..7f808c1ed 100644 --- a/pkg/apis/acid.zalan.do/v1/crds.go +++ b/pkg/apis/acid.zalan.do/v1/crds.go @@ -1,7 +1,7 @@ package v1 import ( - "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do" + "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do" apiextv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/pkg/apis/acid.zalan.do/v1/operator_configuration_type.go b/pkg/apis/acid.zalan.do/v1/operator_configuration_type.go index dde9b624b..55429dc91 100644 --- a/pkg/apis/acid.zalan.do/v1/operator_configuration_type.go +++ b/pkg/apis/acid.zalan.do/v1/operator_configuration_type.go @@ -1,11 +1,11 @@ package v1 import ( - "github.com/zalando/postgres-operator/pkg/util/config" + "github.com/pocorschi/postgres-operator/pkg/util/config" "time" - "github.com/zalando/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/spec" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -97,8 +97,10 @@ type LoadBalancerConfiguration struct { // TODO complete Google Cloud Platform (GCP) configuration type AWSGCPConfiguration struct { WALES3Bucket string `json:"wal_s3_bucket,omitempty"` + WALEGSBucket string `json:"wal_gs_bucket,omitempty"` AWSRegion string `json:"aws_region,omitempty"` LogS3Bucket string `json:"log_s3_bucket,omitempty"` + LogGSBucket string `json:"log_gs_bucket,omitempty"` KubeIAMRole string `json:"kube_iam_role,omitempty"` } diff --git a/pkg/apis/acid.zalan.do/v1/register.go b/pkg/apis/acid.zalan.do/v1/register.go index 1c30e35fb..f2c1b6f4b 100644 --- a/pkg/apis/acid.zalan.do/v1/register.go +++ b/pkg/apis/acid.zalan.do/v1/register.go @@ -5,7 +5,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do" + "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do" ) // APIVersion of the `postgresql` and `operator` CRDs diff --git a/pkg/apiserver/apiserver.go b/pkg/apiserver/apiserver.go index c0fa1f349..f8b75dac9 100644 --- a/pkg/apiserver/apiserver.go +++ b/pkg/apiserver/apiserver.go @@ -13,10 +13,10 @@ import ( "github.com/sirupsen/logrus" - "github.com/zalando/postgres-operator/pkg/cluster" - "github.com/zalando/postgres-operator/pkg/spec" - "github.com/zalando/postgres-operator/pkg/util" - "github.com/zalando/postgres-operator/pkg/util/config" + "github.com/pocorschi/postgres-operator/pkg/cluster" + "github.com/pocorschi/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/util" + "github.com/pocorschi/postgres-operator/pkg/util/config" ) const ( diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index d4680cec0..620127181 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -21,15 +21,15 @@ import ( "encoding/json" - acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" - "github.com/zalando/postgres-operator/pkg/spec" - "github.com/zalando/postgres-operator/pkg/util" - "github.com/zalando/postgres-operator/pkg/util/config" - "github.com/zalando/postgres-operator/pkg/util/constants" - "github.com/zalando/postgres-operator/pkg/util/k8sutil" - "github.com/zalando/postgres-operator/pkg/util/patroni" - "github.com/zalando/postgres-operator/pkg/util/teams" - "github.com/zalando/postgres-operator/pkg/util/users" + acidv1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" + "github.com/pocorschi/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/util" + "github.com/pocorschi/postgres-operator/pkg/util/config" + "github.com/pocorschi/postgres-operator/pkg/util/constants" + "github.com/pocorschi/postgres-operator/pkg/util/k8sutil" + "github.com/pocorschi/postgres-operator/pkg/util/patroni" + "github.com/pocorschi/postgres-operator/pkg/util/teams" + "github.com/pocorschi/postgres-operator/pkg/util/users" rbacv1beta1 "k8s.io/api/rbac/v1beta1" ) diff --git a/pkg/cluster/cluster_test.go b/pkg/cluster/cluster_test.go index 5ff00c7b3..d7b6b4395 100644 --- a/pkg/cluster/cluster_test.go +++ b/pkg/cluster/cluster_test.go @@ -6,11 +6,11 @@ import ( "testing" "github.com/sirupsen/logrus" - acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" - "github.com/zalando/postgres-operator/pkg/spec" - "github.com/zalando/postgres-operator/pkg/util/config" - "github.com/zalando/postgres-operator/pkg/util/k8sutil" - "github.com/zalando/postgres-operator/pkg/util/teams" + acidv1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" + "github.com/pocorschi/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/util/config" + "github.com/pocorschi/postgres-operator/pkg/util/k8sutil" + "github.com/pocorschi/postgres-operator/pkg/util/teams" "k8s.io/api/core/v1" ) @@ -19,6 +19,8 @@ const ( replicationUserName = "standby" ) +fmt.Println("starting up...") + var logger = logrus.New().WithField("test", "cluster") var cl = New(Config{OpConfig: config.Config{ProtectedRoles: []string{"admin"}, Auth: config.Auth{SuperUsername: superUserName, diff --git a/pkg/cluster/database.go b/pkg/cluster/database.go index a4633537d..3398e9536 100644 --- a/pkg/cluster/database.go +++ b/pkg/cluster/database.go @@ -9,9 +9,9 @@ import ( "github.com/lib/pq" - "github.com/zalando/postgres-operator/pkg/spec" - "github.com/zalando/postgres-operator/pkg/util/constants" - "github.com/zalando/postgres-operator/pkg/util/retryutil" + "github.com/pocorschi/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/util/constants" + "github.com/pocorschi/postgres-operator/pkg/util/retryutil" ) const ( diff --git a/pkg/cluster/exec.go b/pkg/cluster/exec.go index 8dd6bd91d..268c4b70b 100644 --- a/pkg/cluster/exec.go +++ b/pkg/cluster/exec.go @@ -10,8 +10,8 @@ import ( "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/remotecommand" - "github.com/zalando/postgres-operator/pkg/spec" - "github.com/zalando/postgres-operator/pkg/util/constants" + "github.com/pocorschi/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/util/constants" ) //ExecCommand executes arbitrary command inside the pod diff --git a/pkg/cluster/filesystems.go b/pkg/cluster/filesystems.go index a34e5a90e..0d6f28b6a 100644 --- a/pkg/cluster/filesystems.go +++ b/pkg/cluster/filesystems.go @@ -4,9 +4,9 @@ import ( "fmt" "strings" - "github.com/zalando/postgres-operator/pkg/spec" - "github.com/zalando/postgres-operator/pkg/util/constants" - "github.com/zalando/postgres-operator/pkg/util/filesystems" + "github.com/pocorschi/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/util/constants" + "github.com/pocorschi/postgres-operator/pkg/util/filesystems" ) func (c *Cluster) getPostgresFilesystemInfo(podName *spec.NamespacedName) (device, fstype string, err error) { diff --git a/pkg/cluster/k8sres.go b/pkg/cluster/k8sres.go index 87eeee27a..a3dc5eb2c 100644 --- a/pkg/cluster/k8sres.go +++ b/pkg/cluster/k8sres.go @@ -15,11 +15,11 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/intstr" - acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" - "github.com/zalando/postgres-operator/pkg/spec" - "github.com/zalando/postgres-operator/pkg/util" - "github.com/zalando/postgres-operator/pkg/util/config" - "github.com/zalando/postgres-operator/pkg/util/constants" + acidv1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" + "github.com/pocorschi/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/util" + "github.com/pocorschi/postgres-operator/pkg/util/config" + "github.com/pocorschi/postgres-operator/pkg/util/constants" "k8s.io/apimachinery/pkg/labels" ) @@ -563,11 +563,22 @@ func (c *Cluster) generateSpiloPodEnvVars(uid types.UID, spiloConfiguration stri Value: c.OpConfig.PamRoleName, }, } + c.logger.Debugf("some test") if spiloConfiguration != "" { envVars = append(envVars, v1.EnvVar{Name: "SPILO_CONFIGURATION", Value: spiloConfiguration}) } if c.OpConfig.WALES3Bucket != "" { + c.logger.Debugf("s3 bucket is active") envVars = append(envVars, v1.EnvVar{Name: "WAL_S3_BUCKET", Value: c.OpConfig.WALES3Bucket}) + envVars = append(envVars, v1.EnvVar{Name: "USE_WALE", Value: "true"}) + envVars = append(envVars, v1.EnvVar{Name: "WAL_BUCKET_SCOPE_SUFFIX", Value: getBucketScopeSuffix(string(uid))}) + envVars = append(envVars, v1.EnvVar{Name: "WAL_BUCKET_SCOPE_PREFIX", Value: ""}) + } + + if c.OpConfig.WALEGSBucket != "" { + c.logger.Debugf("gs bucket is active") + envVars = append(envVars, v1.EnvVar{Name: "WAL_GS_BUCKET", Value: c.OpConfig.WALEGSBucket}) + envVars = append(envVars, v1.EnvVar{Name: "USE_WALE", Value: true}) envVars = append(envVars, v1.EnvVar{Name: "WAL_BUCKET_SCOPE_SUFFIX", Value: getBucketScopeSuffix(string(uid))}) envVars = append(envVars, v1.EnvVar{Name: "WAL_BUCKET_SCOPE_PREFIX", Value: ""}) } @@ -578,6 +589,12 @@ func (c *Cluster) generateSpiloPodEnvVars(uid types.UID, spiloConfiguration stri envVars = append(envVars, v1.EnvVar{Name: "LOG_BUCKET_SCOPE_PREFIX", Value: ""}) } + if c.OpConfig.LogGSBucket != "" { + envVars = append(envVars, v1.EnvVar{Name: "LOG_GS_BUCKET", Value: c.OpConfig.LogGSBucket}) + envVars = append(envVars, v1.EnvVar{Name: "LOG_BUCKET_SCOPE_SUFFIX", Value: getBucketScopeSuffix(string(uid))}) + envVars = append(envVars, v1.EnvVar{Name: "LOG_BUCKET_SCOPE_PREFIX", Value: ""}) + } + if c.patroniUsesKubernetes() { envVars = append(envVars, v1.EnvVar{Name: "DCS_ENABLE_KUBERNETES_API", Value: "true"}) } else { @@ -791,6 +808,7 @@ func (c *Cluster) generateStatefulSet(spec *acidv1.PostgresSpec) (*v1beta1.State volumeMounts := generateVolumeMounts() // generate the spilo container + c.logger.Debugf("this is a test") c.logger.Debugf("Generating Spilo container, environment variables: %v", spiloEnvVars) spiloContainer := generateSpiloContainer(c.containerName(), &effectiveDockerImage, diff --git a/pkg/cluster/k8sres_test.go b/pkg/cluster/k8sres_test.go index 6b96f8ec1..d59c9ea6f 100644 --- a/pkg/cluster/k8sres_test.go +++ b/pkg/cluster/k8sres_test.go @@ -3,10 +3,10 @@ package cluster import ( "k8s.io/api/core/v1" - acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" - "github.com/zalando/postgres-operator/pkg/util/config" - "github.com/zalando/postgres-operator/pkg/util/constants" - "github.com/zalando/postgres-operator/pkg/util/k8sutil" + acidv1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" + "github.com/pocorschi/postgres-operator/pkg/util/config" + "github.com/pocorschi/postgres-operator/pkg/util/constants" + "github.com/pocorschi/postgres-operator/pkg/util/k8sutil" "testing" ) diff --git a/pkg/cluster/pod.go b/pkg/cluster/pod.go index 8beb561ec..93df62003 100644 --- a/pkg/cluster/pod.go +++ b/pkg/cluster/pod.go @@ -7,8 +7,8 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/zalando/postgres-operator/pkg/spec" - "github.com/zalando/postgres-operator/pkg/util" + "github.com/pocorschi/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/util" "k8s.io/api/apps/v1beta1" ) diff --git a/pkg/cluster/resources.go b/pkg/cluster/resources.go index 18c295804..58ffb9545 100644 --- a/pkg/cluster/resources.go +++ b/pkg/cluster/resources.go @@ -11,10 +11,10 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "github.com/zalando/postgres-operator/pkg/util" - "github.com/zalando/postgres-operator/pkg/util/constants" - "github.com/zalando/postgres-operator/pkg/util/k8sutil" - "github.com/zalando/postgres-operator/pkg/util/retryutil" + "github.com/pocorschi/postgres-operator/pkg/util" + "github.com/pocorschi/postgres-operator/pkg/util/constants" + "github.com/pocorschi/postgres-operator/pkg/util/k8sutil" + "github.com/pocorschi/postgres-operator/pkg/util/retryutil" ) const ( diff --git a/pkg/cluster/sync.go b/pkg/cluster/sync.go index d2157c8a2..dd453f69e 100644 --- a/pkg/cluster/sync.go +++ b/pkg/cluster/sync.go @@ -7,12 +7,12 @@ import ( policybeta1 "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" - "github.com/zalando/postgres-operator/pkg/spec" - "github.com/zalando/postgres-operator/pkg/util" - "github.com/zalando/postgres-operator/pkg/util/constants" - "github.com/zalando/postgres-operator/pkg/util/k8sutil" - "github.com/zalando/postgres-operator/pkg/util/volumes" + acidv1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" + "github.com/pocorschi/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/util" + "github.com/pocorschi/postgres-operator/pkg/util/constants" + "github.com/pocorschi/postgres-operator/pkg/util/k8sutil" + "github.com/pocorschi/postgres-operator/pkg/util/volumes" ) // Sync syncs the cluster, making sure the actual Kubernetes objects correspond to what is defined in the manifest. diff --git a/pkg/cluster/types.go b/pkg/cluster/types.go index 5fd5029db..cfb6d12ae 100644 --- a/pkg/cluster/types.go +++ b/pkg/cluster/types.go @@ -3,7 +3,7 @@ package cluster import ( "time" - acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" + acidv1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" "k8s.io/api/apps/v1beta1" "k8s.io/api/core/v1" policybeta1 "k8s.io/api/policy/v1beta1" diff --git a/pkg/cluster/util.go b/pkg/cluster/util.go index 93268cb93..3dff83ba4 100644 --- a/pkg/cluster/util.go +++ b/pkg/cluster/util.go @@ -17,13 +17,13 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" - acidzalando "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do" - acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" - "github.com/zalando/postgres-operator/pkg/spec" - "github.com/zalando/postgres-operator/pkg/util" - "github.com/zalando/postgres-operator/pkg/util/constants" - "github.com/zalando/postgres-operator/pkg/util/k8sutil" - "github.com/zalando/postgres-operator/pkg/util/retryutil" + acidzalando "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do" + acidv1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" + "github.com/pocorschi/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/util" + "github.com/pocorschi/postgres-operator/pkg/util/constants" + "github.com/pocorschi/postgres-operator/pkg/util/k8sutil" + "github.com/pocorschi/postgres-operator/pkg/util/retryutil" ) // OAuthTokenGetter provides the method for fetching OAuth tokens diff --git a/pkg/cluster/volumes.go b/pkg/cluster/volumes.go index 57f8ca7e3..7b1a8a681 100644 --- a/pkg/cluster/volumes.go +++ b/pkg/cluster/volumes.go @@ -9,12 +9,12 @@ import ( "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" - "github.com/zalando/postgres-operator/pkg/spec" - "github.com/zalando/postgres-operator/pkg/util" - "github.com/zalando/postgres-operator/pkg/util/constants" - "github.com/zalando/postgres-operator/pkg/util/filesystems" - "github.com/zalando/postgres-operator/pkg/util/volumes" + acidv1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" + "github.com/pocorschi/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/util" + "github.com/pocorschi/postgres-operator/pkg/util/constants" + "github.com/pocorschi/postgres-operator/pkg/util/filesystems" + "github.com/pocorschi/postgres-operator/pkg/util/volumes" ) func (c *Cluster) listPersistentVolumeClaims() ([]v1.PersistentVolumeClaim, error) { diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index 9b30f89a1..0b16f7a84 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -13,16 +13,16 @@ import ( "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/cache" - "github.com/zalando/postgres-operator/pkg/apiserver" - "github.com/zalando/postgres-operator/pkg/cluster" - "github.com/zalando/postgres-operator/pkg/spec" - "github.com/zalando/postgres-operator/pkg/util" - "github.com/zalando/postgres-operator/pkg/util/config" - "github.com/zalando/postgres-operator/pkg/util/constants" - "github.com/zalando/postgres-operator/pkg/util/k8sutil" - "github.com/zalando/postgres-operator/pkg/util/ringlog" - - acidv1informer "github.com/zalando/postgres-operator/pkg/generated/informers/externalversions/acid.zalan.do/v1" + "github.com/pocorschi/postgres-operator/pkg/apiserver" + "github.com/pocorschi/postgres-operator/pkg/cluster" + "github.com/pocorschi/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/util" + "github.com/pocorschi/postgres-operator/pkg/util/config" + "github.com/pocorschi/postgres-operator/pkg/util/constants" + "github.com/pocorschi/postgres-operator/pkg/util/k8sutil" + "github.com/pocorschi/postgres-operator/pkg/util/ringlog" + + acidv1informer "github.com/pocorschi/postgres-operator/pkg/generated/informers/externalversions/acid.zalan.do/v1" ) // Controller represents operator controller diff --git a/pkg/controller/logs_and_api.go b/pkg/controller/logs_and_api.go index 24e73fabe..c78f0a033 100644 --- a/pkg/controller/logs_and_api.go +++ b/pkg/controller/logs_and_api.go @@ -7,10 +7,10 @@ import ( "github.com/sirupsen/logrus" - "github.com/zalando/postgres-operator/pkg/cluster" - "github.com/zalando/postgres-operator/pkg/spec" - "github.com/zalando/postgres-operator/pkg/util" - "github.com/zalando/postgres-operator/pkg/util/config" + "github.com/pocorschi/postgres-operator/pkg/cluster" + "github.com/pocorschi/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/util" + "github.com/pocorschi/postgres-operator/pkg/util/config" "k8s.io/apimachinery/pkg/types" ) diff --git a/pkg/controller/node.go b/pkg/controller/node.go index 1849954ef..6d8a7650c 100644 --- a/pkg/controller/node.go +++ b/pkg/controller/node.go @@ -4,15 +4,15 @@ import ( "fmt" "time" - "github.com/zalando/postgres-operator/pkg/util/retryutil" + "github.com/pocorschi/postgres-operator/pkg/util/retryutil" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" - "github.com/zalando/postgres-operator/pkg/cluster" - "github.com/zalando/postgres-operator/pkg/util" + "github.com/pocorschi/postgres-operator/pkg/cluster" + "github.com/pocorschi/postgres-operator/pkg/util" ) func (c *Controller) nodeListFunc(options metav1.ListOptions) (runtime.Object, error) { diff --git a/pkg/controller/node_test.go b/pkg/controller/node_test.go index c0ec78aa8..32dafddf0 100644 --- a/pkg/controller/node_test.go +++ b/pkg/controller/node_test.go @@ -3,7 +3,7 @@ package controller import ( "testing" - "github.com/zalando/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/spec" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/pkg/controller/operator_config.go b/pkg/controller/operator_config.go index bca0f5b34..75517a1ce 100644 --- a/pkg/controller/operator_config.go +++ b/pkg/controller/operator_config.go @@ -5,8 +5,8 @@ import ( "time" - acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" - "github.com/zalando/postgres-operator/pkg/util/config" + acidv1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" + "github.com/pocorschi/postgres-operator/pkg/util/config" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -77,9 +77,13 @@ func (c *Controller) importConfigurationFromCRD(fromCRD *acidv1.OperatorConfigur result.MasterDNSNameFormat = fromCRD.LoadBalancer.MasterDNSNameFormat result.ReplicaDNSNameFormat = fromCRD.LoadBalancer.ReplicaDNSNameFormat + + result.WALES3Bucket = fromCRD.AWSGCP.WALES3Bucket + result.WALEGSBucket = fromCRD.AWSGCP.WALEGSBucket result.AWSRegion = fromCRD.AWSGCP.AWSRegion result.LogS3Bucket = fromCRD.AWSGCP.LogS3Bucket + result.LogGSBucket = fromCRD.AWSGCP.LogGSBucket result.KubeIAMRole = fromCRD.AWSGCP.KubeIAMRole result.DebugLogging = fromCRD.OperatorDebug.DebugLogging diff --git a/pkg/controller/pod.go b/pkg/controller/pod.go index 27fd6c956..4ebe274de 100644 --- a/pkg/controller/pod.go +++ b/pkg/controller/pod.go @@ -6,9 +6,9 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" - "github.com/zalando/postgres-operator/pkg/cluster" - "github.com/zalando/postgres-operator/pkg/spec" - "github.com/zalando/postgres-operator/pkg/util" + "github.com/pocorschi/postgres-operator/pkg/cluster" + "github.com/pocorschi/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/util" "k8s.io/apimachinery/pkg/types" ) diff --git a/pkg/controller/postgresql.go b/pkg/controller/postgresql.go index dc082ffab..e568cc575 100644 --- a/pkg/controller/postgresql.go +++ b/pkg/controller/postgresql.go @@ -14,12 +14,12 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/tools/cache" - acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" - "github.com/zalando/postgres-operator/pkg/cluster" - "github.com/zalando/postgres-operator/pkg/spec" - "github.com/zalando/postgres-operator/pkg/util" - "github.com/zalando/postgres-operator/pkg/util/k8sutil" - "github.com/zalando/postgres-operator/pkg/util/ringlog" + acidv1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" + "github.com/pocorschi/postgres-operator/pkg/cluster" + "github.com/pocorschi/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/util" + "github.com/pocorschi/postgres-operator/pkg/util/k8sutil" + "github.com/pocorschi/postgres-operator/pkg/util/ringlog" ) func (c *Controller) clusterResync(stopCh <-chan struct{}, wg *sync.WaitGroup) { diff --git a/pkg/controller/postgresql_test.go b/pkg/controller/postgresql_test.go index 3d7785f92..d4c377775 100644 --- a/pkg/controller/postgresql_test.go +++ b/pkg/controller/postgresql_test.go @@ -1,8 +1,8 @@ package controller import ( - acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" - "github.com/zalando/postgres-operator/pkg/spec" + acidv1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" + "github.com/pocorschi/postgres-operator/pkg/spec" "reflect" "testing" ) diff --git a/pkg/controller/types.go b/pkg/controller/types.go index 0d86abec8..a0f8d018e 100644 --- a/pkg/controller/types.go +++ b/pkg/controller/types.go @@ -4,7 +4,7 @@ import ( "k8s.io/apimachinery/pkg/types" "time" - acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" + acidv1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" ) // EventType contains type of the events for the TPRs and Pods received from Kubernetes diff --git a/pkg/controller/util.go b/pkg/controller/util.go index 57633ae82..006000301 100644 --- a/pkg/controller/util.go +++ b/pkg/controller/util.go @@ -8,11 +8,11 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" - acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" - "github.com/zalando/postgres-operator/pkg/cluster" - "github.com/zalando/postgres-operator/pkg/spec" - "github.com/zalando/postgres-operator/pkg/util/config" - "github.com/zalando/postgres-operator/pkg/util/k8sutil" + acidv1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" + "github.com/pocorschi/postgres-operator/pkg/cluster" + "github.com/pocorschi/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/util/config" + "github.com/pocorschi/postgres-operator/pkg/util/k8sutil" "gopkg.in/yaml.v2" ) diff --git a/pkg/controller/util_test.go b/pkg/controller/util_test.go index cb782904c..96fdb9f25 100644 --- a/pkg/controller/util_test.go +++ b/pkg/controller/util_test.go @@ -10,8 +10,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1core "k8s.io/client-go/kubernetes/typed/core/v1" - "github.com/zalando/postgres-operator/pkg/spec" - "github.com/zalando/postgres-operator/pkg/util/k8sutil" + "github.com/pocorschi/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/util/k8sutil" ) const ( diff --git a/pkg/generated/clientset/versioned/clientset.go b/pkg/generated/clientset/versioned/clientset.go index 6969f794c..1c79c701e 100644 --- a/pkg/generated/clientset/versioned/clientset.go +++ b/pkg/generated/clientset/versioned/clientset.go @@ -25,7 +25,7 @@ SOFTWARE. package versioned import ( - acidv1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1" + acidv1 "github.com/pocorschi/postgres-operator/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" diff --git a/pkg/generated/clientset/versioned/fake/clientset_generated.go b/pkg/generated/clientset/versioned/fake/clientset_generated.go index 861059b11..89ad7a2df 100644 --- a/pkg/generated/clientset/versioned/fake/clientset_generated.go +++ b/pkg/generated/clientset/versioned/fake/clientset_generated.go @@ -25,9 +25,9 @@ SOFTWARE. package fake import ( - clientset "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned" - acidv1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1" - fakeacidv1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/fake" + clientset "github.com/pocorschi/postgres-operator/pkg/generated/clientset/versioned" + acidv1 "github.com/pocorschi/postgres-operator/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1" + fakeacidv1 "github.com/pocorschi/postgres-operator/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" diff --git a/pkg/generated/clientset/versioned/fake/register.go b/pkg/generated/clientset/versioned/fake/register.go index 8e6179239..74c3c2da4 100644 --- a/pkg/generated/clientset/versioned/fake/register.go +++ b/pkg/generated/clientset/versioned/fake/register.go @@ -25,7 +25,7 @@ SOFTWARE. package fake import ( - acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" + acidv1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/generated/clientset/versioned/scheme/register.go b/pkg/generated/clientset/versioned/scheme/register.go index eec31f1c7..3de0f443d 100644 --- a/pkg/generated/clientset/versioned/scheme/register.go +++ b/pkg/generated/clientset/versioned/scheme/register.go @@ -25,7 +25,7 @@ SOFTWARE. package scheme import ( - acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" + acidv1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/acid.zalan.do_client.go b/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/acid.zalan.do_client.go index cf324cc2d..5a2713a8b 100644 --- a/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/acid.zalan.do_client.go +++ b/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/acid.zalan.do_client.go @@ -25,8 +25,8 @@ SOFTWARE. package v1 import ( - v1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" - "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/scheme" + v1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" + "github.com/pocorschi/postgres-operator/pkg/generated/clientset/versioned/scheme" serializer "k8s.io/apimachinery/pkg/runtime/serializer" rest "k8s.io/client-go/rest" ) diff --git a/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/fake/fake_acid.zalan.do_client.go b/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/fake/fake_acid.zalan.do_client.go index 31f2ec817..4ba91021d 100644 --- a/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/fake/fake_acid.zalan.do_client.go +++ b/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/fake/fake_acid.zalan.do_client.go @@ -25,7 +25,7 @@ SOFTWARE. package fake import ( - v1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1" + v1 "github.com/pocorschi/postgres-operator/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) diff --git a/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/fake/fake_operatorconfiguration.go b/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/fake/fake_operatorconfiguration.go index 8023d3b07..a6f8bf2e2 100644 --- a/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/fake/fake_operatorconfiguration.go +++ b/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/fake/fake_operatorconfiguration.go @@ -25,7 +25,7 @@ SOFTWARE. package fake import ( - acidzalandov1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" + acidzalandov1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" schema "k8s.io/apimachinery/pkg/runtime/schema" testing "k8s.io/client-go/testing" diff --git a/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/fake/fake_postgresql.go b/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/fake/fake_postgresql.go index d71c0f076..67d8eab51 100644 --- a/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/fake/fake_postgresql.go +++ b/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/fake/fake_postgresql.go @@ -25,7 +25,7 @@ SOFTWARE. package fake import ( - acidzalandov1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" + acidzalandov1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/operatorconfiguration.go b/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/operatorconfiguration.go index 43a915ca3..77077eef1 100644 --- a/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/operatorconfiguration.go +++ b/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/operatorconfiguration.go @@ -25,8 +25,8 @@ SOFTWARE. package v1 import ( - acidzalandov1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" - scheme "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/scheme" + acidzalandov1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" + scheme "github.com/pocorschi/postgres-operator/pkg/generated/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" rest "k8s.io/client-go/rest" ) diff --git a/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/postgresql.go b/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/postgresql.go index 9afad20f5..e3ad57477 100644 --- a/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/postgresql.go +++ b/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/postgresql.go @@ -25,8 +25,8 @@ SOFTWARE. package v1 import ( - v1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" - scheme "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/scheme" + v1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" + scheme "github.com/pocorschi/postgres-operator/pkg/generated/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/generated/informers/externalversions/acid.zalan.do/interface.go b/pkg/generated/informers/externalversions/acid.zalan.do/interface.go index edf03dce7..caeeefa69 100644 --- a/pkg/generated/informers/externalversions/acid.zalan.do/interface.go +++ b/pkg/generated/informers/externalversions/acid.zalan.do/interface.go @@ -25,8 +25,8 @@ SOFTWARE. package acid import ( - v1 "github.com/zalando/postgres-operator/pkg/generated/informers/externalversions/acid.zalan.do/v1" - internalinterfaces "github.com/zalando/postgres-operator/pkg/generated/informers/externalversions/internalinterfaces" + v1 "github.com/pocorschi/postgres-operator/pkg/generated/informers/externalversions/acid.zalan.do/v1" + internalinterfaces "github.com/pocorschi/postgres-operator/pkg/generated/informers/externalversions/internalinterfaces" ) // Interface provides access to each of this group's versions. diff --git a/pkg/generated/informers/externalversions/acid.zalan.do/v1/interface.go b/pkg/generated/informers/externalversions/acid.zalan.do/v1/interface.go index 77e7c9b34..c58b65945 100644 --- a/pkg/generated/informers/externalversions/acid.zalan.do/v1/interface.go +++ b/pkg/generated/informers/externalversions/acid.zalan.do/v1/interface.go @@ -25,7 +25,7 @@ SOFTWARE. package v1 import ( - internalinterfaces "github.com/zalando/postgres-operator/pkg/generated/informers/externalversions/internalinterfaces" + internalinterfaces "github.com/pocorschi/postgres-operator/pkg/generated/informers/externalversions/internalinterfaces" ) // Interface provides access to all the informers in this group version. diff --git a/pkg/generated/informers/externalversions/acid.zalan.do/v1/postgresql.go b/pkg/generated/informers/externalversions/acid.zalan.do/v1/postgresql.go index 16a055f50..d59de954f 100644 --- a/pkg/generated/informers/externalversions/acid.zalan.do/v1/postgresql.go +++ b/pkg/generated/informers/externalversions/acid.zalan.do/v1/postgresql.go @@ -27,10 +27,10 @@ package v1 import ( time "time" - acidzalandov1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" - versioned "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned" - internalinterfaces "github.com/zalando/postgres-operator/pkg/generated/informers/externalversions/internalinterfaces" - v1 "github.com/zalando/postgres-operator/pkg/generated/listers/acid.zalan.do/v1" + acidzalandov1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" + versioned "github.com/pocorschi/postgres-operator/pkg/generated/clientset/versioned" + internalinterfaces "github.com/pocorschi/postgres-operator/pkg/generated/informers/externalversions/internalinterfaces" + v1 "github.com/pocorschi/postgres-operator/pkg/generated/listers/acid.zalan.do/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/generated/informers/externalversions/factory.go b/pkg/generated/informers/externalversions/factory.go index c36d22a29..ec0a3f430 100644 --- a/pkg/generated/informers/externalversions/factory.go +++ b/pkg/generated/informers/externalversions/factory.go @@ -29,9 +29,9 @@ import ( sync "sync" time "time" - versioned "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned" - acidzalando "github.com/zalando/postgres-operator/pkg/generated/informers/externalversions/acid.zalan.do" - internalinterfaces "github.com/zalando/postgres-operator/pkg/generated/informers/externalversions/internalinterfaces" + versioned "github.com/pocorschi/postgres-operator/pkg/generated/clientset/versioned" + acidzalando "github.com/pocorschi/postgres-operator/pkg/generated/informers/externalversions/acid.zalan.do" + internalinterfaces "github.com/pocorschi/postgres-operator/pkg/generated/informers/externalversions/internalinterfaces" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/generated/informers/externalversions/generic.go b/pkg/generated/informers/externalversions/generic.go index 3af7bb7ec..6892e6ef0 100644 --- a/pkg/generated/informers/externalversions/generic.go +++ b/pkg/generated/informers/externalversions/generic.go @@ -27,7 +27,7 @@ package externalversions import ( "fmt" - v1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" + v1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) diff --git a/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go index bdd892f35..79fa44868 100644 --- a/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -27,7 +27,7 @@ package internalinterfaces import ( time "time" - versioned "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned" + versioned "github.com/pocorschi/postgres-operator/pkg/generated/clientset/versioned" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" cache "k8s.io/client-go/tools/cache" diff --git a/pkg/generated/listers/acid.zalan.do/v1/postgresql.go b/pkg/generated/listers/acid.zalan.do/v1/postgresql.go index da41e1358..6f0f58117 100644 --- a/pkg/generated/listers/acid.zalan.do/v1/postgresql.go +++ b/pkg/generated/listers/acid.zalan.do/v1/postgresql.go @@ -25,7 +25,7 @@ SOFTWARE. package v1 import ( - v1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1" + v1 "github.com/pocorschi/postgres-operator/pkg/apis/acid.zalan.do/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/util/config/config.go b/pkg/util/config/config.go index 3ea8874c5..d732d32dd 100644 --- a/pkg/util/config/config.go +++ b/pkg/util/config/config.go @@ -7,7 +7,7 @@ import ( "fmt" - "github.com/zalando/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/spec" ) // CRD describes CustomResourceDefinition specific configuration parameters @@ -85,7 +85,9 @@ type Config struct { DbHostedZone string `name:"db_hosted_zone" default:"db.example.com"` AWSRegion string `name:"aws_region" default:"eu-central-1"` WALES3Bucket string `name:"wal_s3_bucket"` + WALEGSBucket string `name:"wal_gs_bucket"` LogS3Bucket string `name:"log_s3_bucket"` + LogGSBucket string `name:"log_gs_bucket"` KubeIAMRole string `name:"kube_iam_role"` DebugLogging bool `name:"debug_logging" default:"true"` EnableDBAccess bool `name:"enable_database_access" default:"true"` diff --git a/pkg/util/k8sutil/k8sutil.go b/pkg/util/k8sutil/k8sutil.go index 6f5b15085..7268c68d2 100644 --- a/pkg/util/k8sutil/k8sutil.go +++ b/pkg/util/k8sutil/k8sutil.go @@ -2,7 +2,7 @@ package k8sutil import ( "fmt" - "github.com/zalando/postgres-operator/pkg/util/constants" + "github.com/pocorschi/postgres-operator/pkg/util/constants" "k8s.io/api/core/v1" policybeta1 "k8s.io/api/policy/v1beta1" apiextclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" @@ -17,7 +17,7 @@ import ( "k8s.io/client-go/tools/clientcmd" "reflect" - acidv1client "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned" + acidv1client "github.com/pocorschi/postgres-operator/pkg/generated/clientset/versioned" ) // KubernetesClient describes getters for Kubernetes objects diff --git a/pkg/util/users/users.go b/pkg/util/users/users.go index 112f89b43..862db2ff6 100644 --- a/pkg/util/users/users.go +++ b/pkg/util/users/users.go @@ -7,8 +7,8 @@ import ( "reflect" - "github.com/zalando/postgres-operator/pkg/spec" - "github.com/zalando/postgres-operator/pkg/util" + "github.com/pocorschi/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/util" ) const ( diff --git a/pkg/util/util.go b/pkg/util/util.go index 20e1951f6..1874e8793 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -13,7 +13,7 @@ import ( resource "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/zalando/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/spec" ) const ( diff --git a/pkg/util/util_test.go b/pkg/util/util_test.go index a34e57e23..bc27cc246 100644 --- a/pkg/util/util_test.go +++ b/pkg/util/util_test.go @@ -8,7 +8,7 @@ import ( "regexp" - "github.com/zalando/postgres-operator/pkg/spec" + "github.com/pocorschi/postgres-operator/pkg/spec" ) var pgUsers = []struct { diff --git a/pkg/util/volumes/ebs.go b/pkg/util/volumes/ebs.go index 666436a06..c5d7bd861 100644 --- a/pkg/util/volumes/ebs.go +++ b/pkg/util/volumes/ebs.go @@ -9,8 +9,8 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "k8s.io/api/core/v1" - "github.com/zalando/postgres-operator/pkg/util/constants" - "github.com/zalando/postgres-operator/pkg/util/retryutil" + "github.com/pocorschi/postgres-operator/pkg/util/constants" + "github.com/pocorschi/postgres-operator/pkg/util/retryutil" ) // EBSVolumeResizer implements volume resizing interface for AWS EBS volumes.