Skip to content

Instantly share code, notes, and snippets.

@ryran
Created June 20, 2019 14:48
Show Gist options
  • Select an option

  • Save ryran/d7507f5f9a24bb932e7b0f85843f95cf to your computer and use it in GitHub Desktop.

Select an option

Save ryran/d7507f5f9a24bb932e7b0f85843f95cf to your computer and use it in GitHub Desktop.

Revisions

  1. ryran created this gist Jun 20, 2019.
    11 changes: 11 additions & 0 deletions check-node-kubelet-certs.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    #!/bin/bash

    MASTERS="master0 master1 master2"
    WORKERS="worker0 worker1"

    echo "Checking expiration dates for all node /var/lib/kubelet/pki/kubelet-{server,client}-current certs ..." >&2
    echo >&2
    for h in $MASTERS $WORKERS; do
    echo $h
    ssh $h 'for f in kubelet-{server,client}-current.pem; do printf "\t$f: "; sudo openssl x509 -enddate -noout -in /var/lib/kubelet/pki/$f; done'
    done