Kubernetes Controllers, Custom Controllers and Operators explained with use cases

  Рет қаралды 10,987

Vivek Singh

Vivek Singh

Күн бұрын

Пікірлер: 55
@crujzojam7004
@crujzojam7004 2 жыл бұрын
Great video!! Is it safe to say that If CDRs are present then they belongs to an operator only? Can controllers also create CDRs ? Please help me understand
@viveksinghggits
@viveksinghggits 2 жыл бұрын
Hi Crujzo, There isn't much difference between controller and operator functionality wise. Both are applications that watch for user specified state and then make sure cluster is on the same state. For example if a user says I want a MongoDB database running, controller/operator is going to make sure that you have a MongoDB database running on the cluster. You would use the word operator for controllers that have more domain level knowledge about the thing that its managing for example, in obove case if the controller also knows how to backup and restore DB, how to add users to DB etc. In that case we can call that controller an operator. I hope this was helpful.
@crujzojam7004
@crujzojam7004 2 жыл бұрын
@@viveksinghggits Thanks a lot for the quick reply, so that mean operators are more specialized case of controllers, but what I see as a trend that people are moving away from operators as to handle lots of cases the more lines of code inherit potential bugs as well which becomes a problem rather than a simplified solution ... Is my understanding is correct according to you?
@viveksinghggits
@viveksinghggits 2 жыл бұрын
People are moving away from operators to what?
@VineethYadav-nq6eh
@VineethYadav-nq6eh 3 күн бұрын
Your videos are much better than paid sessions.Thank you for your effort.
@Babe_Chinwendum
@Babe_Chinwendum Жыл бұрын
So so helpful!! Thanks a mil!
@viveksinghggits
@viveksinghggits Жыл бұрын
Thank you for watching. I am glad they were helpful.
@basilkurian0
@basilkurian0 Жыл бұрын
Thanks for making these videos
@viveksinghggits
@viveksinghggits Жыл бұрын
I am greatful for the super thanks and glad that videos were helpful.
@prasunaneerati5626
@prasunaneerati5626 3 жыл бұрын
Very well explained.Thanks for the video
@viveksinghggits
@viveksinghggits 3 жыл бұрын
Hey 👋, Thanks Prasuna. I appreciate it.
@gv.ramana
@gv.ramana 3 жыл бұрын
@@viveksinghggits please help us to make pod security policy. Thank you
@kevalbhogayata6031
@kevalbhogayata6031 2 жыл бұрын
I have a usecase specific query around this. I have a daemonset running on the client clusters. Everytime I update my docker image, I tell my client to restart the daemonset. Can I write a "custom controller to check if a new image SHA is available and restart the daemonset" ?
@viveksinghggits
@viveksinghggits 2 жыл бұрын
Hi Keval, Yes that would be a good solution to tackle the problem of updating the image when a new image is pushed. I would also recommend, checking if combination of image tag and imagePullPolicy can somehow handle this automatically and in that case you wouldn't even need to write custom controller.
@keratishvili
@keratishvili 3 жыл бұрын
Great video would love to see more deep dive materials
@viveksinghggits
@viveksinghggits 3 жыл бұрын
Thanks 😊 Giorgi, Yes, I do have some great videos planned for coming weeks.
@kunchalavikram
@kunchalavikram 3 жыл бұрын
Well explained. Which device you use for writing and the video recording software that displays the speaker's video?
@viveksinghggits
@viveksinghggits 3 жыл бұрын
Hey, thanks Kunchla. If you are talking about those drawings, I have a wacom one tablet that I use to draw. To record the screen I use OBS and have a Logitech Webcam to record speakers face. It's OBS' functionality to show speakers video with screen. Let me know of you need any other details, I would be happy to help.
@adityajoshi3360
@adityajoshi3360 2 жыл бұрын
What is the difference between helm charts and operator?
@viveksinghggits
@viveksinghggits 2 жыл бұрын
Hi Aditya, Have you watched the videos that I have on helm?
@adityajoshi3360
@adityajoshi3360 2 жыл бұрын
@@viveksinghggits yes I have seen that, my question is more toward the operator sdk that allow creating operator with helm
@viveksinghggits
@viveksinghggits 2 жыл бұрын
So, in short what happens there is, operator SDK can be used to create operator for your helm chart. When we create the operator we specify that this is the chart we want to create operator for. Like most of the cases it would introduce a CR and as soon as the CR created the operator is just going to install a helm release. So you have the helm chart already prepared but because of certain reasons/use cases you would want to have an operator and that's where you can use this.
@kingcharles30922
@kingcharles30922 3 жыл бұрын
Hi Vivek, can we create deployments using crd? Or is it can just be used to monitor the deployments. I know we already have replication controller to do this job
@viveksinghggits
@viveksinghggits 3 жыл бұрын
Hi Ashutosh, "Can we create deployment using crd" Why would you want to do that? CRDs are Kubernetes resources that are created to introduce custom resources (that are not already available in k8s) into Kubernetes. "is it (crd) can just be used to monitor the deployments" If I understood the question correctly you are asking if CRDs are used to monitor the deployments. The answer is NO, they are not used to monitor any resources, as explained in above answer they are used to introduce another resource into the Kubernetes API server. Please let me know if that answers your questions, if no please don't hesitate to ask any other question that you have. I would love to answer them.
@kingcharles30922
@kingcharles30922 3 жыл бұрын
@@viveksinghggits Your answer cleared my doubts. Thanks 😊
@viveksinghggits
@viveksinghggits 3 жыл бұрын
Like I said please don't hesitate to ask any other question. For example what happens when a CRD is created or what happens when a CR is created. I would be happy to answer them.
@shamstabrez2986
@shamstabrez2986 2 жыл бұрын
toh phir dono mein differnece kya hua jb dono hi chizen same work krri h via api server monitor krri resources ko then manual kam ko automate whts the difference between them
@viveksinghggits
@viveksinghggits 2 жыл бұрын
Hi, I think the same question is answered in one of the comments of this video. Try to find that out. If you are not able to, let me know.
@shanelindsay5860
@shanelindsay5860 Жыл бұрын
Hi, there do you have any recommendations for reading on launching dynamic sandboxed containers/pods for untrusted consumers of my application? My ideal configuration is allowing a user to launch a docker image as a service dynamically and manage it using my application. I was looking at operators, but it seems to mostly be declarative. I'm not sure what is best practice for launching and managing such services
@viveksinghggits
@viveksinghggits Жыл бұрын
Hi Shane, Sorry, I didn't understand the usecase very well. You will have to make your application secure, right? You can not just rely on infrastructure for security.
@roshankakad9720
@roshankakad9720 2 жыл бұрын
or do you have any Practical video for operator for my below query as i won't find it
@viveksinghggits
@viveksinghggits 2 жыл бұрын
If you go to playlists on my channel, there is a playlist where I wrote kubernetes Operator from scratch which is named similarly. Let me know if you are not able to find it.
@partharora8759
@partharora8759 3 жыл бұрын
How a particular operator attached to particular CR
@viveksinghggits
@viveksinghggits 3 жыл бұрын
Hey Parth, 👋 That's a great 👍question, thanks for asking that. So when we write an operator, we tell it which particular custom resource this operator is going to look for. For example if we write operator for node CR, as explained in video, in operator code we will specify that this is the resource that this operator is responsible for. I am going to cover this in some of the coming videos.
@partharora8759
@partharora8759 3 жыл бұрын
@@viveksinghggits okay thanks
@PREETISBAYAS
@PREETISBAYAS 2 жыл бұрын
Hey Vivek, In simple words can we say that we have custom controllers for native objects and operators for Custom Resources in Kubernetes. And in functionality of both of them is same?
@viveksinghggits
@viveksinghggits 2 жыл бұрын
I think yes, very naively we can say that. Concept is same but functionality is different, in case of operators there are a lot of things that it might need to take care of, internal or external.
@viveksinghggits
@viveksinghggits 2 жыл бұрын
For example entire life cycle of the database or the resources that is being created by operator should ideally be handled by operator.
@roshankakad9720
@roshankakad9720 2 жыл бұрын
Hello Vivek , one query is like, how to check how many operators are there. So using kubectl get we can get CR details but how to check which operator is there in our k8s cluster to manage that particular CR. In CR video you have shown kubectl get etcds but operator practical you didn't shows us in this video. Please help me to get this clarify
@viveksinghggits
@viveksinghggits 2 жыл бұрын
Hi Roshan, Using kubectl we can interact with Kuberenetes resources. Operators are programs that work with Kuberenetes resources or use them to do something. Most of times a CRD would have respective Operator running on the cluster. But it's totally possible to just have CRDs and not the Operator, isn't practical though. I hope Using these statements you can figure the answer out.
@roshankakad9720
@roshankakad9720 2 жыл бұрын
@@viveksinghggits Hi Vivek, its still not clear, Please help me understand in other way around.
@roshankakad9720
@roshankakad9720 2 жыл бұрын
I just want to see operator in k8s cluster, which logic is defined inside operator then it would be more clear to us if anything happened to CR then what exactly operator will do. We can see crd & cr by using kubect commands. Actually i am not a developer as i am part of devops team thats the reason i am curious to see operator in actual in config. I have see like crd & cr running as a pod so thought of that it would also be running as a pod.i am still in dilemma. i would appreciate if you help me really get out of this confusion 😇
@viveksinghggits
@viveksinghggits 2 жыл бұрын
Roshan, you will have to look at the documentation of the operator that you have installed for more details. And of the operator code is open source check the repo to see the code.
@shamstabrez2986
@shamstabrez2986 2 жыл бұрын
bhai toh controllers n operators mein difference kya hua jb dono hi chizen custom resource pr kam krri h
@viveksinghggits
@viveksinghggits 2 жыл бұрын
The exact same question is answered in the pinned comment.
@gv.ramana
@gv.ramana 3 жыл бұрын
subscribed. 👍 well explained vivek...to be honestly...pls improve the audio...your subscribers gonna increase like anything. my 2 cents
@viveksinghggits
@viveksinghggits 3 жыл бұрын
Thanks Ramana, sure I will work on the audio.
@badmintonSeekers
@badmintonSeekers Жыл бұрын
Main difference between Controller an Operator ?
@viveksinghggits
@viveksinghggits Жыл бұрын
Have you watched the entire video? I think I explained it in the video.
@niteshsince1982
@niteshsince1982 3 жыл бұрын
Hi Vivek. Thanks for the video. Do you also have some code snippets on actually how to write custom controllers? Is their a github repo we can get hands on. Theoretically its clear but want to see some code..
@viveksinghggits
@viveksinghggits 3 жыл бұрын
Hey Nitesh, Yes, that is what I will be covering next in my videos. It might take some time though. There are some examples in my github, if you want to check it out meanwhile.
@palashgoel8973
@palashgoel8973 3 жыл бұрын
@@viveksinghggits when is your next video coming?
@viveksinghggits
@viveksinghggits 3 жыл бұрын
Hey Palash, I will be uploading another video this weekend. But that is not going to be about writing controllers. If you are waiting for the one about controllers, that will be in next weekend.
@kingcharles30922
@kingcharles30922 3 жыл бұрын
Hi Vivek, so can two controllers connect with each other?
@viveksinghggits
@viveksinghggits 3 жыл бұрын
Hey Ashutosh, Can you please elaborate the question a bit.
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 2,2 МЛН
One day.. 🙌
00:33
Celine Dept
Рет қаралды 60 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 12 МЛН
What The Heck Are Kubernetes Resources, CRs, CRDs, Operators, etc.?
21:08
Writing a Kubernetes Operator: the Hard Parts - Sebastien Guilloux, Elastic
33:45
CNCF [Cloud Native Computing Foundation]
Рет қаралды 18 М.
Understanding the Kubernetes Resource Model and Controller Pattern
1:24:02
Extending Kubernetes with Custom Controllers - John Sundharam & Harsh Singh, Grofers
26:15
CNCF [Cloud Native Computing Foundation]
Рет қаралды 6 М.
Writing Kubernetes Controllers
18:28
Peter Jausovec
Рет қаралды 18 М.
Kubernetes Custom Resource Definition (CRD) Explained with Demo
22:58
Learn with GVR
Рет қаралды 25 М.
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 2,2 МЛН