-
Notifications
You must be signed in to change notification settings - Fork 336
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(*) add Zone resource to register Remotes to Global #895
Conversation
Signed-off-by: Nikolay Nikolaev <[email protected]>
Signed-off-by: Nikolay Nikolaev <[email protected]>
Signed-off-by: Nikolay Nikolaev <[email protected]>
Signed-off-by: Nikolay Nikolaev <[email protected]>
Signed-off-by: Nikolay Nikolaev <[email protected]>
Signed-off-by: Nikolay Nikolaev <[email protected]>
Signed-off-by: Nikolay Nikolaev <[email protected]>
Signed-off-by: Nikolay Nikolaev <[email protected]>
Signed-off-by: Nikolay Nikolaev <[email protected]>
Signed-off-by: Nikolay Nikolaev <[email protected]>
Signed-off-by: Nikolay Nikolaev <[email protected]>
Signed-off-by: Nikolay Nikolaev <[email protected]>
Signed-off-by: Nikolay Nikolaev <[email protected]>
Signed-off-by: Nikolay Nikolaev <[email protected]>
Signed-off-by: Nikolay Nikolaev <[email protected]>
Signed-off-by: Nikolay Nikolaev <[email protected]>
… with delay Signed-off-by: Nikolay Nikolaev <[email protected]>
app/kumactl/cmd/get/get_zone.go
Outdated
if store.IsResourceNotFound(err) { | ||
return errors.Errorf("No resources found in %s mesh", currentMesh) | ||
} | ||
return errors.Wrapf(err, "failed to get mesh %s", currentMesh) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably meant failed to get zone
?
api/system/v1alpha1/zone.proto
Outdated
// Configure the Remote Control Plane | ||
message RemoteControlPlane { | ||
// The public load balancer address of the Remote Control Plane KDS | ||
string publicAddress = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it clear that the address should be "public"? Maybe just "address" is enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, that was the name we agreed in the spec. I don't have any particular attachment to publicAddress
, so we can go either way. @jakubdyszkiewicz what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like just address
@@ -0,0 +1,82 @@ | |||
package system |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that we don't have validators for system
API, but every entity in mesh
API has it. I think it is useful to have zone_validator.go
and check that all IP addresses have correct format
pkg/kds/global/components_test.go
Outdated
PublicAddress: "grpc://192.168.0.1", | ||
}, | ||
Ingress: &system_proto.Zone_Ingress{ | ||
PublicAddress: "192.168.0.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the test, so not really important, but this is an argument for validation. Ingress address should look like host:port
|
||
return []string{ | ||
zone.GetMeta().GetName(), // NAME | ||
table.TimeSince(zone.GetMeta().GetModificationTime(), rootTime), // AGE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we print remoteCP and ingress address?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remote CP will be removed in the next PR. Adding the Ingress address only.
api/system/v1alpha1/zone.proto
Outdated
// Configure the Remote Control Plane | ||
message RemoteControlPlane { | ||
// The public load balancer address of the Remote Control Plane KDS | ||
string publicAddress = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like just address
@@ -13,7 +13,7 @@ import ( | |||
. "github.com/kumahq/kuma/test/framework" | |||
) | |||
|
|||
var _ = Describe("Test Kubernetes/Universal deployment", func() { | |||
var _ = XDescribe("Test Kubernetes/Universal deployment", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why X
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one will break, we need the bi-directional KDS to make this work.
Simply - put, Universal is run from memory so resources do not persist during restarts, and we have no way to use the Zone resources unless we restart (which will erase the resource from memory)
@@ -13,7 +14,7 @@ import ( | |||
. "github.com/kumahq/kuma/test/framework" | |||
) | |||
|
|||
var _ = Describe("Test Universal deployment", func() { | |||
var _ = XDescribe("Test Universal deployment", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why X
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my response for the other one.
Signed-off-by: Nikolay Nikolaev <[email protected]>
One more thing to be aware of. This resource seems to be bound to default mesh. When default mesh is deleted it will be deleted. We cannot create it without default Mesh. But let's keep it this way for now. I think we might get a more clear picture when joining the Admin server with the API Server and introducing RBAC. |
@jakubdyszkiewicz completely agree. Having a Zone resource belonging to a Mesh sounds wrong. I have not found a way to remove it. It is kind of hidden, because |
if err != nil { | ||
verr.AddViolation("address", "invalid address") | ||
} else { | ||
if host == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kuma validates resources in a way that it tries to find as many errors as possible. So we don't need else
here:
if host == "" {
verr.AddViolation("address", "host has to be explicitly specified")
}
if port == "" {
verr.AddViolation("address", "port has to be explicitly specified")
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, but then if there is an error, host
and port
will be empty for sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but I'm talking about if-branch where err == nil
# Conflicts: # app/kumactl/pkg/install/k8s/control-plane/templates_vfsdata.go
Signed-off-by: Nikolay Nikolaev <[email protected]>
Summary
Adding a
zone
resource.Full changelog
Issues resolved
Fix #XXX
Documentation