Skip to content

Commit

Permalink
Add auto_renew_certificates_systemd_calendar (#7490)
Browse files Browse the repository at this point in the history
This allow to configure when K8S certificates renewal runs

Signed-off-by: Etienne Champetier <[email protected]>
  • Loading branch information
champtar authored Apr 12, 2021
1 parent 42382e2 commit bf6a39e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions inventory/sample/group_vars/k8s-cluster/k8s-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -306,3 +306,5 @@ event_ttl_duration: "1h0m0s"

## Automatically renew K8S control plane certificates on first Monday of each month
auto_renew_certificates: false
# First Monday of each month
# auto_renew_certificates_systemd_calendar: "Mon *-*-1,2,3,4,5,6,7 03:{{ groups['kube_control_plane'].index(inventory_hostname) }}0:00"
2 changes: 2 additions & 0 deletions roles/kubernetes/control-plane/defaults/main/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,5 @@ event_ttl_duration: "1h0m0s"

## Automatically renew K8S control plane certificates on first Monday of each month
auto_renew_certificates: false
# First Monday of each month
auto_renew_certificates_systemd_calendar: "Mon *-*-1,2,3,4,5,6,7 03:{{ groups['kube_control_plane'].index(inventory_hostname) }}0:00"
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
Description=Timer to renew K8S control plane certificates

[Timer]
# First Monday of each month
OnCalendar=Mon *-*-1,2,3,4,5,6,7 03:{{ groups['kube_control_plane'].index(inventory_hostname) }}0:00
OnCalendar={{ auto_renew_certificates_systemd_calendar }}

[Install]
WantedBy=multi-user.target

0 comments on commit bf6a39e

Please sign in to comment.