Skip to content

Commit 97d6f93

Browse files
fix: fix the join script (#336)
fix the script Signed-off-by: Ryan Zhang <[email protected]>
1 parent bc632fb commit 97d6f93

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

hack/membership/joinMC.sh

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@
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

67
if [ "$#" -lt 3 ]; then
78
echo "Usage: $0 <FLEET-IMAGE-TAG> <HUB-CLUSTER-NAME> <MEMBER-CLUSTER-NAME-1> [<MEMBER-CLUSTER-NAME-2> ...]"
89
exit 1
910
fi
1011

1112
export 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-
1713
export HUB_CLUSTER="$2"
1814
if [[ ! $(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."
@@ -100,13 +96,7 @@ fi
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.
10899
echo "Retrieving image..."
109-
export REGISTRY="mcr.microsoft.com/aks/fleet"
110100
export MEMBER_AGENT_IMAGE="member-agent"
111101
export REFRESH_TOKEN_IMAGE="${REFRESH_TOKEN_NAME:-refresh-token}"
112102
export OUTPUT_TYPE="${OUTPUT_TYPE:-type=docker}"
@@ -121,11 +111,8 @@ echo "Creating secret..."
121111
kubectl delete secret hub-kubeconfig-secret --ignore-not-found=true
122112
kubectl create secret generic hub-kubeconfig-secret --from-literal=token=$TOKEN
123113

124-
echo "Uninstalling member-agent..."
125-
helm uninstall member-agent --wait
126-
127114
echo "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

Comments
 (0)