Created
October 24, 2020 21:54
Print K8S API port
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
regex=":([[:digit:]]+)\/" | |
cluster_info=$(kubectl cluster-info) | |
[[ $cluster_info =~ $regex ]] | |
port="${BASH_REMATCH[1]}" | |
echo "Kubernetes API port: ${port}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment