i created K8S cluster (unmanaged) in google cloud. i added the following changes in the master:
--audit-dynamic-configuration --feature-gates=DynamicAuditing=true --runtime-config=auditregistration.k8s.io/v1alpha1=true
as written in : https://kubernetes.io/docs/tasks/debug-application-cluster/audit/
and everything is working as expected. but after restart these settings are not being saved.
anyone encounter this problem?
Assuming you are using kubeadm, this is how you apply flags to the apiserver (all of these changes should be done on the master node)
/etc/kubernetes/manifests/kube-apiserver.yaml
and add these flags to the list of flags:--audit-dynamic-configuration
--feature-gates=DynamicAuditing=true
--runtime-config=auditregistration.k8s.io/v1alpha1=true
Note that every change done to the kube-apiserver manifest causes the apiserver to restart.
ps -ef | grep kube-apiserver
. The output should contain the flags you applied.In case of issues, see the kube-apiserver logs placed at /var/log/containers/
and search for files beginning with kube-apiserver
.