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

fix(kuma-cp) Ingress improvements #840

Merged
merged 3 commits into from
Jun 19, 2020
Merged

Conversation

jakubdyszkiewicz
Copy link
Contributor

Summary

While testing and working with Ingress I found a couple of small problems

  • XDS Snapshot was not stable. We rely on proto.Equal to send snapshot to Envoy if anything changes. This resulted in sending "the same" Envoy config to Ingress with almost every reconciliation loop (1s by default) even without changes. Snapshot was not stable for two reasons
  1. CDS/EDS was not sorted
  2. TcpProxy is marshaled by MarshalAny and put into TypedConfig (protobuffs inside protobuffs). MarshalAny When having many lb.tags in MetadataMatch is not marshaled deterministically. It turned out it can be marshaled deterministically with special settings. I created util for it.
  • TLS Inspector was deprecated. I switched to a recent version (there is no constant proper in go-control-plane yet). I had to add Empty in TypedConfig so our tests pass.
  • Permutations were sometimes duplicated which resulted in same filter chain match which results in invalid config.
  • I split Ingress generation method to many generateXDS methods following the example of the outbound proxy generator.

Documentation

Internal stuff only. Nothing to document.

@jakubdyszkiewicz jakubdyszkiewicz requested a review from a team June 18, 2020 17:14
Copy link
Contributor

@nickolaev nickolaev left a comment

Choose a reason for hiding this comment

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

Looks good.

return nil, err
}
return &any.Any{TypeUrl: googleApis + proto.MessageName(pb), Value: buffer.Bytes()}, nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe #839 should benefit from this one too. @lobkovilya

tags := map[string]string{
"service": "backend",
"version": "v1",
"cloud": "aws",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we increase the number of tags to have higher chances to get a difference (eventually)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem was very visible with 100 iterations with those 3 of tags.

Copy link
Contributor

@lobkovilya lobkovilya left a comment

Choose a reason for hiding this comment

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

That's all my findings :) Looks good!

const googleApis = "type.googleapis.com/"

// When saving Snapshot in SnapshotCache we generate version based on proto.Equal()
// Therefore we need deterministic way of marshaling Any which is part of the Protobuff on which we execute Equal()
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: Protobuff -> Protobuf

const googleApis = "type.googleapis.com/"

// When saving Snapshot in SnapshotCache we generate version based on proto.Equal()
// Therefore we need deterministic way of marshaling Any which is part of the Protobuff on which we execute Equal()
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: marshaling -> marshalling

@jakubdyszkiewicz jakubdyszkiewicz merged commit 4a427aa into master Jun 19, 2020
@jakubdyszkiewicz jakubdyszkiewicz deleted the feat/ingress-improvements branch October 15, 2020 11:54
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.

None yet

3 participants