A dead simple Ruby web server. Serves on port 80. /healthcheck path returns "OK" All other paths return "Well, hello there!"
$ ruby webserver.rb
- kubectl
- helm3
- docker
I have added 3 lines of code into http_server.rb to make it compatible with HTTP1.1 protocol, otherwise more complex workarounds required to enable healthcheck.
minikube started with this command
minikube start --vm-driver=none
default namespace in use for simplify the task
what script does:
build docker container adjust:latest on localhost
docker build -t adjust:latest .
deploy it with helm.
helm upgrade --install adjust -f values.yaml helm_chart
3 replicas and healthcheck enabled. Service should be available withing the k8s as adjust.default.svc.cluster.local FQDN.
Run test.
kubectl run -i --tty test --image=adjust:latest --rm --image-pull-policy='Never' --restart=Never --command -- curl adjust.default.svc.cluster.local
It runs the same container adjust:latest, because it have built-in curl command, run curl adjust.default.svc.cluster.local and print ok if grep lines "Well, hello there"
Because there is no mention about ingress, open public port or use HPA, there is no port accessible outside K8S and there is no autoscaling implemented.