diff --git a/azure_jumpstart_arcbox/artifacts/DataOpsLogonScript.ps1 b/azure_jumpstart_arcbox/artifacts/DataOpsLogonScript.ps1 index c997589429..cc3560d07c 100644 --- a/azure_jumpstart_arcbox/artifacts/DataOpsLogonScript.ps1 +++ b/azure_jumpstart_arcbox/artifacts/DataOpsLogonScript.ps1 @@ -12,7 +12,7 @@ $aksArcClusterName = ($Env:aksArcClusterName).toLower() $aksdrArcClusterName = ($Env:aksdrArcClusterName).toLower() $clusters = @( - [pscustomobject]@{clusterName = $Env:k3sArcDataClusterName; dataController = "$k3sArcDataClusterName-dc" ; customLocation = "$k3sArcDataClusterName-cl" ; storageClassName = 'longhorn' ; licenseType = 'LicenseIncluded' ; context = 'k3s' ; kubeConfig = "C:\Users\$Env:adminUsername\.kube\config-datasvc-k3s" } + [pscustomobject]@{clusterName = $Env:k3sArcDataClusterName; dataController = "$k3sArcDataClusterName-dc" ; customLocation = "$k3sArcDataClusterName-cl" ; storageClassName = 'longhorn' ; licenseType = 'LicenseIncluded' ; context = 'k3s' ; kubeConfig = "C:\Users\$Env:adminUsername\.kube\config-k3s-datasvc" } [pscustomobject]@{clusterName = $Env:aksArcClusterName ; dataController = "$aksArcClusterName-dc" ; customLocation = "$aksArcClusterName-cl" ; storageClassName = 'managed-premium' ; licenseType = 'LicenseIncluded' ; context = 'aks' ; kubeConfig = "C:\Users\$Env:adminUsername\.kube\config-aks" } [pscustomobject]@{clusterName = $Env:aksdrArcClusterName ; dataController = "$aksdrArcClusterName-dc" ; customLocation = "$aksdrArcClusterName-cl" ; storageClassName = 'managed-premium' ; licenseType = 'DisasterRecovery' ; context = 'aks-dr'; kubeConfig = "C:\Users\$Env:adminUsername\.kube\config-aksdr" } ) @@ -107,7 +107,7 @@ Write-Host "`n" # Downloading k3s Kubernetes cluster kubeconfig file Write-Header "Downloading k3s Kubeconfig" $sourceFile = "https://$Env:stagingStorageAccountName.blob.core.windows.net/$($Env:k3sArcDataClusterName.ToLower())/config" -azcopy cp --check-md5 FailIfDifferentOrMissing $sourceFile "C:\Users\$Env:adminUsername\.kube\config-datasvc-k3s" +azcopy cp --check-md5 FailIfDifferentOrMissing $sourceFile "C:\Users\$Env:adminUsername\.kube\config-k3s-datasvc" azcopy cp --check-md5 FailIfDifferentOrMissing $sourceFile "C:\Users\$Env:adminUsername\.kube\config" $addsDomainNetBiosName = $Env:addsDomainName.Split(".")[0] @@ -132,7 +132,7 @@ az aks get-credentials --resource-group $Env:resourceGroup --name $Env:aksdrArcC kubectx aks="$Env:aksArcClusterName-admin" kubectx aks-dr="$Env:aksdrArcClusterName-admin" -kubectx k3s="$namingPrefix-datasvc-k3s" +kubectx k3s="$namingPrefix-k3s-datasvc" Start-Sleep -Seconds 10 @@ -333,7 +333,7 @@ Stop-Transcript # - Deploying data services on k3s cluster ################################################ -wt --% --maximized new-tab pwsh.exe -NoExit -Command Show-K8sPodStatus -kubeconfig "C:\Users\$Env:adminUsername\.kube\config-datasvc-k3s" -clusterName 'k3s Cluster'; split-pane -p "PowerShell" pwsh.exe -NoExit -Command Show-K8sPodStatus -kubeconfig "C:\Users\$Env:USERNAME\.kube\config-aks" -clusterName 'AKS Cluster'; split-pane -H pwsh.exe -NoExit -Command Show-K8sPodStatus -kubeconfig "C:\Users\$Env:USERNAME\.kube\config-aksdr" -clusterName 'AKS-DR Cluster' +wt --% --maximized new-tab pwsh.exe -NoExit -Command Show-K8sPodStatus -kubeconfig "C:\Users\$Env:adminUsername\.kube\config-k3s-datasvc" -clusterName 'k3s Cluster'; split-pane -p "PowerShell" pwsh.exe -NoExit -Command Show-K8sPodStatus -kubeconfig "C:\Users\$Env:USERNAME\.kube\config-aks" -clusterName 'AKS Cluster'; split-pane -H pwsh.exe -NoExit -Command Show-K8sPodStatus -kubeconfig "C:\Users\$Env:USERNAME\.kube\config-aksdr" -clusterName 'AKS-DR Cluster' Write-Header "Deploying Azure Arc Data Controllers on Kubernetes cluster" $clusters | Foreach-Object -ThrottleLimit 5 -Parallel { diff --git a/azure_jumpstart_arcbox/artifacts/DeployAPIM.ps1 b/azure_jumpstart_arcbox/artifacts/DeployAPIM.ps1 index 45b4290e10..04d309a532 100644 --- a/azure_jumpstart_arcbox/artifacts/DeployAPIM.ps1 +++ b/azure_jumpstart_arcbox/artifacts/DeployAPIM.ps1 @@ -28,7 +28,7 @@ az config set extension.use_dynamic_install=yes_without_prompt ################################################ # Retrive SQL Managed Instances ################################################ -kubectx arcbox-datasvc-k3s +kubectx arcbox-k3s-datasvc kubectl get nodes # Retrieving SQL MI connection endpoints diff --git a/azure_jumpstart_arcbox/artifacts/DeploySQLMIADAuth.ps1 b/azure_jumpstart_arcbox/artifacts/DeploySQLMIADAuth.ps1 index a008f2d108..857dc46cdb 100644 --- a/azure_jumpstart_arcbox/artifacts/DeploySQLMIADAuth.ps1 +++ b/azure_jumpstart_arcbox/artifacts/DeploySQLMIADAuth.ps1 @@ -61,7 +61,7 @@ else { $sqlInstances = @( - [pscustomobject]@{instanceName = 'k3s-sql'; dataController = "$k3sArcDataClusterName-dc"; customLocation = "$k3sArcDataClusterName-cl" ; storageClassName = 'longhorn' ; licenseType = 'LicenseIncluded' ; context = 'k3s' ; kubeConfig = "C:\Users\$Env:adminUsername\.kube\config-datasvc-k3s" } + [pscustomobject]@{instanceName = 'k3s-sql'; dataController = "$k3sArcDataClusterName-dc"; customLocation = "$k3sArcDataClusterName-cl" ; storageClassName = 'longhorn' ; licenseType = 'LicenseIncluded' ; context = 'k3s' ; kubeConfig = "C:\Users\$Env:adminUsername\.kube\config-k3s-datasvc" } [pscustomobject]@{instanceName = 'aks-sql'; dataController = "$aksArcClusterName-dc" ; customLocation = "$aksArcClusterName-cl" ; storageClassName = 'managed-premium' ; licenseType = 'LicenseIncluded' ; context = 'aks'; kubeConfig = "C:\Users\$Env:adminUsername\.kube\config-aks" } diff --git a/azure_jumpstart_arcbox/artifacts/DevOpsLogonScript.ps1 b/azure_jumpstart_arcbox/artifacts/DevOpsLogonScript.ps1 index 5e6957f823..fd5f2e30b1 100644 --- a/azure_jumpstart_arcbox/artifacts/DevOpsLogonScript.ps1 +++ b/azure_jumpstart_arcbox/artifacts/DevOpsLogonScript.ps1 @@ -18,7 +18,7 @@ $certdns = "arcbox.devops.com" $appClonedRepo = "https://github.com/$Env:githubUser/azure-arc-jumpstart-apps" $clusters = @( - [pscustomobject]@{clusterName = $Env:k3sArcDataClusterName; context = "$namingPrefix-datasvc-k3s" ; kubeConfig = "C:\Users\$Env:adminUsername\.kube\config" } + [pscustomobject]@{clusterName = $Env:k3sArcDataClusterName; context = "$namingPrefix-k3s-datasvc" ; kubeConfig = "C:\Users\$Env:adminUsername\.kube\config" } [pscustomobject]@{clusterName = $Env:k3sArcClusterName; context = "$namingPrefix-k3s" ; kubeConfig = "C:\Users\$Env:adminUsername\.kube\config-k3s" } ) @@ -37,7 +37,7 @@ if(-not $($cliDir.Parent.Attributes.HasFlag([System.IO.FileAttributes]::Hidden)) $Env:AZURE_CONFIG_DIR = $cliDir.FullName -$Env:k3sArcDataClusterName=(Get-AzResource -ResourceGroupName $Env:resourceGroup -ResourceType microsoft.kubernetes/connectedclusters).Name | Select-String "$namingPrefix-DataSvc-K3s" | Where-Object { $_ -ne "" } +$Env:k3sArcDataClusterName=(Get-AzResource -ResourceGroupName $Env:resourceGroup -ResourceType microsoft.kubernetes/connectedclusters).Name | Select-String "$namingPrefix-K3s-Data" | Where-Object { $_ -ne "" } $Env:k3sArcDataClusterName=$Env:k3sArcDataClusterName -replace "`n","" $Env:k3sArcClusterName=(Get-AzResource -ResourceGroupName $Env:resourceGroup -ResourceType microsoft.kubernetes/connectedclusters).Name | Select-String "$namingPrefix-K3s" | Where-Object { $_ -ne "" } @@ -48,13 +48,13 @@ Write-Header "Az CLI Login" az login --identity az account set -s $env:subscriptionId -# Downloading ArcBox-DataSvc-K3s Kubernetes cluster kubeconfig file -Write-Header "Downloading $namingPrefix-DataSvc-K3s K8s Kubeconfig" +# Downloading ArcBox-K3s-DataSvc Kubernetes cluster kubeconfig file +Write-Header "Downloading $namingPrefix-K3s-DataSvc K8s Kubeconfig" $sourceFile = "https://$Env:stagingStorageAccountName.blob.core.windows.net/$($Env:k3sArcDataClusterName.ToLower())/config" azcopy cp --check-md5 FailIfDifferentOrMissing $sourceFile "C:\Users\$Env:USERNAME\.kube\config" -# Downloading ArcBox-DataSvc-K3s log file -Write-Header "Downloading $namingPrefix-DataSvc-K3s Install Logs" +# Downloading ArcBox-K3s-DataSvc log file +Write-Header "Downloading $namingPrefix-K3s-DataSvc Install Logs" $sourceFile = "https://$Env:stagingStorageAccountName.blob.core.windows.net/$($Env:k3sArcDataClusterName.ToLower())/*" $sourceFile = $sourceFile + "?" + $sas azcopy cp --check-md5 FailIfDifferentOrMissing $sourceFile "$Env:ArcBoxLogsDir\" --include-pattern "*.log" @@ -71,8 +71,8 @@ $sourceFile = "https://$Env:stagingStorageAccountName.blob.core.windows.net/$($E $sourceFile = $sourceFile + "?" + $sas azcopy cp --check-md5 FailIfDifferentOrMissing $sourceFile "$Env:ArcBoxLogsDir\" --include-pattern "*.log" -# # Merging kubeconfig files from ArcBox-DataSvc-K3s and ArcBox-K3s -# Write-Header "Merging ArcBox-DataSvc-K3s & ArcBox-K3s Kubeconfigs" +# # Merging kubeconfig files from ArcBox-K3s-DataSvc and ArcBox-K3s +# Write-Header "Merging ArcBox-K3s-DataSvc & ArcBox-K3s Kubeconfigs" # Copy-Item -Path "C:\Users\$Env:USERNAME\.kube\config" -Destination "C:\Users\$Env:USERNAME\.kube\config.backup" # $Env:KUBECONFIG="C:\Users\$Env:USERNAME\.kube\config;C:\Users\$Env:USERNAME\.kube\config-k3s" # kubectl config view --raw > C:\users\$Env:USERNAME\.kube\config_tmp @@ -263,9 +263,9 @@ $kubeVipDaemonset | kubectl apply -f - Write-Host "`n" } -# Switch Kubernetes context to ArcBox-DataSvc-K3s cluster +# Switch Kubernetes context to ArcBox-K3s-DataSvc cluster foreach ($cluster in $clusters) { - if ($cluster.context -like '*-datasvc-k3s') { + if ($cluster.context -like '*-k3s-datasvc') { $Env:KUBECONFIG=$cluster.kubeConfig kubectx } diff --git a/azure_jumpstart_arcbox/artifacts/gitops_scripts/ResetBookstore.ps1 b/azure_jumpstart_arcbox/artifacts/gitops_scripts/ResetBookstore.ps1 index dc246f9f66..4295dba813 100644 --- a/azure_jumpstart_arcbox/artifacts/gitops_scripts/ResetBookstore.ps1 +++ b/azure_jumpstart_arcbox/artifacts/gitops_scripts/ResetBookstore.ps1 @@ -4,7 +4,7 @@ $certdns = "arcbox.devops.com" Start-Transcript -Path $Env:ArcBoxLogsDir\ResetBookstore.log -# Switch kubectl context to arcbox-datasvc-k3s +# Switch kubectl context to arcbox-k3s-datasvc $Env:KUBECONFIG="C:\Users\$Env:adminUsername\.kube\config" kubectx diff --git a/azure_jumpstart_arcbox/bicep/main.bicep b/azure_jumpstart_arcbox/bicep/main.bicep index 747ffd9288..d297befebf 100644 --- a/azure_jumpstart_arcbox/bicep/main.bicep +++ b/azure_jumpstart_arcbox/bicep/main.bicep @@ -78,7 +78,7 @@ param namingPrefix string = 'ArcBox' var templateBaseUrl = 'https://raw.githubusercontent.com/${githubAccount}/azure_arc/${githubBranch}/azure_jumpstart_arcbox/' var aksArcDataClusterName = '${namingPrefix}-AKS-Data-${guid}' var aksDrArcDataClusterName = '${namingPrefix}-AKS-DR-Data-${guid}' -var k3sArcDataClusterName = '${namingPrefix}-DataSvc-K3s-${guid}' +var k3sArcDataClusterName = '${namingPrefix}-K3s-Data-${guid}' var k3sArcClusterName = '${namingPrefix}-K3s-${guid}' var k3sClusterNodesCount = 3 // Number of nodes to deploy in the K3s cluster