Fix k8s-certs-renew for k8s < 1.20 (#7410)

Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
This commit is contained in:
Etienne Champetier 2021-03-26 11:44:44 -04:00 committed by GitHub
parent edfa3e9b14
commit 2d1597bf10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,10 +1,10 @@
#!/bin/bash #!/bin/bash
echo "## Expiration before renewal ##" echo "## Expiration before renewal ##"
{{ bin_dir }}/kubeadm certs check-expiration {{ bin_dir }}/kubeadm {{ 'alpha ' if kube_version is version('v1.20.0', '<') }}certs check-expiration
echo "## Renewing certificates managed by kubeadm ##" echo "## Renewing certificates managed by kubeadm ##"
{{ bin_dir }}/kubeadm certs renew all {{ bin_dir }}/kubeadm {{ 'alpha ' if kube_version is version('v1.20.0', '<') }}certs renew all
echo "## Restarting control plane pods managed by kubeadm ##" echo "## Restarting control plane pods managed by kubeadm ##"
{% if container_manager == "docker" %} {% if container_manager == "docker" %}
@ -20,4 +20,4 @@ echo "## Waiting for apiserver to be up again ##"
until printf "" 2>>/dev/null >>/dev/tcp/127.0.0.1/6443; do sleep 1; done until printf "" 2>>/dev/null >>/dev/tcp/127.0.0.1/6443; do sleep 1; done
echo "## Expiration after renewal ##" echo "## Expiration after renewal ##"
{{ bin_dir }}/kubeadm certs check-expiration {{ bin_dir }}/kubeadm {{ 'alpha ' if kube_version is version('v1.20.0', '<') }}certs check-expiration