Diffing a local Kubernetes Yaml with Kubernetes yaml got the from api server

20 views
Skip to first unread message

Mayank

unread,
Aug 25, 2016, 12:46:22 AM8/25/16
to Kubernetes user discussion and Q&A
Hi I need a way to diff my local newly generated kubernetes deployment object with the currently deployed Kubernetes object .

The locally generated Kubernetes Deployment object doesnt specify a lot of the defaults and when i query Kubernetes object from the api server, those defaults are filled in. Is there a api/utility function available in kubernetes source code which can take my locally generated kubernetes deployment yaml/json and apply defaults to the missing configurations and then help it diff with the current kubenretes deployment object i get from the server. It seems this functionality might available in the kubectl apply, but we are not using kubectl apply but essentially using the unversioned go client to make api calls.

Any help is appreciated ?

-mayank

Timo Reimann

unread,
Aug 25, 2016, 1:57:32 AM8/25/16
to Kubernetes user discussion and Q&A
Hi,

I haven't tried it out myself yet but noted down that this little tool might be helpful in such situations: https://github.com/weaveworks/kubediff

HTH,

Timo

Mayank

unread,
Aug 27, 2016, 3:35:06 AM8/27/16
to Kubernetes user discussion and Q&A
Thanks Timo, thats a simple diff. What i am looking for is a way to know what defaults are missing from my spec, so that they can be filled before producing the diff. I am sure, the API Server is already doing this, i just need the same functionality in client. Does anyone know how the api server is doing this ?

-Mayank
Reply all
Reply to author
Forward
0 new messages