-
Notifications
You must be signed in to change notification settings - Fork 91
Add an overrideable way to name the load balancers so that multiple DSS can be deployed in one VPC #1188
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
base: master
Are you sure you want to change the base?
Conversation
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.
@StevenPG many thanks for this contribution.
You will find some comments inline.
Please request a new review once ready.
deploy/services/helm-charts/dss/templates/cockroachdb-loadbalancers.yaml
Show resolved
Hide resolved
38536f0
to
34d494b
Compare
Testing
with new variables
Updated values
|
34d494b
to
ee48780
Compare
…SS can be deployed in one VPC Set old values for new configurable vars to be default, moved documentation into schema file Update with the missing ordinal value and moved it to the front to avoid truncation issues
6e654ca
to
d8750be
Compare
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.
@StevenPG, thanks for the changes. Please find new comments inline.
@@ -12,7 +13,7 @@ metadata: | |||
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" | |||
{{- include (printf "%s-lb-crdb-annotations" $cloudProvider) | |||
(dict | |||
"name" (printf "%s-%s" "cockroach-db-external-node" ( $i | toString) ) | |||
"name" (printf "%s-%s" ( $i | toString) $cockroachDbLoadbalancerName | trunc 31) |
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.
Looks like the arguments have been inverted. May I kindly ask you to keep the name and index in the same order to ensure backward compatibility?
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.
In addition, after a second thought, it would be preferable that the helm chart fails if the name is too long instead of truncating it silently. Could you please remove the trunc
?
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.
Just to add a consideration @barroco having too long of a value actually fails quietly and can be difficult to ascertain.
For example. with too long of a value, the service still gets deployed to kubernetes
However, when you describe it, you do see the issue in the events that keeps the load balancer from being deployed. In AWS, you just won't see a LB be created.
This was the reason for the trunaction, and the name and index were re-ordered to decrease possible issues from the truncation.
I just wanted to clarify what you meant by "it would be preferable that the helm chart fails". If the successful publishing but failed deployment to AWS is still acceptable, then I can continue with the requested changes! Please let me know if that's the case.
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.
Thanks for the clarification. Indeed, that's not ideal if the helm installation do not fail and the problem is not immediately detectable. An alternative would be to enforce the max length in the values.schema.json definition with the field "maxLength".
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.
Added in 3341b21
@@ -35,6 +35,10 @@ | |||
"description": "Name of CockroachDB cluster", | |||
"type": "string" | |||
}, | |||
"cockroachDbLoadbalancerName": { | |||
"description": "In AWS, used to name the load balancer. This must be overridden to run multiple DSS instances in a single region.", |
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.
Since it is directly linked to the loadbalancer, I would suggest to move this information in loadbalancers.cockroachdbNodes
with the description: Optional and AWS only: Load balancer name of this Cockroach DB node. This must be overridden to run multiple DSS instances in a single region. (default:
cockroach-db-external-node-X where X is the index of this node)
@@ -155,6 +159,10 @@ | |||
"type": "string", | |||
"description": "Image of the DSS. Please note that the usage of the `latest` tag is discouraged to prevent accidental upgrades in case of restart. Example: `docker.io/interuss/dss:v0.15.0`. Official image releases: https://hub.docker.com/r/interuss/dss/tags" | |||
}, | |||
"gatewayId": { |
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.
Since it is directly linked to the load balancer definition, I would suggest to move this property to loadbalancers.dssGateway
with the description: Optional and AWS only: Load balancer name of the DSS Gateway. This must be overridden to run multiple DSS instances in a single region. (default:
cockroach-db-external-node-X where X is the index)
@@ -13,7 +14,7 @@ metadata: | |||
{{- include (printf "%s-ingress-dss-gateway-annotations" $cloudProvider) | |||
(merge . | |||
(dict | |||
"name" "dss-gateway-external" | |||
"name" ($gatewayId | trunc 63) |
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.
After a second thought, It would be preferable that the helm chart fails if the name is too long instead of truncating it silently. Could you please remove the trunc
?
…ent names to match for easier debugging
@@ -104,6 +104,11 @@ | |||
"description": "Load balancers configuration", | |||
"type": "object", | |||
"properties": { | |||
"cockroachDbLoadBalancerId": { |
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 was expecting it to be part of the object on line 111 as a property id
along the ip and the subnet.
@@ -12,21 +13,21 @@ metadata: | |||
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" | |||
{{- include (printf "%s-lb-crdb-annotations" $cloudProvider) | |||
(dict | |||
"name" (printf "%s-%s" "cockroach-db-external-node" ( $i | toString) ) | |||
"name" (printf "%s-%s" $cockroachDbLoadbalancerName ( $i | toString)) |
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.
Let's move the default value entirely. This would look something like that :
"name" (printf "%s-%s" $cockroachDbLoadbalancerName ( $i | toString)) | |
"name" ($lb.id | default (printf "cockroach-db-external-node-%s" ( $i | toString))) |
@@ -125,6 +130,11 @@ | |||
"dssGateway": { | |||
"type": "object", | |||
"properties": { | |||
"loadBalancerId": { | |||
"type": "string", | |||
"description": "Optional and AWS only: Load balancer name of the DSS Gateway. This must be overridden to run multiple DSS instances in a single region. (default: cockroach-db-external-node-X where X is the index)", |
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.
My apologies for the inaccurate proposal, here is a small correction:
"description": "Optional and AWS only: Load balancer name of the DSS Gateway. This must be overridden to run multiple DSS instances in a single region. (default: cockroach-db-external-node-X where X is the index)", | |
"description": "Optional and AWS only: Load balancer name of the DSS Gateway. This must be overridden to run multiple DSS instances in a single region. (default: dss-gateway-external)", |
I need to think a bit more about this. Could you please revert it for the moment ? Happy to review this in another PR. edit: The down side of doing this is that we would lose the mapping with the underlying cockroachdb pod in the statefulset. So the question would be, what is the most useful in terms of visibility: |
@StevenPG, just to be clear, my remark was only related to mirroring the resources name with the load balancer. The rest is valid. |
I will raise an issue to discuss. This is my proposed solution to the issue I've run into.
While deploying the DSS into an AWS VPC, the networking components are named in such a way that there can only be one running instance. Subsequent deployments result in 400 errors on the Service objects in Kubernetes with a "duplicate name" error.
This can be confusing for a developer, since the terraform is designed in such a way that two environments can be deployed.