envoyproxy / envoyproxy/gateway

Using raw manifests with kustomize: namespace `envoy-gateway-system` is hardcoded into the topology injector webhook causing a mismatch during patching by certgen install hook

Open
#8,354 5 comments 0 reactions 1 assignee Claimed by @stekole View on GitHub
stale triage
Dominant language
Go
Stars
3k
Forks
864
Avg merge
2d 2h
Merged PRs (30d)
140

Description

*Description*:
When using the raw manifests as Kustomize resources (with ArgoCD for instance),
the namespace of several resources is hardcoded with a suffix of 'envoy-gateway-system'. This causes problem during the installation because the cert-gen hook try to patch the webhook using a name derived from the namespace, which obviously does not work if you changed the namespace.

*Repro steps*:

Run `kustomize build .` in a directory with the following `kustomization.yaml`, and grep the result for '.envoy-gateway-system':
```yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: api-gateway

resources:
- https://github.com/envoyproxy/gateway/releases/download/v1.7.0/install.yaml
```

>**Note**: If there are privacy concerns, sanitize the data prior to
sharing.

*Environment*:
N/A

*Logs*:

This is from deploying with ARGOCD, in the eg-gateway-helm-certgen Job
```
2026-02-26T09:40:44.515Z INFO cmd/certgen.go:81 generated certificates
2026-02-26T09:40:44.539Z INFO cmd/certgen.go:125 [api-gateway/envoy-gateway api-gateway/envoy api-gateway/envoy-rate-limit api-gateway/envoy-oidc-hmac]: skipped creating secret since it already exists;Either update the secrets manually or set overwriteControlPlaneCerts in the EnvoyGateway config
Error: failed to patch webhook: failed to get mutating webhook configuration: mutatingwebhookconfigurations.admissionregistration.k8s.io "envoy-gateway-topology-injector.api-gateway" not found
Usage:
envoy-gateway certgen [flags]

Flags:
--config-home string Directory for certificates (defaults to ~/.config/envoy-gateway
--disable-topology-injector Disables patching caBundle for injector MutatingWebhookConfiguration.
-h, --help help for certgen
-l, --local Generate all the certificates locally.
-o, --overwrite Updates the secrets containing the control plane certs.

failed to patch webhook: failed to get mutating webhook configuration: mutatingwebhookconfigurations.admissionregistration.k8s.io "envoy-gateway-topology-injector.api-gateway" not found
```

working around this is somewhat easy enough (just patching the webhook name and target namespace), but it's probably worth mentioning.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.