kontena / pharos-cluster

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

Kontena-lens installation reports "Could not create Kontena Lens configuration" #824

Closed jakubknejzlik closed 5 years ago

jakubknejzlik commented 5 years ago

What happened:

when running pharos-cluster up ... the kontena-lens addon installation starts. CLI creates admin user and then fails. Repeating this process until it exits after few times.

Waiting for Kontena Lens to get up and running ...
    $ sudo curl -LkIs -o /dev/null -w "%{http_code}" -H "Host: lens.XXX.nip.io" http://localhost/
    200    ! 0
W, [2018-11-22T04:02:44.224868 #15264]  WARN -- K8s::Transport<https://51.15.130.161:6443>: GET /api/v1/namespaces/kontena-lens/configmaps/config => HTTP 404 Not Found in 0.049s
    $ sudo curl -iksL -X POST -d '{"clusterName":"novacloud","clusterUrl":"https://XXX:6443","adminPassword":"XXX"}' -H "Host: lens.XXX.nip.io" -H "Content-Type: application/json" http://localhost/api/cluster
    HTTP/1.1 308 Permanent Redirect
    Server: nginx/1.13.12
    Date: Thu, 22 Nov 2018 03:02:44 GMT
    Content-Type: text/html
    Content-Length: 188
    Connection: keep-alive
    Location: https://lens.212.47.249.12.nip.io/api/cluster

    HTTP/2 200
    server: nginx/1.13.12
    date: Thu, 22 Nov 2018 03:02:46 GMT
    content-type: application/json; charset=utf-8
    content-length: 2
    x-powered-by: Express
    etag: W/"2-vyGp6PvFo4RvsFtPoIWeCReyIC8"
    set-cookie: connect.sid=s%3AHdMZr1rdb5CKC8FJwPLVmcA395Wn5Zkc.KzGyW2vcsBFjg7Tc2wCpIimZPW0GNFXw%2BiJU11zXUis; Path=/; Expires=Fri, 22 Nov 2019 03:02:46 GMT; HttpOnly
    vary: Accept-Encoding
    strict-transport-security: max-age=15724800; includeSubDomains

    {}    ! 0
    Could not create Kontena Lens configuration
    retrying after 4 seconds
    $ sudo curl -iksL -X POST -d '{"clusterName":"XXX","clusterUrl":"https://XXX:6443","adminPassword":"6426e8df8518a4b4"}' -H "Host: lens.XXX.nip.io" -H "Content-Type: application/json" http://localhost/api/cluster
    HTTP/1.1 308 Permanent Redirect
    Server: nginx/1.13.12
    Date: Thu, 22 Nov 2018 03:02:50 GMT
    Content-Type: text/html
    Content-Length: 188
    Connection: keep-alive
    Location: https://lens.XXX.nip.io/api/cluster

    HTTP/2 403
    server: nginx/1.13.12
    date: Thu, 22 Nov 2018 03:02:51 GMT
    content-type: application/json; charset=utf-8
    content-length: 75
    x-powered-by: Express
    etag: W/"4b-1ZnzBZfSWKdl1/SG1vp5f+t/tds"
    set-cookie: connect.sid=s%3AU_Mt1tmgWizLUhsGRUjalE6d6kkf0sUd.%2Fkcgj7blUMtUVzCuYSiDg%2FbQ9jcCCVGmKhDSCitQ44s; Path=/; Expires=Fri, 22 Nov 2019 03:02:51 GMT; HttpOnly
    vary: Accept-Encoding
    strict-transport-security: max-age=15724800; includeSubDomains

    {"errors":[{"status":422,"id":"user","title":"Admin user already exists"}]}    ! 0
    Could not create Kontena Lens configuration
    retrying after 8 seconds

When I use the created admin user, the kontena-lens seems to work fine. But the script never ends successfuly

What you expected to happen:

Kontena-lens should be installed and user credentials should be print out in post_install

How to reproduce it (as minimally and precisely as possible):

I use plain installation on 1 master and 2 workers.

Anything else we need to know?: ...

Environment:

network:
  provider: weave
  pod_network_cidr: 172.31.0.0/16
  service_cidr: 172.32.0.0/16
  weave:
    trusted_subnets:
      - '10.133.0.0/16'
addons:
  ingress-nginx:
    enabled: true
  helm:
    enabled: true
  kontena-lens:
    enabled: true
jakolehm commented 5 years ago

Fixed in 2.0.2 (#808).