Auditing in Kubernetes
As Kubernetes clusters runs different resources at desired scale. We need to have full control over the cluster with all lifecycle of events and audits which helps us to trace out the source. Also, it would be great to get notified when something abnormal happens in the cluster. Now let's look at the details we need from api-server when an event occurs. When to log? What to log? Stages in lifecyle of request in api-server: RequestReceived : This is when api-server received the request but request is not processed yet by the api-server. ResponseStarted : The response headers are sent out but the response body isn't sent out. This stage only occurs for long running requests like watch. ResponseComplete : The response is sent out and the request is completed. Panic : When ever a panic occurs while processing the request. Request flow in the api-server: Levels in logging the audits: None : don't log the requests. Metadata : Only metadata. (i.e. requesting user, timestamp, res...