13 𝐦𝐨𝐬𝐭 𝐜𝐨𝐦𝐦𝐨𝐧𝐥𝐲 𝐮𝐬𝐞𝐝 𝐜𝐨𝐦𝐦𝐚𝐧𝐝 𝐟𝐨𝐫 𝐊𝐮𝐛𝐞𝐫𝐧𝐞𝐭𝐞𝐬 🎯
Here are 13 of the most commonly used kubectl commands for managing a real production Kubernetes environment, along with explanations and common use cases:
✅ 𝐂𝐨𝐫𝐞 𝐌𝐚𝐧𝐚𝐠𝐞𝐦𝐞𝐧𝐭
#1 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐠𝐞𝐭
→
→
→
→
#2 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐝𝐞𝐬𝐜𝐫𝐢𝐛𝐞
→
→
#3 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐜𝐫𝐞𝐚𝐭𝐞
→ kubectl create -f my-deployment.yaml
#4 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐚𝐩𝐩𝐥𝐲
→
#5 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐝𝐞𝐥𝐞𝐭𝐞
→
→
✅ Debugging and Troubleshooting
#6 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐥𝐨𝐠𝐬
→
→
#7 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐞𝐱𝐞𝐜
→
#8 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐩𝐨𝐫𝐭-𝐟𝐨𝐫𝐰𝐚𝐫𝐝
→
#9 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐭𝐨𝐩
→
→
#10 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐞𝐱𝐩𝐥𝐚𝐢𝐧
→
→
✅ Managing Workloads
#11 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐫𝐨𝐥𝐥𝐨𝐮𝐭
→
→
#12 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐬𝐜𝐚𝐥𝐞
→
#13 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐞𝐝𝐢𝐭
→
⚡️ 𝐅𝐨𝐥𝐥𝐨𝐰 @prodevopsguy 𝐟𝐨𝐫 𝐦𝐨𝐫𝐞 𝐬𝐮𝐜𝐡 𝐜𝐨𝐧𝐭𝐞𝐧𝐭 𝐚𝐫𝐨𝐮𝐧𝐝 𝐜𝐥𝐨𝐮𝐝 & 𝐃𝐞𝐯𝐎𝐩𝐬!!! // 𝐉𝐨𝐢𝐧 𝐟𝐨𝐫 𝐃𝐞𝐯𝐎𝐩𝐬 𝐃𝐎𝐂𝐬: @devopsdocs
Here are 13 of the most commonly used kubectl commands for managing a real production Kubernetes environment, along with explanations and common use cases:
#1 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐠𝐞𝐭
→
kubectl get pods (list pods)→
kubectl get deployments (list deployments)→
kubectl get services (list services)→
kubectl get all (list most resources in a namespace)#2 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐝𝐞𝐬𝐜𝐫𝐢𝐛𝐞
→
kubectl describe pod my-pod→
kubectl describe node my-node#3 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐜𝐫𝐞𝐚𝐭𝐞
→ kubectl create -f my-deployment.yaml
#4 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐚𝐩𝐩𝐥𝐲
→
kubectl apply -f my-deployment.yaml (apply a deployment definition)#5 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐝𝐞𝐥𝐞𝐭𝐞
→
kubectl delete pod my-pod→
kubectl delete service my-service#6 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐥𝐨𝐠𝐬
→
kubectl logs my-pod→
kubectl logs my-pod -c my-container (specify a container)#7 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐞𝐱𝐞𝐜
→
kubectl exec -it my-pod -- bash (interactive shell)#8 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐩𝐨𝐫𝐭-𝐟𝐨𝐫𝐰𝐚𝐫𝐝
→
kubectl port-forward my-pod 8080:80#9 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐭𝐨𝐩
→
kubectl top pod (pod resource usage) →
kubectl top node (node resource usage)#10 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐞𝐱𝐩𝐥𝐚𝐢𝐧
→
kubectl explain pod →
kubectl explain pod.spec (more specific)#11 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐫𝐨𝐥𝐥𝐨𝐮𝐭
→
kubectl rollout status deployment/my-deployment →
kubectl rollout undo deployment/my-deployment
#12 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐬𝐜𝐚𝐥𝐞
→
kubectl scale deployment/my-deployment --replicas=5#13 𝐤𝐮𝐛𝐞𝐜𝐭𝐥 𝐞𝐝𝐢𝐭
→
kubectl edit deployment my-deploymentPlease open Telegram to view this post
VIEW IN TELEGRAM
In this scenario, GitOps tools are like the robot assistant that follows the blueprint (your Git repository) to ensure every piece fits perfectly.
But how do they differ, and which one should you choose?
𝟏. 𝐒𝐞𝐜𝐫𝐞𝐭 𝐌𝐚𝐧𝐚𝐠𝐞𝐦𝐞𝐧𝐭
↳ ArgoCD: Relies on external tools like Sealed Secrets
↳ FluxCD: Built-in Mozilla SOPS for encrypted secrets
𝟐. 𝐇𝐞𝐥𝐦 𝐒𝐮𝐩𝐩𝐨𝐫𝐭
↳ ArgoCD: Integrates Helm within its application
↳ FluxCD: Uses Helm operator for management
𝟑. 𝐔𝐬𝐞𝐫 𝐈𝐧𝐭𝐞𝐫𝐟𝐚𝐜𝐞
↳ ArgoCD: Native UI with comprehensive overview
↳ FluxCD: Primarily CLI-based, can integrate with other UIs
𝟒. 𝐀𝐫𝐜𝐡𝐢𝐭𝐞𝐜𝐭𝐮𝐫𝐞
↳ ArgoCD: Part of broader Argo Project, with various tools
↳ FluxCD: Focuses on continuous delivery, with GitOps toolkit
𝟓. 𝐑𝐁𝐀𝐂
↳ ArgoCD: Built-in RBAC with GUI management
↳ FluxCD: Relies more on Kubernetes RBAC
𝟔. 𝐃𝐞𝐩𝐥𝐨𝐲𝐦𝐞𝐧𝐭 𝐇𝐨𝐨𝐤𝐬
↳ ArgoCD: Robust support for pre/post synchronization hooks
↳ FluxCD: Relies on Helm for hooks outside of Helm charts
𝟕. 𝐃𝐞𝐩𝐥𝐨𝐲𝐦𝐞𝐧𝐭 𝐓𝐞𝐦𝐩𝐥𝐚𝐭𝐢𝐧𝐠
↳ ArgoCD: Supports direct deployment templating
↳ FluxCD: Templating capabilities tied to Helm's ecosystem
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
1705900428288.gif
1 MB
Version control with 📱 GIT has become an essential skill for developers.
In this post, I'll provide a quick overview of some core GIT concepts and commands.
Key concepts:
➡️ Repository - Where your project files and commit history are stored
➡️ Commit - A snapshot of changes, like a version checkpoint
➡️ Branch - A timeline of commits that lets you work on parallel versions
➡️ Merge - To combine changes from separate branches
➡️ Pull request - Propose & review changes before merging branches
Key commands:
➡️ git init - Initialize a new repo
➡️ git status - View changed files not staged for commit
➡️ git add - Stage files for commit
➡️ git commit - Commit staged snapshot
➡️ git branch - List, create, or delete branches
➡️ git checkout - Switch between branches
➡️ git merge - Join two development histories (branches)
➡️ git push/pull - Send/receive commits to remote repo
✈️ 𝗙𝗼𝗹𝗹𝗼𝘄 @prodevopsguy 𝗳𝗼𝗿 𝗺𝗼𝗿𝗲 𝘀𝘂𝗰𝗵 𝗰𝗼𝗻𝘁𝗲𝗻𝘁 𝗮𝗿𝗼𝘂𝗻𝗱 𝗰𝗹𝗼𝘂𝗱 & 𝗗𝗲𝘃𝗢𝗽𝘀!!! // 𝐉𝐨𝐢𝐧 𝐟𝐨𝐫 𝐃𝐞𝐯𝐎𝐩𝐬 𝐃𝐎𝐂𝐬: @devopsdocs
In this post, I'll provide a quick overview of some core GIT concepts and commands.
Key concepts:
Key commands:
Please open Telegram to view this post
VIEW IN TELEGRAM
Efficient GitHub branching strategies can be a game-changer for your CI/CD pipeline and overall workflow. Let's explore some key strategies that can streamline your development process:
1. Main Branch (main/master): The production-ready branch. All code here should be stable and tested.
2. Feature Branches: Branch off from the main branch to work on new features. Keep them short-lived and merge back to main once complete and reviewed.
3. Release Branches: Create these when you're preparing a new release. They allow for final bug fixes and polishing before merging into the main branch.
4. Hotfix Branches: For urgent fixes on the production code. These branches are crucial for quick and isolated bug fixes.
5. Development Branch (develop): An optional branch that serves as an integration branch for features. This is where ongoing development happens before merging into the main branch.
6. Epic Branches: For larger projects, an epic branch can group related feature branches. It helps in managing complex development work.
feature/login-page, hotfix/payment-bug).Please open Telegram to view this post
VIEW IN TELEGRAM
DevOps & Cloud (AWS, AZURE, GCP) Tech Free Learning
Photo
1. Kubernetes Fundamentals:
- Understanding Kubernetes architecture
- Pods, Nodes, and Clusters
- Namespaces
2. Setup and Configuration:
- Installing Minikube or Kubernetes on local machine
- Understanding kubeadm, kops, and kubectl
3. Basic Objects and Concepts:
- Deployments
- Services
- ReplicaSets
- ConfigMaps and Secrets
4. Networking:
- Cluster IP
- NodePort
- LoadBalancer
- Ingress basics
5. Storage:
- Persistent Volumes (PV)
- Persistent Volume Claims (PVC)
- Storage Classes
6. Basic Usage:
- Creating and managing pods
- Scaling applications
- Rolling updates and rollbacks
- Basic troubleshooting
7. Security:
- Role-Based Access Control (RBAC)
- Service Accounts
8. Monitoring and Logging:
- Basics of monitoring with Prometheus
- Logging with Elasticsearch, Fluentd, and Kibana (EFK stack)
9. Understanding YAML:
- Writing basic YAML files for Kubernetes objects
1. Deployments:
- Blue/Green deployments
- Canary deployments
- A/B testing
2. Networking:
- Service Meshes (Istio, Linkerd)
- Network Policies
- Advanced Ingress configurations
- CNI plugins (Calico, Flannel, Weave)
3. Storage:
- StatefulSets
- Dynamic provisioning
- CSI (Container Storage Interface)
4. Security:
- Pod Security Policies
- Network Policies
- Secrets management (Vault, Sealed Secrets)
- Image security and scanning (Trivy, Clair)
5. Advanced Configuration:
- Helm and Helm Charts
- Kustomize
- Operators and CRDs (Custom Resource Definitions)
6. Performance Tuning:
- Resource limits and requests
- Horizontal Pod Autoscaler (HPA)
- Vertical Pod Autoscaler (VPA)
- Cluster Autoscaler
7. Monitoring and Logging:
- Advanced Prometheus configuration
- Alerting with Alertmanager
- Distributed tracing (Jaeger, OpenTelemetry)
- Centralized logging
8. Cluster Management:
- Multi-cluster management
- Federation
- Backup and restore strategies
9. CI/CD Pipelines:
- Integrating CI/CD with Kubernetes (Jenkins X, Tekton)
- GitOps (ArgoCD, Flux)
10. Disaster Recovery:
- Backup and restore strategies
- High availability and failover planning
11. Scaling and Capacity Planning:
- Handling large-scale deployments
- Capacity planning and resource optimization
12. Service Catalog and Broker:
- Using the Kubernetes service catalog
- Integrating external services
13. Compliance and Auditing:
- Auditing with Kubernetes
- Ensuring compliance with regulatory requirements
14. Troubleshooting:
- Debugging complex issues
- Analyzing logs and metrics
- Using tools like k9s, kubectl-debug, and lens
15. Cost Management:
- Cost optimization strategies
- Using tools like Kubecost
Please open Telegram to view this post
VIEW IN TELEGRAM
- 40% Scripting automation
- 30% Cloud deployments
- 20% Monitoring and optimizing
- 10% Team collaboration
- 20% Scripting automation
- 25% Cloud deployments
- 15% Monitoring and optimizing
- 40% Team collaboration
- 65.73% Debating on the infra/tool choices
- On-demand support
- Many alignment meetings
- Managing system incidents
- Balancing cost-efficiency
- Technical review sessions
- Cross-department collaboration
- Defending infrastructure choices
- Implementing stakeholder feedback
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
1711255043413.gif
2.3 MB
While CICD gets thrown around a lot, it actually refers to two separate practices that work together in the software development lifecycle: Continuous Integration (CI) and Continuous Delivery/Deployment (CD).
Here's a quick breakdown:
Here's the key difference:
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
DevOps & Cloud (AWS, AZURE, GCP) Tech Free Learning
Thanks
ProDevOpsGuy Tech Team
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
1720250854494.gif
392.1 KB
In this way, the process that starts with a developer 'pushing' code to GitHub goes through stages of automated webhook triggering, continuous delivery,
Docker image creation, and container deployment.
All these steps are automated to minimize manual errors and speed up the process.
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
1720362033949.gif
427 KB
Istio is a powerful service mesh that helps manage and secure microservices.
Here are the core components that make it all happen:
- Citadel: It handles security and provides authentication, and encryption for services. It managed certificate generation as well.
- Pilot: It is responsible for traffic management and routing. It works as a service discovery for the mesh.
- Galley: It is responsible for configuration management and distribution. It validates configuration files.
With these components working together, Istio simplifies the complex world of microservices, giving you better control, traffic management, service discovery, health check, load balancing, security, and observability.
Please open Telegram to view this post
VIEW IN TELEGRAM