Configura el tiempo de espera del webhook
En esta página, se describe cómo configurar el tiempo de espera del webhook para Config Connector. Puedes configurar estos webhooks en la versión 1.110 y posteriores de Config Connector.
Configura el tiempo de espera para validar webhooks
Puedes configurar los siguientes webhooks de validación:
deny-immutable-field-updates.cnrm.cloud.google.com
deny-unknown-fields.cnrm.cloud.google.com
iam-validation.cnrm.cloud.google.com
resource-validation.cnrm.cloud.google.com
abandon-on-uninstall.cnrm.cloud.google.com
Por ejemplo, puedes configurar el tiempo de espera de los webhooks de validación deny-immutable-field-updates.cnrm.cloud.google.com
y deny-unknown-fields.cnrm.cloud.google.com
creando y aplicando el siguiente archivo YAML de ejemplo. Estos webhooks son parte de la configuración del webhook de validación de validating-webhook.cnrm.cloud.google.com
.
Crea un archivo llamado
configure-validating-webhook-timeout.yaml
y copia el siguiente archivo YAML en él: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: 15
Usa
kubectl apply
para aplicar la personalización del tiempo de espera del webhook a tu clúster:kubectl apply -f configure-validating-webhook-timeout.yaml
Para verificar que la configuración se realizó correctamente, ejecuta el siguiente comando:
kubectl get validatingwebhookconfigurationcustomizations validating-webhook -o jsonpath='{.status.healthy}{"\n"}'
Debería mostrar el campo
status.healthy
configurado comotrue
.Verifica que el nuevo tiempo de espera personalizado se haya aplicado a los webhooks de destino:
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"}'
Aplicar la personalización puede tardar unos minutos.
Configura el tiempo de espera para los webhooks de mutación
Puedes configurar los siguientes webhooks de mutación:
container-annotation-handler.cnrm.cloud.google.com
generic-defaulter.cnrm.cloud.google.com
iam-defaulter.cnrm.cloud.google.com
management-conflict-annotation-defaulter.cnrm.cloud.google.com
Por ejemplo, puedes configurar el tiempo de espera del webhook de mutación container-annotation-handler.cnrm.cloud.google.com
creando y aplicando el siguiente archivo YAML de ejemplo. El webhook forma parte de la configuración del webhook de mutación de mutating-webhook.cnrm.cloud.google.com
.
Crea un archivo llamado
configure-mutating-webhook-timeout.yaml
y copia el siguiente archivo YAML en él:apiVersion: customize.core.cnrm.cloud.google.com/v1beta1 kind: MutatingWebhookConfigurationCustomization metadata: name: mutating-webhook spec: webhooks: - name: container-annotation-handler timeoutSeconds: 20
Usa
kubectl apply
para aplicar la personalización del tiempo de espera del webhook a tu clúster:kubectl apply -f configure-mutating-webhook-timeout.yaml
Para verificar que la configuración se realizó correctamente, ejecuta el siguiente comando:
kubectl get mutatingwebhookconfigurationcustomizations mutating-webhook -o jsonpath='{.status.healthy}{"\n"}'
Debería mostrar el campo
status.healthy
configurado comotrue
.Verifica que el nuevo tiempo de espera personalizado se haya aplicado a los webhooks de destino:
kubectl get mutatingwebhookconfigurations mutating-webhook.cnrm.cloud.google.com -o jsonpath='{.webhooks[?(@.name=="container-annotation-handler.cnrm.cloud.google.com")].timeoutSeconds}{"\n"}'
Aplicar la personalización puede tardar unos minutos.