Sign inSign up

kielniakodu/k8s-app

By kielniakodu

•Updated over 1 year ago

A simple Go application that demonstrates how Kubernetes works

Image
Networking
Developer tools
Web servers
0

275

kielniakodu/k8s-app repository overview

⁠Kubernetes Demo Application

A simple Go application that demonstrates how Kubernetes works, particularly focusing on liveness and readiness probes.

⁠Quick reference

Repository: https://github.com/JumbleTron/k8s-app⁠

⁠Features

  • Display request information
  • Display server information
  • Kubernetes liveness probe endpoint
  • Kubernetes readiness probe endpoint
  • Easy toggle for enabling/disabling probes

⁠Endpoints

  • / - Home page with links to all endpoints
  • /request - Display detailed information about the HTTP request
  • /server - Display information about the server (hostname, OS, Go version, etc.)
  • /healthz - Kubernetes liveness probe endpoint
  • /readyz - Kubernetes readiness probe endpoint
  • /toggle/ready - Toggle the readiness status (for demonstration purposes)
  • /toggle/healthy - Toggle the health status (for demonstration purposes)

⁠Building and Running

⁠Local Development
# Build the application
go build -o k8s-app .

# Run the application
./k8s-app

The application will be available at http://localhost:8080⁠

⁠Docker
# Build the Docker image
docker build -t k8s-app:latest .

# Run the Docker container
docker run -p 8080:8080 k8s-app:latest

The application will be available at http://localhost:8080⁠

Tag summary

Content type

Image

Digest

sha256:e23a54552…

Size

157.1 MB

Last updated

over 1 year ago

docker pull kielniakodu/k8s-app