Add condition for audit_webhook_mode batch (#7444)

According to the document[1], audit-webhook-batch-max-size and
audit-webhook-batch-max-wait are used only in the batch mode.
This adds a condition to avoid unnecessary writting on the config.

[1]: https://kubernetes.io/docs/tasks/debug-application-cluster/audit/#batching
This commit is contained in:
Kenichi Omichi 2021-04-08 07:52:56 -07:00 committed by GitHub
parent 6f2abbf79c
commit 5a351b4b00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -186,9 +186,11 @@ apiServer:
{% if kubernetes_audit_webhook %} {% if kubernetes_audit_webhook %}
audit-webhook-config-file: {{ audit_webhook_config_file }} audit-webhook-config-file: {{ audit_webhook_config_file }}
audit-webhook-mode: {{ audit_webhook_mode }} audit-webhook-mode: {{ audit_webhook_mode }}
{% if audit_webhook_mode == "batch" %}
audit-webhook-batch-max-size: "{{ audit_webhook_batch_max_size }}" audit-webhook-batch-max-size: "{{ audit_webhook_batch_max_size }}"
audit-webhook-batch-max-wait: "{{ audit_webhook_batch_max_wait }}" audit-webhook-batch-max-wait: "{{ audit_webhook_batch_max_wait }}"
{% endif %} {% endif %}
{% endif %}
{% for key in kube_kubeadm_apiserver_extra_args %} {% for key in kube_kubeadm_apiserver_extra_args %}
{{ key }}: "{{ kube_kubeadm_apiserver_extra_args[key] }}" {{ key }}: "{{ kube_kubeadm_apiserver_extra_args[key] }}"
{% endfor %} {% endfor %}