We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 275dd3d commit 1a2ac23Copy full SHA for 1a2ac23
kaep
@@ -0,0 +1,20 @@
1
+#!/usr/bin/env bash
2
+
3
+# Check for yq executable; error if not found
4
+YQCMD=$(command -v yq)
5
+if [[ ! -x "${YQCMD}" ]]; then
6
+ echo -e "The `yq` executable was not found; please install it or move it into your PATH\n"
7
+ exit 1
8
+fi
9
10
+# Make sure the KUBECONFIG environment variable is defined
11
+if [[ -z "$KUBECONFIG" ]]; then
12
+ echo -e "No valid KUBECONFIG defined\n"
13
14
15
16
+# Get the Kubernetes API endpoint of the first cluster in the current KUBECONFIG
17
+KAEP=$(yq e '.clusters[0].cluster.server' "${KUBECONFIG}")
18
19
+# Display the value to the user
20
+echo -e "The current Kubernetes API endpoint is: ${KAEP}\n"
0 commit comments