Webhook-Zeitlimit konfigurieren
Auf dieser Seite wird beschrieben, wie Sie das Webhook-Zeitlimit für Config Connector konfigurieren. Sie können diese Webhooks in Config Connector Version 1.110 und höher konfigurieren.
Zeitlimit für die Validierung von Webhooks konfigurieren
Sie können die folgenden Validierungs-Webhooks konfigurieren:
deny-immutable-field-updates.cnrm.cloud.google.comdeny-unknown-fields.cnrm.cloud.google.comiam-validation.cnrm.cloud.google.comresource-validation.cnrm.cloud.google.comabandon-on-uninstall.cnrm.cloud.google.com
Sie können beispielsweise das Zeitlimit für die Validierung von Webhooks deny-immutable-field-updates.cnrm.cloud.google.com und deny-unknown-fields.cnrm.cloud.google.com konfigurieren, indem Sie die folgende Beispiel-YAML-Datei erstellen und anwenden. Diese Webhooks sind Teil der Konfiguration des validating-webhook.cnrm.cloud.google.com-Validierungs-Webhooks.
Erstellen Sie eine Datei mit dem Namen
configure-validating-webhook-timeout.yamlund kopieren Sie die folgende YAML-Datei hinein:apiVersion: customize.core.cnrm.cloud.google.com/v1beta1 kind: ValidatingWebhookConfigurationCustomization metadata: name: validating-webhook spec: webhooks: - name: deny-immutable-field-updates timeoutSeconds: 12 - name: deny-unknown-fields timeoutSeconds: 15Verwenden Sie
kubectl apply, um die Anpassung des Webhook-Timeouts auf Ihren Cluster anzuwenden:kubectl apply -f configure-validating-webhook-timeout.yaml
Prüfen Sie mit dem folgenden Befehl, ob die Konfiguration erfolgreich war:
kubectl get validatingwebhookconfigurationcustomizations validating-webhook -o jsonpath='{.status.healthy}{"\n"}'Das Feld
status.healthysollte auftruegesetzt sein.Prüfen Sie, ob das neue benutzerdefinierte Zeitlimit auf die Ziel-Webhooks angewendet wurde:
kubectl get validatingwebhookconfigurations validating-webhook.cnrm.cloud.google.com -o jsonpath='{.webhooks[?(@.name=="deny-immutable-field-updates.cnrm.cloud.google.com")].timeoutSeconds}{"\n"}'kubectl get validatingwebhookconfigurations validating-webhook.cnrm.cloud.google.com -o jsonpath='{.webhooks[?(@.name=="deny-unknown-fields.cnrm.cloud.google.com")].timeoutSeconds}{"\n"}'Das Anwenden der Anpassung kann einige Minuten dauern.
Zeitlimit für Mutating Webhooks konfigurieren
Sie können die folgenden Mutating Webhooks konfigurieren:
container-annotation-handler.cnrm.cloud.google.comgeneric-defaulter.cnrm.cloud.google.comiam-defaulter.cnrm.cloud.google.commanagement-conflict-annotation-defaulter.cnrm.cloud.google.com
Sie können beispielsweise das Zeitlimit des Mutating-Webhooks container-annotation-handler.cnrm.cloud.google.com konfigurieren, indem Sie die folgende Beispiel-YAML-Datei erstellen und anwenden. Der Webhook ist Teil der Konfiguration des mutating-webhook.cnrm.cloud.google.com MutatingWebhookConfiguration.
Erstellen Sie eine Datei mit dem Namen
configure-mutating-webhook-timeout.yamlund kopieren Sie die folgende YAML-Datei hinein:apiVersion: customize.core.cnrm.cloud.google.com/v1beta1 kind: MutatingWebhookConfigurationCustomization metadata: name: mutating-webhook spec: webhooks: - name: container-annotation-handler timeoutSeconds: 20Verwenden Sie
kubectl apply, um die Anpassung des Webhook-Timeouts auf Ihren Cluster anzuwenden:kubectl apply -f configure-mutating-webhook-timeout.yaml
Prüfen Sie mit dem folgenden Befehl, ob die Konfiguration erfolgreich war:
kubectl get mutatingwebhookconfigurationcustomizations mutating-webhook -o jsonpath='{.status.healthy}{"\n"}'Das Feld
status.healthysollte auftruegesetzt sein.Prüfen Sie, ob das neue benutzerdefinierte Zeitlimit auf die Ziel-Webhooks angewendet wurde:
kubectl get mutatingwebhookconfigurations mutating-webhook.cnrm.cloud.google.com -o jsonpath='{.webhooks[?(@.name=="container-annotation-handler.cnrm.cloud.google.com")].timeoutSeconds}{"\n"}'Das Anwenden der Anpassung kann einige Minuten dauern.