{"id":31324724,"url":"https://github.com/tapas4java/kube-playground","last_synced_at":"2026-04-20T13:04:11.882Z","repository":{"id":315566905,"uuid":"1059951631","full_name":"tapas4java/kube-playground","owner":"tapas4java","description":"Kube Playground: Mastering Kubernetes Concepts with Hands-On Examples","archived":false,"fork":false,"pushed_at":"2025-09-20T03:44:19.000Z","size":2349,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-26T16:38:26.931Z","etag":null,"topics":["devbox","grafana","headlamp","kind","kubernetes","microservices"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tapas4java.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-19T07:14:47.000Z","updated_at":"2025-09-23T11:59:46.000Z","dependencies_parsed_at":"2025-09-19T11:35:10.833Z","dependency_job_id":"57389b32-b34a-4361-b9ab-32c2d9154d4c","html_url":"https://github.com/tapas4java/kube-playground","commit_stats":null,"previous_names":["tapas4java/kubernetes-basics"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tapas4java/kube-playground","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tapas4java%2Fkube-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tapas4java%2Fkube-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tapas4java%2Fkube-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tapas4java%2Fkube-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tapas4java","download_url":"https://codeload.github.com/tapas4java/kube-playground/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tapas4java%2Fkube-playground/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32048446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["devbox","grafana","headlamp","kind","kubernetes","microservices"],"created_at":"2025-09-25T21:30:04.050Z","updated_at":"2026-04-20T13:04:11.876Z","avatar_url":"https://github.com/tapas4java.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mastering Kubernetes with Kube-Playground\n\n\u003e 💡 **Easiest Way to Start:** This repository is configured with [Devbox](#-quick-start-with-devbox) to instantly create a complete Kubernetes learning environment with `kind`, `kubectl`, `helm`, and all other tools pre-installed. Just run `devbox shell` to begin!\n\n![Kube Playground](./kube-playground.png)\n\nThis repository is a hands-on playground for learning Kubernetes.\n\nThis post aims to demystify key Kubernetes concepts through practical examples. We'll use kubectl commands to interact with our local Kind Kubernetes cluster. Kubernetes, a powerful platform for orchestrating containerized applications, can be overwhelming for newcomers. In Part 1, we learned what Kubernetes is, why it matters, and explored basic concepts.\n\nIn this Part 2, we'll go through every basics to advanced Kubernetes concept one by one, with hands-on examples you can try in your own local Kind cluster. Think of this as your Kubernetes survival kit.\n\n## 🚀 Prerequisites\n\nThe only prerequisite for this tutorial is to have Devbox installed. You can install it by running the following command in your terminal:\n\n```bash\ncurl -fsSL https://get.jetpack.io/devbox | bash\n```\n\nOnce Devbox is installed, it will provide a complete, isolated environment with all the other tools you need.\n\n## 🚀 Quick Start with Devbox\n\nWith Devbox installed, you can get the entire learning environment up and running with a single command.\n\n1.  Clone this repository.\n2.  Run the following command in the root of the repository:\n\n    ```bash\n    devbox shell\n    ```\n3. Run the `exit` when you are done:\n\n    ```bash\n    exit\n    ```\n\nThis will drop you into a shell and automatically trigger the `start.sh` script. This script will:\n1.  Create a multi-node Kind cluster running Kubernetes v1.34.0.\n2.  Install the NGINX Ingress controller.\n3.  Install the Headlamp dashboard.\n\nOnce the script is finished, your environment is ready! It will print the login token for the Headlamp dashboard.\n\nYou can access the Headlamp dashboard at `http://headlamp.localtest.me`. Copy the token from your terminal and paste it into the login screen.\n\nWhen you are ready to stop, you can type `exit` in your terminal to leave the Devbox shell. This will automatically trigger the cleanup process.\n\n## Repository Structure\n\nThe repository is organized by Kubernetes concepts, with each directory containing the relevant manifests and instructions.\n\n-   `/01-cluster-setup`: Contains all the configuration for the automated environment setup. To see how the environment is created, you can inspect the `start.sh` script and the manifests in this directory.\n\n-   `/02-namespaces`: Namespaces are used to create logical partitions of the cluster. The `namespaces.yaml` file shows how to create `dev` and `prod` namespaces.\n\n-   `/03-pods`: Pods are the smallest deployable units in Kubernetes. We have a basic `nginx-pod.yaml` and a `pod-with-multicontainer.yaml` to show a more complex pod with shared volumes.\n\n-   `/04-replicasets`: A ReplicaSet ensures that a specified number of pod replicas are running at any given time. While not often used directly, they are the basis for Deployments. See `nginx-rs.yaml`.\n\n-   `/05-deployments`: Deployments are the standard way to manage stateless applications. They handle rolling updates and rollbacks. The `nginx-deploy.yaml` provides a basic example, while `deployment-strategies.yaml` demonstrates the difference between `RollingUpdate` and `Recreate` strategies.\n\n-   `/06-services`: Services provide stable network endpoints for pods. We cover four types: `nginx-service-clusterip.yaml` (internal), `nginx-service-nodeport.yaml` (exposes on node), `nginx-service-loadbalancer.yaml` (uses cloud provider LB), and `externalname-service.yaml` (maps to an external DNS name).\n\n-   `/07-configmaps-secrets`: These resources externalize configuration. We show how to create a `configmap.yaml` and `secret.yaml`, and then how to consume them as environment variables (`pod-with-env.yaml`) or as mounted files (`pod-with-volume-mounts.yaml`).\n\n-   `/08-volumes`: Volumes provide data persistence beyond a container's lifecycle. We show a temporary `pod-with-emptydir.yaml` and a persistent example using `pvc.yaml` (the claim) and `pod-with-pvc.yaml` (the consumer).\n\n-   `/09-statefulsets`: For stateful applications, a `statefulset.yaml` provides stable network identifiers and persistent storage. Our example uses Redis and its required `redis-headless-service.yaml`.\n\n-   `/10-daemonsets`: DaemonSets ensure that all (or some) nodes run a copy of a pod. This is useful for log collectors or monitoring agents. See `daemonset.yaml`.\n\n-   `/11-jobs-cronjobs`: For batch processing, a `job.yaml` runs a task to completion. A `cronjob.yaml` runs a job on a schedule. We also include a `parallel-job.yaml` to show how multiple pods can work on a task.\n\n-   `/12-probes`: Probes are used for health checking. The `deployment-with-probes.yaml` example now includes `livenessProbe`, `readinessProbe`, and `startupProbe` to ensure container health.\n\n-   `/13-autoscaling`: The Horizontal Pod Autoscaler (HPA) automatically scales the number of pods. See the `README.md` in this folder for a full walkthrough using the `hpa.yaml` and `php-apache-deployment.yaml`.\n\n-   `/14-scheduling`: Control where your pods run. `node-affinity-pod.yaml` schedules pods based on node labels, `taints-and-tolerations/` forces pods to have tolerations to run on a tainted node, and `pod-affinity-pod.yaml` schedules pods based on the location of other pods.\n\n-   `/15-network-policies`: Network Policies control traffic flow between pods. We provide an example of allowing traffic between a `frontend.yaml` and a `backend.yaml` with `backend-policy.yaml`, and also a `default-deny-policy.yaml` for a more secure posture.\n\n-   `/16-rbac`: Role-Based Access Control manages permissions. `rbac.yaml` shows a `Role` and `RoleBinding` (namespaced), while `clusterrole.yaml` shows a `ClusterRole` and `ClusterRoleBinding` (cluster-wide). Other examples include `pod-with-sa.yaml` and `resource-quota.yaml`.\n\n-   `/17-ingress`: Ingress manages external access to services, typically HTTP. `ingress.yaml` shows basic host-based routing, and `tls-ingress.yaml` demonstrates how to secure it with a TLS certificate.\n\n-   `/18-custom-resources`: Extend the Kubernetes API by creating your own resources with a `crd.yaml` (Custom Resource Definition) and then creating instances of it like `foo-resource.yaml`.\n\n-   `/19-resource-requests-and-limits`: Managing resource requests and limits.\n\n-   `/20-shopping-cart-app`: A complete shopping cart application.\n\n### 🛍️ Example Application: Shopping Cart\n\nThe `/20-shopping-cart-app` directory contains the Google microservices demo, a fully functional, multi-tier application that demonstrates how various Kubernetes resources work together in a realistic scenario.\n\n\u003e **Note:** This application is sourced from the official [GoogleCloudPlatform/microservices-demo](https://github.com/GoogleCloudPlatform/microservices-demo) repository.\n\n**How to Deploy:**\n\n1.  Make sure you are in the root of the repository.\n2.  Apply all the manifests in the `20-shopping-cart-app` directory. This will deploy all the microservices and the Ingress to expose the application.\n    ```bash\n    kubectl apply -f 20-shopping-cart-app/\n    ```\n3.  Verify that all the pods are running:\n    ```bash\n    kubectl get pods\n    ```\n\n**How to Access:**\n\nYou can now access the shopping cart application at `http://shop.localtest.me`.\n\n## Concepts Covered\n\n1.  **Pods**: The Smallest Unit\n2.  **ReplicaSets**: Scaling Pods\n3.  **Deployments**: The Workhorse\n4.  **Services**: Networking Pods\n5.  **ConfigMaps \u0026 Secrets**: External Configuration\n6.  **Namespaces**: Logical Separation\n7.  **Volumes \u0026 Persistent Volumes**: Data Persistence\n8.  **StatefulSets**: For Stateful Apps\n9.  **DaemonSets**: Node-specific Pods\n10. **Jobs \u0026 CronJobs**: Batch and Scheduled Tasks\n11. **Probes**: Health Checks\n12. **Autoscaling**: Automatic Scaling\n13. **Node Scheduling**: Controlling Pod Placement\n14. **Network Policies**: Securing Pod Communication\n15. **RBAC, Service Accounts \u0026 Quotas**: Security and Governance\n16. **Ingress**: HTTP(S) Routing\n17. **Custom Resources \u0026 Operators**: Extending Kubernetes\n18. **Resource Requests \u0026 Limits**: Managing pod resources.\n19. **Shopping Cart App**: A complete microservices demo application example.\n\n📝 Recap\nWe've now covered:\n\n- **Workload objects:** Pod, ReplicaSet, Deployment, StatefulSet, DaemonSet, Job, CronJob\n\n- **Networking:** Service, Ingress, NetworkPolicy\n\n- **Storage:** Volumes, PVCs, StatefulSets\n\n- **Configuration:** ConfigMaps, Secrets, Namespaces\n\n- **Resiliency:** Probes, Autoscaling, Affinity, Taints\n\n- **Security \u0026 Governance:** RBAC, Service Accounts, Quotas\n\n- **Extensibility:** CRDs \u0026 Operators\n\n🎯 Next Steps\nPractice YAMLs from this article in your own cluster.\nBreak things intentionally - delete pods, fail readiness checks, overload CPU - and observe how Kubernetes heals itself.\n\nAfter reading this two-part series, you should feel comfortable with all the core Kubernetes concepts and be ready to tackle production-grade features.\n\n## 🧹 Cluster Cleanup\n\nWhen you are finished with the tutorials, you can simply exit the Devbox shell by typing `exit`.\n\nThis will automatically trigger the `stop.sh` script, which deletes the Kind cluster and all its resources, leaving your system clean.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftapas4java%2Fkube-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftapas4java%2Fkube-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftapas4java%2Fkube-playground/lists"}