kapp
kapp copied to clipboard
Add `app-change describe` command to allow the user to view diffs for deployed changes
Describe the problem/challenge you have
As of today, kapp app-change list -a app_name lists the duration of changes deployed for an application and displays a summary of the operations performed. This feature could be extended to provide the user more insight by making the text diff for each change available.
Describe the solution you'd like
The config maps used to track app-changes can be used to store text diffs as well. And these can be exposed to the user through an app-change describe command.
The end result might be similar to this:
❯ kapp app-change list -a test ─╯
Target cluster 'https://127.0.0.1:57406' (nodes: minikube)
App changes
Name Started At Finished At Successful Description
test-change-vx7z5 2021-10-06T09:12:36Z 2021-10-06T09:12:36Z true update: Op: 1 create, 0 delete, 1 update, 0 noop / Wait to: 2 reconcile, 0 delete, 0 noop
test-change-hcwrt 2021-10-06T09:11:56Z 2021-10-06T09:11:56Z true update: Op: 2 create, 0 delete, 0 update, 0 noop / Wait to: 2 reconcile, 0 delete, 0 noop
2 app changes
Succeeded
❯ kapp app-change describe -a test --app-change test-change-vx7z5
@@ create configmap/config-1-ver-2 (v1) namespace: default @@
...
1, 1 data:
2 - foo1: bar
2 + foo: bar
3, 3 kind: ConfigMap
4, 4 metadata:
@@ update configmap/config-2 (v1) namespace: default @@
...
8, 8 kind: ConfigMap
9 - name: config-1-ver-1
9 + name: config-1-ver-2
10, 10 creationTimestamp: "2021-10-06T09:11:56Z"
11, 11 labels:
Acceptance Criteria
- [x] Text diffs for app changes should be serialised and stored in app-change config maps in addition to any other information that might add value.
- [x] Expose command
app-change describe app_change_namewhich presents the information for that particular change in an intuitive view. - [ ] Make a flag
--app-change-diffavailable, which can let the user to specify that they do not want to store the diff for a particular change.
Checks needed
- [x] Text diffs should be truncated if greater than 0.5 MB in size keeping in mind
etcdlimitations. - [ ] Consider special cases that might cause noisy diffs. (Like resources with
update-strategy: skip)
Anything else you would like to add:
This will provide much needed observability into changes being applied by kapp in scenarios where a kapp deploy is automatically triggered periodically or due to an action.
Vote on this request
This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.
👍 "I would like to see this addressed as soon as possible" 👎 "There are other more important things to focus on right now"
We are also happy to receive and review Pull Requests if you want to help working on this issue.
We should be allowing users to easily exclude text-diff for certain resources. This could be done by:
- An annotation like `kapp.k14s.io/ignore-app-change-diff.
- Allowing the user to specify conditions in
Config.
Does it make sense to have something like this in addition to --app-change-diff flag or should these be replacing it?