Closed SpComb closed 6 years ago
With #502 the Pharos::Phase.new(master: ...)
is mostly irrelevant now, normally only the cluster_context['kubeconfig']
is used... except for Pharos::Addon#kube_client
, which relies on the @kube_client[host]
getting cached by the phases invoking it with a config.
The usages of Pharos::Kube.client
need some cleanup, it's rather misleading now.
This is still broken on 1.3.0-rc.2 if you first rm ~/.pharos/*
before running the pharos-cluster up
for the upgrade:
==> Upgrade master @ terom-pharos-master terom-xenial-test
...
[terom-pharos-master] Upgrading control plane ...
...
No such file or directory @ rb_sysopen - /root/.pharos/master.terom-pharos-dev.kontena.works
/usr/local/lib/ruby/2.4.0/psych.rb:472:in `initialize'
/usr/local/lib/ruby/2.4.0/psych.rb:472:in `open'
/usr/local/lib/ruby/2.4.0/psych.rb:472:in `load_file'
/usr/local/bundle/gems/k8s-client-0.3.2/lib/k8s/config.rb:81:in `load_file'
/app/lib/pharos/kube.rb:62:in `host_config'
/app/lib/pharos/kube.rb:48:in `client'
/app/lib/pharos/phase.rb:83:in `kube_client'
/app/lib/pharos/phases/upgrade_master.rb:53:in `create_dns_patch_thread'
/app/lib/pharos/phases/upgrade_master.rb:39:in `upgrade'
/app/lib/pharos/phases/upgrade_master.rb:23:in `call'
/app/lib/pharos/phase_manager.rb:92:in `block in apply'
/app/lib/pharos/phase_manager.rb:53:in `yield_phase_with_retry'
/app/lib/pharos/phase_manager.rb:44:in `block in run_serial'
/app/lib/pharos/phase_manager.rb:43:in `map'
/app/lib/pharos/phase_manager.rb:43:in `run_serial'
/app/lib/pharos/phase_manager.rb:73:in `run'
/app/lib/pharos/phase_manager.rb:89:in `apply'
/app/lib/pharos/cluster_manager.rb:120:in `apply_phase'
/app/lib/pharos/cluster_manager.rb:87:in `apply_phases'
/app/lib/pharos/up_command.rb:105:in `configure'
/app/lib/pharos/up_command.rb:44:in `block in execute'
/app/lib/pharos/up_command.rb:43:in `chdir'
/app/lib/pharos/up_command.rb:43:in `execute'
/usr/local/bundle/gems/clamp-1.2.1/lib/clamp/command.rb:63:in `run'
/usr/local/bundle/gems/clamp-1.2.1/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/local/bundle/gems/clamp-1.2.1/lib/clamp/command.rb:63:in `run'
/usr/local/bundle/gems/clamp-1.2.1/lib/clamp/command.rb:132:in `run'
/app/lib/pharos/root_command.rb:18:in `run'
bin/pharos-cluster:12:in `<main>'
The
UpgradeMaster
phase uses thekube_client
for thedns_patch_thread
: https://github.com/kontena/pharos-cluster/blob/master/lib/pharos/phases/upgrade_master.rb#L53This assumes that the
~/.pharos/*
kubeconfig for the master already exists prior to runningpharos-cluster up
, because theConfigureClient
phase that writes that file only runs after theUpgradeMaster
phase.The upgrade will fail if the
pharos-cluster up
command is run on a different host than what was used topharos-cluster up
the cluster before the upgrade.