GithubHelp home page GithubHelp logo

kubernetesclusterfromk3s's Introduction

Kubernetes clustering from k3s and deployment

Boostrapping a Kubernetes cluster with K3s and deploying the first Pod with declarative approach and deployment of the packaged application

Introduction

We have traversed the packaging of an application using Docker and its distribution through DockerHub. The next phase in the release process is the deployment of the service. However, running an application in production implies that thousands and millions of customers might consume the product at the same time.

It is paramount to build for scale. It is impossible to manually manage thousands of containers, keeping these are up to date with the latest code changes, in a healthy state, and accessible. As a result, a container orchestrator framework is necessary.

A container orchestrator framework is capable to create, manage, configure thousands of containers on a set of distributed servers while preserving the connectivity and reachability of these containers. In the past years, multiple tools emerged within the landscape to provide these capabilities, including Docker Swarm, Apache Mesos, CoreOS Fleet, and many more. However,

Kubernetes

took the lead in defining the principles of how to run containerized workloads on a distributed amount of machines.

Kubernetes Architecture

A Kubernetes cluster is composed of a collection of distributed physical or virtual servers. These are called nodes. Nodes are categorized into 2 main types: master and worker nodes. The components installed on a node, determine the functionality of a node, and identifies it as a master or worker node.

The suite of master nodes, represents the control plane, while the collection of worker nodes constructs the data plane.

A POD is the anatomic element within a cluster that provides the execution environment for an application. Pods are the smallest manageable units in a Kubernetes cluster. Every pod has a container within it, that executes an application from a Docker image (or any OCI-compliant image).

Install and start Vagrant

. Type 'Vagrant up' from the CLI to initialize the VagrantFile . Edit the VagrantFile by indicating the virtualbox repository and version, setting it to be 'opensuse/Leap-15.2.x86_64' and '15.2.31.632' image1

Install and start VirtualBox

img2

Connect to Vagrant with ssh

image3

Bootstrap the Kubernetes cluster from K3s

. Type 'curl -sfL https://get.k3s.io | sh -' from the vagrant@localhost prompt img4

. Switch to the vagrant superuser mode by typing 'sudo su' . Launch the cluster by typing 'kubectl get no' img5

Viewing deployed cluster

img6 img7

Kubernetes Ressources

img8

Imperative approach

(deploy python-helloworld using the imperative approach)

. kubectl create deploy python-helloworld --image=pixelpotato/python-helloworld:v1.0.0

Declarative approach in writing manifest files for deployment

. Create and edit the manifest.yaml, deployment.yaml, service.yaml , namespace.yaml ... files

. In vagrant super user mode , type 'kubectl apply -f manifest.yaml' , 'kubectl apply -f deployment.yaml' ...( creates a resource defined in the YAML manifests)

. Inspect all the resources within the namespace , type ' kubectl get all -n demo '

kubernetesclusterfromk3s's People

Contributors

christones avatar

Watchers

 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.