A basic go api server made into a helm chart to be deployed in a cluster and has few OpenTelemetry observability setup done.
- Its a best practice to make a new namespace for an application
- namespace can be created by running
kubectl create ns <namespace>
- namespace can be created by running
- helm repo add
<repo name>
https://vijay-anantham.github.io/helloWorldHelm/charts - helm install -n
<namespace>
<release name>
<repo name>
/hello_worldchart
-
It is assumed that you create a new namespace to install the helm chart
-
the otel traces are sent using otlp-http
-
default: "http://jaeger-collector.opentelemetry.svc.cluster.local:4318"
-
To set custom otlp collector it can be set by passing as an environment variable 'OTEL_EXPORTER_OTLP_ENDPOINT'
-
The environment variable can be passed via a config map
-
to pass custom configmap set the
customconfig.enable
to true in the values file. -
pass the name to the custom configmap into the
customconfig.name
variable.
-
-
if no namespace was selected when installing the chart then,
- Run 'kubectl get all -n
<namespace>
'
- Run 'kubectl get all -n
-
if no namespace was selected when installing the chart then,
- Run 'kubectl get all'
-
The following are should be found.
- one pod in 'running' status
- one deployment with name 'rolldice'
- one service with name 'rolldice'
-
To run the application
- If installed in a nampspace
- Run 'kubectl port-forward -n
<namespace>
svc/rolldice 8080:8080'
- Run 'kubectl port-forward -n
- If installed in a nampspace
-
You can get the dice roll value by accessing
http://localhost:8080/rolldice
- You can find the code for the application rolldice in the repo
https://github.com/Vijay-Anantham/roll-dice