name | description |
---|---|
Maven :: Hello World |
Demo project for getting started with Eclipse JKube.
It starts a simple HTTP server on port 8080 that replies with "Hello World" to the /hello endpoint.
|
This is a demo project for getting started with Eclipse JKube.
It starts a simple HTTP server on port 8080.
Performing a request to /hello
endpoint will reply with "Hello World".
We will be using Eclipse JKube for building a docker image and deploying to Kubernetes with a single command.
- Java 8+
- Maven
- Minikube
- JKube
-
Make sure you've Minikube up and running.
minikube start
-
Configure your local environment to re-use the Docker daemon inside the Minikube instance.
$ eval $(minikube -p minikube docker-env)
-
Run the following command to run and deploy hello-world demo app to Kubernetes
$ mvn clean install k8s:build k8s:resource k8s:apply
-
Check logs of the created Pod
$ kubectl get pods NAME READY STATUS RESTARTS AGE helloworld-664bf5fdff-2bmrt 1/1 Running 0 9s
-
Log the running Kubernetes services
$ kubectl get svc helloworld NodePort 10.110.92.145 <none> 8080:32353/TCP 58m kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 7h
-
Call the
/hello
endpoint$ curl `minikube ip`:32353/hello Hello World