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

New vernemq start script always purges #302

Open
rubengees opened this issue Oct 15, 2021 · 2 comments
Open

New vernemq start script always purges #302

rubengees opened this issue Oct 15, 2021 · 2 comments

Comments

@rubengees
Copy link
Contributor

I just tried out the updated vernemq.sh script which now has a better mechanism to decide if the node should leave the cluster or just be stopped.

I noticed that whenever the node is shut down, a cluster leave is performed. It makes no difference if I gracefully shut it down (with kubectl delete) or scale it down (with kubectl scale). I also tried to simulate a normal rolling release (with kubectl rollout restart statefulset vernemq).

I tried to debug the script and found that the jq expression in https://github.com/vernemq/docker-vernemq/blob/master/bin/vernemq.sh#L188 is always true. status.replicas and status.currentReplicas always have the same value, no matter in which way the pod is terminated. I also printed the status object and actually all values regarding the replicas have the same value.

Is this because of a behaviour change in kubernetes? I am testing with 1.12.3.

Also, the helm chart is currently missing the apps/statefulsets get permission here which is needed to run and test this.

cc @isavcic

@ioolkos
Copy link
Contributor

ioolkos commented Nov 23, 2021

@rubengees thanks, this seems relevant, going through it given the next release I'm preparing.

How would you add the stateful set permission here?:

rules:
  - apiGroups: [""] # "" indicates the core API group
    resources: ["pods"]
    verbs: ["get", "watch", "list"]

@rubengees
Copy link
Contributor Author

I can't test right now, so please test these rules before if you want to take them into the chart.

An additional entry like this is required (see this comment on the original PR):

- apiGroups: ["apps"]
  resources: ["statefulsets"]
  verbs: ["get"]

Also, the watch permission can be removed from the pods rule since it is not actually used.

The complete block could look like this:

rules:
  - apiGroups: [ "" ]
    resources: [ "pods" ]
    verbs: [ "get", "list" ]
  - apiGroups: [ "apps" ]
    resources: [ "statefulsets" ]
    verbs: [ "get" ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants