rancher / elemental

Elemental is a software stack enabling centralized, full cloud-native OS management with Kubernetes.
https://elemental.docs.rancher.com/
Apache License 2.0
309 stars 39 forks source link

ELEMENTAL EXTENSION NOT ENABLED #832

Open MayankMil opened 1 year ago

MayankMil commented 1 year ago

What steps did you take and what happened: I have installed rancher 2.7.3 on docker in my linux mint virtual machine and wants to install elemental from extension tab but on extension page it is showing that helm charts not found unable to enable extension.

What did you expect to happen: I expect that extension is enabled inside rancher.

Anything else you would like to add: Rancher Version 2.7.3 Here attached Screenshot For the same MicrosoftTeams-image

Environment:

kkaempf commented 1 year ago

You're probably missing elemental-operator

Please follow our quick start guide

agracey commented 1 year ago

You need to enable the extensions capability in the Rancher configuration: https://ranchermanager.docs.rancher.com/integrations-in-rancher/rancher-extensions

If the helm repo didn't get set up for some reason, here is what should be added:

image
navin772 commented 1 year ago

@agracey can you explain how to enable Rancher extensions and from where? When I go to Configuration -> Extensions from the Rancher side menu, 'Enable' button is not found. I tried adding the ui-plugin-charts repository in one of the clusters but the Rancher extensions page keeps saying "Extension support is not available". I have installed rancher v2.7.3 via docker method. image

kkaempf commented 1 year ago

@navin772 have you followed http://elemental.docs.rancher.com/quickstart-ui exactly ?

navin772 commented 1 year ago

@kkaempf I tried the helm command for installing elemental-operator and it throws the error as in https://github.com/rancher/elemental-operator/issues/414. Upon checking this issue it seems like elemental cannot work with rancher installed via docker (how can someone install elemental and rancher in the same cluster when rancher is working as a docker container). Can you confirm if this is the case?

agracey commented 1 year ago

I'm not sure how Rancher works in the docker only install but that's not typically a supported configuration and is meant to only be used for development of Rancher itself.

K3d might be a better starting place but you will likely need to specify port forwards. I don't think we've tested Elemental running on k3d so you might be a bit on your own.

davidcassany commented 1 year ago

Upon checking this issue it seems like elemental cannot work with rancher installed via docker (how can someone install elemental and rancher in the same cluster when rancher is working as a docker container). Can you confirm if this is the case?

Hi @navin772 , I use rancher on docker with elemental on daily basis, this is my setup for development (development or testing purposes only). Let me share the rough ugly script I use to deploy rancher:

#!/bin/bash -x

set -e

: ${RANCHER_VERSION=v2.7.2}

id=$(docker run --rm \
    -v $(pwd)/rancher-data:/var/lib/rancher \
    -v /usr/share/pki/trust/anchors:/usr/share/pki/trust/anchors \
    -v /usr/share/pki/trust/anchors:/container/certs \
    -e SSL_CERT_DIR="/container/certs" \
    -d -p 80:80 -p 443:443 -p 6443:6443 --privileged "rancher/rancher:${RANCHER_VERSION}")

# If there is already previous k3s data assume it reuses a previous deployment
if [ ! -e "$(pwd)/rancher-data/k3s" ]; then

  # Give sometime to bootstrap
  sleep 90

  # For convenience keep default password to a file
  docker logs ${id}  2>&1 | grep "Bootstrap Password:" > inital-passwd
else
  sleep 60
fi

You might have to tweak few values to get it working in your env. Note this script stores the k3s data into $(pwd)/rancher-data, this way it is possible to stop the docker container and resume again (I never do that though, it tends to be tricky, it is a brute force approach). With such a rancher deployment I can follow the quick start guide of Elemental. For command line usage I download the ~/.kube/config file for the local cluster from the UI.

Let me know if you succeed with this approach.

navin772 commented 1 year ago

Thanks @davidcassany for the script, I will try it out and let you know if it works or not.

    -v /usr/share/pki/trust/anchors:/usr/share/pki/trust/anchors \
    -v /usr/share/pki/trust/anchors:/container/certs \
    -e SSL_CERT_DIR="/container/certs" \

Can you explain me what does these 3 lines do? How do I modify them? I generally use Rancher-generated Certificates.

davidcassany commented 1 year ago

I am not sure you actually needs those, I say you don't. I did that several months ago and never looked back, since it is good enough for my daily development needs. I mean, I do not really remember why I had add these lines. In any case by looking at them I'd say this where included just to share my host certificates with the rancher environment, one for rancher itself others for the container environment. I docker exec on a shell of my docker deployment on regular basis so I presume I needed the certs to be in the system for commands like wget.

navin772 commented 1 year ago

@davidcassany @agracey I think there is a problem in enabling extension support if we are upgrading Rancher to v2.7.x from a previous version including the backup as mentioned in upgrade-docker-installed-rancher. When I used the above method I couldn't enable extension support in v2.7.3 (there was no 'Enable' button). But when I started a new Rancher container (with v2.7.3) without any backup I was able to enable the extensions support and thus install elemental and create elemental clusters.

kkaempf commented 1 year ago

@aalves08 👆🏻

aalves08 commented 1 year ago

Interesting. I use Rancher on docker and I've never done an upgrade (but it's only for dev purposes my env).

Out of curiosity, from which version did you upgrade from @navin772 ?

navin772 commented 1 year ago

Hi @aalves08, I upgraded from v2.6.5

aalves08 commented 1 year ago

@navin772 so, you might be missing the ui-plugin-operator chart. Can you go to your local cluster -> apps -> repositories and add this git repo there? Then, on the the repos list, hit the refresh action a couple of times of the repo you added. Afterwards navigate to the Extensions screen and see if it catches the repository (you should a different message on that "welcome" screen)

Screenshot 2023-07-07 at 14 23 27 Screenshot 2023-07-07 at 14 23 41