{"id":15717639,"url":"https://github.com/fierycod/kubernates-minimal-cluster","last_synced_at":"2025-05-13T00:45:47.918Z","repository":{"id":128552943,"uuid":"159243510","full_name":"FieryCod/kubernates-minimal-cluster","owner":"FieryCod","description":"Quick introduction to locally run the Node.js application cluster using Kubernetes/Minikube on MacOSX","archived":false,"fork":false,"pushed_at":"2018-11-27T19:44:49.000Z","size":1006,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-13T00:45:44.192Z","etag":null,"topics":["cluster","dashboard","docker","kubernetes-cluster","kubernetes-minimal-cluster","mac-osx","minikube","nodejs","pod","tada"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/FieryCod.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":"2018-11-26T22:51:57.000Z","updated_at":"2022-10-03T11:03:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"381b1b4d-ac61-4f6b-a50e-63363c46deb8","html_url":"https://github.com/FieryCod/kubernates-minimal-cluster","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FieryCod%2Fkubernates-minimal-cluster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FieryCod%2Fkubernates-minimal-cluster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FieryCod%2Fkubernates-minimal-cluster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FieryCod%2Fkubernates-minimal-cluster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FieryCod","download_url":"https://codeload.github.com/FieryCod/kubernates-minimal-cluster/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253850875,"owners_count":21973671,"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":["cluster","dashboard","docker","kubernetes-cluster","kubernetes-minimal-cluster","mac-osx","minikube","nodejs","pod","tada"],"created_at":"2024-10-03T21:50:51.394Z","updated_at":"2025-05-13T00:45:47.898Z","avatar_url":"https://github.com/FieryCod.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# How to configure Kubernetes minimal cluster\n\n## Prerequisites ⚠️\n\nIn order to run your very minimal Kubernetes cluster you have to firstly install all of the following software.\nAll installation commands we are using here are for MacOSX users so please bear in mind that the installation process might vary for your OS.\n\nKudos goes to @k911 who gave me a hint the we don't have to seperetely setup docker since minikube is sufficient and setups it for us.\n\n1. Install Docker 🐳\n```\nbrew cask install docker\n```\n2. Install Virtualbox 🗄\n```\nbrew cask install virtualbox\n```\n\n3. Install minikube\n```\nbrew cask install minikube\n```\n\n4. Restart terminal\n\n5. Start minikube\n```\nminikube start\n```\n\n6. Configure shell and read carefully the next section. This will make docker command available in your current shell.\n```\neval $(minikube docker-env)\n```\n\n## Getting cluster ran 😱🤩\n\n1. In order to check how Kubernetes dashboard looks like run the command:\n```\nminikube dashboard\n```\nThis is also the way we'll confirm that our app is running within Kubernetes cluster.\n\n2. Building the image of an application\nFirst we have to build image of our app since it'll be used to create a *pod*.\nTo build the image simply run the following command where -t stands for the tag which we're assigning to the image.\n\n```\ndocker build . -t k8s-node-app\n```\n\n3. Our *pod* will consist only of one container which will be created out of one image *k8s-node-app*.\nHere is how can we create deployment which manages the *pod*:\n```\nkubectl run node-app-instance --image=k8s-node-app --port=3000 --image-pull-policy=Never -l=\"env=prod,ecosystem=nodejs\"\n```\n\n4. Go to dashboard. You should see a green circle there like in image:\n![Kubernetes](https://raw.githubusercontent.com/FieryCod/node-k8s-minimal-config/master/images/kubernates_dashboard.png)\n\n5. Play with the dashboard and scale the pods to 5 instances\n6. Try hit http://localhost:3000 It doesn't work?! Why?!\nThe reason is simple: The pods within the cluster are only accesible by their's internal IP's (they live in virtual network) therefore to expose the virtual network to outside world we have to create a service: LoadBalancer specifically.\n7. To expose the virtual network we will use the following command:\n\n```\nkubectl expose deployment node-app-instance --type=LoadBalancer\n```\n\n8. That's not all because as we're using minikube locally we also have to start the service from minikube. This command should open your web browser.\n```\nminikube service node-app-instance\n```\n9. That's all! You probably now running your first cluster in life. Good job! :tada: :tada: :tada:\n\nHint: You can take all logs from all containers using the label we've created in step 3. In order to do it continuosly we will use [Kubetail](https://github.com/johanhaleby/kubetail).\n```\nbrew tap johanhaleby/kubetail \u0026\u0026 brew install kubetail # Install kubetail\n```\nthen duplicate existing terminal and type\n```\nkubetail -l ecosystem=nodejs\n```\nin other window type\n```\nfor i in `seq 1 10000`; do curl -w '\\n' http://192.168.99.100:31790/; done # Remember to replace the url here :D\n```\nNow you should see some colors 🌈🍕❤️\n\n\n![](https://raw.githubusercontent.com/FieryCod/node-k8s-minimal-config/master/images/running_cluster.png)\n\n## Troubleshooting\n\nIf for some reason the minikube hangs try the following commands: 🔥\n```\ndocker ps $(docker ps -qa) # Removes all running containers\nminikube delete # Removes the vm\nminikube start --logtostderr\n```\n\n## Resources 📖\n\nSimulator: https://cloud.google.com/kubernetes-engine/#terminal_simulator\n\nInteractive tutorial: https://kubernetes.io/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive/\n\nDeploying tutorial: https://kubernetes.io/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive/\n\nLearn Kubernetes using Interactive Browser-Based Scenarios https://katacoda.com/courses/kubernetes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffierycod%2Fkubernates-minimal-cluster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffierycod%2Fkubernates-minimal-cluster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffierycod%2Fkubernates-minimal-cluster/lists"}