-
FYI: This is probably more a feature request than a bug Expected BehaviorWhen installing longhorn on a cluster using helm and flux, the install works Current Behaviorhttps://forums.rancher.com/t/k8s-rancheros-longhorn/9919/2 the longhorn-manager pods throw the above error Steps to Reproduce
Context (variables)Operating system: macOS Hardware: n/a Variables Usedn/a
k3s_version: ""
ansible_user: NA
systemd_dir: ""
flannel_iface: ""
apiserver_endpoint: ""
k3s_token: "NA"
extra_server_args: ""
extra_agent_args: ""
kube_vip_tag_version: ""
metal_lb_speaker_tag_version: ""
metal_lb_controller_tag_version: ""
metal_lb_ip_range: "" Hosts
[master]
IP.ADDRESS.ONE
IP.ADDRESS.TWO
IP.ADDRESS.THREE
[node]
IP.ADDRESS.FOUR
IP.ADDRESS.FIVE
[k3s_cluster:children]
master
node Possible SolutionI went onto the hosts and ran I am thinking that it's probably a good idea to create a new variable that is a list of additional packages to install when provisioning the cluster, maybe as part of the prereq tasks? Should probably only be for worker nodes. Just want to make sure you think this belongs here before I bother thinking more deeply about this.
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
Hey, thanks! I am aware of this and yeah, this is required to run Longhorn. Unfortunately I don't want to add too many dependencies for things downstream (items you install after). You can see how this will get out of handle really quickly. Here are the 2 playbooks I have to install Longhorn dependencies:
---
- name: Install latest open-iscsi on all hosts
hosts: "*"
tasks:
- name: Install open-iscsi
apt:
name: open-iscsi
state: present
update_cache: true
become: true (optional if you are going to use nfs with Longhorn)
---
- name: Install latest nfs-common on all hosts
hosts: "*"
tasks:
- name: Install nfs-common
apt:
name: nfs-common
state: present
update_cache: true
become: true I hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Yeah, totally agree they definitely shouldn't be installed by default. I was more thinking along the lines of a task that just passes a variable to ansibles https://docs.ansible.com/ansible/latest/collections/ansible/builtin/package_module.html Side thought, whats |
Beta Was this translation helpful? Give feedback.
-
Sorry to bud in on this discussion. Just one question: does a general requirement exist to install additional node packages, or is it specifically related to Longhorn? If it's the latter, you can install the packages using the official helm charts available here: https://github.com/longhorn/longhorn/tree/master/deploy/prerequisite As an alternative to this proposal, we could add an empty (and then git-ignored) playbook, where the user can add additional steps. Or a playbook which copies all files (e.g. helm charts, HelmChart(Config) files, etc.) from a directory to the first master. Just an idea ;) |
Beta Was this translation helpful? Give feedback.
-
I just wanted to add some closing thoughts while this is still relatively fresh for anyone else that comes along. The premise @sleiner proposed of just having your own tasks is on the right track, however, it's not easily accomplishable with the current setup without some drawbacks to consider. The following options are assuming you make your changes on your own branch so that you can pull the latest changes from upstream and then rebase off of them. These options are: 1. Add your own playbook file similar to site.yml and reset.yml, and define your custom tasks therePros:
Cons:
2. Create your own role and add it to the main playbook / just add tasks to the main playbookPros:
Cons:
3. Create a PR to add a new task to the main playbook to include an "extra" tasks filePros:
Cons:
4. Implement #198Pros:
Cons:
5. Use the prerequisite charts @hdensity pointed out / create your own k3s resources to install dependencieshttps://github.com/longhorn/longhorn/tree/master/deploy/prerequisite I don't really view this as an option, ansible is meant for managing hosts and k3s is meant for managing applications. This is sort of a grey mix of the two, and while I don't like it, maybe you think differently. If I were willing to put in the work, option 4 is probably the best path, but for now, I'm probably going to go with option 1. Hope this helps 🙂 |
Beta Was this translation helpful? Give feedback.
I just wanted to add some closing thoughts while this is still relatively fresh for anyone else that comes along.
The premise @sleiner proposed of just having your own tasks is on the right track, however, it's not easily accomplishable with the current setup without some drawbacks to consider. The following options are assuming you make your changes on your own branch so that you can pull the latest changes from upstream and then rebase off of them. These options are:
1. Add your own playbook file similar to site.yml and reset.yml, and define your custom tasks there
Pros:
Cons: