I am looking for suggestions on Java API for Kubernetes that I can deploy docker image on kubernetes. My end goal is to be able to deploy docker image on kubernetes programmatically using Java. My current way to deploy the docker image is using the cmd kubectl create -f xxx.yaml
.
I have been googling, but I am unable to find much information for the Java API for this matter. It doesn't see that kubernetes client can handle this either. Appreciated with all the help.
Thanks in advance
Take a look at this Java Kubernetes Client SDK. May be this can help. Look at that entire repo for examples.
One tool in this space is the fabric8 Java client. You can use it to programmatically create and apply resources - https://github.com/fabric8io/kubernetes-client/blob/master/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/FullExample.java
Or to apply yaml from a file kubectl apply -f <spec.yaml> equivalent in fabric8 java api