Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/kured] feature: Add autolock to define when to execute kured #17246

Merged
merged 2 commits into from
Oct 24, 2019
Merged

[stable/kured] feature: Add autolock to define when to execute kured #17246

merged 2 commits into from
Oct 24, 2019

Conversation

mtparet
Copy link
Contributor

@mtparet mtparet commented Sep 19, 2019

What this PR does / why we need it:

Be able to define when to allow kured to be executed.

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

  • DCO signed
  • Chart Version bumped
  • Variables are documented in the README.md
  • Title of the PR starts with chart name (e.g. [stable/chart])

@helm-bot helm-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 19, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @mtparet. Thanks for your PR.

I'm waiting for a helm member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 19, 2019
@helm-bot helm-bot added the Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). label Sep 19, 2019
stable/kured/values.yaml Outdated Show resolved Hide resolved
Signed-off-by: --replace-all <matthieu.paret@lifen.fr>
@mtparet
Copy link
Contributor Author

mtparet commented Sep 19, 2019

/assign @viglesiasce

@mtparet
Copy link
Contributor Author

mtparet commented Sep 23, 2019

@plumdog @patrickmslatteryvt could you take a look at this PR ?

@plumdog
Copy link
Contributor

plumdog commented Sep 24, 2019

@mtparet What is this feature and how does it work? I can't find it mentioned in https://github.com/weaveworks/kured anywhere. Is this an true feature of kured, or something that interacts with the locking configmap annotation that kured uses?

stable/kured/Chart.yaml Outdated Show resolved Hide resolved
@@ -0,0 +1,39 @@
{{- if .Values.autolock.enabled }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could make the two cronjobs use the same template (there's quite a bit of repetition between them, and they are "twins", so their sameness is inherent) which might be tidier, but might be harder to understand.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed but I tried but I don't know how to do that, using functions in .tpl file storing the whole template ?

Copy link
Contributor

Choose a reason for hiding this comment

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

You can do this with something like:

{{ $root := . }}
{{- range $direction := list "lock" "unlock" }}
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: {{ template "kured.fullname" $root }}-{{ $direction }}
...
{{- if eq $direction "lock" }}
  schedule: {{ $root.Values.autolock.scheduleLock | quote }}
{{- else }}
  schedule: {{ $root.Values.autolock.scheduleUnlock | quote }}
{{- end }}
...
{{- end }}

But I'm inclined to say get it merged as it is, then we can worry about dry-ing up the templates later.

stable/kured/values.yaml Outdated Show resolved Hide resolved
@patrickmslatteryvt
Copy link
Contributor

patrickmslatteryvt commented Sep 24, 2019

Great idea while kubereboot/kured#66 is in PR limbo.
I know I'll certainly use it for my AKS clusters.

@patrickmslatteryvt
Copy link
Contributor

@mtparet What is this feature and how does it work? I can't find it mentioned in https://github.com/weaveworks/kured anywhere. Is this an true feature of kured, or something that interacts with the locking configmap annotation that kured uses?

Yeah, I'd have to agree that some more explanation of how this works in the readme would greatly benefit new users.

@helm-bot helm-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). labels Oct 3, 2019
@mtparet
Copy link
Contributor Author

mtparet commented Oct 3, 2019

@patrickmslatteryvt @plumdog

I have added a short description of the feature and address some comments.

change kubectl image
fix annotation job

Signed-off-by: --replace-all <matthieu.paret@lifen.fr>
@mtparet
Copy link
Contributor Author

mtparet commented Oct 4, 2019

As @plumdog approved the PR, should this one be automatically merged ? @cpanato @paulczar

@zanhsieh
Copy link
Collaborator

zanhsieh commented Oct 4, 2019

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 4, 2019
@mtparet
Copy link
Contributor Author

mtparet commented Oct 7, 2019

@plumdog it seems there is /lgtm missing to get this PR merged :)

Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 24, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpanato, mtparet

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 24, 2019
@k8s-ci-robot k8s-ci-robot merged commit 0462a90 into helm:master Oct 24, 2019
@mtparet mtparet deleted the add_autolock_kure branch October 24, 2019 16:39
@maxkisung
Copy link

maxkisung commented Nov 27, 2019

The configuration is a little confusing. Using the default values, does that mean kured will only run reboots between 4am and 6am utc?

hakman pushed a commit to hakman/charts that referenced this pull request Dec 5, 2019
…elm#17246)

* Add feature autolock to define when to execute kured

Signed-off-by: --replace-all <matthieu.paret@lifen.fr>

* fix version of kured
change kubectl image
fix annotation job

Signed-off-by: --replace-all <matthieu.paret@lifen.fr>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). lgtm Indicates that a PR is ready to be merged. ok-to-test size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants