Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Arvindthiru committed Jul 30, 2024
1 parent 3915f00 commit 9881ece
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
15 changes: 9 additions & 6 deletions hack/Azure/setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ export SUB=<AZURE-SUBSCRIPTION-ID>
export RESOURCE_GROUP=<HUB_RESOURCE_GROUP>
export LOCATION=<HUB_LOCATION>

# Run the script. Be sure to replace the values of <HUB-CLUSTER-NAME> with those of your own.
# Run the script. Be sure to replace the values of <IMAGE-TAG> <HUB-CLUSTER-NAME> with those of your own.
# The latest fleet image tag could be found here https://github.com/Azure/fleet/releases.
# Ex.: ./hack/setup/createHubCluster.sh v0.10.8 test-hub
# Run the script.
chmod +x hack/Azure/setup/createHubCluster.sh
./hack/Azure/setup/createHubCluster.sh <HUB-CLUSTER-NAME>
./hack/Azure/setup/createHubCluster.sh <IMAGE-TAG> <HUB-CLUSTER-NAME>
```

It may take a few minutes for the script to finish running. Once it is completed, verify that the `hub-agent` has been installed:
Expand Down Expand Up @@ -90,12 +93,12 @@ A cluster can join in a hub cluster if:
For your convenience, Fleet provides a script that can automate the process of joining a cluster
onto a hub cluster. To use the script, run the commands below after creating needed AKS clusters:
```sh
# Pass in the hub cluster name and a list of cluster context names (separated by a space) as arguments to the script that you would like to
# join the fleet as member clusters. Their context will be used to access the cluster.
# Ex.: ./hack/setup/joinMC.sh test-hub member member2 member3
# Pass in the fleet image tag, hub cluster name and a list of cluster context names (separated by a space) as arguments to the script that you would like to
# join the fleet as member clusters. Their context will be used to access the cluster. The latest fleet image tag can be found here https://github.com/Azure/fleet/releases.
# Ex.: ./hack/setup/joinMC.sh v0.10.8 test-hub member member2 member3
# Run the script.
chmod +x hack/Azure/setup/joinMC.sh
./hack/Azure/setup/joinMC.sh <HUB-CLUSTER-NAME> <MEMBER-CLUSTER-NAME-1> <MEMBER-CLUSTER-NAME-2> <MEMBER-CLUSTER-NAME-3> <MEMBER-CLUSTER-NAME-4>
./hack/Azure/setup/joinMC.sh <IMAGE-TAG> <HUB-CLUSTER-NAME> <MEMBER-CLUSTER-NAME-1> <MEMBER-CLUSTER-NAME-2> <MEMBER-CLUSTER-NAME-3> <MEMBER-CLUSTER-NAME-4>
```
It may take a few minutes for the script to finish running. Once it is completed, verify
Expand Down
6 changes: 3 additions & 3 deletions hack/Azure/setup/createHubCluster.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This script creates a Hub CLuster from an AKS Cluster (AKS Cluster and Container Registry must be created beforehand).

export HUB_CLUSTER=$1
export IMAGE_TAG=$1
export HUB_CLUSTER=$2

az account set -s ${SUB}
az group create --name $RESOURCE_GROUP --location $LOCATION
Expand All @@ -16,7 +17,6 @@ kubectl config use-context $HUB_CLUSTER_CONTEXT
# Retrieve the hub agent image
echo "Retrieving hub-agent image..."
export REGISTRY="mcr.microsoft.com/aks/fleet"
export TAG=$(curl "https://api.github.com/repos/Azure/fleet/tags" | jq -r '.[0].name')
export OUTPUT_TYPE="${OUTPUT_TYPE:-type=docker}"


Expand All @@ -25,7 +25,7 @@ echo "Installing hub-agent..."
helm install hub-agent charts/hub-agent/ \
--set image.pullPolicy=Always \
--set image.repository=$REGISTRY/hub-agent \
--set image.tag=$TAG \
--set image.tag=$IMAGE_TAG \
--set logVerbosity=2 \
--set namespace=fleet-system \
--set enableWebhook=false \
Expand Down
6 changes: 3 additions & 3 deletions hack/Azure/setup/joinMC.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# CAN ONLY BE RUN AFTER CREATING NEEDED AKS CLUSTERS AND HUB CLUSTER. This script creates member clusters for
# AKS Clusters and joins them onto the fleet hub cluster.

export AGENT_IMAGE_VERSION="$1"
export IMAGE_TAG="$1"

export HUB_CLUSTER="$2"
export HUB_CLUSTER_CONTEXT=$(kubectl config view -o jsonpath="{.contexts[?(@.context.cluster==\"$HUB_CLUSTER\")].name}")
Expand Down Expand Up @@ -86,9 +86,9 @@ echo "Installing member-agent..."
helm install member-agent charts/member-agent/ \
--set config.hubURL=$HUB_CLUSTER_ADDRESS \
--set image.repository=$REGISTRY/$MEMBER_AGENT_IMAGE \
--set image.tag=$AGENT_IMAGE_VERSION \
--set image.tag=$IMAGE_TAG \
--set refreshtoken.repository=$REGISTRY/$REFRESH_TOKEN_IMAGE \
--set refreshtoken.tag=$AGENT_IMAGE_VERSION \
--set refreshtoken.tag=$IMAGE_TAG \
--set image.pullPolicy=Always \
--set refreshtoken.pullPolicy=Always \
--set config.memberClusterName=$MEMBER_CLUSTER \
Expand Down

0 comments on commit 9881ece

Please sign in to comment.