diff --git a/azure_jumpstart_arcbox/artifacts/DevOpsLogonScript.ps1 b/azure_jumpstart_arcbox/artifacts/DevOpsLogonScript.ps1 index d41b6a9fbb..7f15d1fc5a 100644 --- a/azure_jumpstart_arcbox/artifacts/DevOpsLogonScript.ps1 +++ b/azure_jumpstart_arcbox/artifacts/DevOpsLogonScript.ps1 @@ -257,17 +257,18 @@ $kubeVipDaemonset | kubectl apply -f - kubectl create configmap -n kube-system kubevip --from-literal range-global=$lowestServiceIp-$highestServiceIp Start-Sleep -Seconds 30 - Write-Header "Creating longhorn storage on K3scluster" + Write-Header "Creating longhorn storage on $($cluster.clusterName)" kubectl apply -f "$Env:ArcBoxDir\longhorn.yaml" --kubeconfig $cluster.kubeConfig Start-Sleep -Seconds 30 Write-Host "`n" } -# # Longhorn setup for RWX-capable storage class -# Write-Header "Creating longhorn storage" -# kubectl apply -f "$Env:ArcBoxDir\longhorn.yaml" -# Start-Sleep -Seconds 30 - +foreach ($cluster in $clusters) { + if ($cluster.context -like '*-datasvc-k3s') { + $Env:KUBECONFIG=$cluster.kubeConfig + kubectx + } +} # Create Kubernetes Namespaces Write-Header "Creating K8s Namespaces" @@ -281,7 +282,6 @@ foreach ($namespace in @('bookstore', 'bookbuyer', 'bookwarehouse')) { kubectl label namespace $namespace istio-injection=enabled } - ############################# # - Apply GitOps Configs ############################# @@ -322,7 +322,7 @@ az k8s-configuration flux create ` --scope namespace ` --namespace bookstore ` --url $appClonedRepo ` - --branch main--sync-interval 3s ` + --branch main --sync-interval 3s ` --kustomization name=bookstore path=./bookstore/rbac-sample # Create GitOps config for Hello-Arc application diff --git a/azure_jumpstart_arcbox/artifacts/installK3s.sh b/azure_jumpstart_arcbox/artifacts/installK3s.sh index 5dc316a06f..78d8b87d73 100644 --- a/azure_jumpstart_arcbox/artifacts/installK3s.sh +++ b/azure_jumpstart_arcbox/artifacts/installK3s.sh @@ -29,6 +29,9 @@ sed -i '10s/^/export k3sControlPlane=/' vars.sh export vmName=$3 +# Save the original stdout and stderr +exec 3>&1 4>&2 + exec >installK3s-${vmName}.log exec 2>&1 @@ -198,6 +201,9 @@ fi echo "" echo "Uploading the script logs to staging storage" echo "" +# Restore the original stdout and stderr +exec 1>&3 2>&4 # Further commands will now output to the original stdout and stderr and not the log file + sleep 60 log="/home/$adminUsername/jumpstart_logs/installK3s-$vmName.log" storageContainerNameLower=$(echo $storageContainerName | tr '[:upper:]' '[:lower:]')