Merge branch 'refs/heads/master' into dev_zhengyang
This commit is contained in:
commit
0c55ce90fa
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
VERSION="0.0.2-20250320"
|
VERSION="0.0.3-20250509"
|
||||||
|
|
||||||
CLUSTER_API_LB_IP=${CLUSTER_API_LB_IP:-4.155.160.32}
|
CLUSTER_API_LB_IP=${CLUSTER_API_LB_IP:-4.155.160.32}
|
||||||
CLUSTER_API_LB_PORT=${CLUSTER_API_LB_PORT:-6443}
|
CLUSTER_API_LB_PORT=${CLUSTER_API_LB_PORT:-6443}
|
||||||
@ -29,13 +29,14 @@ help() {
|
|||||||
echo "Usage: [environment-option=value] freeleaps-cluster-authenticator <sub-command>"
|
echo "Usage: [environment-option=value] freeleaps-cluster-authenticator <sub-command>"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Sub Commands:"
|
echo "Sub Commands:"
|
||||||
echo " auth,-a,--auth Setup kubectl for freeleaps cluster with Mathmast account."
|
echo " auth,-a,--auth Setup kubectl for freeleaps cluster with Mathmast account."
|
||||||
echo " reset-auth,-r,--reset-auth Reset kubectl authentication state for freeleaps cluster."
|
echo " reset-auth,-r,--reset-auth Reset kubectl authentication state for freeleaps cluster."
|
||||||
echo " clear,-c,--clear Clear authentication for freeleaps cluster."
|
echo " refresh-auth,-ra,--refresh-auth Refresh kubectl authentication state for freeleaps cluster, very useful when account roles has been updated."
|
||||||
echo " doctor,-d,--doctor Check if all the required tools are installed."
|
echo " clear,-c,--clear Clear authentication for freeleaps cluster."
|
||||||
echo " dashboard,-db,--dashboard Open the Kubernetes dashboard, forward the port to localhost and listen on 8443."
|
echo " doctor,-d,--doctor Check if all the required tools are installed."
|
||||||
echo " get-token,-gt,--get-token Get the token for the current user, usually to using Kubernetes Dashboard authentication."
|
echo " dashboard,-db,--dashboard Open the Kubernetes dashboard, forward the port to localhost and listen on 8443."
|
||||||
echo " help,-h,--help Show this help message."
|
echo " get-token,-gt,--get-token Get the token for the current user, usually to using Kubernetes Dashboard authentication."
|
||||||
|
echo " help,-h,--help Show this help message."
|
||||||
echo ""
|
echo ""
|
||||||
echo "Environment Options:"
|
echo "Environment Options:"
|
||||||
echo " [Optional] CLUSTER_API_LB_IP: IP address of the cluster API load balancer."
|
echo " [Optional] CLUSTER_API_LB_IP: IP address of the cluster API load balancer."
|
||||||
@ -353,6 +354,17 @@ get_token() {
|
|||||||
echo "[GET_TOKEN] Expiration Timestamp: ${expiration}"
|
echo "[GET_TOKEN] Expiration Timestamp: ${expiration}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
refresh_auth() {
|
||||||
|
gather_prerequisites
|
||||||
|
|
||||||
|
echo "[REFRESH] Refreshing kubectl authentication state..."
|
||||||
|
rm -rf "${HOME}/.kube/cache/oidc-login"
|
||||||
|
setup_kubelogin
|
||||||
|
check_whoami
|
||||||
|
|
||||||
|
echo "[REFRESH] Your kubectl has been refreshed with your Mathmast account."
|
||||||
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
if [ $# -lt 1 ]; then
|
if [ $# -lt 1 ]; then
|
||||||
echo "[ERROR] No sub-command provided."
|
echo "[ERROR] No sub-command provided."
|
||||||
@ -369,6 +381,9 @@ main() {
|
|||||||
reset-auth|-r|--reset-auth)
|
reset-auth|-r|--reset-auth)
|
||||||
reset_auth
|
reset_auth
|
||||||
;;
|
;;
|
||||||
|
refresh-auth|-ra|--refresh-auth)
|
||||||
|
refresh_auth
|
||||||
|
;;
|
||||||
clear|-c|--clear)
|
clear|-c|--clear)
|
||||||
clear_auth
|
clear_auth
|
||||||
;;
|
;;
|
||||||
|
|||||||
@ -15,7 +15,7 @@ chat:
|
|||||||
registry: docker.io
|
registry: docker.io
|
||||||
repository: null
|
repository: null
|
||||||
name: chat
|
name: chat
|
||||||
tag: snapshot-6d2955c
|
tag: snapshot-e641c02
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
|
|||||||
@ -15,7 +15,7 @@ freeleaps:
|
|||||||
registry: docker.io
|
registry: docker.io
|
||||||
repository: null
|
repository: null
|
||||||
name: backend
|
name: backend
|
||||||
tag: snapshot-6d2955c
|
tag: snapshot-e641c02
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
|
|||||||
@ -8,7 +8,7 @@ frontend:
|
|||||||
registry: docker.io
|
registry: docker.io
|
||||||
repository: null
|
repository: null
|
||||||
name: frontend
|
name: frontend
|
||||||
tag: snapshot-8d7ded9
|
tag: snapshot-e641c02
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user