Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdmissionWebhook fails on AWS EKS with custom CNI #899

Open
martin31821 opened this issue Aug 1, 2023 · 3 comments
Open

AdmissionWebhook fails on AWS EKS with custom CNI #899

martin31821 opened this issue Aug 1, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@martin31821
Copy link

Describe the bug

Error from server (InternalError): error when creating "emqx.yaml": Internal error occurred: failed calling webhook "mutating.apps.emqx.io": failed to call webhook: Post "https://emqx-operator-webhook-service.emqx-operator-system.svc:443/mutate-apps-emqx-io-v2beta1-emqx?timeout=10s": Address is not allowed

Background:
AWS EKS calls webhooks from the Control Plane, which in case of a CNI other than the default VPC CNI results in Pod IPs not reachable from the control plane.

To Reproduce

  1. AWS EKS Cluster
  2. Use Cilium as CNI
  3. Install EMQX Operator
  4. Create EMQX Instance
  5. Error Message as above.

Expected behavior

Expected the EMQX Cluster to be created

Anything else we need to know?:

Environment details::

  • Kubernetes version: 1.25.6 EKS
  • Cloud-provider/provisioner: EKS + Terraform
  • emqx-operator version: 2.2.0
  • Install method: Helm

Potential Fix:

It would be good to include a mode to enable HostNetwork for the controller-manager in order to allow the EKS control plane to reach the pod.

@martin31821 martin31821 added the bug Something isn't working label Aug 1, 2023
@Rory-Z
Copy link
Member

Rory-Z commented Aug 8, 2023

Sorry I don't know much about Cilium, Are you saying that if Cilium is used as the CNI, the Kubernetes mutating web hook cannot access the EMQX Operator Controller Pod ? If yes, so this CNI does not seem to meet the requirements of Kubernetes ?
Again, I don't know much about Cilium, so if I'm wrong, please let me know.

@martin31821
Copy link
Author

It's not a problem with cilium, the problem here is, that the operator (falsely) assumes that the kubernetes control plane is part of the K8s overlay network, which in the case of EKS + any custom CNI it isn't.

That being said, I'll open a PR that fixes the issue here by adding a switch for hostNetwork.

@Rory-Z
Copy link
Member

Rory-Z commented Aug 8, 2023

Great, looking forward your PR

@Rory-Z Rory-Z added enhancement New feature or request and removed bug Something isn't working labels Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants