Kubernetes & Strimzi Administration
14 chapters
1. Describe a node (capacity, allocatable, conditions, pods)
[Verse 1]
When you need to peek inside a node's state
kubectl describe will show you straight
Capacity tells you what's available to use
CPU and memory, the resources you can choose
Allocatable shows what pods can really claim
After system reserves, what's left in the game
[Chorus]
Capacity, allocatable, conditions, pods
Four key things that every node shows
Describe the node and you will see
The health and state of your machinery
Capacity, allocatable, conditions, pods
kubectl describe reveals the code
[Verse 2]
Node conditions tell you if it's running right
Ready, memory pressure, disk space tight
True or false for each condition type
Is your node healthy or not quite right
OutOfDisk, NetworkUnavailable too
These conditions tell you what your node can do
[Chorus]
Capacity, allocatable, conditions, pods
Four key things that every node shows
Describe the node and you will see
The health and state of your machinery
Capacity, allocatable, conditions, pods
kubectl describe reveals the code
[Bridge]
Pods section shows what's running there
Every container, every workload pair
Non-terminated pods are listed out
So you can see what it's all about
From system pods to your apps deployed
Check the node to see what's employed
[Verse 3]
Taints and tolerations, labels too
Architecture info to help you choose
Operating system, kernel version
All the details for your node's conversion
Events at bottom show what went wrong
A timeline of issues all along
[Chorus]
Capacity, allocatable, conditions, pods
Four key things that every node shows
Describe the node and you will see
The health and state of your machinery
Capacity, allocatable, conditions, pods
kubectl describe reveals the code
[Outro]
So when your cluster's acting strange
Use describe node to see the change
Four key sections, remember well
Your node's story they will tell
2. List nodes with status
[Verse 1]
When you need to check your cluster's health today
Every node's condition in a clear display
There's a command that shows you everything you need
Status, roles, and versions at computer speed
[Chorus]
kubectl get nodes dash o wide
Shows the status side by side
Internal IP and external too
Age and version coming through
Get nodes wide, get nodes wide
All the details you can't hide
Memory, CPU, and OS name
Node inspection is the game
[Verse 2]
Ready, NotReady, or Unknown state
Each node tells you if it's running great
The wide output gives you so much more
Than basic listing like before
[Chorus]
kubectl get nodes dash o wide
Shows the status side by side
Internal IP and external too
Age and version coming through
Get nodes wide, get nodes wide
All the details you can't hide
Memory, CPU, and OS name
Node inspection is the game
[Bridge]
Master nodes and worker nodes
Each one has its special codes
Container runtime version shown
Architecture type is known
Kernel version, OS image
All displayed in one quick bridge
[Verse 3]
Troubleshooting starts with knowing what you've got
Which nodes are healthy, which ones are not
The wide flag expands your view so clear
Every detail that you need is here
[Chorus]
kubectl get nodes dash o wide
Shows the status side by side
Internal IP and external too
Age and version coming through
Get nodes wide, get nodes wide
All the details you can't hide
Memory, CPU, and OS name
Node inspection is the game
[Outro]
So remember when your cluster needs a health check run
kubectl get nodes wide until the job is done
All your nodes displayed with status crystal clear
Infrastructure visibility is always here
3. Drain a node (evict pods for maintenance)
[Verse 1]
When your server needs some care and love
Time to take it offline from above
But pods are running, workloads too
Here's the gentle way to see it through
[Chorus]
Kubectl drain, move them all away
Ignore daemon sets, they're here to stay
Delete empty dir data, clean and bright
Drain the node for maintenance night
Kubectl drain, that's the way
Keep your cluster running every day
[Verse 2]
First you tell Kubernetes the plan
Mark the node as unschedulable man
Then eviction notices go out
Pods get time to shut down without doubt
[Chorus]
Kubectl drain, move them all away
Ignore daemon sets, they're here to stay
Delete empty dir data, clean and bright
Drain the node for maintenance night
Kubectl drain, that's the way
Keep your cluster running every day
[Bridge]
System pods will stick around
Daemon sets stay safe and sound
But your apps will migrate free
To other nodes gracefully
[Verse 3]
Type the command with the node name clear
Add those flags so nothing you fear
Ignore daemon sets is what you need
Delete empty dir helps you succeed
[Chorus]
Kubectl drain, move them all away
Ignore daemon sets, they're here to stay
Delete empty dir data, clean and bright
Drain the node for maintenance night
Kubectl drain, that's the way
Keep your cluster running every day
[Outro]
When maintenance is done and through
Uncordon brings it back for you
The node returns to active state
Your cluster's healthy, running great
4. Cordon a node (prevent new scheduling)
[Verse 1]
When your node needs maintenance time
And you want to stop the flow
New pods won't land upon that spot
But old ones still can go
It's not about removing them
Just blocking what's ahead
Think of it like closing lanes
While traffic moves instead
[Chorus]
Kubectl cordon, lock the door
No new scheduling anymore
Keep it safe, keep it sound
While the old pods stick around
Cordon means to block the way
New arrivals have to stay
Away from nodes that need some care
Kubectl cordon gets you there
[Verse 2]
Picture workloads as travelers
Looking for a place to rest
When you cordon up a node
They'll find another nest
The scheduler sees the warning sign
And routes them somewhere new
But existing pods keep running
Just like they're supposed to do
[Chorus]
Kubectl cordon, lock the door
No new scheduling anymore
Keep it safe, keep it sound
While the old pods stick around
Cordon means to block the way
New arrivals have to stay
Away from nodes that need some care
Kubectl cordon gets you there
[Bridge]
Type the name after cordon
Watch the status change to ready comma scheduling disabled
It's a gentle way to pause
Before you drain or upgrade
Smart administrators know
This is how the game is played
[Verse 3]
When your maintenance is complete
And you're ready for the load
Use uncordon to reverse
And reopen up that node
The scheduler will smile again
And send new pods your way
Cordon and uncordon both
Help manage work and play
[Chorus]
Kubectl cordon, lock the door
No new scheduling anymore
Keep it safe, keep it sound
While the old pods stick around
Cordon means to block the way
New arrivals have to stay
Away from nodes that need some care
Kubectl cordon gets you there
[Outro]
Block new pods but keep the old
That's the story being told
Kubectl cordon, know the way
Manage nodes throughout the day
5. Uncordon a node (allow scheduling again)
[Verse 1]
When a node is cordoned off, no pods can land
It's marked as unschedulable across the cluster span
Maintenance is done, the hardware's running clean
Time to bring it back into the scheduling scene
[Chorus]
Uncordon, uncordon, let the workloads flow
kubectl uncordon, watch the green light glow
Node name in the command, scheduling's back again
Uncordon, uncordon, pods can run my friend
[Verse 2]
Maybe you were patching or fixing something broke
Cordoned for safety, now remove that scheduling yoke
The node sits ready with resources to spare
But scheduling's blocked until you declare
[Chorus]
Uncordon, uncordon, let the workloads flow
kubectl uncordon, watch the green light glow
Node name in the command, scheduling's back again
Uncordon, uncordon, pods can run my friend
[Bridge]
Type the command line, specify the node
kubectl uncordon removes the scheduling load
From blocked to ready, the status will change
Pods can be placed in the cluster range
[Verse 3]
Check your node status before and after too
See the Ready state when the uncordon's through
No more unschedulable taint upon the node
Back in rotation for the workload load
[Chorus]
Uncordon, uncordon, let the workloads flow
kubectl uncordon, watch the green light glow
Node name in the command, scheduling's back again
Uncordon, uncordon, pods can run my friend
[Outro]
When maintenance ends and you're ready to go
Uncordon that node and watch the traffic flow
6. Remove a taint
[Verse 1]
When your node has got a taint that's blocking what you need
And the pods won't schedule there, it's time to take the lead
You've got the kubectl power in your hands to set things right
Just add a dash at the end to make it shine so bright
[Chorus]
Remove the taint, remove the taint
With kubectl magic, don't you faint
Node name first, then key equals value
Colon NoSchedule, then the dash will save you
Remove the taint, remove the taint
That minus sign makes scheduling saint
[Verse 2]
Start with kubectl taint nodes, then type your node by name
The key and value pair comes next, it's all part of the game
NoSchedule with a colon, that's the taint effect you see
But add that dash at the very end to set your workload free
[Chorus]
Remove the taint, remove the taint
With kubectl magic, don't you faint
Node name first, then key equals value
Colon NoSchedule, then the dash will save you
Remove the taint, remove the taint
That minus sign makes scheduling saint
[Bridge]
The dash is key, the dash is gold
It tells Kubernetes what you've told
Remove this taint from my node today
Let all my pods come out and play
[Verse 3]
Remember when you're learning this imported knowledge well
The syntax flows like poetry, it's got a tale to tell
From audiobooks to practice labs, you're building up your skill
That trailing dash removes the block and bends nodes to your will
[Final Chorus]
Remove the taint, remove the taint
With kubectl magic, don't you faint
Node name first, then key equals value
Colon NoSchedule, then the dash will save you
Remove the taint, remove the taint
That minus sign makes scheduling saint
[Outro]
kubectl taint nodes, don't forget the dash
Your scheduling problems gone in a flash
7. Taint a node
[Verse 1]
In the cluster where the pods all play
Some nodes need rules to guide their way
When workloads shouldn't land just anywhere
We paint a warning in the air
[Chorus]
Taint a node, taint a node
Key equals value, NoSchedule mode
Kubectl taint, don't hesitate
Name your node and set the gate
Taint a node, keep control
Block the pods that shouldn't roll
[Verse 2]
Start with kubectl taint command
Point to nodes across the land
Give a name, the target's clear
Then the magic word appears
[Chorus]
Taint a node, taint a node
Key equals value, NoSchedule mode
Kubectl taint, don't hesitate
Name your node and set the gate
Taint a node, keep control
Block the pods that shouldn't roll
[Bridge]
Key comes first, then equals sign
Value next to draw the line
Colon separates the way
NoSchedule keeps pods at bay
[Verse 3]
Database nodes for data streams
Special hardware for your dreams
GPU clusters, memory kings
Taints protect these precious things
[Chorus]
Taint a node, taint a node
Key equals value, NoSchedule mode
Kubectl taint, don't hesitate
Name your node and set the gate
Taint a node, keep control
Block the pods that shouldn't roll
[Outro]
When you need to guard your ground
Taints will keep your nodes sound
kubectl taint nodes by name
Control the scheduling game
8. Output formats
[Verse 1]
When you need to see your pods in different ways
Kubectl's got options to brighten up your days
Add a dash oh flag and choose your style
JSON, YAML, names, or custom compile
[Chorus]
Output formats, make it clear
JSON structures, YAML here
Names only when that's all you need
Custom columns for the info you read
Dash oh JSON, dash oh YAML too
Dash oh name for a simpler view
Format the data the way you want to see
Kubernetes info flowing easily
[Verse 2]
JSON gives you structure with brackets everywhere
Objects nested deep with data you can share
YAML makes it readable with indented lines
Human-friendly format that clearly defines
[Chorus]
Output formats, make it clear
JSON structures, YAML here
Names only when that's all you need
Custom columns for the info you read
Dash oh JSON, dash oh YAML too
Dash oh name for a simpler view
Format the data the way you want to see
Kubernetes info flowing easily
[Bridge]
Custom columns let you pick and choose
Name from metadata dot name you can use
Status from the phase field, create your own view
Mix and match the fields that matter most to you
[Verse 3]
When you just need names, keep it clean and light
Dash oh name will give you just what's in sight
No extra details cluttering your screen
The simplest output you have ever seen
[Final Chorus]
Output formats, make it clear
JSON structures, YAML here
Names only when that's all you need
Custom columns for the info you read
Choose your format, make it right
Information formatted bright
Kubectl outputs any way you please
Managing pods becomes a breeze
[Outro]
Four different ways to see your pods today
Pick the format that lights up your way
9. Watch resources in real-time
[Verse 1]
When you need to see what's happening live
In your cluster where the pods reside
There's a flag that makes the magic flow
Watch them change as systems grow
kubectl get pods then add the dash w
Real-time updates streaming through
No more guessing what's going on
Watch your workloads roll along
[Chorus]
Watch it live, watch it now
Dash w will show you how
Pods are starting, pods are dying
Real-time truth, no more lying
kubectl get pods dash w
Stream the changes straight to you
Watch it live, watch it flow
Real-time data, now you know
[Verse 2]
Static snapshots just won't do
When you need the current view
Applications scaling up and down
Watch mode keeps you safe and sound
Container status changing fast
Pending, running, then at last
Terminating, back to new
Watch flag shows you what is true
[Chorus]
Watch it live, watch it now
Dash w will show you how
Pods are starting, pods are dying
Real-time truth, no more lying
kubectl get pods dash w
Stream the changes straight to you
Watch it live, watch it flow
Real-time data, now you know
[Bridge]
No need to run the same command
Over and over by your hand
One simple flag will do the trick
Real-time monitoring, smooth and quick
Press control c when you're done
Watching pods is so much fun
Live updates on your screen
Best monitoring you've ever seen
[Chorus]
Watch it live, watch it now
Dash w will show you how
Pods are starting, pods are dying
Real-time truth, no more lying
kubectl get pods dash w
Stream the changes straight to you
Watch it live, watch it flow
Real-time data, now you know
[Outro]
When your cluster's running wild
Watch mode keeps your stress quite mild
kubectl get pods dash w
Real-time power just for you
10. JSONPath queries
[Verse 1]
When you need to find the data hidden deep inside
JSON structures holding secrets that your pods can't hide
Kubectl gives you power with a special query way
JSONPath expressions help you find what you need today
Start with curly braces, then a dot to lead the way
Items is the array where your resources all stay
Star inside brackets means you want them every one
Metadata dot name reveals each pod when you are done
[Chorus]
JSONPath queries, dig into the tree
Dot notation flowing, find what you can see
Curly braces wrapping, expressions that are true
Filter through the data, kubectl works for you
JSONPath queries, make the data sing
Question mark at symbol, filters everything
[Verse 2]
Nodes hold addresses in a nested array deep
Status then addresses where the network details sleep
Question mark at symbol starts a filter test inside
Type equals InternalIP finds the ones you need to find
At dot type equals quotes around InternalIP
Closing bracket filters, then dot address is the key
This expression pattern helps you query what you need
From the complex JSON, simple answers you can read
[Chorus]
JSONPath queries, dig into the tree
Dot notation flowing, find what you can see
Curly braces wrapping, expressions that are true
Filter through the data, kubectl works for you
JSONPath queries, make the data sing
Question mark at symbol, filters everything
[Bridge]
Items star for every single one
Brackets hold the filters when you're done
Metadata and status, know the structure well
JSONPath expressions have a story they can tell
[Verse 3]
Practice with these patterns till they flow just like a song
Curly braces dot and star will never steer you wrong
Filters with conditions help you narrow down the field
JSONPath with kubectl makes the hidden data yield
[Chorus]
JSONPath queries, dig into the tree
Dot notation flowing, find what you can see
Curly braces wrapping, expressions that are true
Filter through the data, kubectl works for you
JSONPath queries, make the data sing
Question mark at symbol, filters everything
[Outro]
From pods to nodes and more
JSONPath opens every door
Query smart and query clean
Find the data in between
11. Explain any field in a manifest
[Verse 1]
When you need to understand a field inside your manifest
There's a command that shows you every detail at your request
Kubectl explain will be your guide, it breaks it down so clear
From deployment strategy to the pods that you hold dear
[Chorus]
Explain any field, explain it all
Recursive flag shows big and small
Dot notation leads the way
Strategy spec and probe display
Explain any field, make knowledge bright
Kubectl's wisdom shining light
[Verse 2]
Deployment dot spec dot strategy, that's the path you trace
Rolling update or recreate, each has its own place
Max unavailable and surge, these fields control the flow
How your pods get updated when new versions need to go
[Chorus]
Explain any field, explain it all
Recursive flag shows big and small
Dot notation leads the way
Strategy spec and probe display
Explain any field, make knowledge bright
Kubectl's wisdom shining light
[Verse 3]
Pod spec containers liveness probe, check if pods are well
Initial delay and period time, success and failure tell
HTTP get or exec command, or TCP socket test
Recursive shows the nested tree, exploring every nest
[Bridge]
From the top level down below
Every field that you need to know
Documentation at your hand
Understanding Kubernetes land
[Chorus]
Explain any field, explain it all
Recursive flag shows big and small
Dot notation leads the way
Strategy spec and probe display
Explain any field, make knowledge bright
Kubectl's wisdom shining light
[Outro]
No more guessing what fields mean
Explain command keeps knowledge clean
In your manifest today
Kubectl shows you the right way
12. Generate YAML without creating (great for templates)
[Verse 1]
Before you make it real, just make it on paper
Dry run client mode, your template maker
Generate the YAML without the creation
Perfect for your deployment preparation
[Chorus]
Dry run client, output YAML
Make your templates, never fail
Dash dash dry run equals client
Output format keeps you compliant
Generate without creating
Perfect for automating
[Verse 2]
Kubectl create deployment web with nginx image
Add the dry run flag, no cluster damage
Pipe it to deploy dot yaml for your file
Template generation with Kubernetes style
[Chorus]
Dry run client, output YAML
Make your templates, never fail
Dash dash dry run equals client
Output format keeps you compliant
Generate without creating
Perfect for automating
[Bridge]
Kubectl run test with busybox container
Dry run client mode, you're the commander
Pod dot yaml saved for later use
Template generation, you cannot lose
[Verse 3]
Production readiness starts with planning
Every resource needs resource scanning
CPU limits, memory requests defined
Templates help keep everything aligned
[Chorus]
Dry run client, output YAML
Make your templates, never fail
Dash dash dry run equals client
Output format keeps you compliant
Generate without creating
Perfect for automating
[Outro]
From development to production staging
Dry run templates for safe deploying
Generate YAML, test before you go
Template mastery helps your cluster grow
13. Enable kubectl autocompletion
[Verse 1]
When you're typing kubectl commands all day long
Your fingers get tired, something feels wrong
There's a better way to work with your cluster
Tab completion will make your workflow much faster
[Chorus]
Source the completion, bash or zsh
Let kubectl help you, no need to stress
K alias setup, complete the line
Autocompletion saves you time
Tab tab tab, watch it appear
Every command crystal clear
[Verse 2]
Source from kubectl completion bash
Pipe it right in with a single dash
Or maybe you're running zsh instead
Same command works, just swap what's said
[Chorus]
Source the completion, bash or zsh
Let kubectl help you, no need to stress
K alias setup, complete the line
Autocompletion saves you time
Tab tab tab, watch it appear
Every command crystal clear
[Bridge]
Complete dash o default dash F
Underscore underscore start kubectl, don't forget
Map it to k for the shortcut you love
Now your terminal fits like a glove
[Verse 3]
Production workloads need speed and precision
Autocompletion supports your mission
Pod names and namespaces, flags and more
Tab completion opens up every door
[Chorus]
Source the completion, bash or zsh
Let kubectl help you, no need to stress
K alias setup, complete the line
Autocompletion saves you time
Tab tab tab, watch it appear
Every command crystal clear
[Outro]
Enable completion, make it stick
Your Kubernetes workflow will be so quick
Source and complete, remember these two
Autocompletion is there for you
14. Get all resource types
[Verse 1]
When you need to know what's running in your cluster space
All the resource types that Kubernetes can embrace
There's a command that shows you everything you need
kubectl api-resources is the key indeed
[Chorus]
Get all resource types, see what you can find
Pods and services, deployments in a line
Namespaces, secrets, configs by design
kubectl api-resources shows them every time
[Verse 2]
Short names and long names, all displayed for you
API versions tell you what each resource can do
Namespaced or cluster-wide, the scope is crystal clear
Every object type that lives within your sphere
[Chorus]
Get all resource types, see what you can find
Pods and services, deployments in a line
Namespaces, secrets, configs by design
kubectl api-resources shows them every time
[Bridge]
Filter by API group or search for what you need
Verify permissions, make your queries succeed
From basic pods to custom resources too
The complete inventory is waiting there for you
[Verse 3]
ConfigMaps and volumes, ingress rules galore
Persistent volume claims and so much more
When you're troubleshooting or just want to explore
This command opens up the Kubernetes door
[Chorus]
Get all resource types, see what you can find
Pods and services, deployments in a line
Namespaces, secrets, configs by design
kubectl api-resources shows them every time
[Outro]
Now you know the way to see what's possible
Every resource type accessible
kubectl api-resources, your discovery tool
Master this command and you'll always stay cool
Back to Home