File tree 2 files changed +21
-0
lines changed
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -205,12 +205,15 @@ jobs:
205
205
--publisher Microsoft.Azure.Extensions \
206
206
--force-update \
207
207
--protected-settings "{\"commandToExecute\": \" \
208
+ sudo chmod -R 777 /etc/rancher/k3s/k3s.yaml && \
208
209
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml && \
209
210
kubectl config use-context default && \
210
211
kubectl get pods -A -v6 && \
211
212
az login --service-principal -u ${{ secrets.AZURE_SP_CLIENT_ID }} -p \"\"${{ secrets.AZURE_SP_CLIENT_SECRET }}\"\" --tenant $tenantId && \
212
213
az extension add --name connectedk8s --yes && \
213
214
az extension add --name azure-iot-ops --yes && \
215
+ sleep 1m && \
216
+ kubectl delete node \$(kubectl get nodes | grep NotReady | awk '{print \$1}') && \
214
217
az connectedk8s connect --debug -n $clusterName -l $location -g $resourceGroup --subscription $subscriptionId && \
215
218
az connectedk8s enable-features --debug -n $clusterName -g $resourceGroup --custom-locations-oid \"\"${{ secrets.CUSTOM_LOCATIONS_OBJECT_ID }}\"\" --features cluster-connect custom-locations && \
216
219
saId=\$(az storage account create -n $saName -g $resourceGroup --enable-hierarchical-namespace -o tsv --query id) && \
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ az vm extension set \
4
+ --resource-group rg-arc-vmnext \
5
+ --vm-name arc-vmnext \
6
+ --name customScript \
7
+ --publisher Microsoft.Azure.Extensions \
8
+ --force-update \
9
+ --protected-settings " {\" commandToExecute\" : \" \
10
+ export KUBECONFIG=/etc/rancher/k3s/k3s.yaml && \
11
+ notReadyNotes=\$ (kubectl get nodes | grep NotReady | awk '{print \$ 1}' 2>/dev/null) && \
12
+ len=\$ {#notReadyNotes} && \
13
+ echo \"\" not ready\$ len\"\" && \
14
+ if [[ -z \$ notReadyNotes ]]; then echo \"\" xxxx\"\" && kubectl delete node \"\"\$ notReadyNotes\"\" ; fi && \
15
+ kubectl config use-context default && \
16
+ kubectl get pods -A -v6 \
17
+ \" }"
18
+
You can’t perform that action at this time.
0 commit comments