{"id":23739971,"url":"https://github.com/jharrilim/k8s-demo","last_synced_at":"2026-03-12T06:39:37.757Z","repository":{"id":56661509,"uuid":"307250675","full_name":"jharrilim/k8s-demo","owner":"jharrilim","description":"Tutorial/Example repo of a simple K8s setup.","archived":false,"fork":false,"pushed_at":"2020-10-26T11:36:01.000Z","size":35,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-23T04:00:01.470Z","etag":null,"topics":["docker-desktop","docker-desktop-for-mac","docker-desktop-for-windows","kubernetes","kubernetes-deployment","kubernetes-service","tutorial"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jharrilim.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}},"created_at":"2020-10-26T03:21:05.000Z","updated_at":"2024-10-03T12:41:55.000Z","dependencies_parsed_at":"2022-08-15T22:50:27.938Z","dependency_job_id":null,"html_url":"https://github.com/jharrilim/k8s-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jharrilim/k8s-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jharrilim%2Fk8s-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jharrilim%2Fk8s-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jharrilim%2Fk8s-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jharrilim%2Fk8s-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jharrilim","download_url":"https://codeload.github.com/jharrilim/k8s-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jharrilim%2Fk8s-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30417529,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T04:41:02.746Z","status":"ssl_error","status_checked_at":"2026-03-12T04:40:12.571Z","response_time":114,"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":["docker-desktop","docker-desktop-for-mac","docker-desktop-for-windows","kubernetes","kubernetes-deployment","kubernetes-service","tutorial"],"created_at":"2024-12-31T09:40:57.120Z","updated_at":"2026-03-12T06:39:37.740Z","avatar_url":"https://github.com/jharrilim.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kubernetes Intro\n\n- [Prerequisites](#prerequisites)\n- [Getting Started](#getting-started)\n  - [Run a Docker Registry Locally](#run-a-docker-registry-locally)\n  - [Enable Kubernetes on Docker Desktop for Mac/Windows](#enable-kubernetes-on-docker-desktop-for-macwindows)\n  - [(Optional) Download the VSCode Kubernetes Extension](#optional-download-the-vscode-kubernetes-extension)\n- [How to Deploy an Application](#how-to-deploy-an-application)\n  - [Containerize Your Application](#containerize-your-application)\n  - [Write a Kubernetes Deployment](#write-a-kubernetes-deployment)\n  - [Write a Kubernetes Service](#write-a-kubernetes-service)\n  - [Deploy](#deploy)\n    - [Apply the Deployment and Service Manifests](#apply-the-deployment-and-service-manifests)\n    - [Check if Service is Running](#check-if-service-is-running)\n  - [🎉 Congratulations 🎉](#-congratulations-)\n- [Cleanup](#cleanup)\n- [Useful Commands](#useful-commands)\n  - [Set your default namespace so you don't accidentally push to `default`](#set-your-default-namespace-so-you-dont-accidentally-push-to-default)\n  - [View your current contexts (you probably have docker-desktop and a cloud provider)](#view-your-current-contexts-you-probably-have-docker-desktop-and-a-cloud-provider)\n  - [Switch to the docker-desktop context](#switch-to-the-docker-desktop-context)\n  - [Run an Ubuntu container in the cluster to debug](#run-an-ubuntu-container-in-the-cluster-to-debug)\n- [FAQ](#faq)\n  - [I enabled Kubernetes in Docker for Desktop (Mac), but I can't access my NodePort. What do I do?](#i-enabled-kubernetes-in-docker-for-desktop-mac-but-i-cant-access-my-nodeport-what-do-i-do)\n\n## Prerequisites\n\n- Have [Docker Desktop](https://www.docker.com/products/docker-desktop) installed\n\n## Getting Started\n\n### Run a Docker Registry Locally\n\nFirst things first, startup your own local Docker Registry on localhost:5000 by doing:\n\n```sh\ndocker-compose up\n```\n\n### Enable Kubernetes on Docker Desktop for Mac/Windows\n\n1. Click the Docker Desktop icon in the tray and select \"preferences\"\n2. Click Kubernetes\n3. Check \"Enable Kubernetes\"\n4. Click \"Apply \u0026 Restart\"\n\n### (Optional) Download the VSCode Kubernetes Extension\n\nIf you use VS Code, download the [Kubernetes extension](https://marketplace.visualstudio.com/items?itemName=ms-kubernetes-tools.vscode-kubernetes-tools).\nIt provides you with documentation on hover for each of the fields in a Kubernetes manifest.\n\n## How to Deploy an Application\n\n### Containerize Your Application\n\n1. Write a Dockerfile for your app.\n2. Build and tag your image and remember to:\n    1. Prefix it with the domain name/port if you want to deploy to a registry that isn't docker.io.\n    2. Version it with a git tag or the commit hash.\n3. `docker push` the built image to a container registry.\n\n### Write a Kubernetes Deployment\n\n1. Copy the [frontend.deployment.yml](./frontend/manifests/dev/frontend.deployment.yml)\nfor now since it is pretty basic and has comments describing it.\n2. In the deployment.yml, make sure the container image name is set to the same name of the image\nthat was sent to the container registry via `docker push`.\n3. Ensure that there is a label called `app` and it has a name representing this deployment.\n\n\u003e Note: VS Code users who've installed the Kubernetes extension have access to\n\u003e snippets for generating Kubernetes yaml manifests.\n\n### Write a Kubernetes Service\n\n1. Copy the [frontend.service.yml](./frontend/manifests/dev/frontend.service.yml).\n2. Ensure that the selector has the `app` label that was given to the deployment.\n\n### Deploy\n\n#### Apply the Deployment and Service Manifests\n\n```sh\nkubectl apply -f your-app.deployment.yml\nkubectl apply -f your-app.service.yml\n```\n\n#### Check if Service is Running\n\n```sh\nkubectl get svc\n```\n\n### 🎉 Congratulations 🎉\n\nYour application is deployed! You may now access it on your own host.\n\n## Cleanup\n\nLet's delete the Kubernetes objects that were created in the above steps.\n\nThe service can be deleted by doing:\n\n```sh\nkubectl delete service yourservicename\n```\n\n\u003e Note: If you are unsure of the service name, you can use `kubectl get svc` to find it.\n\nYou can delete the deployment by doing:\n\n```sh\nkubectl delete deployment yourdeploymentname\n```\n\n\u003e Note: If you are unsure of the deployment name, you can use `kubectl get deployments` to find it.\n\n## Useful Commands\n\n[Kubernetes Cheatsheet](https://kubernetes.io/docs/reference/kubectl/cheatsheet/)\n\n### Set your default namespace so you don't accidentally push to `default`\n\nThis is useful when you have a shared cluster in the cloud, and you have an assigned\nnamespace that you wish to use.\n\n```sh\nkubectl config set-context --current --namespace=joe\n```\n\nVerify it!\n\n```sh\nkubectl config view | grep namespace\n```\n\n### View your current contexts (you probably have docker-desktop and a cloud provider)\n\n```sh\nkubectl config get-contexts\n```\n\n### Switch to the docker-desktop context\n\n```sh\nkubectl config use-context docker-desktop\n```\n\n### Run an Ubuntu container in the cluster to debug\n\n```sh\nkubectl run -i --tty --rm debug --image=ubuntu --restart=Never -- bash\n```\n\n## FAQ\n\n### I enabled Kubernetes in Docker for Desktop (Mac), but I can't access my NodePort. What do I do?\n\nRestart your computer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjharrilim%2Fk8s-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjharrilim%2Fk8s-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjharrilim%2Fk8s-demo/lists"}