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

feat: support custom names for generated k8s resources #3537

Merged
merged 7 commits into from
Jun 7, 2024

Conversation

arkodg
Copy link
Contributor

@arkodg arkodg commented Jun 4, 2024

Relates to #3527

Relates to envoyproxy#3527

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
@arkodg arkodg requested a review from a team as a code owner June 4, 2024 22:45
Copy link

codecov bot commented Jun 4, 2024

Codecov Report

Attention: Patch coverage is 79.48718% with 8 lines in your changes missing coverage. Please review.

Project coverage is 68.18%. Comparing base (607d8bc) to head (767b10e).
Report is 7 commits behind head on main.

Files Patch % Lines
internal/gatewayapi/helpers.go 0.00% 4 Missing ⚠️
internal/provider/kubernetes/predicates.go 77.77% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3537      +/-   ##
==========================================
+ Coverage   68.16%   68.18%   +0.02%     
==========================================
  Files         167      168       +1     
  Lines       20370    20408      +38     
==========================================
+ Hits        13885    13915      +30     
- Misses       5485     5493       +8     
  Partials     1000     1000              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@arkodg arkodg requested a review from a team June 4, 2024 22:52
Copy link
Member

@cnvergence cnvergence left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably we would need to also change it in kubernetes provider

func infraName(gateway *gwapiv1.Gateway, merged bool) string {

@arkodg
Copy link
Contributor Author

arkodg commented Jun 5, 2024

hey @cnvergence can you elaborate why thats needed, the above diff is changing the value right before setting the resource name ?

@arkodg arkodg closed this Jun 5, 2024
@arkodg arkodg reopened this Jun 5, 2024
@arkodg
Copy link
Contributor Author

arkodg commented Jun 5, 2024

oh @cnvergence I see the issue now, we are fetching based on name and not labels 😢

key := types.NamespacedName{

&
key := types.NamespacedName{

cc @dprotaso this is the issue seen in knative-extensions/net-gateway-api#738

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Signed-off-by: Arko Dasgupta <arko@tetrate.io>
@arkodg arkodg requested review from cnvergence and a team June 6, 2024 00:16
Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Signed-off-by: Arko Dasgupta <arko@tetrate.io>
@@ -228,6 +228,15 @@ func GatewayClassOwnerLabel(name string) map[string]string {
return map[string]string{OwningGatewayClassLabel: name}
}

// OwnerLabels returns the owner labels based on the mergeGateways setting
func OwnerLabels(gateway *gwapiv1.Gateway, mergeGateways bool) map[string]string {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Copy link
Member

@cnvergence cnvergence left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@davem-git
Copy link

If this is addressed here, will it also fix when I rename the envoyDeployment:, the HPA envoyHpa? It no longer works it keeps the original generated name. There doesn't seem to be a way to patch that either

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
@arkodg
Copy link
Contributor Author

arkodg commented Jun 6, 2024

If this is addressed here, will it also fix when I rename the envoyDeployment:, the HPA envoyHpa? It no longer works it keeps the original generated name. There doesn't seem to be a way to patch that either

thanks for catching this ! ive fixed the deployment targetRef naming in hpa.
I havent changed the name on the hpa resource itself, that needs an API change, which can be handled in a future PR

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
zhaohuabing

This comment was marked as off-topic.

Copy link
Member

@zhaohuabing zhaohuabing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@arkodg arkodg merged commit 33fceb0 into envoyproxy:main Jun 7, 2024
23 checks passed
@arkodg arkodg deleted the dep-svc-name branch June 7, 2024 00:00
@davem-git
Copy link

On this same issue. I've renamed the deployment by patching the name, this causes the gateway to break. While the deployment with 3 replicas I get this error

  Last Transition Time:  2024-06-14T15:02:58Z
    Message:               The Gateway has been scheduled by Envoy Gateway
    Observed Generation:   1
    Reason:                Accepted
    Status:                True
    Type:                  Accepted
    Last Transition Time:  2024-06-14T15:03:07Z
    Message:               Deployment replicas unavailable
    Observed Generation:   1
    Reason:                NoResources
    Status:                False
    Type:                  Programmed

the gateway status is this

NAME            CLASS           ADDRESS         PROGRAMMED   AGE
acme-envoy   acme-envoy   IPADDRESS   False        4m19s

@arkodg
Copy link
Contributor Author

arkodg commented Jun 14, 2024

@davem-git can you raise a separate GH issue to highlight the issue you are facing

arkodg added a commit to arkodg/gateway that referenced this pull request Aug 21, 2024
* should have been part of envoyproxy#3537

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants