Deploy to minikube is very similar to deploying it to a hosted cluster but you don't need to use a docker registry as the image can be created directly in the context of the minikube docker.
- Build a docker image which contains the new ozone build
- Replace the image reference to your newly built image in the kubernetes resource files (eg. use youruser/ozone:0.5.0-SNAPSHOT image instead of apache/ozone/0.5 in the k8s files)
- Deploy the kubernetes resources files.
Step (1) and (2) is handled by the docker-build maven profile.
The most important part is to switch to use the minikube docker context instead of your local docker context:
Build ozone, build and publish docker image
Now you can build a new ozone and create the new docker images (activated by docker-build profile)
Deploy to kubernetes
Finally you can deploy any of the example cluster to kubernetes:
And you can check the results with
Note: the kubernetes/examples/minikube resource set is optimized for minikube usage:
- You can have multiple datanodes even if you have only one host (in a real production cluster usually you need one datanode per physical host)
- The services are publish with node port
Access the services
Now you can access any of the services. For each web endpoint an additional NodeType service is defined in the minikube k8s resource set. NodeType services are available via a generated port of any of the host nodes:
Minikube contains a convenience command to access any of the NodePort services: