Skip to content
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

DO NOT MERGE Consistently downcase the masterKubeConfig path #299

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jperville
Copy link
Collaborator

This PR is a short fix for a bug I encountered when trying to provision a node whose fqdn contains uppercase letters (eg.MY-OSE-SERVER.example.com).

The symptoms

The chef run failed with a broken origin-node service.
The interesting snippet was in the origin-node service logs :

May 21 12:19:15 MY-OSE-SERVER origin-node[32335]: I0521 12:19:15.969796   32335 start_node.go:309] Reading node configuration from /etc/origin/node/node-config.yaml
May 21 12:19:15 MY-OSE-SERVER origin-node[32335]: Invalid NodeConfig /etc/origin/node/node-config.yaml
May 21 12:19:15 MY-OSE-SERVER origin-node[32335]: masterKubeConfig: Invalid value: "/etc/origin/node/system:node:MY-OSE-SERVER.example.com.kubeconfig": could not read file: stat /etc/origin/node/system:node:MY-OSE-SERVER.example.com.kubeconfig: no such file or directory
May 21 12:19:15 MY-OSE-SERVER systemd[1]: origin-node.service: main process exited, code=exited, status=255/n/a

The investigation

Apparently, the cookbook downcases the path of the master kube config path when it creates it on the disk, but it does not downcase the path when referencing that file in /etc/origin/node/node-config.yaml.

The fix

The fix is just to downcase the masterKubeConfig entry in the template that is rendered into /etc/origin/node/node-config.yaml

Before this PR:

$ grep --color -ry system:node.*fqdn.*kubeconfig *
templates/default/openshift_node/node.yaml.v1.erb:masterKubeConfig: system:node:<%= node['fqdn'].downcase %>.kubeconfig
templates/default/node.yaml.erb:masterKubeConfig: system:node:<%= node['fqdn'] %>.kubeconfig

After this PR:

$ grep --color -ry system:node.*fqdn.*kubeconfig *
templates/default/openshift_node/node.yaml.v1.erb:masterKubeConfig: system:node:<%= node['fqdn'].downcase %>.kubeconfig
templates/default/node.yaml.erb:masterKubeConfig: system:node:<%= node['fqdn'].downcase %>.kubeconfig

@jperville
Copy link
Collaborator Author

Please do NOT merge, there are other broken behavior when the fqdn contains non downcase letters, for example origin-ndoe does not start because "Could not find an allocated subnet for node: MY-OSE-SERVER.example.com, Waiting..." ... I will force downcase fqdn and reinstall.

@jperville jperville changed the title Consistently downcase the masterKubeConfig path DO NOT MERGE Consistently downcase the masterKubeConfig path May 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant