Making Kubernetes Dev-Friendly with Komodor & Okteto

Nir Shtein. Making Kubernetes Dev-Friendly with Komodor & Okteto
Nir Shtein
Arsh Sharma. Making Kubernetes Dev-Friendly with Komodor & Okteto
Arsh Sharma

You can also view the full presentation deck here.

*This is an auto-generated transcript

0:11

all right okay

0:16

so we’ll begin shortly let’s give everyone a couple of minutes to join in

0:22

we already have a few guests here

0:27

welcome Aman Ben Grady ashika yogesh

0:35

welcome all let’s give more people a chance to join

0:42

in before we begin

1:09

[Music]

1:28

[Music]

1:35

who is with us now welcome to making kubernetes they’re friendly with uh

1:42

Commodore and octeto uh we’ll introduce our speakers and let

1:47

them take the stage but first some housekeeping so

1:53

um like I said today’s subject is making kubernetes differently so

1:59

as all of you know uh kubernetes was forced on us several

2:06

years ago and as the years go by it’s becoming more and more prominent eating

2:12

up more and more of the world and as Developers we are forced to

2:17

[Music] um owner apps end-to-end but it’s not as

2:22

easy when you uh when your app is running on kubernetes under the hood and

2:35

will share their knowledge of their experience and teach you how uh how to

2:42

overcome those challenges and um if you don’t know near Stein she started

2:50

being a software engineer at Commodore is also the main contributor to valid

2:55

Cube commodore’s first open source project our Sharma is a Dev experience

3:00

engineer from octeto and a very prolific public speaker you may have heard them

3:06

before in some conference or talk and together we are going to discuss

3:14

making kubernetes differently so without further Ado uh guys take it away and

3:22

show us what you’ve got

3:29

um

3:36

hey everyone thanks for joining uh could you change the slide and we can get started

3:42

uh so before we like begin talking about

3:48

uh what we have how we can make kubernetes Dev friendly

3:54

um it thank goodies yep I wanted to uh give

3:59

a bit of uh history lesson sort of about what has happened in the past and how we

4:05

have reached this point where we currently are so if you remember like

4:10

about seven eight years ago nobody was talking about microservices or containers that much we all were coding

4:18

monolithical applications which were running in infrastructure which we either owned in our own buildings or we

4:25

rented out but uh what problems started emerging from this approach was that

4:31

scaling became very very tough like as we sort of uh grew the code base and the

4:38

users managing this uh monolithical applications running in a data center became very tough and this was something

4:45

like we as an industry started struggling with so the solution we came

4:51

up to for this problem was containers and Docker popularized containers a lot

4:56

and the rise of containers basically led us to you know break down these

5:02

monoliths which we had written into microservices so now instead of the

5:07

entire application being in one single code base on gate we started breaking up different parts of the application and

5:14

different teams were responsible for different microservices and what happened was that we started

5:20

containerizing these microservices so we no longer you know relied on uh one single machine running

5:28

all of this instead we started leveraging the power of cloud remote machines and started accessing them

5:35

then to make things more easy or let’s say like complicated for developers

5:40

kubernetes came into picture and what kubernetes did was it helped us run all

5:46

of these containerized microservices at scale now all of this happened and with

5:52

this we changed the landscape in production significantly right we introduced new tools we introduced new

5:59

methodologies CI CD became different we had staging environments and what or not

6:04

now what all of this did was that it changed the world of developers

6:09

developers who could earlier just work on the local machines now started facing

6:16

a lot of problems and the key reason we feel for this was that while the tooling and Technologies

6:22

upgraded in the production or devops landscape the tools available for developers sort of did not improve at

6:29

the same same pace so if you go to the next slide I want to touch uh on some of the challenges which

6:38

developers started facing since the shift happened could you go to the next slide

6:46

so with this change what happened was that the feedback loop became significantly longer what this means is

6:53

that now when we run up apps in kubernetes in production that is very

6:59

different from running a single microservices locally so let’s say you’re a full stack developer and you’re

7:05

working on the front end right now running that front end locally and the results you are seeing aren’t always

7:11

going to be how they would look in production because the production has changed a lot so for this you would have

7:17

to rely on cicd jobs or access to staging environments the problem with

7:23

both of these approaches are that they are time consuming for cicd to kick in you have to commit your changes and wait

7:30

for the CI to run all of its processes whereas for staging environments you

7:35

often in organizations you have to like wait to get the access because someone else is running there or

7:43

uh in general like the long story short is that as a developer now earlier when

7:49

you could just hit save and be confident that what you are seeing is what you will get now that was no longer the case

7:55

the solution which got offered to Developers for this was

8:01

try to mimic that production kubernetes configuration locally on your desktop use tools like mini Cube kind or what or

8:07

not now this led to two main problems first of all developers were now you

8:13

know suddenly expected to know about kubernetes just to go about their jobs of making applications and writing code

8:20

they had to keep up with the vast kubernetes landscape of tools and

8:25

everything which is very complicated I’m telling you uh and second problem which happened was whenever developers had to

8:32

write code now they would have to do all of this additional configuration stuff and spend time you know bringing up this

8:39

infrastructure playing with yamls changing values and all of that

8:44

so all of these like lead to a very massive hit on productivity and this

8:50

leads to a very frustrating experience for developers who are just trying to ship new features and fix bugs because

8:58

something which was very simple earlier which was as simple as just running your application in one command writing code

9:04

and hitting save now became so complicated because the production landscape changed and the local

9:09

development did not keep up with it so these are a few challenges which

9:15

saved the world of developers and I’ll now hand it over to need to take it from here

9:20

yeah thank you actually can you click

9:29

cool so as Ash mentioned there’s a big difference between the local environment

9:34

and the production environment and let’s talk about why there is a difference between the local and the production and

9:41

the main reason for that is that production is running on kubernetes and your local environment probably running

9:47

on some uh some CLI comments some make fives uh Docker Docker compose in the in

9:55

the best case scenario or even one in your local environment on kubernetes this is like the the perfect scenario

10:02

but still if you have your local environment in production environment both one in kubernetes there will be

10:09

still be differences between them and what of those differences and how can we answer them so the first difference that

10:17

I can mention between the lock and the production is that on local I wanting on a single instance I have a single serial

10:23

server and on production I have multiple multiple service replica sets

10:30

and why this make a difference for example if I have some cash so the Pod

10:36

is the pots are distributed from each other and doesn’t aware of the other ports so if I want to share with cash I

10:42

need to share the cash across all the pots and I can share it as a site

10:48

container within within the port it can be also some states if I want to

10:56

save a data to some storage so I need to use some mechanism that

11:01

help you to do it so the how kubernetes achieved by using some stateful sets

11:07

meaning that you define some volume you can still like on the white yaml there is a status

11:13

and at the end there is a full volume claim when they Define some volume and

11:19

what is the permission to the volume and what is the size and how can I identify some volume and all the ports will go to

11:25

the same same month it’s involved and now I can share a state a course

11:31

multiple replica second thing is that it’s very common

11:37

that you wipe your code on your local local machine and thanks for Google you test it you

11:44

validated someone doing a coded view FX is great but you push it to production

11:51

the CI is passed but now it’s conduction and no things work

11:57

a very annoying scenario and kubernetes invented a solution for us this

12:03

invention called A Wedding smob Ting sports are there to determine if

12:09

your container is ready to accept traffic and liveness pop out there to determine if you’re continuing to be

12:15

restart they are very simple I just defined some endpoints some port and just expose in

12:22

your application that’s poured in that endpoint and then kubernetes examine those

12:28

endpoints and verify that everything okay and looking for a 200 status code

12:34

in that endpoint you need to specify some it can be some validation that your

12:40

application is fine it can be connection to the database it can be some cache in

12:45

validation it can be some business logic and whatever why that that your

12:52

application is working properly so I recommend to put always live in seven is perb across all of your applications

13:00

oh they can click wait another thing to note when you’re

13:08

deploying any application any workload it can be demonstrate status deployment

13:13

whatever to production is not about the resources when I’m doing something on my

13:18

local machine and the resources is my computer and I don’t know if my application is consuming a lot of

13:25

resources a small amount of Visa says I really don’t know it so a way to make sure that I’m not

13:33

consuming too much resources our requests a resources request limits and

13:38

those Define the the request of limits of the memory and the CPU two ways to

13:44

see if you are on track on the usages of your resources is wanted to to do a

13:50

profiling any standard APM offering a

13:55

cool and new and very simple profiling and the second way is to track on cubic

14:02

CTA on kubernetes kubernetes Native events as you can see like on the bottom

14:07

screenshot there is how you get the native evangels Whiting Cube still get events and then

14:15

get all the events across all over your kubernetes cluster but if you want to

14:20

get only the events of specific pod you just do a describe and you see the ports and the events of this particular pod in

14:28

the end of the of the usage um second

14:34

scenario is that you have missing dependencies between your local local environment and production environment

14:40

uh sometimes I have some packages of some CLI that installed globally on my

14:45

local environment and when I’m wanting my application if it works because they are installed my machine but when I

14:52

deploy to production it doesn’t included in my image so very common and simple

14:58

way to do it and most of the companies does that is to work on your local machine with in Docker files one in

15:07

containers instead of some CLI comments and this will solve it because this is

15:12

like the basic same image within the local and within the production

15:18

and the last thing that I think is very important to know when you are deploying to kubernetes are the rollout and of the

15:26

wallet works and it’s not switching between version a to version e b by just

15:32

clicking your fingers it’s not like that there was a wall procedure that is very

15:38

easy in Commodore in camera in kubernetes and before kubernetes is what

15:43

it was very very hard to do a wallet but kubernetes offers a very simple way called warning updates

15:50

and it helps you to do a rollout from version a to version B it does all the work for you all you need to do is to

15:57

specify the configuration that is suitable for your application and this is basically determined by two

16:04

configuration one is Max Surge and the second is Max and available basically

16:09

both of them means how much I want to do my wall out fast versus how much I want

16:15

to do my wallet safely so as a wolf thumb I configure those

16:21

both configuration to 33 and the default is 25. and this is my five best practices how

16:30

to avoid pitfalls from deploying local environments to production

16:36

um our fits your stage

16:41

thanks for that um I’m gonna share my screen now so the video shop steering

16:48

yours and uh like Neil just told you about the

16:53

pitfalls uh you like a developers run into like when dealing with kubernetes I

16:59

am going to show you how octeto helps you combat some of these by uh making it

17:06

easier for you to develop applications by simply uh developing on a kubernetes

17:11

cluster directly so octeto basically what it does is it deploys your

17:17

application to an actual kubernetes cluster dividend development and it allows you to code your applications

17:23

there so uh it’s kind of like hot reloading for kubernetes clusters and

17:29

we’re going to see that in action and we’re going to understand how this improves the dev experience by following

17:36

this story from a perspective of a developer so let’s say you’re a full stack developer and your company has

17:43

this movies rental application where you can go and rent movies and you’ve been tasked with adding a promotional

17:50

discount for kubecon which is coming up soon and so for that you have uh things

17:56

which you need to manage so as a developer now if I have to work on let’s say first adding a banner to this

18:01

application I need to bring up this application now this is not simply an isolated front-end web page right this

18:09

is a full-blown microservice application so many microservices make it up there’s a backend there are databases involved

18:15

and all that stuff so as a developer if I do not have access to a tool like

18:20

octet or what I would have to do is locally create all of these and locally run all of these micro services on my

18:26

local computer and bring each one of them up now that is a very time consuming task and load consuming also

18:33

for the local machine but with octeto it’s as simple as going to your octet or dashboard clicking launch Dev

18:39

environment and adding the URL for your Repository when you do the process for the first time it takes like a couple of minutes

18:46

so I already did that before but once you do that you’ll see that you have access to all of these endpoints for

18:52

different microservices now uh I on the front-end endpoint and which is why I’m

18:57

seeing my application here and you can see all of these micro Services which make up our application have been

19:03

deployed by octeto so let’s see how you would begin developing with octeto you would clone

19:10

this code which for this application and after that open up your favorite editor

19:16

this is one of the other things I love about octeto is how you can continue using the same tools you love so any

19:22

editor at all any other prefer tool you don’t have to switch from that uh once you do that you have to install

19:30

the CLI tool called octet or CLI which is completely open source and uh once

19:35

you have that on your machine all you need to do is run one single command which is octet or

19:41

once you run octet or octeto will connect to your cluster and it will show

19:47

you which one of your microservices you want to work on so let’s say as a developer we first want to add that

19:53

Banner on the front end which lets our users know that we are running a discount for kubecon so I’ll select the

20:00

front-end microservice now what is happening behind the scenes is that octeto is replacing the

20:06

container which is running in the cluster with a Dev container what’s special about this Dev container

20:13

is that any code we will write now on a local machine as you will just see that

20:19

when you hit save that code will get transferred to the uh code running in that Dev container so there’s a two-way

20:27

file synchronization service which allows you to write code and see the results of that code running live in the

20:33

classroom so this is what I meant uh when I said that with tools like octeter you can get instant and genuine feedback

20:40

instant because it happens as soon as you hit save you don’t need to commit or wait for staging environments and

20:46

genuine because this is happening in an actual cluster just like how your application would be running in

20:52

production so you see that now our data op is done we have access to a terminal which is in

20:58

that uh container in the cluster so just how you would be doing it locally you

21:04

first run yeah and to install all the dependencies and then you type yarn start to bring up your front end and now

21:12

if you see go you go back to your endpoint and see and hit refresh

21:17

you’ll see that it is in development mode okay so let’s make a change on the

21:23

front end and add that Banner I have already cheated and the code is already

21:28

there so we are just going to uncomment that and see what happens when we hit save

21:33

so I uncomment this I hit save I go back

21:39

and I see that a banner is here which shows me that there’s a discount for users so you saw how instantly as soon

21:45

as we hit save these this code we wrote got transferred to the code running in the cluster and we were able to get

21:52

feedback now but if we see and try renting a movie let’s say a 13 movie you’ll see

21:59

that the price is still the same there is no 50 discount which makes sense because we have only added this change

22:04

on the front end right now you have to work on the back end also and uh now

22:09

that would involve like bringing up if you if you were not using octet or that would involve bringing up the database

22:15

locally and doing all of that but with octet all you have to do is open up another terminal and type another octet

22:23

or up and this will again list you all the microservices and I know that the

22:28

worker microservice which is written in go is what is responsible for uh processing the price of our movie so I

22:35

run that up and you can do this for any number of micro Services which make up your application so this way you can have

22:42

your entire application up and choose to work on different parts of it easily without having to you know configure

22:48

anything like you do not this application which is running right now if you see on your alternator dashboard

22:53

it uses mongodb and it also uses postgres none of which are running on my

22:59

local machine not only does this save resources but it is also a very convenient way and I can just get

23:05

directly to the code writing phase so once uh octeto app is done launching a

23:11

Dev container into the service let’s change our code and actually add a

23:17

discount now I know that the code for this is in main.go and again

23:23

I will uncomment this line which reduces the price of the movies by 50 now since

23:29

this is like a go Application you would have to like build it and run it so I run made to build the application

23:35

uh build a binary for my application and then I will run make start to

23:43

actually run the application so now if I go and hit refresh

23:48

you’ll see that the price is reduced and if we add like another movie which is for uh three dollars we’ll see that the

23:55

price is actually 1.5 dollars uh so this was it for the demo of the octeto platform and uh you can

24:03

share the screen again but what I want you to take from this is that how

24:08

convenient developing Cloud native applications which consists of like anywhere any number of like 10 to maybe

24:16

even 20 30 micro Services is it’s a super easy process when you can bring

24:21

all of that up in an actual kubernetes cluster and see your changes as if they were actually running in production so

24:28

I’ll now hand it over to Neil to show how Commodore also helps so all some of the problems which developers face when

24:35

working on cloud native applications thank you very much Ash

24:40

so now I will do some Commodore demo before I dive into the Commodore

24:46

platform and about what is Commodore and how how to use it so condo is a SAS

24:53

platform that help you to troubleshoot and manage kubernetes clusters so how we

24:59

basically do it it’s very simple we have an agent that is installed on each one

25:04

of the customers cluster using just a simple hand command and then the agent

25:10

watching all the events that’s happening on the cluster we post them to the Commodore platform Commodore process and

25:18

ingests all of those events and then backstem into the into the UI

25:25

well so this is the Commodore Plaza here is like

25:32

the main the main view of the application here’s all these Services I

25:37

mean all the workloads demons deployments wall out whatever across all

25:44

over my clusters so here we can see like a full view of all of the Clusters and all of the

25:51

workloads so um as developer I probably responsible

25:57

for not a single service and not for all these services in the application

26:02

so I want to track only the services and the application that I’m as as a

26:08

developer is responsible for so for that we have some

26:16

more zoom zoom view that display only the services and all the application

26:22

that is relevant for me as you can see this is the the application view only

26:27

for the backend developers here we can see like all the wall outs that happened all the deployments that happened in the

26:34

last the last day all the issues that I had within the services and what are the related kubernetes

26:40

resources to those applications like a node Sports config map sequence PVC and

26:47

Etc so let’s dive team dive into some

26:53

specific service so here I can see some metadata and

26:59

another data about about my service and I can see the timeline of what

27:05

happened to the service we need to remember that kubernetes is stateless it doesn’t remember what happened in the

27:11

past and it only knows what is happening right now or a few minutes ago and

27:16

kubernetes is stateful it does remember what happened in the past so here you can see some timeline of

27:24

that particular service in the last day in the last two days in the last week

27:29

uh I can say that that timeline is specifically for that service but if I’m

27:35

a devops or some manager of the kubernetes cluster so I have the events

27:41

tab that I want to but to show you like not only specific workload events but

27:46

all the workloads all the all the events of all the resources it was all the Clusters

27:52

so but I’m a developer and this is what I curse so this is an example of a rollout

28:00

here we can see like the wall of changes this is the kubernetes changes I increase my replicas from three to six

28:07

change some two annotations change some config marks and I can see also the

28:13

changes that I made within GitHub or within any git provider if you the

28:19

developer just changed the diamond configuration

28:26

so I had it all out the world was successful but I see that after a few minutes uh I had a problem this is

28:32

called the availability issue meaning my service was unavailable as you can see it’s still happening right now it’s

28:38

still opens I have only one of six replicas that is available so if I deep dive into these specific

28:47

capabilities you can see like all the information and that they need in order to investigate and see what is the

28:53

problem and this is what Commodore suggest me coming to test me hey maybe

28:58

it is the problem I can see the logs I can see the events as I said before to

29:03

track the events and on those parts of this deployment

29:09

and if I want to Deep dive even more into the pods I can see all the Bots that are related

29:15

to this service and do some actions in order to troubleshoot in order to see what is the problem like openings from a

29:23

shell to the container and doing some

29:28

commands group

29:38

I can also delete the the Pod and doing the squad everything that I could do if

29:44

I use a keep ctm so once I know that uh

29:51

I had some add some wall out I had some problem and now I want to see what is

29:58

the problem I see what is the problem and now I have all the all the tools and all the capabilities to troubleshoot and

30:04

solve the problem from end to end and I think this is the real power of commodore to give you the context and

30:11

the full image of the problem and to lead it to the solution and to give it the tools to solve the solution until

30:17

the end and so this was it I moved the mic back

30:24

to you arsh or the can you share screen

30:37

so uh just to wrap things up this is a key takeaway we wanted everyone to get

30:44

from this webinar is that the tools in production have changed and that it is

30:50

about time we started investing in Dev tools or which are the tools available for developers to come back with this

30:58

changing world of kubernetes and containers because we have we as an

31:03

industry have always agreed on the fact that like the local environment must

31:08

match what’s happening in production and until we bridge that Gap it’s going to

31:13

be very tough for developers to deal with the challenges of kubernetes uh

31:19

tools like octeto and commodore help solve this problem because they speak a language which developers understand and

31:26

help bridge that gap between uh development and the production kubernetes setup thanks and I’ll give it

31:35

back to UDI to conclude

31:43

thank you thank you thank you thank you

31:49

okay so um uh before we wrap things up completely

31:56

we have one question that we haven’t answered yet so uh Neil and Ash you can

32:03

each contribute an answer to this question by Faisal farook the question

32:09

is being a beginner in this field what would be your suggestion currently working on front end

32:17

so I’m guessing uh Faisal isn’t working

32:22

on kubernetes yet any any suggestions before we go

32:31

I’m not really sure I understand what’s being asked but uh

32:36

if you’re working on front end and if your app is this like a fronted

32:42

application then are you asking about like any Frameworks you should be using or are you talking about how to

32:50

scale this application because if you’re talking about Frameworks then I think the popular choice right now is react uh

32:57

but if you’re talking about like what you should do like to scale this application then I would definitely

33:03

advise that uh like if you feel like this is going to go grow up into a big

33:09

project then you should invest in like containerizing this Microsoft this front-end microservice and uh

33:16

looking into Solutions which help you around that it totally depends on what approach you want to take when you

33:22

deploy this to production need do you have something you want to add to that

33:27

yeah nothing nothing okay nothing for me I will just say that

33:36

no matter where you are on your journey right now and what’s your area of uh specific expertise currently you can

33:43

always transfer your skills you can always learn new things new Frameworks new languages even something as big and

33:51

scary as kubernetes can be learned um

33:56

let’s see if we have time for this um

34:02

yeah why not so uh just before we move on to the next question so I just want to share a little secret about Neil he

34:09

started as a Unity developer so he wasn’t uh Cloud native wasn’t born

34:16

in the cloud like uh others so he learned everything about kubernetes in

34:22

the recent years and uh you can too it’s possible so uh one final question before we go

34:30

um from you hi I’m a moon stack developer I am new to doctors and

34:36

kubernetes this session was quite great and I got a fair idea about Komodo and octeto is doing oh okay so it’s not a

34:42

question just a compliment to YouTube so uh thank you glad you found the session

34:48

useful yuvraj can you elaborate

34:59

no I was just saying that I’m happy to know that yuvraj from the session yeah

35:05

and I’m sure it’s not the only one I found it useful I will say that and I think

35:11

um everyone will joined or will watch it uh or whatever the recording later we’ll learn something new

35:17

and this is an evolving field a going field it’s a question that a lot of really smart people around the world are

35:24

sketching their heads and thinking how to make kubernetes differently how can I enable my devs to own kubernetes and not

35:32

the other way around so I hopefully we gave when I say we I mean near and Ash I

35:40

had very little contribution to this but hopefully we gave people some food for

35:45

thought and um you have we will share the recording

35:51

and the deck with everyone you have a Twitter handles here so feel free to reach out

35:57

um we also have a slack Community which you are all welcome to join and share

36:03

other resources and events in there and uh any final words from the potato side

36:13

um yes I would advise I see a question about like pricing and you can anyone

36:18

who wants to know more about Dr can visit octeto.com and uh explore the

36:24

product for yourself and if you have any questions regarding uh how to uh like

36:31

make uh your journey to like using octet or anything or hey help you need you can

36:37

reach out to us on community.teto.com which is our community and you can ask questions if

36:42

you have any feedback for this webinar or if you found it useful just uh it would be great if you could let us know

36:48

by making a post there and I would really appreciate that thanks for watching

36:53

thanks everyone see you next time thank you bye bye thanks bye