Max
Max

Reputation: 337

Kubernetes-client API to run and expose a docker image

I'm having trouble finding an easy way to automate the following kubectl command lines using Kubernetes-client Java API :

$ kubectl run foo --image=bar/baz:v1 --port 8080

$ kubectl expose deployment foo --type=LoadBalancer --port 80 --target-port 8080

The first one runs a docker image on port 8080 and the second one defines it as a load balancer and expose it to port 80.

Upvotes: 0

Views: 222

Answers (1)

Jordan Liggitt
Jordan Liggitt

Reputation: 18111

Adding -v=9 shows the API requests made by those commands

Upvotes: 1

Related Questions