Let’s Deploy A Containerized Application @ Docker Community All Hands

September 1, 2022

< 1 min read

Let’s Deploy A Containerized Application @ Docker Community All Hands

Kubernetes is an open-source container orchestration system for automating deployment, scaling, and management. Docker Desktop is the easiest way to run Kubernetes on your local machine. Will talk about docker desktop k8s cluster setup, and deploying/Upgrading/Scaling/Debugging an application.

 

View Slides Here

Speakers

Oum Kale

Software Engineer, R & D

Oum Kale, is a Software Engineer(RnD Team) at JFrog working on the Installer team to build Kubernetes Operator for deployment and management applications. He is also a Core-Contributor/Member of the CNCF Incubating project LitmusChaos.  He is a Sporty guy International Rated Chess Player.

Video Transcript

okay docker community all have hands

uh today i will be talking about the

deployment of counterized applications

uh i will have a small intro about me i

am software engineer at jfrog from rnd

team india

i am certified kubernetes administrator

also core contributor and member of cncf

incubating project litmus cos

also sporty guy international related

chess player so feel free to ping me for

playing chess after the talk

uh

also i wanted to give a chance to win

apple earports from someone

so scan the qr code and or open the

below link

let’s back to the talk now

i have a question for you all uh how the

era is changing

you remember like earlier days we used

to have physical servers for application

deployment

then we moved to the virtual machines

vms

and now we have containers

so what is the container and what all

related tools around this let’s talk

about deeply

so

there are few things like image

containers docker kubernetes and all

these words you’ll be listening again

and again so what exactly it is let’s

have a look into this

so docker image a docker image is

basically a file which is used to

execute code in a docker container

so

every day like every developer build

something test something locally only by

running some command right so do you

wanted to

test that

using some deployment or you wanted to

package that

yeah so

the docker file we use for building our

docker image and once we build it we can

push it to docker hub which is a

default registry we can get we can push

it some other private registry as well

so once we push the image

now we can run that image in containers

now what is the container container are

executable units of software in which

application code is packaged along with

its libraries and dependencies so once

uh

we have

image that image we can run it

containers that image is holding all the

required things for to run the

application

and next thing is the docker

what is the docker docker is an open

source platform that enables developers

to build deploy run update and manage

containers and docker engine is open

source containerization technology for

building and controlling our

applications

docker have a strong isolation

properties and

many other things which makes a docker

is darker

next thing is the orchestration now

we’ve talked about the containers and

platform for containers

which using which we can

create manage update run container

and the next thing is the orchestration

where we can have the automated

configuration around the containers to

manage it

and coordination in like

computer systems

and also container orchestration is the

automation of much of the operational

efforts required to run countries

workloads and services there are a lot

of

orchestration tools like kubernetes

docker swarm mesos and others kubernetes

is a cncf graduate project and it’s one

of the most

having hike in market today

now we’ll talk about the docker desktop

and kubernetes as well and docker

desktop is basically simple interface

that enables us to manage our containers

applications and images directly from

our machine without having to use the

cli to perform core actions docker

desktop having couple of other

features as well like docker engine

docker cli client docker compose docker

content trust kubernetes and credential

helpers so let’s talk more on the

kubernetes thing

in docker desktop basically kubernetes

can run on top of docker and docker

desktop includes the support from for

running a kubernetes cluster for us

without having manually configuration

it is the best uh

so we once we do have the containers and

like we image and all we wanted to run

it into kubernetes cluster our

application right we wanted to deploy

and test there are a couple of other

ways also like mini cube kind and other

clusters also to test it locally to run

locally but yeah

rocker desktops has like

came up with the kubernetes cluster

support as well which is very seamless

and it’s very easy one click kubernetes

cluster setup provides

a support is given from docker desktop

so it is very easy

and we will see more like when we have

the demo thing which follow the steps to

install that so here are the two things

now uh if you have a

fresh installation you have you don’t

have any other cluster running and all

then once you do the

docker setup

uh docker kubernetes installation from

docker desktop so then it installs the

supportive stuff as well as like

kubernetes cube ctl binary also which is

the kubernetes client which talks with

the api server if it is already there

you have some other cluster running on

top of that you have docker and install

the docker desktop kubernetes cluster

then we have to set up the docker

desktop context in that case

so let’s take uh let’s talk more about

while having the demo

uh let’s talk about the internal

kubernetes cluster uh architecture

uh we can see there are the five main

components and

also the node inside the node there are

two main components

uh there is api server scheduler etc

database control manager and cloud

control manager which is a part of the

master node

and node uh node have the two things

cubelet and q proxy

uh

api server is the one of like main

component

of the kubernetes control uh plane which

exposed the kubernetes apis

etc database is a key value pair

database where it’s a high availability

key value stored

uh which is used around the complete

kubernetes

cluster like let’s take example if we

install some resource like example

deployment which is having some pod

specs

uh template uh replica account and all

so once we apply that where does it get

stored it must be storing somewhere

right so it

behaves and it creates or as per the

required resources so there is that all

latest gets getting stored into the atcd

let’s exam uh take talk about the coupe

scheduler thing

cube scheduler is basically responsible

for

alerting a node for any pod when some

new part comes up it’s on the basis of

some rules regulations like toleration

a

affinity and all based on that it alerts

a node for the part

control manager

is the car

is the component which runs the

controller processes

for example like node controller job

controller endpoint controller and many

more

cloud control manager is like little

different uh

which is actually the

behaves as per the cloud specific uh

work

and let’s talk about the node thing node

having number two major things one is

the cubelet and one is the cube proxy

late is basically uh let’s assume the

node as a ship and every ship has a

captain right so let’s say the cubelet

is the work which is doing of the

captain’s work

which is responsible for all internet

working and

to keep updating to the api server and q

proxy is the network proxy that runs on

each node

and

which is like a which is

maintains the network rules on the node

now in our demo of let’s move to the

demo part now these are the commands

which i just noted out which we are

going to run during the demo part

and inside the demo we will uh configure

the kubernetes cluster on top of docker

desktop using docker desktop we will

install it and we will also deploy one

application we will

scale it we will describe it we will

debug it and lot of things let’s start

so first thing to do is uh

to open the docker desktop

uh once it gets open like we have to go

to the settings things uh inside

settings we have the docker desktop

features there is a kubernetes

stuff here we have to view

uh we are using the kubernetes version

is 1.22.42

24.2 and the simply one click

installation one click kubernetes

cluster clear creation stuff just how to

do enable kubernetes and we have to

apply and restart thing

so this is docker engine is already

running kubernetes is

getting started

now let’s for some more time

see uh we we can see now

uh

resources are up and name space is up

and everything is up now

cluster is connected i already using the

docker list of config if someone is

having already installed having some

other cluster is running

they wanted to use the docker list of

contacts now they have simply have to

do the

run this command

which will use the docker desktop

context now context is basically uh

in kubernetes we

have an

config file uh on the directory of dot

cue

slash config where

server endpoint uh certifications uh

name cluster name and all stuff we put

there basically whenever we do some

cubesat get ns right so who authorize

this command right to get the all name

spaces

so basically when we run this command in

this command we are not passing any

token or any certification right but to

authorize this we need this

credits right details so basically once

we do this cubesat command it authorizes

using the config file

so config is basically

used for to get this uh

api call successfully this is more on

internally we have the api calls only

to end points and

so let’s deploy one sample application

now

uh

i’m using one sample application uh

which is a reporter to help

a cncf project

application project which is built to

understand the working of the micro

services so i’m just using that portal

to him and updated my images

with some minor change in that

so

this is the resource we are going to

apply there are five six resource

application micro services and every

micro service have one deployment and

service to expose that

so let’s deploy this

we can deploy any application uh

if there is a

ml file we can simply

apply this file like this format some

file name and dot yaml

and once you apply this it will install

all the resources which is inside that

mm since it is a github url only we

don’t have to worry about like i’m

simply the same

command like cubesat laptop minus f and

ml

uh basically this yaml this is the place

where we have to keep our we have to

keep our update our image name

like whatever we locally build we build

boost somewhere so that is the image

where we have to update here

and we have to

add the ports and all for this what are

the port internal use inside that

application so once we apply this

we can see now by defaultly it goes into

the default namespace and now we can see

that we called paul’s error

so since i’m running it locally let

me put forward this

so it is port forwarding let’s open the

application now here

see it is working

so this is the application is used for

demo purpose here

we can have our own application to get

open like this

so currently this application is having

version of 0.1.0

now let’s play around the

upgrade part let’s say let’s update we

wanted to object update our application

version okay new really happen our new

we have something changed that we have

new image we wanted to update that it’s

very much seamless let’s try this now

let’s see the container name

it’s a server

and images

let’s update with the one zero point one

point one now

we can see this image has been updated

and let’s see the ports uh ports now so

new pod is coming up

and it since it is the rolling update

once the new port comes up older will go

down since the

availability of the application will be

there

now let’s see

see older is going down now

and stuff has been done let’s

now let’s move to our application uh

earlier it was 0.1.0 now refresh the

page

it is a 0.1.1 now so see how seamless

upgrade it is actually we can upgrade

any part on any component of our

application very seamlessly

now

someone wants to some failure of call or

some it unable to pull image or some

crash look back happen or any some

failure of application happen

how to debug that

so

since we have tried for now two things

one is the cubesat get a name space

which is a cluster scope

pv is a cluster scope crd is a cluster

scope so we can get that and we can also

get the names for what is the name

spacecraft we have to provide the name

space if you don’t provide it will go

for the default namespace

like this

so

so this thing and this thing will be

same so if you don’t know it will go for

the default thing

uh now let’s describe the any one of

component like i am getting the deploy

so these are the deployment controllers

for this parts deployment controller

scripts the replica set and replica sets

basically responsible for maintaining

like

managing the ports based on the owner

reference weight i said

let’s describe the deployment now

so it is uh it has added the kubernetes

events what all stuff has

happened it has done

it will also

mention like it will also show us what

during upgrade strategy our main ready

map second sign containers what is the

image we have passed current image is

0.1.1

port for the container uh

readiness pro

environment variable in such any form so

whatever the stuff is there it will be

shown here the same like uh same way we

can describe our pod also

so we can see our bodies now it has

successfully assigned

to docker desktop

pulled the image successfully

it has created the container as well

and stuff is running

so we can see all stuff here so if

someone wants to see the logs of our

application now

they wanted to see some live stream line

for

locks

then they can someone can use the minus

f sign in this

minus will show on keep online

and if you remember the minus and minus

f it will list out it just lists the

logs

to the

see so

if someone wants to let’s try now

someone can try to easily insert the

container someone can actually delete

the port and try someone can

just explore the stuff and just get its

hands hands on

there are a lot of other resources also

like which we saw recently the service

service is used to expose our

application outside the world

through some cluster api node port our

load balancer there are a couple of

phase

type of service

so one can try to get is there is a

state full set application which is used

for if there is a data they want us to

persist even the port goes down new

ports come up data

you should data someone wants to

purchase then we can have a perception

volume for that specifically stateful

set can be used you can see describe

logs execute command set container one

can apply the file in this format

as there are a lot of other resources

like secret config map ingress and any

number of resources one can create and

let’s try

try by yourself you will get

and

we can we can actually edit our

resources also through cubecity command

one can get the resources in yaml file

a lot of stuff is there just explore

it’s very

straightforward and

easy

so feel free to ask any question i’m

here to answer

and

one can again scan the code

or open the below link

and i would like to connect with you all

thank you so much