{"id":24312848,"url":"https://github.com/nicolaspearson/kubernetes.api.gateway","last_synced_at":"2026-04-14T10:32:32.608Z","repository":{"id":96018106,"uuid":"160360260","full_name":"nicolaspearson/kubernetes.api.gateway","owner":"nicolaspearson","description":"Kubernetes Implementation For The Node API Gateway","archived":false,"fork":false,"pushed_at":"2018-12-04T17:06:48.000Z","size":16,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T11:52:08.825Z","etag":null,"topics":["api-gateway","kubernetes","microservices","nats","nodejs","postgresql","reactjs","redis","traefik"],"latest_commit_sha":null,"homepage":"https://github.com/nicolaspearson/node.api.gateway","language":"Shell","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/nicolaspearson.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-12-04T13:17:45.000Z","updated_at":"2024-05-31T16:58:27.000Z","dependencies_parsed_at":"2023-04-01T10:07:12.030Z","dependency_job_id":null,"html_url":"https://github.com/nicolaspearson/kubernetes.api.gateway","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nicolaspearson/kubernetes.api.gateway","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolaspearson%2Fkubernetes.api.gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolaspearson%2Fkubernetes.api.gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolaspearson%2Fkubernetes.api.gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolaspearson%2Fkubernetes.api.gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicolaspearson","download_url":"https://codeload.github.com/nicolaspearson/kubernetes.api.gateway/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolaspearson%2Fkubernetes.api.gateway/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31793212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: 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":["api-gateway","kubernetes","microservices","nats","nodejs","postgresql","reactjs","redis","traefik"],"created_at":"2025-01-17T08:30:34.827Z","updated_at":"2026-04-14T10:32:32.594Z","avatar_url":"https://github.com/nicolaspearson.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kubernetes API Gateway\n\nThis repository contains Kubernetes files for clustering the [node.api.gateway](https://github.com/nicolaspearson/node.api.gateway) back-end, and the [react.antd.fuse](https://github.com/nicolaspearson/react.antd.fuse) front-end.\n\n## Getting Started\n\nThe instructions below are for your local development environment.\n\n1. Install Docker for Mac, alternatively use Minikube [Minikube](https://github.com/kubernetes/minikube)\n2. Enable [Kubernetes](https://rominirani.com/tutorial-getting-started-with-kubernetes-with-docker-on-mac-7f58467203fd) via Docker for Mac. (Not required if using Minikube)\n3. Install [Kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/): `brew install kubernetes-cli`\n4. Check Kubernetes Nodes: `kubectl get nodes`\n5. Install Helm: `brew install kubernetes-helm \u0026\u0026 helm init --upgrade`\n6. Follow the instructions in either the Development or Production sections.\n\nFurther reading: [Learn Kubernetes in under 3 hours](https://medium.freecodecamp.org/learn-kubernetes-in-under-3-hours-a-detailed-guide-to-orchestrating-containers-114ff420e882)\n\n## Development\n\nSome of the instructions below are for Minikube user only, if you are not using Minikube you may ignore those sections.\n\n### Install The Kubernetes Dashboard\n\nIf you are not using Minikube you can install the Kubernetes dashboard by following the instructions below:\n\n1. Add the dashboard as a pod: `kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml`\n2. Ensure it was created: `kubectl get pods --namespace=kube-system`\n3. Setup port-forwarding: `kubectl port-forward \u003cyour-kubernetes-dashboard-name\u003e 8443:8443 --namespace=kube-system`, e.g. `kubectl port-forward kubernetes-dashboard-7b9c7bc8c9-chvng 8443:8443 --namespace=kube-system`\n4. Go to the dashboard: https://localhost:8443. You can skip sign in if prompted.\n\n### Build Local Images\n\nCheck the available docker images: `docker image ls`\n\nIf you do not have the required images for this project you will need to build them from existing repositories.\n\n1. Clone the React project: `git clone https://github.com/nicolaspearson/react.antd.fuse.git`\n2. Clone the Node API Gateway project: `git clone https://github.com/nicolaspearson/node.api.gateway.git`\n3. Open and build the React project: `cd react.antd.fuse \u0026\u0026 docker-compose build`\n4. Open and build the API project: `cd node.api.gateway \u0026\u0026 docker-compose build`\n5. Verify the built images: `docker image ls`\n\n### Deployment\n\n-   Deploy All: `./dev-deploy.sh`\n-   Undeploy All: `./dev-undeploy.sh`\n\nVisit the Traefik dashboard: http://dashboard.localhost\n\nAdd the API Gateway to your hosts file:\n\n-   `echo \"127.0.0.1 gateway.localhost\" | sudo tee -a /etc/hosts`\n\nAdd the React Client Frontend to your hosts file:\n\n-   `echo \"127.0.0.1 react.client.localhost\" | sudo tee -a /etc/hosts`\n\n### The API Gateway\n\nThe API Gateway is created at `gateway.localhost` by the deploy script, navigate to http://gateway.localhost/api/v1/auth/authorize using your browser, and make sure you see an appropriate response to verify that the gateway is available.\n\n### The React Client Frontend\n\nThe React Client App is created at `react.client.localhost` by the deploy script, navigate to http://react.client.localhost using your browser.\n\n## Minikube\n\nIf you are using Minikube, follow the instructions below.\n\n### Start Minikube\n\nIf you are building the Docker images locally you need to expose it to Minikube:\n\n-   Start Minikube: `minikube start`\n-   Check Kubernetes Nodes: `kubectl get nodes`\n\nTo view the kubernetes dashboard: `minikube dashboard`\n\n### Share Docker Environment With Minikube\n\nShare the docker env with minikube: `eval $(minikube docker-env)`\n\n### Build Local Images For Minikube\n\nCheck the available docker images: `docker image ls`\n\nYou will notice that it displays the images available to Minikube, but not the images that have already been created on your local machine. Minikube runs in a VM and therefore your images cannot be simply be shared, you will need to create the images within the Minikube context, e.g.\n\n1. Open the project: `cd react-lupinemoon-client` / Open the api project: `cd node.api.gateway`\n2. View local images: `docker image ls`\n3. Switch to Minikube Docker Env: `eval $(minikube docker-env)`\n4. View Minikube images: `docker image ls`\n5. Build the image in the Minikube context: `docker-compose up --build`\n6. View built images: `docker image ls`\n7. Your Minikube instance now has your local images built within it's context\n\n### Stop Minikube\n\n-   Stop Minikube: `minikube stop`\n\nGet a shell to the running Container: `kubectl exec -it \u003cpod-name\u003e -- /bin/bash`\n\n## Production\n\nThis section will remain empty until the deployment pipeline has been built.\n\n## Kubernetes Cheat Sheet\n\nBelow are some tips for using Kubernetes, the commands provided are **NOT** specific to this project.\n\n[Cheat Sheet and Autocomplete](https://kubernetes.io/docs/reference/kubectl/cheatsheet/)\n\n### Client Configuration\n\n-   Setup autocomplete in bash; bash-completion package should be installed first\n\n    `source \u003c(kubectl completion bash)`\n\n-   View Kubernetes config\n\n    `kubectl config view`\n\n-   View specific config items by json path\n\n    `kubectl config view -o jsonpath='{.users[?(@.name == \"k8s\")].user.password}'`\n\n### Manage Resources\n\n-   Get documentation for pod or service\n\n    `kubectl explain pods,svc`\n\n-   Create resource(s) like pods, services or daemon sets\n\n    `kubectl create -f ./my-manifest.yaml`\n\n-   Apply a configuration to a resource\n\n    `kubectl apply -f ./my-manifest.yaml`\n\n-   Start a single instance of Nginx\n\n    `kubectl run nginx --image=nginx`\n\n-   Create a secret with several keys\n\n        \t```\n        \tcat \u003c\u003cEOF | kubectl create -f -\n        \tapiVersion: v1\n        \tkind: Secret\n        \tmetadata:\n        \t  name: mysecret\n        \ttype: Opaque\n        \tdata:\n        \t  password: $(echo -n \"s33msi4\" | base64)\n        \t  username: $(echo -n \"jane\" | base64)\n        \tEOF\n        \t```\n\n-   Delete a resource\n\n    `kubectl delete -f ./my-manifest.yaml`\n\n### Viewing, Finding Resources\n\n-   List all services in the namespace\n\n    `kubectl get services`\n\n-   List all pods in all namespaces in wide format\n\n    `kubectl get pods -o wide --all-namespaces`\n\n-   List all pods in json (or yaml) format\n\n    `kubectl get pods -o json`\n\n-   Describe resource details (node, pod, svc)\n\n    `kubectl describe nodes my-node`\n\n-   List services sorted by name\n\n    `kubectl get services --sort-by=.metadata.name`\n\n-   List pods sorted by restart count\n\n    `kubectl get pods --sort-by='.status.containerStatuses[0].restartCount'`\n\n-   Rolling update pods for frontend-v1\n\n    `kubectl rolling-update frontend-v1 -f frontend-v2.json`\n\n-   Scale a replicaset named 'foo' to 3\n\n    `kubectl scale --replicas=3 rs/foo`\n\n-   Scale a resource specified in \"foo.yaml\" to 3\n\n    `kubectl scale --replicas=3 -f foo.yaml`\n\n-   Execute a command in every pod / replica\n\n    `for i in 0 1; do kubectl exec foo-$i -- sh -c 'echo $(hostname) \u003e /usr/share/nginx/html/index.html'; done`\n\n### Monitoring \u0026 Logging\n\n-   Deploy Heapster from Github repository\n    https://github.com/kubernetes/heapster\n\n    `kubectl create -f deploy/kube-config/standalone/`\n\n-   Show metrics for nodes\n\n    `kubectl top node`\n\n    `kubectl top node my-node-1`\n\n-   Show metrics for pods\n\n    `kubectl top pod`\n\n    `kubectl top pod my-pod-1`\n\n-   Show metrics for a given pod and its containers\n\n    `kubectl top pod pod_name --containers`\n\n-   Dump pod logs (stdout)\n\n    `kubectl logs pod_name`\n\n-   Stream pod container logs\n    (stdout, multi-container case)\n\n    `kubectl logs -f pod_name -c my-container`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicolaspearson%2Fkubernetes.api.gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicolaspearson%2Fkubernetes.api.gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicolaspearson%2Fkubernetes.api.gateway/lists"}