Skip to content

aoshfan/kubeaks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Smells Maintainability Rating Security Rating Bugs Vulnerabilities Duplicated Lines (%) Reliability Rating Quality Gate Status Technical Debt Coverage Lines of Code

kubeaks

Name: Kubeaks

Description: Kubeaks is a tools to help you switch between AKS cluster, even though the cluster just created.

How cluster switch happen

  1. Firstly, it will use ~/.kubeconfig to login into the cluster.
  2. If error, kubeaks will try to authenticate using Azure SDK, and write the login into ~/.kubeconfig.

Tools commands:

  • [COMMAND] $ kubeaks init
    • will appear an interactive terminal to fill up the question example subscription, rg, clustername the information later will be saved in ~/.kubeaks.yaml
  • [COMMAND] $ kubeaks switch/s CLUSTER_NAME
    • this will switch to aks cluster CLUSTER_NAME

    • When to swich a cluster, the cluster infomation will be pickup from ~/.kubeaks.yaml

    • ~/.kubeaks.yaml

      - name: blue
          azure:
            subscription: 12345678-1111-1234-1234-1234567890ab
            resourceGroup: rg-1
            clusterName: aks-blue
          kubeconfig:
            name: rg-aks-dev-blue
      
      - name: green
          azure:
            subscription: 12345678-2222-1234-1234-1234567890ab
            resourceGroup: rg-2
            clusterName: aks-green
          kubeconfig:
            name: rg-aks-dev-green
      
      - name: red
          azure:
            subscription: 12345678-3333-1234-1234-1234567890ab
            resourceGroup: rg-1
            clusterName: aks-red
          kubeconfig:
            name: rg-aks-dev-red

Manual way of switch AKS cluster

# 1. set subscription
$ az account set --subscription 12345678-1234-1234-1234-1234567890ab

# 2. Get AKS cluster credentials by specifing RG & AKS name
$ az aks get-credentials --resource-group dev --name blue

# 3. After getting the credentials, we use kubelogin
$ kubelogin convert-kubeconfig -l azurecli

# 4. verify
$ kubectl get namespaces

Working command

Init
go run main.go init

Switch
go run main.go cluster switch --clustername e-b-d

About

When AKS Cluster destroy and then re-create with a same name, we could skip re-authenticate using manual work instead we could use kubeaks.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages