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 
 



Thursday 10 February 2022

empty_dir = {} is not expected here - Terraform

 Hi all, i did some conversion from yaml to tf using tool called k2tf . As part of code conversion and i use to be in my terraform module. so if you have this line with "empty_dir = {}" terraform cannot read as it is not part of the syntax. 

as first i was just commenting the line like below 

 spec {

        volume {

          name      = "tmp-dir"

          #empty_dir = {}

        }

turn out everytime i run terraform plan it will be part of changes . 


so i was trying to ignore this line code using a ignore_changes function but could find the right class to put into. so i look back the line like picture above and change  from empty_dir = {} to empty_dir {} and it workkkk.. 

so my lesson to me here is other than commenting, i should also pay attention to syntax to replace it .

btw if any of you interested in using k2tf, i already made container image , you may pull it using this command - docker pull pra8/k2tf 

* i have just compile the tool and make it a container 

that all for now and see you guys on next post


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. 

Kubecost on AKS Part 02