64 lines
2.7 KiB
Markdown
64 lines
2.7 KiB
Markdown
# Hello Kube demo app
|
|
|
|
A demo app that can be deployd to a Kubernetes cluster (k8s, kind, etc.). It displays a message, and also namespace, pod, node and image details.
|
|
|
|
This is a fork from [paulbouwer/hello-kubernetes](https://github.com/paulbouwer/hello-kubernetes)
|
|
|
|
## Configuration
|
|
|
|
| Variables | Required | Default Value | Description |
|
|
| --- | -------- | ------------- | ----------- |
|
|
| DOCKER_IMAGE | Yes | hello-kube | Docker image name |
|
|
| DOCKER_IMAGE_VERSION | Yes | 1.0 | Docker image version |
|
|
| DOCKER_REGISTRY | yes | docker.io | Docker registry name |
|
|
| DOCKER_REGISTRY_USER | Yes | gmouchet | Docker registry user |
|
|
| DOCKER_REGISTRY_PASSWORD| Yes | secret | Docker registry user password |
|
|
| PORT_LOCAL| No| 8080 | The port for URL <server_fqdn>:<PORT_LOCAL>|
|
|
| PORT | No | 8080 | The port that the app listens on. |
|
|
| MESSAGE | No | "Hello world!" | The message displayed by the app. |
|
|
| RENDER_PATH_PREFIX | No | "" | The path prefix to use when rendering the urls for the static assets in the handlebar templates. <br/> Must be used when app is deployed with an ingress using a backend path for traffic to app. |
|
|
| HANDLER_PATH_PREFIX | No | "" | The path prefix to use by handlers when serving the dynamic and static assets. <br/> Note: Must be used when app is deployed with an ingress that has a backend path for traffic to the app, but which does not rewrite the backend paths to '/'. |
|
|
| KUBERNETES_NAMESPACE | Yes | "-" | The Kubernetes namespace that the app has been deployed to. |
|
|
| KUBERNETES_NODE_NAME | Yes | "-" | The name of the Kubernetes node that the app is deployed on. |
|
|
|
|
The application relies on the following files for configuration and operational information.
|
|
|
|
| File | Required | Information | Description |
|
|
| ---- | -------- | ----------- | ----------- |
|
|
| package.json | Yes | `.version` | The release version is used when the CONTAINER_IMAGE env is not provided. |
|
|
| info.json | Yes | `.containerImageArch` | The container image architecture is used for display. This file will be overwritten in future versions as part of the container image build process when multi-arch images are suppoted. |
|
|
|
|
## Build image
|
|
**Multi architecture**
|
|
|
|
To create a multi-architecture image, proceed as follows:
|
|
|
|
```bash
|
|
docker buildx create --use --name gmobuilder
|
|
docker buildx inspect gmobuilder --bootstrap
|
|
```
|
|
|
|
```bash
|
|
docker buildx build --platform linux/amd64,linux/arm64 -t gmouchet/hello-kube:latest . --push
|
|
```
|
|
or user script `./docker.sh build`
|
|
|
|
**Variables**
|
|
```bash
|
|
cp .env.dist .env
|
|
vim .env
|
|
```
|
|
|
|
**Build image**
|
|
```bash
|
|
./docker.sh build-no-cache
|
|
```
|
|
**Others actions**
|
|
```bash
|
|
./docker.sh help
|
|
```
|
|
|
|
## Changelog
|
|
### v1.0.0 (2025-04-12)
|
|
#### Added
|
|
- initial version |