go-hello-world-chart
by wasilak
A Helm chart for go-hello-world
About this chart
go-hello-world-chart
A Helm chart for go-hello-world
Overview
go-hello-world is a reference implementation for Kubernetes deployment patterns. It includes:
- Multiple HTTP routing framework implementations (chi, echo, fiber, gin, gorilla)
- Integrated observability with OpenTelemetry
- Prometheus metrics collection
- Structured logging with slog
- Docker container support with multi-architecture builds
- Comprehensive CLI arguments for flexible configuration
This Helm chart simplifies deployment to Kubernetes and makes the application discoverable through container registries.
Installation
Prerequisites
- Kubernetes 1.19+
- Helm 3.0+
Quick Start - OCI Registry
Install directly from GitHub Container Registry (GHCR):
helm install go-hello-world oci://ghcr.io/wasilak/go-hello-world-chart
Install with Custom Values
helm install go-hello-world oci://ghcr.io/wasilak/go-hello-world-chart \
--set replicaCount=3 \
--set service.type=LoadBalancer
Install from Local Chart
If developing locally:
helm install go-hello-world ./charts/go-hello-world
Specify Version
Install a specific chart version:
helm install go-hello-world oci://ghcr.io/wasilak/go-hello-world-chart:0.5.2
Configuration
The following table lists the configurable parameters of the go-hello-world chart and their default values.
Example: Custom Replica Count
replicaCount: 3
Example: LoadBalancer Service
service:
type: LoadBalancer
Example: Enable OpenTelemetry
args:
- "-listen-addr=:3000"
- "-log-format=json"
- "-log-level=info"
- "-otel-enabled"
env:
- name: "OTEL_SERVICE_NAME"
value: "go-hello-world"
- name: NODE_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: "OTEL_EXPORTER_OTLP_ENDPOINT"
value: "http://$(NODE_IP):4318"
Example: Custom Logging Configuration
args:
- "-listen-addr=:3000"
- "-log-format=json"
- "-log-level=debug"
Maintainers
| Name | Url | |
|---|---|---|
| wasilak | [email protected] |
Values
| Key | Type | Default | Description |
|---|---|---|---|
| annotations | object | {} | |
| args[0] | string | "-listen-addr=:3000" | |
| args[1] | string | "-log-format=json" | |
| args[2] | string | "-log-level=info" | |
| env[0].name | string | "OTEL_SERVICE_NAME" | |
| env[0].value | string | "go-hello-world" | |
| env[1].name | string | "NODE_IP" | |
| env[1].valueFrom.fieldRef.fieldPath | string | "status.hostIP" | |
| env[2].name | string | "OTEL_EXPORTER_OTLP_ENDPOINT" | |
| env[2].value | string | "http://$(NODE_IP):4318" | |
| image.pullPolicy | string | "IfNotPresent" | |
| image.repository | string | "ghcr.io/wasilak/go-hello-world" | |
| image.tag | string | "{{ .Chart.AppVersion }}" | |
| imagePullPolicy | string | "Always" | |
| podAnnotations | object | {} | |
| replicaCount | string | "1" | |
| service.name | string | "go-hello-world" | |
| service.port | int | 3000 | |
| service.targetPort | int | 3000 | |
| service.type | string | "ClusterIP" |
Accessing the Application
After installation, you can access the application in several ways:
Port Forward (for testing)
kubectl port-forward svc/go-hello-world 3000:3000
Then open http://localhost:3000 in your browser.
Via Ingress
Create an ingress resource to expose the application:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: go-hello-world
spec:
ingressClassName: nginx
rules:
- host: go-hello-world.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: go-hello-world
port:
number: 3000
Via LoadBalancer
If you set service.type=LoadBalancer:
kubectl get svc go-hello-world
Use the external IP to access the application.
Application Arguments
The application supports the following command-line arguments:
| Argument | Default | Description |
|---|---|---|
-listen-addr | :3000 | Address to listen on |
-log-format | json | Log format (json, text) |
-log-level | info | Log level (debug, info, warn, error) |
-otel-enabled | false | Enable OpenTelemetry instrumentation |
Upgrading
To upgrade an existing installation:
helm upgrade go-hello-world oci://ghcr.io/wasilak/go-hello-world-chart
With custom values:
helm upgrade go-hello-world oci://ghcr.io/wasilak/go-hello-world-chart \
--set replicaCount=5
Uninstalling
To remove the release:
helm uninstall go-hello-world
Troubleshooting
Pod is not starting
Check pod status and logs:
# Check pod status
kubectl get pods -l app=go-hello-world
# View pod logs
kubectl logs -l app=go-hello-world
# Describe pod for events
kubectl describe pod -l app=go-hello-world
Application is not accessible
Verify service is running:
kubectl get svc go-hello-world
kubectl get endpoints go-hello-world
Test connectivity:
kubectl run -it --rm debug --image=busybox --restart=Never -- wget -O- http://go-hello-world:3000
Image pull errors
Verify image repository and tag:
# Check image pull policy
kubectl get deployment go-hello-world -o yaml | grep -A5 image
# Pull the image manually to test
docker pull ghcr.io/wasilak/go-hello-world:1.8.2
Support
- 📖 Project Repository
- 🐛 Issue Tracker
- 📦 OCI Registry
Autogenerated from chart metadata using helm-docs v1.14.2
Deploy go-hello-world-chart with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has go-hello-world-chart on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartgo-hello-world-chart is pinned at v1.8.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply