Merge "Improvements to output adding custom title to certs"
This commit is contained in:
commit
55c9075d46
@ -118,8 +118,12 @@ PrintCertInfo-fromTlsSecret () {
|
|||||||
|
|
||||||
kubectl --kubeconfig /etc/kubernetes/admin.conf -n $NAMESPACE get secret $SECRET -o yaml | fgrep tls.crt | fgrep -v "f:tls.crt" | awk '{print $2}' | base64 --decode > $TMP_SECRET_SECRET_FILE
|
kubectl --kubeconfig /etc/kubernetes/admin.conf -n $NAMESPACE get secret $SECRET -o yaml | fgrep tls.crt | fgrep -v "f:tls.crt" | awk '{print $2}' | base64 --decode > $TMP_SECRET_SECRET_FILE
|
||||||
|
|
||||||
|
if [ ! -z "$NAME" ]; then
|
||||||
|
NAME=$(echo $NAME " / ")
|
||||||
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "$BOLD" $NAMESPACE " / " $SECRET " CERTIFICATE:" "$RESET"
|
echo "$BOLD" $NAME $NAMESPACE " / " $SECRET " CERTIFICATE:" "$RESET"
|
||||||
echo "$BOLD" "------------------------------------------" "$RESET"
|
echo "$BOLD" "------------------------------------------" "$RESET"
|
||||||
|
|
||||||
echo -e '\t' "Renewal \t: " $RENEWAL
|
echo -e '\t' "Renewal \t: " $RENEWAL
|
||||||
@ -162,10 +166,14 @@ PrintCertInfo-fromGenericSecret () {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -z "$NAME" ]; then
|
||||||
|
NAME=$(echo $NAME " / ")
|
||||||
|
fi
|
||||||
|
|
||||||
echo "$SECRET_VALUE" | base64 --decode > $TMP_GEN_SECRET_FILE
|
echo "$SECRET_VALUE" | base64 --decode > $TMP_GEN_SECRET_FILE
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "$BOLD" $NAMESPACE " / " $SECRET " / " $SECRETFILE " CERTIFICATE:" "$RESET"
|
echo "$BOLD" $NAME $NAMESPACE " / " $SECRET " / " $SECRETFILE " CERTIFICATE:" "$RESET"
|
||||||
echo "$BOLD" "------------------------------------------" "$RESET"
|
echo "$BOLD" "------------------------------------------" "$RESET"
|
||||||
|
|
||||||
echo -e '\t' "Renewal \t: " "${RENEWAL}"
|
echo -e '\t' "Renewal \t: " "${RENEWAL}"
|
||||||
@ -360,9 +368,10 @@ PrintCertInfo-fromFile "openstack CA" "/etc/ssl/private/openstack/ca-cert.pem" "
|
|||||||
# OIDC
|
# OIDC
|
||||||
PrintCertInfo-for-OIDC-Certificates
|
PrintCertInfo-for-OIDC-Certificates
|
||||||
|
|
||||||
PrintCertInfo-fromGenericSecret "" "monitor" "mon-elastic-services-secrets" "ca.crt"
|
# analytics certificates
|
||||||
PrintCertInfo-fromGenericSecret "" "monitor" "mon-elastic-services-secrets" "ext-ca.crt"
|
PrintCertInfo-fromGenericSecret "Internal Analytics CA Certificate" "monitor" "mon-elastic-services-secrets" "ca.crt"
|
||||||
PrintCertInfo-fromGenericSecret "" "monitor" "mon-elastic-services-secrets" "kibana.crt"
|
PrintCertInfo-fromGenericSecret "External Analytics CA Certificate" "monitor" "mon-elastic-services-secrets" "ext-ca.crt"
|
||||||
|
PrintCertInfo-fromGenericSecret "External Kibana Certificate" "monitor" "mon-elastic-services-secrets" "kibana.crt"
|
||||||
|
|
||||||
# Kubernetes Certificates
|
# Kubernetes Certificates
|
||||||
echo
|
echo
|
||||||
@ -371,7 +380,14 @@ echo "$BOLD" "------------------------------------------" "$RESET"
|
|||||||
echo "Note: 'CERTIFICATES' are Renewal: ${GREEN}Automatic${RESET}"
|
echo "Note: 'CERTIFICATES' are Renewal: ${GREEN}Automatic${RESET}"
|
||||||
echo "Note: 'CERTIFICATE AUTHORITIES' are Renewal: ${RED}Manual${RESET}"
|
echo "Note: 'CERTIFICATE AUTHORITIES' are Renewal: ${RED}Manual${RESET}"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
# works with stable and experimenal certs subcommand
|
||||||
|
kubeadm certs &> /dev/null
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
kubeadm certs check-expiration
|
||||||
|
else
|
||||||
kubeadm alpha certs check-expiration
|
kubeadm alpha certs check-expiration
|
||||||
|
fi
|
||||||
echo
|
echo
|
||||||
CleanUp
|
CleanUp
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user