On the previous blog we created our Kubernetes deployment files for our Ignite application. On this blog we shall deploy our Ignite application on Kubernetes. I will use minikube on this.
Let’s build first
I shall create a simple docker image, thus a Dockerfile is neeeded.
Let’s add a Dockerfile to the root of our project.
Now we want to deploy this to our local Κubernetes. Follow this guide on how to use local images on Kubernetes.
Then let’s build our app
docker build -f Dockerfile -t job-api:1.0 .
Time to apply our Kubernetes yaml files.
kubectl apply -f job-cache-rbac.yaml
kubectl apply -f job-api-deployment.yaml
kubectl apply -f job-api-service.yaml
Give it some time and check your pods
> kubectl get pods
NAME READY STATUS RESTARTS AGE
Running 0 11m
Running 0 11m
Let’s issue a request through the first pod. This request will reach github and then shall cache the results in memory.
-it job-api-deployment-86f54c9d75-dpnsc -- curl localhost:8080
Then we shall use the other endpoint in order to fetch data straight from ignite.
-it job-api-deployment-86f54c9d75-xj267 -- curl localhost:8080
So we are successful, which means that our Ignite cluster is running in our Kubernetes workloads. The data are cached and shared between the nodes.
You can find the code on GitHub.
Published on Java Code Geeks with permission by Emmanouil Gkatziouras, partner at our JCG program. See the original article here: Apache Ignite and Spring on your Kubernetes Cluster Part 3: Testing the application
Opinions expressed by Java Code Geeks contributors are their own.