https://github.com/upcloudltd/hello-container
Simple container for testing and demonstrating container and pod networking.
https://github.com/upcloudltd/hello-container
container container-image demo demo-application hello-world server testing webserver
Last synced: 5 months ago
JSON representation
Simple container for testing and demonstrating container and pod networking.
- Host: GitHub
- URL: https://github.com/upcloudltd/hello-container
- Owner: UpCloudLtd
- License: mit
- Created: 2022-10-11T15:34:34.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-23T12:48:59.000Z (over 2 years ago)
- Last Synced: 2025-03-31T17:56:00.713Z (about 1 year ago)
- Topics: container, container-image, demo, demo-application, hello-world, server, testing, webserver
- Language: HTML
- Homepage:
- Size: 237 KB
- Stars: 0
- Watchers: 10
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hello-container
Simple container for testing and demonstrating
- container and pod networking, and
- (rolling) deployment updates.
The container runs an nginx server that (from the `/` root route) returns either HTML or TXT response with `Hello! 👋` message as well as containers hostname and address.
## Usage
To create a deployment and expose it from your Kubernetes cluster, run:
```sh
kubectl create deployment --image=ghcr.io/upcloudltd/hello hello
kubectl expose deployment hello --port=80 --target-port=80 --type=LoadBalancer
kubectl get svc -w
```
This process might take a few minutes. After external IP for hello service is visible, use it to test that pod is reachabe from the internet. For example:
```sh
$ curl http://lb-${id}.upcloudlb.com
```
Environment variable `NGINX_PORT` can be used to change port that Nginx listens to.
```sh
$ docker run -e NGINX_PORT=8080 ghcr.io/upcloudltd/hello
```
## Development
Build `hello-container` image with:
```sh
docker build . -t hello-container
# With version note
docker build . -t hello-container --build-arg "VERSION_NOTE=at $(git rev-parse HEAD)"
# With custom emoji and greeting
docker build . -t hello-container \
--build-arg "VERSION_NOTE=at $(git rev-parse HEAD)" \
--build-arg "EMOJI=🐄" \
--build-arg "HELLO=Moo"
```
Run `hello-container` with:
```sh
docker run -i -p 8080:80 --rm hello-container
```