Skip to content

DO NOT MERGE Consistently downcase the masterKubeConfig path#299

Open
jperville wants to merge 1 commit intoIshentRas:masterfrom
PerfectMemory:node-fqdn-downcased-kubeconfig
Open

DO NOT MERGE Consistently downcase the masterKubeConfig path#299
jperville wants to merge 1 commit intoIshentRas:masterfrom
PerfectMemory:node-fqdn-downcased-kubeconfig

Conversation

@jperville
Copy link
Copy Markdown
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 jperville requested review from IshentRas and ianmiell May 21, 2019 12:23
@jperville jperville added the bug label May 21, 2019
@jperville
Copy link
Copy Markdown
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