Lab 01 — Kubernetes Fundamentals
This lab moves you from Kubernetes theory into practical platform operations.
You will build and inspect a simple Kubernetes application while learning how the major resources connect.
The lab focuses on:
Cluster ↓Namespace ↓Deployment ↓Pods ↓Service ↓Configuration ↓Observability ↓TroubleshootingThe goal is not only to make an application run.
The goal is to understand:
What Kubernetes created
Why each resource exists
How the resources connect
How to verify application health
How to investigate failuresMission Information
Section titled “Mission Information”Difficulty: Beginner
Estimated Time: 60–90 minutes
Primary Skills:
Kubernetes Fundamentals
kubectl Operations
Workload Management
Service Networking
Configuration
Observability
Basic TroubleshootingLab Scenario
Section titled “Lab Scenario”You have joined a platform engineering team.
The team is beginning to move a simple web application into Kubernetes.
Your task is to create an isolated training namespace, deploy the application, expose it through a Service, add configuration, inspect the running resources, scale the workload, and troubleshoot a controlled configuration problem.
You will operate only inside your authorized lab environment.
Lab Objectives
Section titled “Lab Objectives”By the end of this lab, you should be able to:
- Verify access to a Kubernetes cluster
- Identify cluster nodes
- Create and use a namespace
- Understand Pods and Deployments
- Deploy a basic application
- Inspect Kubernetes resources
- Expose a workload through a Service
- Understand labels and selectors
- Scale a Deployment
- Review logs and events
- Create a ConfigMap
- Understand Kubernetes Secrets
- Inspect health and readiness
- Troubleshoot a simple Service failure
- Clean up the lab environment
Lab Architecture
Section titled “Lab Architecture”You will build:
Kubernetes Cluster│└── ghc-k8s-lab Namespace │ ├── Deployment │ ↓ │ Pods │ ├── Service │ ↓ │ Application Access │ └── ConfigMap ↓ Application ConfigurationBefore You Start
Section titled “Before You Start”You need access to:
Authorized Kubernetes Cluster
kubectl
Terminal / Shell
Ability to Create Resourcesin a Training NamespaceYou can use:
Local Kubernetes Lab
Training Cluster
Cloud-Hosted Kubernetes LabDo not perform these exercises against production infrastructure.
Lab Safety Rules
Section titled “Lab Safety Rules”Use only:
Your Own Cluster
Training Cluster
Explicitly Authorized EnvironmentKeep all resources inside the lab namespace whenever possible.
The lab uses benign application workloads and configuration changes only.
Part 01 — Verify kubectl
Section titled “Part 01 — Verify kubectl”Start by checking that the Kubernetes client is available.
kubectl version --clientYou should receive client version information.
Why This Matters
Section titled “Why This Matters”kubectl is the primary command-line interface used to interact with Kubernetes.
Conceptually:
kubectl ↓Kubernetes API ↓Cluster ResourcesStudent Task
Section titled “Student Task”Confirm:
-
kubectlis installed - The command runs successfully
Part 02 — Verify Cluster Access
Section titled “Part 02 — Verify Cluster Access”Check your current Kubernetes context.
kubectl config current-contextThen inspect cluster information.
kubectl cluster-infoImportant Habit
Section titled “Important Habit”Before making changes, always verify:
Cluster
Context
NamespaceThis becomes extremely important when working across:
Development
Testing
ProductionStudent Task
Section titled “Student Task”Record:
Current Context:
Cluster:
Environment:Part 03 — Inspect the Nodes
Section titled “Part 03 — Inspect the Nodes”List the Kubernetes nodes.
kubectl get nodesYou may see output similar to:
NAME STATUS ROLES AGEcontrol-01 Ready control-plane ...worker-01 Ready <none> ...worker-02 Ready <none> ...The exact output depends on your environment.
What Are Nodes?
Section titled “What Are Nodes?”Nodes provide compute capacity for Kubernetes workloads.
Conceptually:
Cluster│├── Node 1│ └── Pods│├── Node 2│ └── Pods│└── Node 3 └── PodsInspect More Detail
Section titled “Inspect More Detail”Choose one node and inspect it.
kubectl describe node <node-name>Look for areas such as:
Labels
Conditions
Capacity
Allocatable Resources
Pods
EventsStudent Task
Section titled “Student Task”Identify:
Number of Nodes:
Ready Nodes:
Node Roles:
Approximate CPU Capacity:
Approximate Memory Capacity:Security Perspective
Section titled “Security Perspective”Nodes are critical security assets.
Later security labs will examine:
Node Hardening
Administrative Access
Runtime Security
Workload IsolationPart 04 — Inspect Existing Namespaces
Section titled “Part 04 — Inspect Existing Namespaces”Run:
kubectl get namespacesYou may see namespaces used for:
Default Workloads
System Components
Platform ServicesWhy Namespaces Matter
Section titled “Why Namespaces Matter”Namespaces help organize resources.
Example:
Cluster│├── development├── testing├── production└── securityThey can also provide scope for:
RBAC
Policies
Resource QuotasPart 05 — Create the Lab Namespace
Section titled “Part 05 — Create the Lab Namespace”Create a dedicated namespace.
kubectl create namespace ghc-k8s-labVerify:
kubectl get namespace ghc-k8s-labWhy Use a Dedicated Namespace?
Section titled “Why Use a Dedicated Namespace?”This gives the lab a clear boundary.
Instead of mixing training resources with unrelated workloads:
Shared Namespace ↓Confusionyou use:
ghc-k8s-lab ↓Lab Resources OnlyStudent Task
Section titled “Student Task”- Namespace created
- Namespace visible
- Name recorded
Part 06 — Set the Working Namespace
Section titled “Part 06 — Set the Working Namespace”You can specify the namespace with every command:
kubectl get pods -n ghc-k8s-labFor convenience, you may also update the current context namespace:
kubectl config set-context --current --namespace=ghc-k8s-labVerify:
kubectl config view --minifyImportant
Section titled “Important”Remember to change the namespace back when you finish if you altered your current context.
Part 07 — Create Your First Deployment
Section titled “Part 07 — Create Your First Deployment”Create a simple NGINX Deployment.
kubectl create deployment web-app --image=nginxVerify:
kubectl get deploymentsThen:
kubectl get podsWhat Just Happened?
Section titled “What Just Happened?”You requested:
DeploymentKubernetes then created:
Deployment ↓ReplicaSet ↓PodInspect all three:
kubectl get deploymentkubectl get replicasetkubectl get podsStudent Task
Section titled “Student Task”Record:
Deployment Name:
ReplicaSet Name:
Pod Name:
Pod Status:Part 08 — Inspect the Deployment
Section titled “Part 08 — Inspect the Deployment”Run:
kubectl describe deployment web-appLook for:
Labels
Selector
Replicas
Pod Template
Image
EventsDeployment Mental Model
Section titled “Deployment Mental Model”A Deployment describes desired application state.
Example:
Desired:1 Pod Running nginxKubernetes works to maintain that condition.
Part 09 — Inspect the Pod
Section titled “Part 09 — Inspect the Pod”List Pods with additional information:
kubectl get pods -o wideNotice:
Pod Name
Status
Pod IP
NodeNow inspect the Pod.
kubectl describe pod <pod-name>Look for:
Namespace
Labels
Node
Container
Image
State
Conditions
EventsWhy Pod Inspection Matters
Section titled “Why Pod Inspection Matters”When something goes wrong, the Pod description often provides the first useful evidence.
A common troubleshooting workflow is:
Pod Problem ↓Get Pod ↓Describe Pod ↓Review Events ↓Review LogsPart 10 — Review Application Logs
Section titled “Part 10 — Review Application Logs”Get the Pod name:
kubectl get podsThen review logs:
kubectl logs <pod-name>At first there may be little output because the web server may not yet have received traffic.
Logs Answer
Section titled “Logs Answer”What did the application do?Later, logs become essential for:
Troubleshooting
Security Monitoring
Incident ResponsePart 11 — Expose the Application
Section titled “Part 11 — Expose the Application”The Pod exists, but applications normally need a stable network abstraction.
Create a Service:
kubectl expose deployment web-app --port=80 --target-port=80 --name=web-serviceVerify:
kubectl get servicesArchitecture Now
Section titled “Architecture Now”Client ↓Service ↓Deployment PodsWhy Not Connect Directly to the Pod?
Section titled “Why Not Connect Directly to the Pod?”Pods are replaceable.
A Pod may disappear and another may be created.
Therefore:
Pod IPshould not generally be treated as a permanent application endpoint.
The Service provides a stable abstraction.
Part 12 — Inspect the Service
Section titled “Part 12 — Inspect the Service”Run:
kubectl describe service web-serviceLook for:
Selector
Port
TargetPort
EndpointsCritical Relationship
Section titled “Critical Relationship”The Service finds Pods through labels.
Conceptually:
Service ↓Selector ↓Pod LabelsInspect the labels:
kubectl get pods --show-labelsThen inspect the Service selector:
kubectl get service web-service -o yamlStudent Task
Section titled “Student Task”Identify:
Service Selector:
Pod Label:
Service Port:
Target Port:Part 13 — Inspect Service Endpoints
Section titled “Part 13 — Inspect Service Endpoints”Run:
kubectl get endpoints web-serviceor, depending on the environment:
kubectl get endpointslicesYou should see backend information associated with the Service.
Why This Matters
Section titled “Why This Matters”If you have:
Servicebut:
No Backend Endpointsthe application will not function through the Service.
This becomes a very common troubleshooting scenario.
Part 14 — Test the Application
Section titled “Part 14 — Test the Application”One simple lab method is port forwarding.
Run:
kubectl port-forward service/web-service 8080:80Keep that terminal open.
In another terminal, access:
http://localhost:8080or use a local HTTP client if available.
You should receive the default NGINX response.
Traffic Flow
Section titled “Traffic Flow”Your Computer ↓Port Forward ↓Service ↓Pod ↓NGINXStudent Task
Section titled “Student Task”- Application reachable
- Service functioning
- Pod responding
Part 15 — Review Logs Again
Section titled “Part 15 — Review Logs Again”After sending requests, run:
kubectl logs <pod-name>You should now see web request activity.
Observe the Connection
Section titled “Observe the Connection”You have now created:
User Request ↓Application ↓Log EntryThis is your first practical example of application telemetry.
Part 16 — Scale the Deployment
Section titled “Part 16 — Scale the Deployment”Check current replicas:
kubectl get deployment web-appNow scale to three:
kubectl scale deployment web-app --replicas=3Verify:
kubectl get podsYou should see three Pods.
What Happened?
Section titled “What Happened?”You changed desired state:
Before:1 Replica
After:3 ReplicasThe controller reconciled:
Desired = 3Actual = 1 ↓Create 2 More ↓Actual = 3Student Task
Section titled “Student Task”Record:
Desired Replicas:
Available Replicas:
Number of Running Pods:Part 17 — Inspect Pod Distribution
Section titled “Part 17 — Inspect Pod Distribution”Run:
kubectl get pods -o wideObserve which nodes are running your Pods.
In a multi-node environment, they may be distributed across available nodes.
Scheduling Concept
Section titled “Scheduling Concept”New Pod ↓Scheduler ↓Suitable NodeThe scheduler considers cluster conditions and workload requirements.
Part 18 — Delete One Pod
Section titled “Part 18 — Delete One Pod”Choose one Pod and delete it:
kubectl delete pod <pod-name>Immediately watch:
kubectl get pods -wYou should observe a replacement Pod being created.
The Deployment still says:
Desired Replicas:3After deletion:
Actual:2Kubernetes detects the mismatch and reconciles it.
Desired = 3
Actual = 2
Controller ↓Creates ReplacementImportant Kubernetes Principle
Section titled “Important Kubernetes Principle”This is:
Self-Healing Through ReconciliationPart 19 — Create a ConfigMap
Section titled “Part 19 — Create a ConfigMap”Create a simple ConfigMap:
kubectl create configmap web-config \ --from-literal=environment=training \ --from-literal=application=gohackerscloudVerify:
kubectl get configmapsInspect:
kubectl describe configmap web-configWhat Is a ConfigMap?
Section titled “What Is a ConfigMap?”A ConfigMap stores non-sensitive application configuration.
Examples:
Environment Name
Feature Flags
Service URLs
Application ModeSecurity Rule
Section titled “Security Rule”Do not use ConfigMaps for credentials.
Use:
ConfigMapfor:
Non-Sensitive DataPart 20 — Inspect ConfigMap YAML
Section titled “Part 20 — Inspect ConfigMap YAML”Run:
kubectl get configmap web-config -o yamlObserve:
metadata
dataStudent Task
Section titled “Student Task”Identify:
ConfigMap Name:
Configuration Keys:
Configuration Values:Part 21 — Understand Secrets
Section titled “Part 21 — Understand Secrets”Create a training-only Secret.
Use a fake value only.
kubectl create secret generic demo-secret \ --from-literal=username=training-user \ --from-literal=password=training-passwordVerify:
kubectl get secretsImportant
Section titled “Important”These are deliberately fake lab credentials.
Never place real passwords, API keys, tokens, or production credentials into course examples.
Inspect Metadata
Section titled “Inspect Metadata”Use:
kubectl describe secret demo-secretNotice that describe does not simply print the secret value in normal output.
Security Perspective
Section titled “Security Perspective”A Kubernetes Secret is still sensitive.
Security depends on:
RBAC
Cluster Storage Protection
Workload Access
Logging
RotationDo not assume:
Secret Resource =Automatically SafePart 22 — Compare ConfigMap and Secret
Section titled “Part 22 — Compare ConfigMap and Secret”| ConfigMap | Secret |
|---|---|
| Non-sensitive configuration | Sensitive configuration |
| App settings | Credentials |
| Feature flags | Tokens |
| Service endpoints | Certificates/keys |
Decision Question
Section titled “Decision Question”Ask:
Would exposure of this valuecreate security impact?If yes, treat it as sensitive information.
Part 23 — Add Environment Configuration to the Deployment
Section titled “Part 23 — Add Environment Configuration to the Deployment”Set a training environment variable:
kubectl set env deployment/web-app ENVIRONMENT=trainingVerify:
kubectl describe deployment web-appLook for the environment variable in the container definition.
What Happened?
Section titled “What Happened?”Changing the Deployment template may cause Kubernetes to create replacement Pods.
Conceptually:
Deployment Configuration Changed ↓New ReplicaSet / Updated Pods ↓New Desired StateStudent Task
Section titled “Student Task”Observe:
kubectl get replicasetCompare the ReplicaSets before and after the Deployment change.
Part 24 — Review Rollout Status
Section titled “Part 24 — Review Rollout Status”Run:
kubectl rollout status deployment/web-appThen:
kubectl rollout history deployment/web-appWhy This Matters
Section titled “Why This Matters”Application changes should be:
Tracked
Validated
RecoverablePart 25 — Inspect Resource YAML
Section titled “Part 25 — Inspect Resource YAML”Run:
kubectl get deployment web-app -o yamlDo not try to memorize everything.
Identify major sections:
metadata
spec
statusThen within the Pod template:
containers
image
environment
labelsDeclarative Thinking
Section titled “Declarative Thinking”The YAML represents desired configuration.
The cluster maintains runtime status separately.
Think:
Spec ↓What You Want
Status ↓What Kubernetes ObservesPart 26 — Understand Labels
Section titled “Part 26 — Understand Labels”List Deployment and Pod labels:
kubectl get deployment web-app --show-labelskubectl get pods --show-labelsLabels help Kubernetes associate related resources.
Example:
app=web-appLabels Are Used For
Section titled “Labels Are Used For”Organization
Selection
Services
Policies
SchedulingPart 27 — Controlled Troubleshooting Exercise
Section titled “Part 27 — Controlled Troubleshooting Exercise”You will now intentionally create a safe Service misconfiguration.
First record the current Service:
kubectl get service web-service -o yamlPay attention to its selector.
Mission
Section titled “Mission”Temporarily change the Service selector so it no longer matches the Pods.
Edit the Service:
kubectl edit service web-serviceLocate the selector and change the label value to something that does not match the Pods.
For example, conceptually:
Correct:app=web-app
Temporary Incorrect:app=broken-web-appSave the change.
Part 28 — Observe the Failure
Section titled “Part 28 — Observe the Failure”Check the Service:
kubectl describe service web-serviceThen:
kubectl get endpoints web-serviceYou should notice that the Service no longer has the expected backend endpoints.
Troubleshooting Scenario
Section titled “Troubleshooting Scenario”You now have:
Deployment:Healthy
Pods:Healthy
Service:Exists
Application:Unavailable Through ServiceWhat is wrong?
Investigation Workflow
Section titled “Investigation Workflow”Use:
01 Check Pods
02 Check Service
03 Check Service Selector
04 Check Pod Labels
05 Check EndpointsCheck Pods
Section titled “Check Pods”kubectl get podsIf healthy:
Problem Probably Not Pod AvailabilityCheck Labels
Section titled “Check Labels”kubectl get pods --show-labelsCheck Service Selector
Section titled “Check Service Selector”kubectl describe service web-serviceCompare:
Service Selector vsPod LabelsYou should identify the mismatch.
Part 29 — Repair the Service
Section titled “Part 29 — Repair the Service”Edit the Service again:
kubectl edit service web-serviceRestore the original correct selector.
Then verify:
kubectl get endpoints web-serviceThe backend endpoints should return.
Validate Application
Section titled “Validate Application”Run port forwarding again if required:
kubectl port-forward service/web-service 8080:80Test the application.
Troubleshooting Milestone
Section titled “Troubleshooting Milestone”You have just followed:
Symptom ↓Inspect Workload ↓Inspect Service ↓Inspect Selector ↓Inspect Labels ↓Identify Root Cause ↓Repair ↓ValidateThis is a professional troubleshooting workflow.
Part 30 — Review Kubernetes Events
Section titled “Part 30 — Review Kubernetes Events”Run:
kubectl get events --sort-by=.metadata.creationTimestampEvents may reveal information about:
Pod Scheduling
Image Pulling
Container Startup
Workload ChangesWhy Events Matter
Section titled “Why Events Matter”When troubleshooting Kubernetes, events can often quickly explain:
What Kubernetes Tried to Doand:
Why It FailedPart 31 — Inspect Application Resource Relationships
Section titled “Part 31 — Inspect Application Resource Relationships”At this stage, map what you created.
Namespace ↓Deployment ↓ReplicaSet ↓PodsNetworking:
Service ↓Label Selector ↓PodsConfiguration:
ConfigMap
SecretObservability:
Pod Logs
EventsStudent Exercise
Section titled “Student Exercise”Draw this relationship yourself without referring to the lesson.
If you can explain each connection, you understand the core Kubernetes workload model.
Part 32 — Basic Security Review
Section titled “Part 32 — Basic Security Review”Now review the environment with a security mindset.
Ask:
Which Namespace?
Which Image?
Which Service Account?
Which Service Exposure?
Which ConfigMaps?
Which Secrets?
Which Permissions?Check Service Account
Section titled “Check Service Account”Inspect the Pod:
kubectl describe pod <pod-name>Identify the service account being used.
Security Question
Section titled “Security Question”Ask:
Does this application actually needKubernetes API permissions?This question will become central in the Kubernetes RBAC lab.
Part 33 — Review the Container Image
Section titled “Part 33 — Review the Container Image”Check:
kubectl get deployment web-app -o yamlIdentify the image.
Record:
Image:
Registry:
Image Tag:Security Questions
Section titled “Security Questions”Ask:
Is the image trusted?
Where did it come from?
Is the version controlled?
Has it been assessed for vulnerabilities?You will examine these topics more deeply later.
Part 34 — Review Network Exposure
Section titled “Part 34 — Review Network Exposure”Check:
kubectl get servicesDetermine whether the Service is:
Internal
or
Externally ExposedIn this lab, keep exposure limited to the training requirement.
Security Principle
Section titled “Security Principle”Do not make a service public just because it is technically easy.
Ask:
Does this workloadneed external connectivity?Part 35 — Review Sensitive Configuration
Section titled “Part 35 — Review Sensitive Configuration”List:
kubectl get secretsThen ask:
Which workloads need each Secret?
Who should be able to read it?Later labs will connect Secret protection to:
RBAC
Workload Identity
Policy EnforcementPart 36 — Understand Health
Section titled “Part 36 — Understand Health”Check:
kubectl get podsA Pod may show:
Runningbut application health requires more context.
In production systems, Kubernetes may use:
Startup Probes
Readiness Probes
Liveness ProbesHealth Model
Section titled “Health Model”Startup ↓Application Initialized ↓Readiness ↓Can Receive Traffic ↓Liveness ↓Still HealthyThese concepts become more important in CKA and CKAD-style operations.
Part 37 — Delete the Deployment and Observe the Service
Section titled “Part 37 — Delete the Deployment and Observe the Service”Before doing this, make sure you understand what will happen.
Delete:
kubectl delete deployment web-appNow inspect:
kubectl get podskubectl get servicekubectl get endpoints web-serviceYou should observe:
Deployment Removed ↓ReplicaSet / Pods Removed ↓Service Still Exists ↓No Application BackendImportant Concept
Section titled “Important Concept”Kubernetes resources are related, but they are still distinct objects.
Deleting:
Deploymentdoes not automatically mean:
Delete Every Unrelated ResourcePart 38 — Recreate the Application
Section titled “Part 38 — Recreate the Application”Recreate:
kubectl create deployment web-app --image=nginxScale it:
kubectl scale deployment web-app --replicas=3Now inspect:
kubectl get pods --show-labelsThen verify the Service selector still matches.
kubectl get endpoints web-serviceIf the labels and selector align, the Service should regain backends.
Part 39 — Final Architecture Review
Section titled “Part 39 — Final Architecture Review”You should now understand:
Cluster ↓Namespace ↓Deployment ↓ReplicaSet ↓PodsApplication networking:
Client ↓Service ↓PodsConfiguration:
ConfigMap ↓Application
Secret ↓Sensitive Application ConfigurationOperations:
Status +Events +Logs ↓TroubleshootingLab Troubleshooting Framework
Section titled “Lab Troubleshooting Framework”Use this framework in future Kubernetes labs.
Workload Problem
Section titled “Workload Problem”Deployment ↓ReplicaSet ↓Pod ↓Events ↓LogsNetwork Problem
Section titled “Network Problem”Service ↓Selector ↓Endpoints ↓Pod ↓PortConfiguration Problem
Section titled “Configuration Problem”ConfigMap / Secret ↓Pod Configuration ↓Application ↓LogsLab Challenge 01 — Identify the Broken Layer
Section titled “Lab Challenge 01 — Identify the Broken Layer”Suppose:
Pods:Running
Service:Exists
Endpoints:EmptyWhat should you check first?
Answer:
Service Selector vsPod LabelsLab Challenge 02 — Pod Is Not Running
Section titled “Lab Challenge 02 — Pod Is Not Running”Suppose:
Pod:PendingInvestigate:
Describe Pod
Events
Scheduling
Resources
StorageDo not immediately delete and recreate the Pod.
Find the cause first.
Lab Challenge 03 — Application Is Running but Unavailable
Section titled “Lab Challenge 03 — Application Is Running but Unavailable”Check:
Pod Ready?
Service Selector Correct?
Endpoints Present?
Correct Port?
Application Listening?Lab Challenge 04 — Configuration Change Caused Failure
Section titled “Lab Challenge 04 — Configuration Change Caused Failure”Review:
Deployment Change
ConfigMap
Environment Variables
Application Logs
Rollout HistoryLab Challenge 05 — Security Review
Section titled “Lab Challenge 05 — Security Review”For your final running workload, answer:
Which image is running?
Which namespace?
Which service account?
Which Service exposes it?
Which ConfigMaps exist?
Which Secrets exist?
Which Pod labels are used?Evidence Collection
Section titled “Evidence Collection”Capture evidence for your lab notes.
Include:
Cluster Context
Node List
Namespace
Deployment
ReplicaSet
Pods
Pod Distribution
Service
Endpoints
ConfigMap
Secret Metadata
Application Logs
Events
Troubleshooting FindingLab Evidence Template
Section titled “Lab Evidence Template”Lab:Kubernetes Fundamentals
Date:
Cluster:
Namespace:
Deployment:
Replicas:
Service:
Configuration:
Troubleshooting Scenario:
Root Cause:
Remediation:
Validation:Security Finding Exercise
Section titled “Security Finding Exercise”Document the intentionally broken Service as though it were an operational finding.
Finding:Service selector does not match application Pod labels.
Affected Resource:web-service
Observation:The Service existed but contained no expected backend endpoints.
Impact:Application traffic could not be routedto the running workload.
Root Cause:Incorrect Service selector.
Recommendation:Maintain consistent labels and selectorsand validate Service endpoints after changes.Operational Lesson
Section titled “Operational Lesson”Notice that:
Pods Were Healthybut:
Application Was Unavailablebecause Kubernetes applications depend on connected resources.
This teaches an important principle:
Resource Healthy ≠Service HealthyYou must understand the full dependency path.
Security Lesson
Section titled “Security Lesson”The same relationship-based thinking applies to security.
Example:
Secure Pod ↓Over-Privileged Service Account ↓Security Riskor:
Secure Application ↓Public Service ↓Unnecessary ExposureNever assess Kubernetes resources only in isolation.
Cleanup
Section titled “Cleanup”When finished, delete the entire lab namespace:
kubectl delete namespace ghc-k8s-labThis removes the resources created inside the namespace.
Verify:
kubectl get namespacesIf You Changed Your Default Namespace
Section titled “If You Changed Your Default Namespace”Restore your preferred namespace or context configuration.
For example:
kubectl config set-context --current --namespace=defaultValidate:
kubectl config view --minifyLab Completion Checklist
Section titled “Lab Completion Checklist”Environment
Section titled “Environment”- Verified kubectl
- Verified current context
- Inspected cluster nodes
- Created dedicated namespace
Workloads
Section titled “Workloads”- Created Deployment
- Inspected ReplicaSet
- Inspected Pods
- Scaled application
- Observed Pod replacement
Networking
Section titled “Networking”- Created Service
- Reviewed selectors
- Reviewed Pod labels
- Reviewed endpoints
- Accessed application
Configuration
Section titled “Configuration”- Created ConfigMap
- Created training Secret
- Understood ConfigMap vs Secret
- Reviewed Deployment configuration
Observability
Section titled “Observability”- Reviewed Pod logs
- Reviewed Kubernetes events
- Reviewed Deployment rollout
Troubleshooting
Section titled “Troubleshooting”- Created controlled Service failure
- Identified selector mismatch
- Repaired configuration
- Validated recovery
Security
Section titled “Security”- Identified container image
- Identified service account
- Reviewed Service exposure
- Reviewed Secret presence
- Considered application attack surface
Cleanup
Section titled “Cleanup”- Removed lab resources
- Verified namespace deletion
- Restored preferred context settings
Skills You Practiced
Section titled “Skills You Practiced”You have now worked with:
kubectl
Cluster Contexts
Nodes
Namespaces
Deployments
ReplicaSets
Pods
Services
Labels
Selectors
Endpoints
ConfigMaps
Secrets
Scaling
Logs
Events
TroubleshootingCareer Connection
Section titled “Career Connection”These are foundational skills for:
Kubernetes Administrator
DevOps Engineer
Cloud Engineer
Platform Engineer
Site Reliability Engineer
Cloud Security Engineer
Kubernetes Security EngineerFor security-focused roles, understanding normal Kubernetes operation is essential before analyzing abnormal or malicious behavior.
Interview Questions
Section titled “Interview Questions”- What is a Kubernetes cluster?
- What is a node?
- What is a namespace?
- Why would you use namespaces?
- What is a Pod?
- What is a Deployment?
- What is a ReplicaSet?
- How are Deployments, ReplicaSets, and Pods related?
- What is desired state?
- What is reconciliation?
- What happens when you delete a Pod managed by a Deployment?
- What is a Kubernetes Service?
- Why should applications not normally depend directly on Pod IP addresses?
- How does a Service identify backend Pods?
- What are labels?
- What is a selector?
- What are Service endpoints?
- What would cause a Service to have no endpoints?
- How would you troubleshoot a Service that cannot reach Pods?
- What is a ConfigMap?
- What is a Kubernetes Secret?
- What is the difference between a ConfigMap and Secret?
- Why are Kubernetes Secrets still security-sensitive?
- What does scaling a Deployment do?
- What role does the scheduler play?
- Why are Kubernetes events useful?
- How do you view application logs?
- What is the difference between Pod status and application health?
- What are readiness probes used for?
- What are liveness probes used for?
- Why should Kubernetes workloads use trusted images?
- What is a service account?
- Why does workload identity matter?
- Why should unnecessary Services not be externally exposed?
- Why are relationships between Kubernetes resources important during troubleshooting?
Final Lab Mental Model
Section titled “Final Lab Mental Model”Remember:
CLUSTER ↓NAMESPACE ↓DEPLOYMENT ↓REPLICASET ↓PODSThen:
SERVICE ↓SELECTOR ↓POD LABELS ↓APPLICATIONSupported by:
CONFIGURATION
SECRETS
LOGS
EVENTSThis is your first practical Kubernetes operational model.
Lab Outcome
Section titled “Lab Outcome”Before this lab:
You knew what Kubernetes resources were.After this lab:
You created them,
connected them,
observed them,
changed them,
broke them safely,
troubleshot them,
and restored them.That is the transition from:
Kubernetes Theoryto:
Kubernetes Hands-On SkillsWhat’s Next?
Section titled “What’s Next?”➡️ Lab 02 — Kubernetes RBAC
In the next lab, you will focus on Kubernetes identity and authorization.
You will work with:
Service Accounts ↓Roles ↓ClusterRoles ↓RoleBindings ↓ClusterRoleBindings ↓Permissions ↓Least PrivilegeThe progression is:
Lab 01Understand Kubernetes Resources ↓Lab 02Control Who Can Access ThemYou will begin moving from general Kubernetes administration into practical Kubernetes security.