Deploy Your First Kubernetes Workload
Learn how to deploy a simple application on your Kubernetes cluster.
π Step 5: Deploy Your First Kubernetes Workload
Now that your cluster is ready with networking, letβs deploy a simple app to test it.
π§ͺ Deploy a Nginx Web Server
Run the following command on your control plane node (cp-node-1):
bash
This creates a deployment named nginx running the official Nginx container image.
π΅οΈββοΈ Check Deployment Status
Verify the deployment and pods are running:
bash
You should see the nginx deployment with one pod in Running status.
π Expose the Deployment
To access the Nginx server, expose it as a service:
bash
This exposes the deployment on a random port on all nodes.
π Find the NodePort
Get the service details to find the port assigned:
bash
Look for the NodePort value under the PORT(S) column (e.g., 80:31234/TCP).
π Access the Nginx Server
Open your browser and navigate to:
bash
Replace <node-ip> with your node's IP and <node-port> with the port from the previous step.
You should see the Nginx welcome page.
β Clean Up (Optional)
To delete the deployment and service:
bash
β Next Steps
- Learn about scaling deployments
- Set up Persistent Volumes and Storage
- Explore advanced networking options