Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

translator: make edgelb pool name optional #4

Merged
merged 1 commit into from
Jan 10, 2019

Conversation

bmcustodio
Copy link
Contributor

This PR makes the kubernetes.dcos.io/edgelb-pool-name annotation optional. In case a value isn't provided, dklb computes the name of the target EdgeLB pool according to the following format:

<mke-cluster-name>--<namespace>--<name>

where <mke-cluster-name> is obtained from the MKE cluster's name by replacing all forward slashes with --. This means that, for example, if the MKE cluster's name is dev/kubernetes01, the EdgeLB pool for the my-svc service in the my-namespace namespace will be

dev--kubernetes01--my-namespace--my-svc

The -- separator is not ideal, but it is pretty much the only option we have given the limitations on the name of an EdgeLB Pool:

# dcos edgelb create pool.json
{
  "code": 400,
  "message": "pool.name: foo:bar invalid: did not match ^[a-z0-9]([a-z0-9-]*[a-z0-9])?$"
}
dcos-edgelb: error: [POST /v2/pools][400] V2CreatePool default  &{Code:400 Message:pool.name: foo:bar invalid: did not match ^[a-z0-9]([a-z0-9-]*[a-z0-9])?$}, try --help

@bmcustodio bmcustodio added the enhancement Improvement to existing feature label Jan 10, 2019
@bmcustodio bmcustodio self-assigned this Jan 10, 2019
@bmcustodio bmcustodio force-pushed the bcustodio/optional-edgelb-pool-name branch from b3fcf93 to bf88ca1 Compare January 10, 2019 11:04
@bmcustodio bmcustodio requested a review from pires January 10, 2019 11:04
Copy link
Contributor

@pires pires left a comment

Choose a reason for hiding this comment

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

LGTM

@pires pires merged commit a54f0ee into master Jan 10, 2019
@pires pires deleted the bcustodio/optional-edgelb-pool-name branch January 10, 2019 11:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Improvement to existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants