-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
Hostname patch for vsphere provider limitations with juju #44780
Hostname patch for vsphere provider limitations with juju #44780
Conversation
MY_HOSTNAME=$(hostname) | ||
|
||
if [ "${MY_HOSTNAME}" == "ubuntuguest" ]; then | ||
echo "Detected broken vsphere integration. Applying hostname override" |
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.
Could we use juju-log
?
|
||
if [ "${MY_HOSTNAME}" == "ubuntuguest" ]; then | ||
echo "Detected broken vsphere integration. Applying hostname override" | ||
if [ -z "${JUJU_UNIT_NAME}" ]; then |
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.
We should do bash fallback instead of just exiting. For example
: ${JUJU_UNIT_NAME:=`uuidgen`}
At the top of the script will make sure that JUJU_UNIT_NAME exists or is assigned to a UUID
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.
Ok, We can certainly do that. +1
I think this is a good place to resolve this, in exec.d, just a few places to simplify logic |
2adc196
to
03bf672
Compare
This patch sets the hostname to a unique identifier (the juju unit name) during pre-deployment of the charm. This may not be a FQDN resolveable hostname but will prevent hostname collision.
03bf672
to
32acffc
Compare
@marcoceppi i took your suggestions wholesale and verified they work as intended. Ready for another pass on this one. |
@k8s-bot gce etcd3 e2e test this |
/assign @marcoceppi |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chuckbutler, marcoceppi
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue (batch tested with PRs 42486, 44780) |
What this PR does / why we need it:
The Juju VSphere provider doesn't set a unique hostname which causes issues when scaling worker-pools and they all have the hostname
ubuntuguest
. Instead we assign the JUJU_UNIT_NAME to that hostname to prevent the collision which allows the master to sort out that there are multiple units and not one attempting re-registration.Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes https://github.com/juju-solutions/bundle-canonical-kubernetes/issues/237Special notes for your reviewer:
The charm-pre-exec runs before it installs the charm software so the validation can happen quickly. Check hostname output, as well as kubectl get no post deployment.