Skip to content

Commit

Permalink
improve the azure setup script (#877)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Zhang <[email protected]>
  • Loading branch information
ryanzhang-oss and Ryan Zhang committed Jul 11, 2024
1 parent 5215190 commit 8fff068
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
13 changes: 9 additions & 4 deletions hack/Azure/setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ If you would like to add a prometheus server to access metrics, run the followin
kubectl get service -n fleet-system
````

2. Install the Prometheus community Helm Chart
2. Get the Prometheus community Helm Chart
```
helm install prom prometheus-community/kube-prometheus-stack -f prommethus.yaml
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
```
The `prommethus.yaml` file should contain the following YAML code:

3. Edit the prometheus.yaml file in this directory to replace `<EXTERNAL-IP>` with the external IP address obtained previously.:
```yaml
prometheus:
service:
Expand All @@ -64,7 +66,10 @@ If you would like to add a prometheus server to access metrics, run the followin
static_configs:
- targets: ["<EXTERNAL-IP>:8080"]
```
Replace `<EXTERNAL-IP>` with the external IP address obtained previously.
4. Install the Prometheus server
```
helm install prom prometheus-community/kube-prometheus-stack -f ./hack/Azure/setup/prometheus.yaml
```
</details>


Expand Down
2 changes: 1 addition & 1 deletion hack/Azure/setup/createHubCluster.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export HUB_CLUSTER=$1

az account set -s ${SUB}
az group create --name $RESOURCE_GROUP --location $LOCATION
az aks create --resource-group $RESOURCE_GROUP --name $HUB_CLUSTER --node-count 2
az aks create --resource-group $RESOURCE_GROUP --name $HUB_CLUSTER --location $LOCATION --node-count 2
az aks get-credentials --resource-group $RESOURCE_GROUP --name $HUB_CLUSTER

export HUB_CLUSTER_CONTEXT=$(kubectl config view -o jsonpath="{.contexts[?(@.context.cluster==\"$HUB_CLUSTER\")].name}")
Expand Down
3 changes: 2 additions & 1 deletion hack/Azure/setup/joinMC.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ kubectl config use-context $MEMBER_CLUSTER_CONTEXT

# Create the secret with the token extracted previously for member agent to use.
echo "Creating secret..."
kubectl delete secret hub-kubeconfig-secret
kubectl create secret generic hub-kubeconfig-secret --from-literal=token=$TOKEN

echo "Uninstalling member-agent..."
Expand All @@ -86,7 +87,7 @@ helm install member-agent charts/member-agent/ \
--set image.pullPolicy=Always \
--set refreshtoken.pullPolicy=Always \
--set config.memberClusterName=$MEMBER_CLUSTER \
--set logVerbosity=5 \
--set logVerbosity=8 \
--set namespace=fleet-system \
--set enableV1Alpha1APIs=false \
--set enableV1Beta1APIs=true
Expand Down
File renamed without changes.

0 comments on commit 8fff068

Please sign in to comment.