How to create kubernetes objects by passing a yaml file like kubectl apply in golang

7/30/2019

I am creating a tool that will create kubernetes object using a yaml file. I am writing it in golang. The tool would like to achieve same behaviour as kubectl apply -f test.yaml

-- Know Nothing
client-go
kubectl
kubernetes

1 Answer

7/30/2019

Basically, the fastest is to use an existing library like the official go client.

In essence kubectl also uses client-go so you can also follow its source code as a guideline.

You can also use k8s which is another K8s go client.

-- Rico
Source: StackOverflow