How to deploy workload to GCP Kubernetes Programatically?

11/18/2018

I have achieved vast amount of automation in terms of creating projects, creating kubernetes engine and other IaaS elements, by using GCP APIs from Python GCP Client.

But I am not very positive on deploying docker container workloads to the provisioned cluster. The GCP documents point to kubectl apply -f config.yaml, but this entails using command line tools by first switching to project etc...

This is exactly what I am trying to get away from. Is there a google API that lets us accomplish this?

And no, I do not want third party deployment automation tools for various reasons.

-- Ace
google-kubernetes-engine
kubernetes

1 Answer

11/18/2018

You can use Kubernetes client library to deploy workload programatically.

Here is some client for kubernetes:

  1. Go client: client-go
  2. Java client: kubernetes-client/java
  3. Python client: kubernetes-client/python
-- Emruz Hossain
Source: StackOverflow