Created
October 24, 2020 21:54
-
-
Save devniel/70cd5d00dc2ab5cc47a4bacd8cc97724 to your computer and use it in GitHub Desktop.
Print K8S API port
This file contains 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