Commit Graph

40 Commits

Author SHA1 Message Date
Demch1k d97c271b84
Add abitility to set QPS and Burst limits for api client (#2667)
* Add abitility to set QPS and Burst limits for api client 

---------

Co-authored-by: Ivan Sokoryan <i.sokoryan@robo.cash>
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2024-12-23 08:53:27 +01:00
Felix Kunde 654d22d04a
Configure annotations to be ignored in comparisons during sync (#1823)
* feat: add ignored annotations when comparing during sync

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
Co-authored-by: Moshe Immerman <moshe@flanksource.com>
2022-03-24 18:38:37 +01:00
Alex Stockinger 692c721854
Introduce ENABLE_JSON_LOGGING env variable (#1158) 2020-10-08 15:32:15 +02:00
Felix Kunde cf829df1a4
define ownership between operator and clusters via annotation (#802)
* define ownership between operator and postgres clusters
* add documentation
* add unit test
2020-03-17 16:34:31 +01:00
Felix Kunde 31e568157b reflect change in github url (#496)
Project was moved from the incubator to the Zalando main org, hence the rename
2019-02-25 11:26:55 +01:00
zerg-junior 4b5d3cd121
Fix golint failures
* Fix golint fails based on the original work from  the user u5surf

* Skip installing Docker as CDP now have one pre-installed (repairs builds on CDP)
2019-01-08 13:04:48 +01:00
Oleksii Kliukin 3a9378d3b8
Allow configuring the operator via the YAML manifest. (#326)
* Up until now, the operator read its own configuration from the
configmap.  That has a number of limitations, i.e. when the
configuration value is not a scalar, but a map or a list. We use a
custom code based on github.com/kelseyhightower/envconfig to decode
non-scalar values out of plain text keys, but that breaks when the data
inside the keys contains both YAML-special elememtns (i.e. commas) and
complex quotes, one good example for that is search_path inside
`team_api_role_configuration`. In addition, reliance on the configmap
forced a flag structure on the configuration, making it hard to write
and to read (see
https://github.com/zalando-incubator/postgres-operator/pull/308#issuecomment-395131778).

The changes allow to supply the operator configuration in a proper YAML
file. That required registering a custom CRD to support the operator
configuration and provide an example at
manifests/postgresql-operator-default-configuration.yaml. At the moment,
both old configmap and the new CRD configuration is supported, so no
compatibility issues, however, in the future I'd like to deprecate the
configmap-based configuration altogether. Contrary to the
configmap-based configuration, the CRD one doesn't embed defaults into
the operator code, however, one can use the
manifests/postgresql-operator-default-configuration.yaml as a starting
point in order to build a custom configuration.

Since previously `ReadyWaitInterval` and `ReadyWaitTimeout` parameters
used to create the CRD were taken from the operator configuration, which
is not possible if the configuration itself is stored in the CRD object,
I've added the ability to specify them as environment variables
`CRD_READY_WAIT_INTERVAL` and `CRD_READY_WAIT_TIMEOUT` respectively.

Per review by @zerg-junior  and  @Jan-M.
2018-07-16 16:20:46 +02:00
Sergey Dudoladov b412a831d6 Remove the second namespace prefix from the operator configmap name 2018-02-16 12:30:07 +01:00
Sergey Dudoladov d5d15b7546 Look for secrets in the deployed namespace 2018-02-14 15:37:30 +01:00
Sergey Dudoladov 5837015b3c Add the fileWithNamespace const 2018-02-14 11:43:09 +01:00
Sergey Dudoladov 06fd9e33f5 Watch the namespace where operator deploys to unless told otherwise 2018-02-13 18:17:47 +01:00
Sergey Dudoladov dc4229e84d Include review comments 2018-02-13 15:51:12 +01:00
Sergey Dudoladov 5b0e2ea66d Fetch operator configmap from operator's namespace 2018-02-13 13:39:49 +01:00
Sergey Dudoladov 8b7bbde06e Make env var overwrite configmap setting for watching namespaces 2018-02-06 16:12:47 +01:00
Murat Kabilov 702d901bd9 use clear name for env var denoting namespace to watch (#129) 2017-10-12 10:42:20 +02:00
Murat Kabilov 58572bb43f move controller config to the spec package 2017-08-15 11:41:46 +02:00
Murat Kabilov 50754c9a81 make global vars in the main file private 2017-08-01 16:44:29 +02:00
Murat Kabilov 1f8b37f33d Make use of kubernetes client-go v4
* client-go v4.0.0-beta0
* remove unnecessary methods for tpr object
* rest client: use interface instead of structure pointer
* proper names for constants; some clean up for log messages
* remove teams api client from controller and make it per cluster
2017-07-25 15:25:17 +02:00
Oleksii Kliukin 4455f1b639 Feature/unit tests (#53)
- Avoid relying on Clientset structure to call Kubernetes API functions.
While Clientset is a convinient "catch-all" abstraction for calling
REST API related to different Kubernetes objects, it's impossible to
mock. Replacing it wih the kubernetes.Interface would be quite
straightforward, but would require an exra level of mocked interfaces,
because of the versioning. Instead, a new interface is defined, which
contains only the objects we need of the pre-defined versions.

-  Move KubernetesClient to k8sutil package.
- Add more tests.
2017-07-24 16:56:46 +02:00
Oleksii Kliukin deb36f33e0 Merge pull request #4 from zalando-incubator/disable_teams_api_db_access_flags
Allow disabling access to the DB and the Teams API.

Command-line options --nodatabaseaccess and --noteamsapi disable all
teams api interaction and access to the Postgres database. This is
useful for debugging purposes when the operator runs out of cluster
(with --outofcluster flag).

The same effect can be achieved by setting enable_db_access and/or
enable_teams_api to false.
2017-05-12 17:52:34 +02:00
Oleksii Kliukin 5adceceb36 go fmt run 2017-05-12 17:48:25 +02:00
Oleksii Kliukin abd04e6f5a Avoid abbreviations in user-facing parameters. 2017-05-12 17:44:51 +02:00
Oleksii Kliukin 03064637f1 Allow disabling access to the DB and the Teams API.
Command-line options --nodatabaseaccess and --noteamsapi disable all
teams api interaction and access to the Postgres database. This is
useful for debugging purposes when the operator runs out of cluster
(with --outofcluster flag).

The same effect can be achieved by setting enable_db_access and/or
enable_teams_api to false.
2017-05-12 17:40:48 +02:00
Oleksii Kliukin db661414ee Move license to the root folder. 2017-05-12 16:16:07 +02:00
Murat Kabilov e694db9ba7 add MIT License 2017-05-12 11:55:37 +02:00
Murat Kabilov 92d7fbf372 replace github.bus.zalan.do with github.cm/zalando-incubator 2017-05-12 11:50:16 +02:00
Murat Kabilov 1b82009151 Command exec inside the Pod method 2017-05-12 11:41:36 +02:00
Murat Kabilov fd449342e5 Use Kubernetes API instead of API group 2017-05-12 11:41:36 +02:00
Murat Kabilov da438aab3a Use ConfigMap to store operator's config 2017-05-12 11:41:34 +02:00
Oleksii Kliukin 71b93b4cc2 Feature/infrastructure roles (#91)
* Add infrastructure roles configured globally.

Those are the roles defined in the operator itself. The operator's
configuration refers to the secret containing role names, passwords
and membership information. While they are referred to as roles, in
reality those are users.

In addition, improve the regex to filter out invalid users and
make sure user secret names are compatible with DNS name spec.

Add an example manifest for the infrastructure roles.
2017-05-12 11:41:33 +02:00
Murat Kabilov 101dc06acb Better logging for teams api calls 2017-05-12 11:41:32 +02:00
Murat Kabilov 310c119dfa Display config on operator start up 2017-05-12 11:41:30 +02:00
Murat Kabilov c2d2a67ad5 Get config from environment variables;
ignore pg major version change;
get rid of resources package;
2017-05-12 11:41:29 +02:00
Murat Kabilov ae77fa15e8 Pod Rolling update
introduce Pod events channel;
add parsing of the MaintenanceWindows section;
skip deleting Etcd key on cluster delete;
use external etcd host;
watch for tpr/pods in the namespace of the operator pod only;
2017-05-12 11:41:25 +02:00
Murat Kabilov dfde075c66 Use TPR object namespace while creating its objects 2017-05-12 11:37:09 +02:00
Murat Kabilov 6e2d64bd50 Create human users from teams api 2017-05-12 11:37:09 +02:00
Murat Kabilov abb1173035 Code refactor 2017-05-12 11:37:09 +02:00
Murat Kabilov 75e6bfa55c makefile improvements 2017-05-12 11:37:07 +02:00
Oleksii Kliukin e96f8a80ee Option to run the operator out of cluster. 2017-05-08 12:10:27 +02:00
Murat Kabilov 256ff37c19 refactor file tree structure 2017-05-08 12:10:25 +02:00