cloud-ark / cloud-ark/kubeplus

Tracking provenance of KubePlus actions on Application instances

Open
#1,450 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
756
Forks
95
Avg merge
1d 14h
Merged PRs (30d)
7

Description

As a manage service provider, I would like to know:
- what actions have been performed on an Application instance
- who has performed those actions
- when were the actions performed

One way to implement this will be to capture this information via the mutating-webhook component of KubePlus. The mutating-webhook intercepts all the incoming actions. So it provides natural place to implement this functionality. Where should this information be stored? One option is to store it inside the mutating webhook. A problem with this approach is we then have to build some functionality to expose this information for outside consumption. Also, for durability purpose, we will have to periodically save this information in some persistent storage. Another option is to save this information as an annotation on the application object itself. This will obviate the need for additional mechanism for external consumption of this information, and also for periodically saving it for durability. The main concern here will be the size of the object will increase overtime. A third option will be to create a "audit configmap" and store the information in the configmap. This option has the advantage that it does not make the application object itself bloated, and also gains from the underlying storage (etcd) available in the cluster. The name of the configmap can be saved as an annotation on the application instance.

We should go with the third option above. In order to make the audit information available to the users, we can implement the following kubectl plugin:

kubectl audit ``

This plugin will find out the config map from the provided instance. Then read the configmap and display the audit information available there.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the mutating-webhook component and the kubectl plugin entry point described in the issue. Define how an audit ConfigMap is named, linked from each Application instance, and updated with action, actor, and timestamp data. Done means kubectl audit can locate the ConfigMap and display the recorded actions without bloating the Application object.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
backend, cli, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.