In my Python-for-DevOps journey, Weeks 2 and 3 were all about turning theory into daily operational tools.
Hereβs a recap concepts + projects so you can follow along if youβre learning too. for code checkout this repo https://github.com/Harivelu0/python-for-devops
π Week 2: Automating DevOps Tasks with Python
π― Goal: Learn to automate daily DevOps operations with Python CLI tools.
π Key Concepts Covered
-
Working with APIs β Using
requests
to interact with REST APIs. -
Automating SSH Tasks β Using
paramiko
for remote command execution. -
Cloud SDKs for Automation β
-
boto3
for AWS -
google-cloud-sdk
for GCP
-
Building CLI Tools β Using
argparse
for structured command-line arguments.
π¨ Hands-on Projects
- AWS EC2 Instance Manager (boto3 + argparse)
- Start, stop, and terminate EC2 instances via CLI.
- Learned how to integrate Python with AWS SDK.
- Added safety confirmation for termination.
- Kubernetes Pod Status Checker (kubectl + subprocess)
- Runs
kubectl get pods
for a given namespace. - Parses and formats pod data for better readability.
π‘ Takeaway:
By the end of Week 2, I could write Python scripts that directly manage cloud resources and cluster workloads no manual clicking in the AWS Console or running repetitive kubectl
commands.
π³ Week 3: Docker & Python for Containerized Applications
π― Goal: Learn to containerize Python applications for portability and automation.
π Key Concepts Covered
-
Dockerizing Python Apps β Writing
Dockerfile
for Python scripts. - Running Python in Containers β Understanding how to package and run apps in isolated environments.
- Docker Compose β Setting up multi-container environments.
-
Python SDK for Docker (
docker-py
) β Managing containers programmatically. -
System Metrics in Containers β Using
psutil
inside containers to expose metrics.
π¨ Hands-on Projects
- Docker Manager CLI (subprocess)
- Start, stop, restart, or remove containers from Python CLI.
- Dockerized Flask Metrics API (psutil)
- Returns CPU & memory usage in JSON format.
- Packaged into a Docker image for portability.
π‘ Takeaway:
Week 3 connected my Python skills to Docker I can now both control Docker from Python and run Python inside Docker. This is a huge step toward production-ready automation tools.
Top comments (1)
Amazing! πππ