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

How is the envoy gateway kubernetes service name defined? #2141

Closed
bholland-bh opened this issue Oct 31, 2023 · 15 comments
Closed

How is the envoy gateway kubernetes service name defined? #2141

bholland-bh opened this issue Oct 31, 2023 · 15 comments
Labels
kind/decision A record of a decision made by the community. kind/question Further information is requested stale

Comments

@bholland-bh
Copy link

I would like to be able to set a name for the generated envoy service, or at least make sure the name doesn't ever change.

➜ kubectl get service -n envoy-gateway-system
NAME                                     TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)               AGE
envoy-envoy-gateway-system-eg-656e766f   ClusterIP   172.20.249.184   <none>        80/TCP                27d
envoy-gateway                            ClusterIP   172.20.94.26     <none>        18000/TCP,18001/TCP   28d
envoy-gateway-metrics-service            ClusterIP   172.20.0.145     <none>        8443/TCP              28d

Here the name of my eg service, is envoy-envoy-gateway-system-eg-656e766f What components make up this service name? Will it always be the same value?

@cnvergence
Copy link
Member

hi @bholland-bh, currently it is generated by this function

func ExpectedResourceHashedName(name string) string {
hashedName := providerutils.GetHashedName(name, 48)
return fmt.Sprintf("%s-%s", config.EnvoyPrefix, hashedName)
}

It will be the same value, its format consists of a prefix(envoy), gateway namespace, gateway name, and 8 characters of the hashed name.

@zirain
Copy link
Member

zirain commented Nov 1, 2023

you'd better query by labels.

@Xunzhuo Xunzhuo added the kind/question Further information is requested label Nov 1, 2023
@bholland-bh
Copy link
Author

hi @bholland-bh, currently it is generated by this function

func ExpectedResourceHashedName(name string) string {
hashedName := providerutils.GetHashedName(name, 48)
return fmt.Sprintf("%s-%s", config.EnvoyPrefix, hashedName)
}

It will be the same value, its format consists of a prefix(envoy), gateway namespace, gateway name, and 8 characters of the hashed name.

Thank you so much for the direct link.

you'd better query by labels.

Due to requirements beyond my control, I've got to tuck Envoy Gateway behind EKS ALB ingress. Which uses service names as the destination.

I'm interacting with the resources via labels, but the ALB uses service names

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    alb.ingress.kubernetes.io/backend-protocol: HTTP
    alb.ingress.kubernetes.io/certificate-arn: <arn>
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]'
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/ssl-redirect: '443'
    alb.ingress.kubernetes.io/success-codes: 200-499
    alb.ingress.kubernetes.io/tags: environment=dev,Name=eg-public,application=eg,client=shared
    alb.ingress.kubernetes.io/target-type: ip
    alb.ingress.kubernetes.io/waf-acl-id: <WAF>
    kubernetes.io/ingress.class: alb
  name: eg-ingress
  namespace: envoy-gateway-system
  labels:
    environment: dev
    team: blue
spec:
  defaultBackend:
    resource:
      kind: Service
      name: envoy-envoy-gateway-system-eg-656e766f

@arkodg
Copy link
Contributor

arkodg commented Nov 1, 2023

I think this is a valid use case
need someone from the community to brainstorm on the drawbacks of exposing this knob (only for service name) apart from naming collisions (which should fall on the user)

@arkodg arkodg added the kind/decision A record of a decision made by the community. label Nov 1, 2023
@mingshun
Copy link

mingshun commented Nov 8, 2023

I also want to put Envoy Gateway behind EKS ALB ingress. And I encounter the same problem. Is there any update here?

@arkodg
Copy link
Contributor

arkodg commented Nov 15, 2023

ptal @envoyproxy/gateway-maintainers
I'm a +1 on this, it makes it easier to author infra intent

@cnvergence
Copy link
Member

+1 even for multiple envoys per gateway deployments

Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days.

@github-actions github-actions bot added the stale label Dec 16, 2023
@quyenhoang96
Copy link
Contributor

+1

@github-actions github-actions bot removed the stale label Dec 16, 2023
Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days.

@github-actions github-actions bot added the stale label Jan 15, 2024
@arkodg
Copy link
Contributor

arkodg commented Mar 1, 2024

can be solved using the newly added patch field in #2716

apiVersion: http://gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
  name: custom-proxy-config
  namespace: envoy-gateway-system
spec:
  logging:
    level:
      default: warn
  provider:
    kubernetes:
      envoyService:
        patch:
          value:
            metadata:
              name: custom-name
        type: ClusterIP
    type: Kubernetes

@arkodg arkodg closed this as completed Mar 1, 2024
arkodg added a commit to arkodg/gateway that referenced this issue Jun 3, 2024
* Users prefer setting their own custom names for generated
k8s resources for the Envoy Proxy fleet instead of the autogenerated
resources
  * https://envoyproxy.slack.com/archives/C03E6NHLESV/p1717068088779319
  * knative-extensions/net-gateway-api#738
  * envoyproxy#2141

Signed-off-by: Arko Dasgupta <[email protected]>
zirain pushed a commit that referenced this issue Jun 4, 2024
* Users prefer setting their own custom names for generated
k8s resources for the Envoy Proxy fleet instead of the autogenerated
resources
  * https://envoyproxy.slack.com/archives/C03E6NHLESV/p1717068088779319
  * knative-extensions/net-gateway-api#738
  * #2141

Signed-off-by: Arko Dasgupta <[email protected]>
@davem-git
Copy link

When i specify a name, my gateway doesn't standup.

@arkodg
Copy link
Contributor

arkodg commented Jun 5, 2024

@davem-git can you elaborate on the issue you're facing ?

@davem-git
Copy link

davem-git commented Jun 5, 2024

Sure thing. I applied

apiVersion: http://gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
  name: custom-proxy-config
  namespace: envoy-gateway-system
spec:
  logging:
    level:
      default: warn
  provider:
    kubernetes:
      envoyService:
        patch:
          value:
            metadata:
              name: custom-name
        type: Loadbalancer
    type: Kubernetes

The service standup fine with the propername. When I go to deploy the gateway, it doesn't work
I get

❯ kubectl get gateway
NAME            CLASS           ADDRESS   PROGRAMMED   AGE
envoy             envoy                                 False                   3m52s

I revert the changes and it creates the standard loadblancer with the long name

❯ kubectl get gateway
NAME            CLASS           ADDRESS         PROGRAMMED   AGE
envoy             envoy             13.64.208.227   True         34m

@arkodg
Copy link
Contributor

arkodg commented Jun 5, 2024

ah yes, fixing this in #3537 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/decision A record of a decision made by the community. kind/question Further information is requested stale
Projects
None yet
Development

No branches or pull requests

8 participants