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

more cleanup #10413

Merged
merged 9 commits into from
Jan 3, 2025
Merged

more cleanup #10413

merged 9 commits into from
Jan 3, 2025

Conversation

yuval-k
Copy link
Contributor

@yuval-k yuval-k commented Dec 22, 2024

bring in control plane to gateway
don't start gloo anymore.
use upstream go control plane
remove gloov1 objects from gateway (settings still remain)

Note : now that gloo doesn't start anymore we lose the gloo features that are not the control plane. these come to mind:

  • stats \ stats page. Gloo uses deprecated opencensus. so this is an opportunity to use otel instead. Stats should be served on their own port.
  • admin page (for snapshots, pprof, changing log level). I don't recommend using the go-utils admin page as it mixes stats and admin page. In addition i don't think admin page should be in an external dependency. it should be part of this project where it is easy to change.
  • leader election - we didn't have it before in gateway, but have it even less now. relevant for status writing.
  • webhook validation
  • snapshot history (not sure what this one is; might not be needed with the krt and xds snapshots available)
  • snapshot sanitizers (we can bring these back, though i'm not sure we need to with the changes to envoy over the years)

don't start gloo anymore.
use upstream go control plane
remove gloov1 objects from gateway (settings still remain)
…needs to propagate to the listener.

also need to make sure we don't override status of other gateway-api controllers
@lgadban
Copy link
Contributor

lgadban commented Dec 23, 2024

snapshot history (not sure what this one is; might not be needed with the krt and xds snapshots available)

provides GME-style snapshots for debugging etc but is dependent on the gloov1 apiSnapshot schema.
We should replace it with an equivalent solution that is backed by krt and/or xds snapshot (probably both, as we want to capture the input resources which feed krt)

restConfig *rest.Config,
uccBuilder krtcollections.UniquelyConnectedClientsBulider,
extraPlugins []extensionsplug.Plugin,
extraGwClasses []string, // TODO: we can remove this and replace with something that watches all GW classes with our controller name
Copy link
Contributor

Choose a reason for hiding this comment

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

+1

FWIW, I think the initial point of this was to allow extensions to provide classnames

Comment on lines 23 to 25
func NewControlPlane(ctx context.Context,
bindAddr net.Addr,
callbacks xdsserver.Callbacks) (envoycache.SnapshotCache, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

style nits: ctx on a new line, return signature on new line; same for NewControlPlaneWithListener

@@ -128,23 +146,18 @@ func StartGGv2WithConfig(ctx context.Context,
}, krt.WithName("GlooSettingsSingleton"))

logger.Info("creating reporter")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
logger.Info("creating reporter")

tiberiuac pushed a commit to openet/gloo that referenced this pull request Dec 30, 2024
@yuval-k yuval-k enabled auto-merge (squash) December 30, 2024 16:39
Copy link
Contributor

@lgadban lgadban left a comment

Choose a reason for hiding this comment

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

LGTM, good iteration on cleanup, will continue to be an ongoing process

tests are failing so can reapprove if larger changes are needed to get things passing

@yuval-k
Copy link
Contributor Author

yuval-k commented Dec 31, 2024

re failing tests:

  • regression gloo & (old) gateway fail because gloo no longer turned on.
  • the Kubernetes E2E will need to be fixed one by one, as they have both new gateway and old gloo test, so i figure that can be done in a follow-up.

@@ -1,4 +1,4 @@
package translator
package gatewaytranslator
Copy link
Contributor

Choose a reason for hiding this comment

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

can we name the package gateway (same as directory name) otherwise we will get confused when importing it

@@ -1,4 +1,4 @@
package translator_test
package gatewaytranslator_test
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment - gateway_test

@@ -1,4 +1,4 @@
package translator_test
package gatewaytranslator_test
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
package gatewaytranslator_test
package gateway_test

same comment

@@ -288,8 +289,8 @@ func (v *validator) validateProxiesAndExtensions(ctx context.Context, snapshot *

validatingK8sGateway := isK8sGatewayProxy(opts.Resource)
if validatingK8sGateway {
Copy link
Contributor

Choose a reason for hiding this comment

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

this logic seems wrong? why are we translating gloo edge proxies if it's a k8sgateway proxy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this code will get deleted anyway (its from ggv2 validation where a gateway is translated to a proxy); just didn't want to do this in this PR.

@@ -26,6 +26,10 @@ const (
)

func NewPlugin(ctx context.Context, commoncol *common.CommonCollections) extensionsplug.Plugin {
if !commoncol.InitialSettings.Spec.GetGloo().GetIstioOptions().GetEnableIntegration().GetValue() {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a comment here why we return empty plugin if istio integration is enabled?


import "github.com/solo-io/gloo/projects/gateway2/ir"

func (h *RoutesIndex) TEST() []ir.HttpRouteIR {
Copy link
Contributor

Choose a reason for hiding this comment

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

what is this file for, do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i can deleted that, i used it temporary for a test

@@ -33,20 +32,7 @@ func (s *ProxyTranslator) syncXds(
// TODO: me may need to copy this to not change krt cache.
// TODO: this is also may not be needed now that envoy has
// a default initial fetch timeout
snap.MakeConsistent()
s.xdsCache.SetSnapshot(proxyKey, snap)
// snap.MakeConsistent()
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to add this back later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think not, but we can discuss.
i think we can build the code such that, we no longer need sanitizers

return p.snap.Equal(in.snap)
// check that all the versions are the equal
for i, r := range p.snap.Resources {
if r.Version != in.snap.Resources[i].Version {
Copy link
Contributor

Choose a reason for hiding this comment

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

are the snapshot resources guaranteed to be sorted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, its an array where the index is the resource type.

Copy link
Contributor

@jenshu jenshu left a comment

Choose a reason for hiding this comment

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

i'm good with merging so we can iterate

@yuval-k yuval-k merged commit c3e1651 into main Jan 3, 2025
8 of 17 checks passed
@yuval-k yuval-k deleted the yuval-k/more-cleanup branch January 3, 2025 20:59
@jenshu jenshu mentioned this pull request Jan 9, 2025
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.

3 participants