Giter Club home page Giter Club logo

starting-k8s's Introduction

Introduction to kubernetes

This project describe how to create a small k8s cluster on azure, and how to deploy a service to internet. In this tutorial, we will use as much as possible docker to not have to install anything else.

Also, this tutorial is planned to have something running in a demo presentation of few hours max. It will not explain every components in details. If you are interested to have a deep understanding, I highly recommend you Kubernetes in action

Finally, this tutorial is not about Docker. Having a base understanding of what are images, containers, and be able to run an image locally is required.

Prerequisite

Start a new cluster

Cli

Build cli container

If you do not wants to install az cli & kubectl cli, you can use this cli to run everything you will need.

From build buildcli folder, build a cli container with docker build -t demo-cli .. From your current terminal, come back to the root starting-k8s directory, then access it with docker run -it -v ${PWD}:/workdir --rm demo-cli. (from powershell, replace ${PWD} by $(PWD)).

Login

Before doing more actions, you need to login to your account, with az login. Follow the instruction by opening url with your browser, and login to your account.

You should be ready to run any azure commands now.

Create a resource group and the cluster

First, you need to create a resource group that will handle your cluster. Simply run az group create --location <location> --name training. e.g.: az group create --location westeurope --name training

The location list can be found by double tapping tab when you already entered az group create --location with white space. If you do not know what to put, you can select westeurope

If you already have a resource group named training, feel free to replace it with another name. We will use training name in all next steps of this tutorial.

Then, you are ready to create your cluster with az aks create -g training -n default-cluster -s Standard_A2_v2 -c 2 --generate-ssh-keys

After a few times, the kubernetes cluster is ready to use ! To configure your kubectl to reach your new cluster, do az aks get-credentials -g training -n default-clusterm

From now, if you want to stop the tutorial to not pay anymore for a small cluster, you can delete it with az aks delete -g training -n default-cluster. NB: it exists a stop command, but you will still pay a little bit for a service in sleep mode.

next tutorial

I am expecting you to follow the tutorial in the following order.

  • ./standalone-service
  • ./horizontal-scaling
  • ./next if people enjoyed it ..

starting-k8s's People

Contributors

worming004 avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.