{"id":25696320,"url":"https://github.com/rishavmehra/devops","last_synced_at":"2026-05-06T11:31:25.978Z","repository":{"id":132466661,"uuid":"451641328","full_name":"rishavmehra/devops","owner":"rishavmehra","description":"Kubernetes learning","archived":false,"fork":false,"pushed_at":"2025-02-16T11:12:17.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-25T01:53:03.113Z","etag":null,"topics":["kubectl","kubernetes","kubernetes-cluster","kubernetes-controller","kubernetes-setup","yaml"],"latest_commit_sha":null,"homepage":"https://github.com/rishavmehra/Kubernetes","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rishavmehra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-24T21:37:19.000Z","updated_at":"2025-02-17T08:22:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"559fa09b-7da2-46b6-9182-fc9630e100fb","html_url":"https://github.com/rishavmehra/devops","commit_stats":null,"previous_names":["rishavmehra/devops"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishavmehra%2Fdevops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishavmehra%2Fdevops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishavmehra%2Fdevops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishavmehra%2Fdevops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rishavmehra","download_url":"https://codeload.github.com/rishavmehra/devops/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240587540,"owners_count":19825004,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kubectl","kubernetes","kubernetes-cluster","kubernetes-controller","kubernetes-setup","yaml"],"created_at":"2025-02-25T01:53:04.963Z","updated_at":"2026-05-06T11:31:20.954Z","avatar_url":"https://github.com/rishavmehra.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DevOps\n\nDistributed Systems Check here:\n- [Distributed Systems](https://github.com/rishavmehra/distributedsystems)\n\n## Kubernetes\n\n📄 **Reference:**  \n- [📌 kubectl Cheat Sheet](https://kubernetes.io/docs/reference/kubectl/quick-reference/)  \n- [📘 Pods Documentation](https://kubernetes.io/docs/concepts/workloads/pods/)\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003eMost Used Commands\u003c/summary\u003e\n\u003cbr\u003e\n\u003cpre\u003e\u003ccode\u003e\n$ kubectl get pods\n$ kubectl run nginx --image=nginx --dry-run=client -o yaml\n$ kubectl describe pod \u003cpod-name\u003e\n$ kubectl get pod \u003cpod-name\u003e -o yaml\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n## 🔧 Exercise 1: Working with Pods (Declarative Only)\n\n### 🎯 Task:\n\u003e Create a **Pod** in the **default namespace** using a YAML file with the following specifications:\n\u003e\n\u003e - Use any **container image** of your choice.\n\u003e - The pod must have **2 containers**.\n\u003e - After applying the YAML, **verify** that the pod is running.\n\n### 📂 Solution:\n👉 [00. Exercises/Pod/Pod.yaml](00.%20Exercises/Pod/Pod.yaml)\n\n---\n\n## 🔧 Exercise 2: Expose the App\n\n### 🎯 Task:\n\u003e Create a service to expose a Pod in Kubernetes using different service types:\n\u003e\n\u003e - Create a Pod running an Nginx container that exposes ports 80 and 443.\n\u003e - Expose the Pod with a NodePort service on port 30007.\n\u003e - Create a LoadBalancer service that exposes the HTTPS port with TLS passthrough.\n\u003e - Create another Pod with httpd that shares the same label to demonstrate service selector functionality.\n\n### 📂 Solution:\n👉 [00. Exercises/expose-the-app/manifest.yaml](00.%20Exercises/expose-the-app/manifest.yaml) - Nginx Pod  \n👉 [00. Exercises/expose-the-app/manifest2.yaml](00.%20Exercises/expose-the-app/manifest2.yaml) - Apache httpd Pod  \n👉 [00. Exercises/expose-the-app/svc.yaml](00.%20Exercises/expose-the-app/svc.yaml) - NodePort Service  \n👉 [00. Exercises/expose-the-app/svc-lb.yaml](00.%20Exercises/expose-the-app/svc-lb.yaml) - LoadBalancer Service\n\n#### 📚 Key Concepts:\n- **Services** act as stable network endpoints for Pods\n- **NodePort** exposes the service on each node's IP at a static port\n- **LoadBalancer** provisions an external load balancer to route traffic to the service\n- **Selectors** determine which Pods a Service targets based on labels\n\n---\n\n## 🔧 Exercise 3: Ingress from First Principle\n\n### 🎯 Task:\n\u003e Implement a multi-service architecture with a custom Nginx-based ingress controller:\n\u003e\n\u003e - Create separate namespaces for frontend and backend applications\n\u003e - Deploy a PostgreSQL database\n\u003e - Deploy a frontend application (httpd) and a backend service (bun)\n\u003e - Implement a custom Nginx reverse proxy to route requests based on domain names:\n\u003e   - k8s.rshv.xyz(use your own domain) should route to the backend service\n\u003e   - k8s2.rshv.xyz(use your own domain) should route to the frontend service\n\n### 📂 Solution:\n👉 [00. Exercises/ingress-first-principle/fe.yaml](00.%20Exercises/ingress-first-principle/fe.yaml) - Frontend Application  \n👉 [00. Exercises/ingress-first-principle/backend.yaml](00.%20Exercises/ingress-first-principle/backend.yaml) - Backend Application  \n👉 [00. Exercises/ingress-first-principle/db.yaml](00.%20Exercises/ingress-first-principle/db.yaml) - Database Deployment  \n👉 [00. Exercises/ingress-first-principle/reverse-proxy.yaml](00.%20Exercises/ingress-first-principle/reverse-proxy.yaml) - Custom Nginx Ingress\n\n#### 📚 Key Concepts:\n- **Namespaces** provide isolation between different application components\n- **ConfigMaps** store configuration data like Nginx configuration\n- **Service Discovery** using Kubernetes DNS (servicename.namespace.svc.cluster.local)\n- **Custom Ingress Controller** using Nginx reverse proxy for domain-based routing\n\n## 🔧 Exercise 4: Kubernetes Native Ingress\n\n### 🎯 Task:\n\u003e Implement path-based routing using Kubernetes native Ingress resources:\n\u003e\n\u003e - Deploy two applications: a backend using Nginx and a frontend using Apache httpd\n\u003e - Create ClusterIP services for both applications\n\u003e - Configure a Kubernetes Ingress resource to route traffic based on URL paths:\n\u003e   - /backend path should route to the backend service\n\u003e   - /frontend path should route to the frontend service\n\u003e - Use annotations to configure URL rewriting\n\n### 📂 Solution:\n👉 [00. Exercises/ingress/manifest-be.yaml](00.%20Exercises/ingress/manifest-be.yaml) - Backend Deployment and Service  \n👉 [00. Exercises/ingress/manifest-fe.yaml](00.%20Exercises/ingress/manifest-fe.yaml) - Frontend Deployment and Service  \n👉 [00. Exercises/ingress/ingress.yaml](00.%20Exercises/ingress/ingress.yaml) - Ingress Resource\n\n#### 📚 Key Concepts:\n- **Ingress Resources** provide HTTP/HTTPS routing, path-based routing, and name-based virtual hosting\n- **IngressClass** specifies which controller should implement the Ingress\n- **Path Types** define how paths are matched (Prefix, Exact, ImplementationSpecific)\n- **Annotations** configure controller-specific behaviors like URL rewriting\n- **Ingress Controller** is the component that actually implements the Ingress rules (typically Nginx)\n\n---\n# HELM\n[Cheat Sheet](https://helm.sh/docs/intro/cheatsheet/)\n```\n// Install a chart from a local directory\nhelm create mychart\nhelm install mychartrelease mychart\n\n// Uninstall a release\nhelm uninstall mychartrelease\n\n// List releases\nhelm list -a\n\n// upgrade the the helm chart\nhelm upgrade mychartrelease mychart\n\n// rollback to a previous version\nhelm rollback mychartrelease 1\n\n// debug\nhelm install --dry-run --debug mychartrelease mychart\n\n// helm template\nhelm template mychart\n\n\n// helm lint\nhelm lint mychart\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishavmehra%2Fdevops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frishavmehra%2Fdevops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishavmehra%2Fdevops/lists"}