Installation of Kubernetes on Azure

Kubernetes Introduction

Kubernetes (K8S) is an open-source system for automating deployment, scaling, and management of containerized applications.

It groups containers that make up an application into logical units for easy management and discovery.
Running Kubernetes Cluster on Public Cloud:
While trying to deploy Kubernetes cluster on Public Cloud like azure, there are two options:

  1. Deploy K8S from scratch using ACS engine on azure.
  2. Use one of the turnkey methods like Flannel based or Weave based.

There are many resources describing the Flannel based and the Weave based turnkey solutions for deployment of K8S on Azure, however very few available on deployment of K8S from scratch using ACS engine on azure.
We present a technique of end-to-end deployment of K8S from scratch using ACS engine on azure.

Fig: Installation of K8S on Azure over the network using ACS Engine.

Steps of Kubernetes deployment on Azure

Pre-Requisite:
Installation of git, Python 2.7.9 or greater, docker (latest version).

  1. Installation of Azure CLI on linux host VMAs they say “A great cloud needs a great tools” and hence we need to install azure cli on the linux host VM using,
    $ curl -L https://aka.ms/InstallAzureCli | bash
  2. Installation of Azure CLI on linux host VM
    Pre-Requisite:
    It needs golang being installed on the linux VM host.

    $ apt-get install golang

    Steps for installation of ACS engine on linux host VM.

    1. Setup go path using,
      $ mkdir $HOME/go
    2. Edit
      $HOME/.bash_profile

      and add the following lines to setup your go path

      $ export PATH=$PATH:/usr/local/go/bin
      $ export GOPATH=$HOME/go
      note: if ~/.bash_profile is missing than add the above lines to the ~/.bashrc file.
      $ source $HOME/.bash_profile
    3. Perform some preliminary steps in order to achieve the binary of the acs-engine.
      • Get the local copy of the acs-engine git hub project.
        $ go get github.com/Azure/acs-engine
      • Change the path to,
        $ cd $GOPATH/src/github.com/Azure/acs-engine
      • Install glide using;
        $ sudo add-apt-repository ppa:masterminds/glide
        $ sudo apt-get install glide
        $ sudo apt-get update
        $ glide create
        $ glide install
        $ sudo make
        $ sudo apt-get update
      • Get the binary of the go-bindata;
        $ go get -u github.com/jteeuwen/go-bindata/…
        $ cd ~/GOPATH/bin
        Verify that go-bindata is available in this location.
        $ sudo make (To build the binary of the acs-engine)
        Verify that binary of the acs-engine is created at the location;
        $ ls GOPATH/src/github.com/Azure/acs-engine/bin
  3. Run the acs-engine binary to get the azure command-line parameters.
    $ cd GOPATH/src/github.com/Azure/acs-engine/bin
     $ ./acs-engine
  4. Generating the service PrincipalKubernetes uses a Service Principal to talk to Azure APIs to dynamically manage resources such as User Defined Routes and L4 Load Balancers.Using Azure CLI:
    $ az login
    $ az account set –subscription=“${SUBSCRIPTION_ID}”
    $ az ad sp create-for-rbac –role=“Contributor” --scopes=/subscriptions/${SUBSCRIPTION_ID}

    This will output your appId, password, name, and tenant. The name or appId may be used for the servicePrincipalProfile.servicePrincipalClientId and the password is used for servicePrincipalProfile.servicePrincipalClientSecret

    Confirm your service principal by opening a new shell and run the following commands substituting in name, password, and tenant:

    $ az login --service-principal -u NAME -p PASSWORD –tenant TENANT
    $ az vm list-sizes --location westus
    (Note: replace westus by <resource group location name>
  5. Create a new kubernetes.json file under the example directory in the following path
    $GOPATH/src/github.com/Azure/acs-engine/examples

    Add the following parameters:

    1. SSH Public keys under the values for the “keyData”.This can be obtained from the
      $ cat ~/.ssh/id_rsa.pub
    2. Add values for the keys “servicePrincipalClientID” and for “servicePrincipalClientSecret”.
    3. Add values for “dns-prefix” key under master profile.
    4. Add private ip’s for the master nodes and for the slave nodes under the master profile and in the agent profile.
  6. Generate the new Template deployment
    Run

    $./bin/acs-engine generate examples/kubernetes.json

    to generate the templates in the _output/Kubernetes-UNIQUEID directory. The UNIQUEID is a hash of your master’s FQDN prefix.

  7. Deploying with Azure CLI 2.0
    The generated templates from the step 5 i.e. azuredeploy.json and azuredeployparameters.json in the _output/Kubernetes-UNIQUEID directory can now be used using azure cli to deploy the cluster.
  8. Verification
    To Verify your deployment using below command:
    SSH to k8s-master (use Public IP address or DNS name)

    ssh azureuser@

    Execute below commands and see the output:

    kubectl get nodes # list all nodes in k8s cluster
    kubectl get services --all-namespaces

[Tweet “Installation of #Kubernetes on #Azure ~ via @CalsoftInc”]

 
Share:

Related Posts

Navigating Big Data Storage Challenges

Navigating Big Data Storage Challenges

The last decade or so has seen a big leap in technological advancements. One of the technologies to come up at this time and see a rapid…

Share:

A Deep Dive into 5G Service-Based Architecture (SBA)

5G technology roll out signifies an immense revenue opportunity for telecom industry.

Share:
Technical Documentation

Technical Documentation Review and Tips

Technical reviews are vital for effective and quality documentation. To make this happen, have documentation and its reviews listed as one of the deliverables – just like development or testing. This will place priority on the process, and ensure everyone involved understands the importance of proper and thorough reviews.

Share:
Technology Trends 2024

Technology Trends 2024- The CXO perspective

In the rapidly evolving landscape of 2024, technology trends are reshaping industries and redefining business strategies. From the C-suite perspective, executives are navigating a dynamic environment where artificial intelligence, augmented reality, and blockchain are not just buzzwords but integral components of transformative business models. The Chief Experience Officers (CXOs) are at the forefront, leveraging cutting-edge technologies to enhance customer experiences, streamline operations, and drive innovation. This blog delves into the strategic insights and perspectives of CXOs as they navigate the ever-changing tech terrain, exploring how these leaders are shaping the future of their organizations in the era of 2024’s technological evolution.

Share:
Technology Trends 2024

The Winds of Technology Blowing into 2024

As 2023 draws to a close, the digital landscape is poised for a seismic shift in 2024. Generative Artificial Intelligence (Gen AI) continues its integrative streak, disrupting industries from B2B to healthcare. Networking trends emphasize simplicity, while the synergy of cloud and edge computing with Gen AI promises real-time workflows. Quantum computing, cybersecurity, intelligent automation, and sustainable technology are key players, reshaping the technological fabric. Join us as we navigate the transformative currents of 2024, unraveling the impact on enterprises in our forthcoming article. Stay tuned for the tech evolution ahead!

Share:
Generative AI Shaping Future Industries

[Infoblog] Generative AI Shaping Future Industries

Generative AI is at the forefront of innovation, harnessing the power of machine learning algorithms to create new and original content, from images and music to entire virtual environments. This infographic depicts how Gen AI is evolving industries and shaping its future.

Share: