APIRule Conversion Webhook Not Working Because of Certificate Issue ​
Symptoms ​
There is an error related to the conversion webhook certificate when fetching or creating an
APIRuleresource, for example:bashError from server: conversion webhook for gateway.kyma-project.io/v1beta1, Kind=APIRule failed: Post "https://api-gateway-webhook-service.kyma-system.svc:9443/convert?timeout=30s": x509: certificate has expired or is not yet validThere is an error in the
api-gateway-controller-managerlogs with the message"Secret \"api-gateway-webhook-certificate\" not found", for example:bashERROR Reconciler error {"controller": "secret", "controllerGroup": "", "controllerKind": "Secret", "Secret": {"name":"api-gateway-webhook-certificate","namespace":"kyma-system"}, "namespace": "kyma-system", "name": "api-gateway-webhook-certificate", "reconcileID": "a808b99f-6db6-47f5-a82e-8176811238ac", "error": "Secret \"api-gateway-webhook-certificate\" not found"}
Cause ​
The Secret api-gateway-webhook-certificate was deleted, or the automatic certificate rotation did not work.
Solution ​
Restart api-gateway-controller-manager to recreate the Secret:
bash
kubectl rollout restart deployment -n kyma-system api-gateway-controller-manager