Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/arcbox_3.0' into arcbox_3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
janegilring committed Aug 6, 2024
2 parents 3811d5b + fa20fd1 commit 9926645
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
9 changes: 7 additions & 2 deletions azure_jumpstart_arcbox/artifacts/DataOpsLogonScript.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,13 @@ $clusters | Foreach-Object -ThrottleLimit 5 -Parallel {

Start-Sleep -Seconds 10

az customlocation create --name $customLocation --resource-group $Env:resourceGroup --namespace arc --host-resource-id $connectedClusterId --cluster-extension-ids $extensionId --only-show-errors

try {
az customlocation create --name $customLocation --resource-group $Env:resourceGroup --namespace arc --host-resource-id $connectedClusterId --cluster-extension-ids $extensionId --only-show-errors
} catch {
Write-Host "Error creating custom location: $_" -ForegroundColor Red
Exit 1
}

Start-Sleep -Seconds 10

# Deploying the Azure Arc Data Controller
Expand Down
16 changes: 8 additions & 8 deletions azure_jumpstart_arcbox/artifacts/installK3s.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/bin/bash
exec >installK3s.log
exec 2>&1

sudo apt-get update

sudo sed -i "s/PasswordAuthentication no/PasswordAuthentication yes/" /etc/ssh/sshd_config
Expand All @@ -20,7 +17,6 @@ echo $templateBaseUrl:$7 | awk '{print substr($1,2); }' >> vars.sh
echo $storageContainerName:$8 | awk '{print substr($1,2); }' >> vars.sh
echo $k3sControlPlane:$9 | awk '{print substr($1,2); }' >> vars.sh


sed -i '2s/^/export adminUsername=/' vars.sh
sed -i '3s/^/export subscriptionId=/' vars.sh
sed -i '4s/^/export vmName=/' vars.sh
Expand All @@ -31,6 +27,11 @@ sed -i '8s/^/export templateBaseUrl=/' vars.sh
sed -i '9s/^/export storageContainerName=/' vars.sh
sed -i '10s/^/export k3sControlPlane=/' vars.sh

export vmName=$3

exec >installK3s-${vmName}.log
exec 2>&1

# Set k3 deployment variables
export K3S_VERSION="1.29.6+k3s2" # Do not change!

Expand All @@ -42,7 +43,7 @@ sudo curl -v -o /etc/profile.d/welcomeK3s.sh ${templateBaseUrl}artifacts/welcome

# Syncing this script log to 'jumpstart_logs' directory for ease of troubleshooting
sudo -u $adminUsername mkdir -p /home/${adminUsername}/jumpstart_logs
while sleep 1; do sudo -s rsync -a /var/lib/waagent/custom-script/download/0/installK3s.log /home/${adminUsername}/jumpstart_logs/installK3s.log; done &
while sleep 1; do sudo -s rsync -a /var/lib/waagent/custom-script/download/0/installK3s-$vmName.log /home/${adminUsername}/jumpstart_logs/installK3s-$vmName.log; done &

# Downloading azcopy
echo ""
Expand Down Expand Up @@ -189,15 +190,14 @@ else
echo "ERROR: Failed to add k3s worker nodes"
exit 1
fi

sudo service sshd restart
fi

# Uploading this script log to staging storage for ease of troubleshooting
echo ""
echo "Uploading the script logs to staging storage"
echo ""
# Authorize azcopy by using a system-wide managed identity
log="/home/$adminUsername/jumpstart_logs/installK3s.log"
log="/home/$adminUsername/jumpstart_logs/installK3s-$vmName.log"
storageContainerNameLower=$(echo $storageContainerName | tr '[:upper:]' '[:lower:]')
azcopy cp $log "https://$stagingStorageAccountName.blob.core.windows.net/$storageContainerNameLower/installK3s-$vmName.log"

0 comments on commit 9926645

Please sign in to comment.