You can switch the cluster/configuration context using the following command:
[desk@cli] $kubectl config use-context test-account
Task:Enable audit logs in the cluster.
To do so, enable the log backend, and ensure that:
1. logs are stored at/var/log/Kubernetes/logs.txt
2. log files are retained for5days
3. at maximum, a number of10old audit log files are retained
A basic policy is provided at/etc/Kubernetes/logpolicy/audit-policy.yaml. It only specifies what not to log.
Note: The base policy is located on the cluster's master node.
Edit and extend the basic policy to log:
1.Nodeschanges atRequestResponselevel
2. The request body ofpersistentvolumeschanges in the namespacefrontend
3.ConfigMapandSecretchanges in all namespaces at theMetadatalevel
Also, add a catch-all rule to log all other requests at theMetadatalevel
Note:Don't forget to apply the modified policy.
Currently there are no comments in this discussion, be the first to comment!