This repository includes a Helm chart for Kubernetes deployment under deploy/charts/helloworld.
Prerequisites:
- Kubernetes cluster and
kubectlconfigured - Helm 3 installed
- Container image published to a registry (default:
ghcr.io/berndonline/k8s/go-helloworld)
Install or upgrade the chart:
cd deploy/charts/helloworld
helm upgrade --install helloworld . \
--namespace helloworld \
--create-namespace \
--set image.repository=ghcr.io/berndonline/k8s/go-helloworld \
--set image.tag="latest"Expose via Envoy Gateway (Gateway API HTTPRoute):
cd deploy/charts/helloworld
helm upgrade --install helloworld . \
--namespace helloworld \
--create-namespace \
--set httpRoute.enabled=true \
--set httpRoute.parentRefs[0].name=eg \
--set httpRoute.parentRefs[0].namespace=envoy-gateway-system \
--set httpRoute.hostnames[0]=my.example.com \
--set image.repository=ghcr.io/berndonline/k8s/go-helloworld \
--set image.tag="latest"This assumes an Envoy Gateway instance listening on the GatewayClass/Gateway referenced by parentRefs. Update hostnames and matches as needed for your cluster.
-
Image
--set image.repository=...--set image.tag=...(leave empty to use chartappVersion)--set image.pullPolicy=IfNotPresent
-
Gateway API / HTTPRoute
--set httpRoute.enabled=true--set httpRoute.parentRefs[0].name=eg--set httpRoute.parentRefs[0].namespace=envoy-gateway-system--set httpRoute.hostnames[0]=my.example.com- Override
httpRoute.matchesfor custom path matching (defaults toPathPrefix /). - Supply an entire array of rule definitions via
httpRoute.rulesif you need custom filters/backends.
-
Metrics (Prometheus Operator / kube-prometheus-stack)
--set metrics.enabled=true- Optional RBAC (if your Prometheus requires it within the app namespace):
--set metrics.rbacEnabled=true--set metrics.prometheusServiceAccount=prometheus-k8s--set metrics.prometheusNamespace=monitoring
- Optional alert rules (edit
values.yamlundermetrics.rules)
-
Tracing (Jaeger agent sidecar)
--set tracing.enabled=true--set tracing.collectorArgs={"--reporter.grpc.host-port=dns:///jaeger-collector-headless.observability:14250","--reporter.type=grpc"}
-
DynamoDB backing store / AWS STS
--set dynamodb.enabled=true--set dynamodb.tableName=my-dynamodb-table--set dynamodb.region=eu-west-1--set dynamodb.roleArn=arn:aws:iam::123456789012:role/MyHelloWorldRole- Optionally set a custom session name:
--set dynamodb.roleSessionName=helloworld - When using IRSA, also provide the projected token path (usually
/var/run/secrets/eks.amazonaws.com/serviceaccount/token) via--set dynamodb.webIdentityTokenFile=... - To have the chart project a service account token with a custom audience, enable
--set dynamodb.serviceAccountTokenProjection.enabled=trueand optionally tune:--set dynamodb.serviceAccountTokenProjection.mountPath=/var/run/secrets/eks.amazonaws.com/serviceaccount--set dynamodb.serviceAccountTokenProjection.tokenFile=token--set dynamodb.serviceAccountTokenProjection.audience=sts.amazonaws.com--set dynamodb.serviceAccountTokenProjection.expirationSeconds=3600--set dynamodb.serviceAccountTokenProjection.volumeName=aws-token
- Ensure the pod uses an IAM role that is permitted to assume
roleArn(for example by enablingserviceAccount.createand binding it through IAM Roles for Service Accounts)
-
Kafka producer
--set kafka.enabled=true--set kafka.topic=content-created--set kafka.brokers[0]=my-cluster-kafka-bootstrap.kafka:9092(point at your Strimzi bootstrap service; repeat the index for additional brokers if needed)- Optional client identifier:
--set kafka.clientId=helloworld - Create the topic ahead of time (for Strimzi apply
deploy/strimzi/kafka-topic.yamlin the Kafka namespace)
-
Resources and Security
- Defaults are set in
values.yaml(requests/limits) - Container and pod security contexts are enabled by default; override via:
--set containerSecurityContext.readOnlyRootFilesystem=false--set podSecurityContext.runAsNonRoot=true
- Defaults are set in
-
Service Account
--set serviceAccount.create=trueto create a SA for the deployment--set serviceAccount.name=my-sato use an existing SA
-
Pod Disruption Budget
--set pdb.enabled=true(setpdb.minAvailableas needed)
helm uninstall helloworld -n helloworld