kubernetes tutorial | Tips and Tricks | Linux Bash | Cursor Column, Alias, Auto Completion, Yaml

Published: 01 November 2022
on channel: VSPARKZ
1,319
17

Certified Kubernetes Administrator
-----------------------------------------------------------
kubernetes tutorial | Tips and Tricks | Linux Bash | Cursor Column, Alias, Auto Completion, Yaml

Description
------------------------
In this video, you are going to Some of the Tips and Tricks while working with the kubernetes environment. we are also going to see a demo on each of those as well.

Kubernetes Tips and Tricks
--------------------------------------------

Tip 1 - Indentation & Cursor Column for YAML files
Tip 2 - Autocompletion - kubectl commands
Tip 3 - Alias for kubectl utility
Tip 4 - Creating Kubernetes YAML manifest

For suggestions/feedback/doubts contact
email: [email protected]


Happy Learning !!!
============================================================


USEFUL LINKS
----------------------------

API References:

https://kubernetes.io/docs/reference/...

Kubectl Command Reference:

https://kubernetes.io/docs/reference/...

Kubernetes Cheat Sheet

https://kubernetes.io/docs/reference/...

============================================================
#vsparkz #kubernetes #k8s #containers


DEMO STEPS
-------------------------

*** $ - Notation to represent a command


Tip 1 - Indentation & Cursor Column for YAML files
--------------------------------------------------------------------------------------

$ kubectl run nginx --image=nginx --dry-run=client -o yaml

Copy the output of the above command and create a file pod.yaml

Install VIM Editor...

$ yum install vim
$ vim .vimrc

Copy the below contents in .vimrc file...

$ set ts=2 et cursorcolumn
$ source .vimrc

$ vim pod.yaml

Tip 2 – Bash Auto Completion - kubectl commands
-----------------------------------------------------------------------------------------

Install bash completion package (Optional)...

$ yum install bash-completion

Copy the below command in bash-completion.txt

$ kubectl completion bash

$ source bash-completion.txt

Copy the above commands in .bashrc file

Tip 3 - Alias for kubectl utility
----------------------------------------------------------

$ alias k=kubectl
$ complete -o default -F __start_kubectl k

Copy the above commands in .bashrc file

Check the alias for k...

$ type k

Tip 4 - Creating Kubernetes YAML manifest
-------------------------------------------------------------------------

Create a Simple yaml definition file

Create a Pod Template

$ kubectl run nginx --image=nginx --dry-run=client -o yaml

Copy the output of the above command and create a file pod.yaml

Create a Deployment Template

$ kubectl create deployment frontend --image=nginx --replicas=1 --dry-run=client -o yaml

Copy the output of the above command and create a file deployment.yaml

Create a complex yaml definition file

$ kubectl api-resources

$ kubectl explain pods

$ kubectl explain pods --recursive


-- THE END --


Watch video kubernetes tutorial | Tips and Tricks | Linux Bash | Cursor Column, Alias, Auto Completion, Yaml online without registration, duration hours minute second in high quality. This video was added by user VSPARKZ 01 November 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,319 once and liked it 17 people.