Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

k8s-handle diff support #121

Closed
sepich opened this issue Mar 19, 2020 · 1 comment · Fixed by #122
Closed

k8s-handle diff support #121

sepich opened this issue Mar 19, 2020 · 1 comment · Fixed by #122
Labels
enhancement New feature or request

Comments

@sepich
Copy link

sepich commented Mar 19, 2020

Hello,
How hard is to add kubectl diff functionality right into k8s-handle?
It is handy to have a test for Merge Request actually showing what would be changed in Cluster after all templates are rendered etc.
Right now we are using something like:

k8s-handle render -s section

kubectl config set-credentials user --token="$K8S_TOKEN"
kubectl config set-cluster cluster --server=https://k8s --insecure-skip-tls-verify=true
kubectl config set-context context --cluster=cluster --user=user
kubectl config use-context context

kubectl diff -n namespace -R -f /tmp/k8s-handle

While running steps in docker, this requires container with both k8s-handle and kubectl - which complicates stuff.
Advantage to have diff in python is that it's format would be easier to customize (drop unnecessary fields etc)

Another command where knowledge about objects in the Cluster could be useful is deploy.
Because for new users all these logs looks scary:
INFO:k8s_handle.k8s.provisioner:Deployment "prometheus" already exists, replace it
Why do you replace the object if it does not changed? For example kubectl apply shows if object was actually changed or not. Would be great to show diff on deploy too, or skip objects which has zero diff.

What do you think?

@rvadim rvadim added the enhancement New feature or request label Mar 20, 2020
@rvadim
Copy link
Collaborator

rvadim commented Mar 21, 2020

Hi, thank you for report.
It's currently unavailable due to kubernetes-client/python#1117

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants