Skip to content

helloworld sample service

The helloworld sample service is a dual-version application provided for testing and experimentation within Service mesh environments, specifically tailored for demonstrating Istio capabilities^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__helloworld__README.md].

Functionality

The service returns its specific version and the instance hostname when invoked^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__helloworld__README.md]. This behavior makes it particularly useful for observing how traffic is routed across different iterations of a service, verifying that requests reach the intended backend instances^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__helloworld__README.md].

Deployment

The service is deployed via kubectl using the provided helloworld.yaml file^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__helloworld__README.md]. To function correctly with Istio, the environment requires Automatic sidecar injection to be enabled^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__helloworld__README.md].

Administrators can deploy both versions simultaneously or target specific versions (e.g., v1 or v2) using label selectors^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__helloworld__README.md]. For advanced configurations, a helper script gen-helloworld.sh is included to generate custom YAML manifests, allowing users to specify version strings and toggle the inclusion of Service or Deployment resources^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__helloworld__README.md].

Networking and Ingress

External access is configured by applying a specific gateway resource (helloworld-gateway.yaml)^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__helloworld__README.md]. Once the Ingress host and ports are determined, the service can be accessed via curl at the /hello endpoint^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__helloworld__README.md].

Autoscaling

The sample is explicitly configured to support the Kubernetes Horizontal Pod Autoscaler (HPA)^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__helloworld__README.md]. Because both the application containers and the injected istio-proxy sidecars define CPU requests, the service can scale out automatically based on load^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__helloworld__README.md].

A loadgen.sh script is provided to simulate traffic, allowing users to observe the HPA increasing the replica count (up to a defined maximum) when CPU utilization rises^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__helloworld__README.md].

Use Cases

The primary use case for this service is demonstrating Canary Deployment strategies in conjunction with autoscaling^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__helloworld__README.md]. By running multiple versions simultaneously, users can validate traffic splitting rules before rolling out updates to a wider audience.

Sources

  • 400-devops__07-Monitoring-and-Observability__k8s-istio__samples__helloworld__README.md