Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate annotations to the StatefulSet #932

Merged
merged 26 commits into from May 4, 2020
Merged

Conversation

RafiaSabih
Copy link
Contributor

To help with this reported issue.

@FxKu FxKu added the zalando label Apr 24, 2020
@sdudoladov sdudoladov added this to the 1.5 milestone Apr 27, 2020
@sdudoladov sdudoladov linked an issue Apr 27, 2020 that may be closed by this pull request
@sdudoladov sdudoladov changed the title Initial commit Propagate annotations to the StatefulSet Apr 27, 2020
@sdudoladov
Copy link
Member

sdudoladov commented Apr 27, 2020

@RafiaSabih

  1. we will need to test if adding such an annotation to the stafeful set causes a rolling update (it should not)
  2. we also need to figure out if there can be cases where such annotations need to be present in a k8s cluster but revoked from some individual stateful set, because for example that particular cluster should never be downscaled

- set the type of the new  configuration parameter to be array of
  strings
- propagate the annotations to statefulset at sync
@Jan-M
Copy link
Member

Jan-M commented Apr 27, 2020

  1. is out of scope for now.

pkg/cluster/sync.go Outdated Show resolved Hide resolved
pkg/cluster/k8sres.go Outdated Show resolved Hide resolved
Rafia Sabih added 2 commits April 28, 2020 11:46
-handle rollingUpdate flag
-modularize code
-rename config parameter name
pkg/cluster/sync.go Outdated Show resolved Hide resolved
pkg/cluster/sync.go Outdated Show resolved Hide resolved
pkg/apis/acid.zalan.do/v1/operator_configuration_type.go Outdated Show resolved Hide resolved
docs/reference/cluster_manifest.md Outdated Show resolved Hide resolved
e2e/tests/test_e2e.py Outdated Show resolved Hide resolved

k8s.delete_operator_pod()

annotations = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it meant to be pg_crd_annotations["metadata"]["annotations"] ?

return False
for key in svc.metadata.annotations:
if svc.metadata.annotations[key] != annotations[key]:
return False
return True

def check_statefulset_annotations(self, sset_labels, annotations, namespace='default'):
ssets = self.api.apps_v1.list_namespaced_stateful_set(namespace, label_selector=sset_labels, limit=1).items
for sset in ssets:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why loop if only one stateful set is fetched ?
It is effectively sset = self.api.apps_v1.list_namespaced_stateful_set(namespace, label_selector=sset_labels, limit=1).items[0]

e2e/tests/test_e2e.py Outdated Show resolved Hide resolved
e2e/tests/test_e2e.py Show resolved Hide resolved
pkg/cluster/resources.go Outdated Show resolved Hide resolved
FxKu and others added 8 commits April 30, 2020 09:47
- handle the update path to update sts and connection pooler deployment.
  This way no need to wait for sync
- rename the parameter to downscaler_annotations
- handle other review comments
@FxKu
Copy link
Member

FxKu commented May 4, 2020

👍

1 similar comment
@RafiaSabih
Copy link
Contributor Author

👍

@FxKu FxKu merged commit d52296c into master May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow propagating annotations to the StatefulSet
4 participants