Differences between revisions 1 and 10 (spanning 9 versions)
Revision 1 as of 2018-09-29 06:50:36
Size: 178
Editor: PieterSmit
Comment:
Revision 10 as of 2019-03-12 02:31:31
Size: 2335
Editor: PieterSmit
Comment:
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
 * Use az tool, with docker run -it microsoft/azure-cli == Links ==
 * [[https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough|Quickstart: AKS cluster]]
 * [[https://docs.microsoft.com/en-us/azure/aks/kubernetes-helm|2018-Helm in Azure Kubernetes AKS]]
 * [[https://kubernetes.io/docs/reference/kubectl/cheatsheet/|cheatsheet]]
Line 6: Line 9:
 * {{{ az aks install-cli }}}
 * browse
== Kubernets config ==
 * Use Declarative, we declare the state and kubectl implements using {{{
kubectl apply -R -f configs/
   }}}
Line 11: Line 16:
== Setup Cluster, using the Azure az commands and azure aks install-cli kubectl ==
 * Use az tool, with docker run -it microsoft/azure-cli

 * in the container add the kubectl {{{
az aks install-cli }}}

 * list subscriptions {{{
az account list --output table }}}
 * set subscription to the one that contains k8s {{{
az account set --subscription xx-xx-xx
}}}

 * run az proxy to connect the browser to kubernets admin in cloud {{{
Proxy running on http://127.0.0.1:8001/
Press CTRL+C to close the tunnel...
Forwarding from 127.0.0.1:8001 -> 9090

## Problem only binds to loopback, in a container, if not using container for microsoft/azure-cli skip next command.
nc -v -lk -p 8001 -s $(hostname -i) -e /usr/bin/nc 127.0.0.1 8001
}}}
  * List nodes {{{
kubectl get nodes
}}}
    * If this fails with "Unable to connect to the server: dial tcp: lookup ...." reset with {{{
rm .kube/config
az aks get-credentials --resource-group <nameRG> --name >nameClusterInRG>
kubectl get nodes
      }}}
  * List namespaces {{{
kubectl get namespaces
}}}

== Test ==
 * az - setup proxy tunnel to web admin
   * az aks get-credentials --resource-group K8S-xxx --name K8S-xxx {{{
Merged "K8S-INF" as current context in /root/.kube/config }}}
   * kubectl get nodes
   * Create azure-vote.yml from https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough
   * kubectl apply -f azure-vote.yaml {{{
deployment.apps/azure-vote-back created
service/azure-vote-back created
deployment.apps/azure-vote-front created
service/azure-vote-front created
bash-4.4# }}}
   * kubectl get service azure-vote-front --watch {{{
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
azure-vote-front LoadBalancer 10.0.61.46 1.5.1.39 80:31745/TCP 101s
}}}

Kubernets cluster in Azure cloud

Kubernets config

  • Use Declarative, we declare the state and kubectl implements using

    kubectl apply -R -f configs/

Setup Cluster, using the Azure az commands and azure aks install-cli kubectl

  • Use az tool, with docker run -it microsoft/azure-cli
  • in the container add the kubectl

    az aks install-cli 
  • list subscriptions

    az account list --output table 
  • set subscription to the one that contains k8s

    az account set --subscription xx-xx-xx
  • run az proxy to connect the browser to kubernets admin in cloud

    Proxy running on http://127.0.0.1:8001/
    Press CTRL+C to close the tunnel...
    Forwarding from 127.0.0.1:8001 -> 9090
    
    ## Problem only binds to loopback, in a container, if not using container for microsoft/azure-cli skip next command.
    nc -v -lk -p 8001 -s $(hostname -i) -e /usr/bin/nc 127.0.0.1 8001
    • List nodes

      kubectl get nodes
      • If this fails with "Unable to connect to the server: dial tcp: lookup ...." reset with

        rm .kube/config
        az aks get-credentials --resource-group <nameRG> --name >nameClusterInRG>
        kubectl get nodes
    • List namespaces

      kubectl get namespaces

Test

  • az - setup proxy tunnel to web admin
    • az aks get-credentials --resource-group K8S-xxx --name K8S-xxx

      Merged "K8S-INF" as current context in /root/.kube/config 
    • kubectl get nodes
    • Create azure-vote.yml from https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough

    • kubectl apply -f azure-vote.yaml

      deployment.apps/azure-vote-back created
      service/azure-vote-back created
      deployment.apps/azure-vote-front created
      service/azure-vote-front created
      bash-4.4# 
    • kubectl get service azure-vote-front --watch

      NAME               TYPE           CLUSTER-IP   EXTERNAL-IP     PORT(S)        AGE
      azure-vote-front   LoadBalancer   10.0.61.46   1.5.1.39        80:31745/TCP   101s

...

k8s/Azure (last edited 2023-03-09 02:01:02 by PieterSmit)