NET-7179: Update MeshGateway to use new proto with workload selector#3465
NET-7179: Update MeshGateway to use new proto with workload selector#3465
Conversation
There was a problem hiding this comment.
Nice! You got through the hard part.
To update the CRD definitions, you can just run make ctrl-manifests from here and see the changes to the 2 ...meshgateways.yaml files. You should see the workload bits pop in after running that command.
The interesting thing is that we actually don't want the workload bits to appear in the CRD, so part of this work is figuring out how to make that happen. I suspect that we have 2 options:
- some kubebuilder annotation that tells the CRD generator to skip the field, or
- making our
MeshGatewayGo type a little more custom to omit the workload selector
1490933 to
429d817
Compare
2e045c8 to
3bf7e7d
Compare
| metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
|
||
| Spec pbmesh.MeshGateway `json:"spec,omitempty"` | ||
| Spec pbmesh.MeshGatewaySpec `json:"spec,omitempty"` |
There was a problem hiding this comment.
So we need to also include the WorkloadSelector on this type, so that we can send it in when we register to Consul. The tricky part is making sure this is not added to the CRD, even though it will be present here.
0b40357 to
a1efde0
Compare
There was a problem hiding this comment.
couple of nits on review, about to test it out.
for anyone not in the conversations outside of this PR, we've decided to include the workload selector in the CRD for now and come back to remove it later. This lets us spend our time in the most valuable place possible right now, which is getting TCP traffic working through mesh-gateway.
Co-authored-by: Nathan Coleman <nathan.coleman@hashicorp.com>
nathancoleman
left a comment
There was a problem hiding this comment.
- Confirmed that
MeshGatewayCRD created in consul-k8s includes the workload selector - Confirmed that
MeshGatewayresource created in consul includes the workload selector - Confirmed that the
ServiceEndpointsresource in consul for the mesh gateway still selects the correctWorkloads - Confirmed that the
protocolfield on the listeners is written all the way down
Changes proposed in this PR
How I've tested this PR
local install and uninstall of Consul
How I expect reviewers to test this PR
Checklist