Replies: 5 comments 26 replies
-
Posting the diff of decrypted data(Kubernetes secrets) to GitHub or any other external system it’s a no-go IMO. |
Beta Was this translation helpful? Give feedback.
-
I think that diff functionality is a must for production use. For example, I've made a mistake in configuration files and flux completely deleted everything including itself with prune enabled. Of course I can disable pruning, but in this case I would need to do it for everything and it defeats the purpose. These mistakes can be prevented only by checking everything before applying... |
Beta Was this translation helpful? Give feedback.
-
kubectl will have support for hiding secrets in 1.22, see this PR. In most git flows, there is a production branch (most often named
I have not yet found an idea about how to report the output that I am really happy with. My only idea so far would be to add a URL field to specify a webhook to which the diff could then be posted. |
Beta Was this translation helpful? Give feedback.
-
In Flux 0.26 we've introduced the |
Beta Was this translation helpful? Give feedback.
-
The In my case, I am trying to do flux diffing within a github-action with a specific service account having only read-only access to all kubernetes objects within my cluster to limit risks. I was expecting flux to be able to do diff by reading only the current cluster objects but in fact it looks like it need more than that:
Maybe it is the awaited behaviour but I feel like the diff command shouldn't require more than the view roles within kubernetes to output something. |
Beta Was this translation helpful? Give feedback.
-
Usually, one really valuable step in your CI against a PR is to do a kubectl/helm diff to show users what would change in your cluster (minus secrets).
A great example of this is probably how Terraform Enterprise/Spacelift/Atlantis do this.
They will run a terraform plan and post the diff of the plan back to your PR as a comment and link through to the plan phase for you to inspect. This is really helpful when reviewing PRs, catching errors early on, and communicating the impact of your PRs. In the CiOps world, it is common for people to use helmfile to do a similar thing too.
Currently, you could probably hack this into your CI, reading a helmRelease/kustomize resource and trying to construct diff commands. This would end up devaluing one of the main benefits of gitops, not having k8s credentials in CI tasks. Additionally, it would also mean you have to try and replicate the same logic that the helm (merging values) and kustomize (sops secrets), and even source (repackaging helm values files) controllers carry out.
I am wondering if there is a way to implement this in flux2. Getting the source controller to create an artifact for a PR, letting the controllers do the diff, send a notification to a github pr, and store the diff output in a resource, cleaned up on PR close? Just an idea.
Really, I am wondering if this is on anyone else's radar, and If this could become a feature request?
Beta Was this translation helpful? Give feedback.
All reactions