<p>i created K8S cluster (unmanaged) in google cloud.
i added the following changes in the master:</p>

<p>--audit-dynamic-configuration --feature-gates=DynamicAuditing=true --runtime-config=auditregistration.k8s.io/v1alpha1=true</p>

<p>as written in :
<a href="https://kubernetes.io/docs/tasks/debug-application-cluster/audit/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/debug-application-cluster/audit/</a></p>

<p>and everything is working as expected.
but after restart these settings are not being saved.</p>

<p>anyone encounter this problem?</p>

inza
<p>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)</p>

<ol>
<li>Edit the following file: <code>/etc/kubernetes/manifests/kube-apiserver.yaml</code> and add these flags to the list of flags:</li>
</ol>

<pre><code>--audit-dynamic-configuration
--feature-gates=DynamicAuditing=true
--runtime-config=auditregistration.k8s.io/v1alpha1=true
</code></pre>

<p>Note that every change done to the kube-apiserver manifest causes the apiserver to restart.</p>

<ol start="2">
<li>Once it is up and running execute the following command to verify flags are all set and server is up and running: <code>ps -ef | grep kube-apiserver</code>. The output should contain the flags you applied.</li>
</ol>

<p>In case of issues, see the kube-apiserver logs placed at <code>/var/log/containers/</code> and search for files beginning with <code>kube-apiserver</code>.</p>
