Hello Kubernetes
A Hello World web app in plain Python, for trying out a deployment or debugging requests inside a cluster. Its page shows a configurable hello text (HELLO_TEXT), the pod's namespace, service account, pod and node names and IP addresses, and a fixed set of request headers such as Host, User-Agent and X-Forwarded-For. /headers returns every request header as plain text.
registry.gitlab.com/hosstio/docker-images/hello-kubernetes/main:latestSource: hosstio/docker-images/hello-kubernetes
Run
shell
docker run --interactive --tty --publish 8000:8000 registry.gitlab.com/hosstio/docker-images/hello-kubernetes/main:latestBrowse to http://127.0.0.1:8000. Set HELLO_TEXT to change the hello text:
shell
docker run --interactive --tty --publish 8000:8000 --env HELLO_TEXT="Foobar!" registry.gitlab.com/hosstio/docker-images/hello-kubernetes/main:latestThe Kubernetes values come from downward API environment variables. Under docker run those fields show their placeholders, like ${KUBERNETES_NAMESPACE}.
Deploy
The repository's kubernetes.yaml sets those environment variables:
shell
kubectl apply --filename kubernetes.yaml