kontena / pharos-cluster

Pharos - The Kubernetes Distribution
https://k8spharos.dev/
Apache License 2.0
311 stars 43 forks source link

Deploy k8s cluster fails with ctr: mkdir /opt/pharos/bin: no such file or directory\n" #1557

Closed raghavanv90 closed 3 years ago

raghavanv90 commented 3 years ago

When I try to deploy the k8s cluster it fails with a below error, Environment: VMs - Tried it on both versions - CentOS Linux release 7.4.1708 (Core) & CentOS Linux release 7.8.2003 (Core) pharos 3.2.1 chpharos 0.6.2

`ERROR: Pharos::PhaseManager::Error : Phase failed on 1 host:

[root@localhost ~]# cat cluster.yml hosts:

rwunderer commented 3 years ago

Same problem here on Debian 9. The strange thing is that neither pharos-cluster nor jakolehm/cfssl have been updated recently and it was working last week.

For the moment the workaround seems to be to manually run

sudo mkdir /opt/pharos

on the master(s)

Kerwood commented 3 years ago

I am experiencing the same issue on 3 newly installed CentOS 7.8 machines.

Below is the pharos up command in debug mode.

...
    10.6.70.11: + ctr -n pharos image pull docker.io/jakolehm/cfssl:0.1.1
    10.6.70.11: docker.io/jakolehm/cfssl:0.1.1: resolving      |--------------------------------------| 

     ## OUTPUT OMITTED ##

    10.6.70.11: docker.io/jakolehm/cfssl:0.1.1:                                                   resolved       |++++++++++++++++++++++++++++++++++++++| 

     ## OUTPUT OMITTED ##

    10.6.70.11: elapsed: 1.6 s                                                                    total:   0.0 B (0.0 B/s)                                         
    10.6.70.11: unpacking linux/amd64 sha256:060f8665eb7a898674ca59bd38366f04ffab7393efae6151534cb0603b2fb078...
    10.6.70.11: done
    10.6.70.11: + ctr -n pharos install --path /opt/pharos --replace docker.io/jakolehm/cfssl:0.1.1
    10.6.70.11: ctr: mkdir /opt/pharos/bin: no such file or directory
    10.6.70.11: ! 1
    [node01] Error: exec failed with code 1: configure-cfssl.sh
...

https://github.com/kontena/pharos-cluster/blob/master/lib/pharos/host/el7/scripts/configure-cfssl.sh

Maybe there's breaking changes to ctr? Maybe the --path option used to create the directory if it did not exist. But doesn't any more.

DESCRIPTION:

ctr is an unsupported debug and administrative client for interacting
with the containerd daemon. Because it is unsupported, the commands,
options, and operations are not guaranteed to be backward compatible or
stable from release to release of the containerd project.
Kerwood commented 3 years ago

I can confirm. ctr from v1.3.0 and up does not create the missing directory, if it does not exist. I created a pull request.

raghavanv90 commented 3 years ago

@rwunderer yeah workaround seems to solve the issue However observing other issue after manually creating "sudo mkdir /opt/pharos" - Opened https://github.com/kontena/pharos-cluster/issues/1559, are you facing the same?

jakolehm commented 3 years ago

Fixed in #1556

jberger commented 3 years ago

Following the directions on the site I hit this problem today still. Its seems like your fix has been applied, is there a new iteration of the same bug or have has it not reached the latest release/documentation?

jberger commented 3 years ago

Ok well I guess the problem is that it is fixed in pharos 3.2.2 and current is still 3.2.1 as of installing using chpharos today. Could that get pushed?