-
Notifications
You must be signed in to change notification settings - Fork 16.7k
[stable/kured] feature: Add autolock to define when to execute kured #17246
Conversation
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 Once the patch is verified, the new status will be reflected by the 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. |
Signed-off-by: --replace-all <matthieu.paret@lifen.fr>
/assign @viglesiasce |
@plumdog @patrickmslatteryvt could you take a look at this PR ? |
@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 |
@@ -0,0 +1,39 @@ | |||
{{- if .Values.autolock.enabled }} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
Great idea while kubereboot/kured#66 is in PR limbo. |
Yeah, I'd have to agree that some more explanation of how this works in the readme would greatly benefit new users. |
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>
/ok-to-test |
@plumdog it seems there is /lgtm missing to get this PR merged :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[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 |
The configuration is a little confusing. Using the default values, does that mean kured will only run reboots between 4am and 6am utc? |
…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>
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.]
[stable/chart]
)