https://github.com/florianvazelle/kube-nodejs-helloworld
Hello world in nodejs with docker and kubernetes
https://github.com/florianvazelle/kube-nodejs-helloworld
docker-image kubernetes nodejs
Last synced: 2 months ago
JSON representation
Hello world in nodejs with docker and kubernetes
- Host: GitHub
- URL: https://github.com/florianvazelle/kube-nodejs-helloworld
- Owner: florianvazelle
- Created: 2021-05-28T12:03:22.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-28T15:52:42.000Z (about 5 years ago)
- Last Synced: 2025-06-05T04:26:29.167Z (about 1 year ago)
- Topics: docker-image, kubernetes, nodejs
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Kubernetes Node.js Hello World App
## Docker
To build the hello world container :
```
$ make build
```
To start the docker image in background, run :
```
$ make run
```
Test it, with :
```
$ make test
```
## Kubernetes
Go to the `kubernetes/` directory.
### 1. Start minikube
```
$ minikube start
$ minikube addons enable ingress
```
### 2. Create/Apply kube resources
```
$ kubectl apply -f deployment.yaml
$ kubectl apply -f service.yaml
$ kubectl apply -f config-map.yaml
$ kubectl apply -f ingress.yaml
```
### 3. Test it
```bash
$ kubectl port-forward service/service-helloworld-app 8000:8000
$ minikube service service-helloworld-app --url
$ echo "192.168.49.2 myapp.local" >> /etc/hosts
$ curl myapp.local
```
## Reference
- [nodejs-docker-webapp](https://nodejs.org/en/docs/guides/nodejs-docker-webapp/)