Created
February 21, 2022 15:31
-
-
Save abdennour/d820f46b35c93b85faf5a0020080ef15 to your computer and use it in GitHub Desktop.
Get Cluster CIDR Range - Kubernetes
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
# Credit: https://stackoverflow.com/a/61685899/747579 | |
SVCRANGE=$(echo '{"apiVersion":"v1","kind":"Service","metadata":{"name":"tst"},"spec":{"clusterIP":"1.1.1.1","ports":[{"port":443}]}}' | kubectl apply -f - 2>&1 | sed 's/.*valid IPs is //') | |
echo $SVCRANGE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment