Showing posts with label Azure Arc. Show all posts
Showing posts with label Azure Arc. Show all posts

Wednesday, 29 June 2022

Deploy Arc Data Controller - Az command

 Here are some az command to deploy your azure arc data controller 

Prerequisite :

1. Az cli is installed 

2. Storage class ext4 deployed 

3. AKS HCI cluster deployed 

4. kubectl is installed 


here is the command 

az extension add --name k8s-extension

az extension add --name connectedk8s

az extension add --name k8s-configuration

az extension add --name customlocation

$namespace = "arc-dc"

$location = "arcdc" #custom location 

$region = "eastus"          #Azure region 

$subscription = "subname"   #subscription name 

#$subscriptionid = "abcdefg" #subscription id 

$rg = "RG"                  #RG name 

$cluster = "cluster01"      #cluster name 


az login 

az account set --subscription "subname"

az connectedk8s connect --subscription $subscription --resource-group $rg --name $cluster --location $region

az connectedk8s enable-features -n $cluster -g $rg --features cluster-connect custom-locations

az k8s-extension create --cluster-name $cluster --resource-group $rg --name $namespace --cluster-type connectedClusters --extension-type microsoft.arcdataservices --auto-upgrade true --scope cluster --release-namespace $namespace --config Microsoft.CustomLocation.ServiceAccount=sa-arc-bootstrapper


$akshciid = az connectedk8s show -n $cluster -g $rg  --query id -o tsv

$extensionid = az k8s-extension show --name arc-dc --cluster-type connectedClusters -c $cluster -g $rg  --query id -o tsv


az customlocation create --resource-group $rg --name $location --namespace $namespace --host-resource-id $akshciid --cluster-extension-ids $extensionid --location $region


#use portal to create data controller 

#Example:

#az arcdata dc create --profile-name azure-arc-aks-premium-storage --k8s-namespace arc --name arc --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group my-resource-group --location eastus --connectivity-mode direct --use-k8s

#check deployment status 

kubectl get datacontrollers --namespace arc-dc

thanks for reading 

Monday, 28 February 2022

Azure Arc Data Controller on Azure Stack HCI - ext4 storage creation

 Hi all, continue on hybrid deployment for related topic on Azure Arc, this post will be focusing on creating a storage with fstype: ext4 in order to complete Azure Arc Data Controller deployment. 



Some common issue if this requirement is not meet is , it will cause the agent cannot be initialize. example here - click here 

The official guide is available at the end of the post but will show here how i made it possible in my test lab . 

1. Locate the config on yaml for default storage class. 
2. Take note on the group and hostname using tools or run this command - kubectl get storageclass default -o yaml
3. Three things needed to be apply in your new yaml to create that fstype:ext4 is 


  3.1 Name : this will appear as the name of your  new storage class 
  3.2 Container ; the file path for storing your persistence volume
  3.3 Group
  3.4 Hostname ; this is created based on your pre-stage your dns on deploying Azure Stack HCI at the beginning  

4. for my case, i did not create another custom storage container , i just use the same container as my default storage class 

5. you may deploy by using kubectl apply -f  /examplepathext4.yaml

6. After that you may try to deploy data controller again and put the name of your new storage class . 

reference link is here 

hope this will help in your journey to with azure arc data controller , thanks for reading and see you again 
 



Wednesday, 9 February 2022

AKS HCI Access Token - Azure Arc

Hello All, 

Having to play with kubernetes or K8s is great plus point and now, public cloud provider like microsoft has their manages service k8 offering; AKS to be running on Azure Stack HCI . 

As service is now running on your datacenter, but with azure arc integration , it also can be view from your azure portal with some parameter need to be pass to get the view 


i was abit struggling to find the token in order to view the k8 properties on portal but after sometimes, i manage to pull it. i will share the step here so it will be easier for you to get that token to be use in few place . Here is what you need

1. AKS running on HCI with azure arc enable 

2. try and error ; but i will make easier 

For me, i use free software to access my k8s cluster which is Lens , so browse through the secret in the k8 and look for some key word, one thing that caught my eyes is azure arc, so i click to look into the content of the secret. 



so i unhide the token and copy over the token and paste over in azure portal like the first picture and walla , all the namespace appear. 

i have also incorperate the token into my kube config because i want to use the same kube config to acess k8 either via lens or k8-dashbaord. here how u add into the existing kube config 


add the extra line with token : <your token> and pay attention on the allignment due to format. 

that all for now, thanks for reading and stay safe.