22# AKS Clusters and joins them onto the hub cluster.
33
44# Perform validation to ensure the script can run correctly.
5+ export REGISTRY=" ${REGISTRY:- mcr.microsoft.com/ aks/ fleet} "
56
67if [ " $# " -lt 3 ]; then
78 echo " Usage: $0 <FLEET-IMAGE-TAG> <HUB-CLUSTER-NAME> <MEMBER-CLUSTER-NAME-1> [<MEMBER-CLUSTER-NAME-2> ...]"
89 exit 1
910fi
1011
1112export IMAGE_TAG=" $1 "
12- if [[ $( curl " https://api.github.com/repos/Azure/fleet/tags" ) != * " $1 " * ]] > /dev/null 2>&1 ; then
13- echo " fleet image tag $1 does not exist"
14- exit 1
15- fi
16-
1713export HUB_CLUSTER=" $2 "
1814if [[ ! $( kubectl config view -o jsonpath=" {.contexts[?(@.context.cluster==\" $HUB_CLUSTER \" )]}" ) ]] > /dev/null 2>&1 ; then
1915 echo " The cluster named $HUB_CLUSTER does not exist."
10096
10197# # Install the member agent helm chart on the member cluster.
10298
103- # The variables below uses the Fleet images kept in the Microsoft Container Registry (MCR),
104- # and will retrieve the latest version from the Fleet GitHub repository.
105- #
106- # You can, however, build the Fleet images of your own; see the repository README for
107- # more information.
10899echo " Retrieving image..."
109- export REGISTRY=" mcr.microsoft.com/aks/fleet"
110100export MEMBER_AGENT_IMAGE=" member-agent"
111101export REFRESH_TOKEN_IMAGE=" ${REFRESH_TOKEN_NAME:- refresh-token} "
112102export OUTPUT_TYPE=" ${OUTPUT_TYPE:- type=docker} "
@@ -121,11 +111,8 @@ echo "Creating secret..."
121111kubectl delete secret hub-kubeconfig-secret --ignore-not-found=true
122112kubectl create secret generic hub-kubeconfig-secret --from-literal=token=$TOKEN
123113
124- echo " Uninstalling member-agent..."
125- helm uninstall member-agent --wait
126-
127114echo " Installing member-agent..."
128- helm install member-agent charts/member-agent/ \
115+ helm upgrade -- install member-agent charts/member-agent/ \
129116 --set config.hubURL=$HUB_CLUSTER_ADDRESS \
130117 --set image.repository=$REGISTRY /$MEMBER_AGENT_IMAGE \
131118 --set image.tag=$IMAGE_TAG \
@@ -134,7 +121,7 @@ helm install member-agent charts/member-agent/ \
134121 --set image.pullPolicy=Always \
135122 --set refreshtoken.pullPolicy=Always \
136123 --set config.memberClusterName=$MEMBER_CLUSTER \
137- --set logVerbosity=8 \
124+ --set logVerbosity=5 \
138125 --set namespace=fleet-system \
139126 --set enableV1Beta1APIs=true
140127
0 commit comments