Kubectl Basic Commands - Create and Debug Pod in a Minikube cluster | Kubernetes Tutorial 18
HTML-код
- Опубликовано: 1 окт 2024
- Kubectl the command line tool for accessing the Kubernetes cluster. In this video we create and debug a pod in a minikube cluster using Kubectl commands.
I'll go through the basic commands of the Kubernetes CLI. You will learn how to create, edit, delete deployments/pods. Also how to debug a pod with useful debugging commands.
▬▬▬▬▬▬ T I M E S T A M P S ⏰ ▬▬▬▬▬▬
0:12 - Get status of different components
1:08 - create a pod/deployment
4:57 - layers of abstraction
5:19 change the pod/deployment
7:14 - debugging pods
10:43 - delete pod/deployment
11:42 - CRUD by applying configuration file
16:22 - summary of commands
Git repo link of all the commands I use:
gitlab.com/nan...
-------------------------------------------------------------------------------------------------------
What is Kubernetes? 👉🏼 • What is Kubernetes | K...
Kubernetes Components explained? 👉🏼 • Kubernetes Components ...
For any questions/issues/feedback, please leave me a comment and I will get back to you as soon as possible. Also please let me know what you want to learn about Docker & Kubernetes.
#kubernetes #kubernetestutorial #devops #techworldwithnana
-------------------------------------------------------------------------------------------------------
This video is the 18th of a complete series for beginners. At the end of this tutorial you will fully understand Docker and Kubernetes.
⭐️ Full Playlist: • Docker and Kubernetes ...
-------------------------------------------------------------------------------------
The complete step-by-step guide to Docker and Kubernetes will include the following topics:
🐳 DOCKER basics:
- Container concept
- Why docker? (image vs. traditional DevOps)
- Install docker on different operating systems
- 8 basic commands you need to know (2 parts)
- Docker vs. Virtual Machine
- Docker in Practice: Overview of whole development process with Docker (development, continuous delivery, deployment) Probably 3-5 videos including Docker-Compose, Dockerfile, Private Repository.
- Docker Volumes in theory and practice
✵ KUBERNETES basics:
- Main Kubernetes components (including Pod, Service, Ingress, Volumes, ConfigMap, Secrets, Deployment, StatefulSet)
- Kubernetes architecture for beginners (master, slave nodes & processes)
- How Kubernetes makes high availability, scalability and disaster recovery possible
- Minikube, Kubectl - set up the cluster
- Kubectl basic commands - Demo
- Configuration file (YAML) - syntax
- Communication between the pods - basic networking concepts in Kubernetes
- K8s Deployment in practice - example application deployment (pod + service + Ingress + secret)
- K8s Volumes explained
- Kubernetes Networking
- Kubernetes Namespaces
-----------------------------------------------------------------------------------
✅ Connect with me
on RUclips: / @techworldwithnana
on DEV: dev.to/techwor...
on Instagram: / techworld_with_nana or my personal account: / nanuchij
on Twitter: / njuchi_
on Tumblr: www.tumblr.com...
Legal Notice:
Kubernetes and the Kubernetes logo are trademarks or registered trademarks of The Linux Foundation in the United States and/or other countries. The Linux Foundation and other parties may also have trademark rights in other terms used herein. This video is not accredited, certified, affiliated with, nor endorsed by Kubernetes or The Linux Foundation.
0:12 - Get status of different components
1:08 - create a pod/deployment
4:57 - layers of abstraction
5:19 change the pod/deployment
7:14 - debugging pods
10:43 - delete pod/deployment
11:42 - CRUD by applying configuration file
16:22 - summary of commands
👉🏼 For any questions/issues/feedback, please leave me a comment and I will get back to you as soon as possible.
Please don't forget to subscribe and give me a thumbs up if you liked my video 😊
Your presentation and the video content is very good, able to easily understand the concepts. i find it more informative than any other udemy vidoes
@@vigneshmanick2759 Thanks for such positive feedback, really appreciate it :)
Thanks a lot Nana, so sweet of you, great work keep it up. May God bless u with success nd happiness.
@@amulsharma8172 🙏 Thank you so much Amul 🙂
Nana how to get token from hidden pod
Hey Nana! Love your videos. One small edit though,
‘-i’ stands for interactive
‘-t’ stands for TTY (teletype) which tells the terminal to behave like a physical terminal and less like a shell environment.
Nice tutorial. I think you forgot to mention what to do when we want to use a local image rather than pulling from a public docker registry. For anyone interested, you can upload a local image to minikube with:
minikube image load
and then run the 3:17 command
Done thanks
Copied to onenote
Editing a deployment automatically starts a new pod with the new properties and the old one is stopped
Kubectl logs somePodName returns the logs printed by a pod
Kubectl exec gives you a terminal into the pod
Kubectl exec -it somePodName - ibn/bash
Deleting deployment deletes replicaset too
Creating deployment from cli instead of typing out all the configuration options we use config files
12:50 using kubectl apply which takes a configuration file and applies its contents
Config file defines spec specifications for a deployment, including how many replicas of the deployment. Inside the config for deployment we have config for the pod itself, like the image it’ll use
A pod can have multiple containers inside it also
After making changes to the config file you save and do kubectl apply
If deployment doesn’t exist this also makes it from scratch
Loved the tutorial. Also, for ppl following the tutorial: Nginx version 1.16 is not available as of now. Try 1.17
Thanks Abdul for sharing this!
is this a Latvian or Austrian flag in the top right handside of screenshare?
Great work, I gone through the many Kubernetes blogs and videos and you explained the concepts in detailed. I cleared my concepts. Thanks a ton !
Thank you so much, glad I could help :) Hope you like my upcoming videos too 🙅🏼♀️
hi, at 10:01 idk what root user I have to key in there. how to obtain that root user for my laptop? thanks
history -w /dev/stdout | sort | uniq | grep ^kubectl
this might help to review and learn all those commands in these videos, for those who likes to code along, and then get back to do over
Your videos are so beautiful and useful. Thank you for putting the extra effort.
I'm glad you find it really helpful Mark. Best of luck to your journey. Stay safe and blessed. 🙂
Hi Nana The video was informative. I have one error while creating using command kubectl apply -f nginx-deployment.yaml like this error: the path "nginx-deployment.yaml" does not exist can please help me out
I had the same issue. You need to create the file nginx-deployment.yaml first. Then add her code inside the file. Finally, you can kubectl apply -f nginx-deployment.yml
@@MetalBearSeto How can the .yaml file be created? I got stuck at the same spot
Thanks for the detailed tutorial. I have met a problem when editing the deployment config, after changing image from " nginx" to "nginx:1,16" kubectl told me "error: deployments.apps "nginx-depl" is invalid". how can I check where go wrong?
Thanks for this awesome video. Thank you, Nana
what is the difference between the following commands?
$kubectl create deployment nginx1 --image=nginx
AND
$kubectl run nginx --image=nginx
strict decoding error: unknown field "spec.selector.template" error find during kubectl apply -f nginx-deployment.yaml
kubectl apply -f nginx-deployment.yaml
commnand is giving error : error parsing nginx-deployment.yaml: error converting YAML to JSON: yaml: line 11: did not find expected key. Please help!!!!!
Thanks for the videos.
Thank you Nana for the execellent tutorial!!
what an amazing tutorial! thanks a bunch Nana
Thank you for your positive feedback 😊 🙏
Hi nana..
Ur videos r lightweight like docker🥰
Nd smallest unit of contents...
Another informative and right-to-the-point video. Thanks so much!
tried to execute kubectl create deployment nginx-depl --image=nginx and get Error from server, service could not find the requested resource. Any ideas what is the fix?
nginx deployment file is here kubernetes.io/es/docs/concepts/workloads/controllers/deployment/
Thanks !!! gratitude to you. you must be a very nice person to dedicate your time educating everyone thru your Channel. Work as DevOps/SRE Engineer, dealing with K8 on the daily basis ( besides the Splunk logs, kubectl describe command is my best friend how to troubleshoot ) I have a questions. would you please tell me what type of editor you are using when creating a yaml file for deployment. I use vi editor and it gives me lots trouble to get my indentation right. if you can post the url where you down-load your yaml editor I would be grateful to you. Thanks again for spreading your know how and teaching everyone here. Mat.
Thanks a lot Mat! :) I just use Visual Studio Code code.visualstudio.com/ and put the code inside an online validator. But there are also YAML extensions you can install in VSC for built-in validation and auto-complete - just looked one up "YAML language support by Red Hat " - they also have built-in Kubernetes syntax support. I didn't try it out though.
use vimdiff whatever changes need to be done will be highlighted when you are comparing two files all you need to do is press the pgdwn button to the desired row and just type "do" values from right to left will be copied and after being done with changes type"esc" button in keyboard then type "wqall!" That way it saves the changes made in the file
@@TechWorldwithNana use vimdiff whatever changes need to be done will be highlighted when you are comparing two files all you need to do is press the pgdwn button to the desired row and just type "do" values from right to left will be copied and after being done with changes type"esc" button in keyboard then type "wqall!" That way it saves the changes made in the file
რამდენი ვიდეოა გისმენ და ვერ წარმოვიდგენდი რო ქართველი იყავი სანამ მარჯვენა ზედა კუთხეში ნანა ჯანაშია არ წავიკითხე შემთვევით 😁 ძალიან კარგად საუბრობ ინგლისურად 😊😊
hey nana,Please make a tutorial on nginx and docker swarm for beginners .
Hi Madhu, thanks for your suggestion will consider it 👍
Thanks for the session about k8"s commands .
I can't recommend your kubernetes series highly enough.
You are a good person Nana.
Hallo, how can i access my application with ip my computer or ip cluster? thanks
So clear and didactic! TKS for that's videos...
Aaawww, this is much appreciated Rodrigo. Stay safe. 🙂
Thank you for such a good tutorial.Waiting eagerly for configuration file tutorial.
Thanks a lot Ghazi! Will publish the configuration file tutorial in a few days :)
Just fenomenal tutorial
Love the way you explained it. Thanks!!
Happy you like my way of explaining things :)
Good Stuff
Glad you loved it Sundarraj! 🙂
Thanks for the video , but isn't it better to use yml instead of the cli ?
BESTEST!
Awesome compliment Aaditya! Thank you. 🙂
nice introduction to kubernates command line
Hey, your content is really good. Is it possible to get the ppt ?
You can create a Pod with kubectl run command.
Thanks for the video, however can I ask if I'm using AWX and create a Directory to minikube - but seems the directory is not visible either to the linux host or the minikube container? am I missed something? thanks in advnace.
this is great stuff. thanks!
simplest explanation i have seen till now with such a detailed way...Thanks :)
You're welcom Abhilash. 🙂
Mam ur explaination is awesome...but your kubernetes videos don't have specific order can you please give numbering to them..as of now they are scattered.
Very nice and well explained
One doubt in it. Earlier you told that Database pods will use Stateful Component but in this video you use Deployment Component for Mongo db right ?
When you are to use `exec`, bin/bash is not available for alpine images, should be using bin/sh instead.
.. Just for those who are relatively new to docker..
This is such wonderful tutorial series.love this
Thanks Tim, glad the video series is helpful for you 🙂
Thanx.
Is each replica has seperate pod?
Thx from russians developers! Very clear explanation of the K8s concepts. Please explain how to use my local docker image!
How to upload files from local host to pods in cmd modes
How do we exec into a multi container pod? and also follow logs for one container in a multi container pod ? by default the exec command and the logs command will show the logs or exec into the first container in the pod
Kubectl exec [pod_name] [container_name]
I wrote the code as it is as you have suggsted:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.16
ports:
- containerPort: 80
please let me know where i have gone wrone
This is what I need! Skip lousy and duplicate intro and go into real command operations directly!
Hi,
Your knowledge sharing skill is wonderful.
I am keep leaning better.
I want to thank you for this.
My doubt on this session :
After creating a new config.yaml file there will be two pods both updated and the old ones.
Now which one of these will be executed by K8 in default condition?
Thanks for this video. The config file that you created with the command "vim nginx-deployment.yaml", is this like a default syntax or do you have to write code from scratch?
Hey Nana, thanks for very interactive session in terms of KubeCtl command and all details. However I would recommand please put shortcuts on screen for minikube terminal too... It will help beginners to do it with same speed as you are doing. Very informative and much needed session.
Thanks again for the such detail video. I am addicted by your teaching style.
Beautiful explanation with wonderful content. Thanks for sharing.
i love you for making those videos, sharing knowledge without nothing back, i send you a big hug a thank again for all you have done, you deserve a new subscriber, me
Nicely explained.. Any plans for a similar video series on Red hat Openshift..?
i need reaming sessions where can i find
it's amazing all , but i would like to know how can i to create multinodes with minikube. tks for your videos
@TechWorld with Nana please clear this doubt. We learned that pod can have 1 or more than 1 container inside it. But in K8 smallest unit is pod. How we can go inside particular container inside pod? In case of multiple container inside pod. Kubectl exec -it podname will login to which container?
I got answer from your another lecture Pods and Containers - Kubernetes Networking | Container Communication inside the Pod
ruclips.net/video/5cNrTU6o3Fw/видео.html
you are amazing Nana!!!!
Nice tutorial. Looking forward for more such stuff
Thanks, best to subscribe to not miss new videos 🙂Many cool topics in the pipeline :)
cannot wait for your tutorials
I have an idea for your theme song at the end of every video: Nananana, nananana, hey hey hey, goodbye!!
😅
Thanks, It was helpful, I'm gonna go for zero to hero for the Kubernetes
Is Kubernetes cluster equally to a node, right?
1 pod can contain many containers, right?
Hi @Techworld with Name, I have been following of these vides for a short time. Your explanations are very crispy. Easily understandable. I really appreciate your work for the community. Keep up this splendid work for folks. Thanks once again for sharing these to all of us.
Finally found your videos you did a great job ! can i get from a local docker image an deployment ? instead of docker hub ?
I really like your Layers of Abstraction breakdown, most other instructors should learn your way of teaching.
Excellent teaching!
Awesome videos.
When there is something on terminal and we pause the video to write that down, the video progress bar comes up and it hinders seeing the command on the terminal. You may clear up the terminal so that commands come up at the top.
Hi Nana,
Git repo link of all the commands .... here i am not able to see any file...
every time i save i have this error
> kubectl edit deployment nginx-depl
error: deployments.apps "nginx-depl" is invalid
A copy of your changes has been stored to "/tmp/kubectl-edit-3zmtr.yaml"
error: Edit cancelled, no valid changes were saved.
never mind was adding a tab at the beginning od - image when i add : after nginx
Awesome tutorial , easy to learn K8S.
Thanks!! :)
Happy to learn here :)
Awesome! Thanks for your work and efforts!
You're welcome, happy you like my videos 🙂
thank u Nana , can u please make a new video to explain Kubernetes Jobs .
Super tutorial 🙏
amazing video. Love the way you teach k8s
How to start and Stop pods
Great video. The way you teach is really great, specially I like the summary at the end. Good job!
Amazing explanation! Thank you!
Hey Nana, I am getting an error while doing the deployment, It says ImagePullBackOff Error. What could be the possible reason for such an error? And how do we debug and fix it?
My guess is that you wrote 'image=nginx:1.16' verbatim as seen when editing the yaml file at 6:12, but you should instead be using nginx:1.18 or newer (depending on how old my comment is). Check the nginx page on Docker Hub (hub.docker.com/_/nginx ) and see the supported tags section (i.e. supported images from which kubernetes will automatically try to pull the docker image from, assuming a match is found). The page no longer contains v1.16, but the image probably existed when the video was made.
Keep up the good work. A big fan of your videos. Easily understandable with practical implementations.
Thank you Nana
thanks a lot!!
Excelent, you're teaching me a lot!!!
I have checked many resources but this one is so clear. I'm gonna invest myself and spend my weekend with this playlist. thank you very much and I hope you keep continue to produce.
Best tutorials on youtube! Thanks ;)
excellent
love u
Learned so many things in this video :) Thanks
nicevideo
Very clearly explained Nana Thanks
Great work. Thank you
Thanks Paresh
Nice and clean explanation as always 💌
Excellent content
Thanks a lot Kardam :)
great work , Glory to you