-
Notifications
You must be signed in to change notification settings - Fork 396
[Question][Suggestion] How to provision k3os servers usual way? #314
Comments
@Moep90 wrote:
|
@dweomer thanks. I think I wasnt clear enough. |
@Moep90 from a thread in the rancher-users#k3os slack:
You shouldn't write to |
@dweomer I just talk about the My current situation/setup is the following:
...available to provide My Steps are:
How can I achive step 3 +4 with any kind of automation but without using |
@Moep90 in vSphere (and I believe VMware on a workstation) the
Keep in mind that the Packer builds are mostly contributed by the community and only reviewed/updated sporadically. That said, the vSphere template(s) are relatively recent and look to be in good order. I am not sure you need two different builds (one for server, one for agent) however and the server build should suffice for your use-case (with userdata via cdrom). This implies that you will likely want to have a server userdata ISO and an agent userdata ISO uploaded to vSphere. See: |
@dweomer thanks for you answer, I didnt know that. But this is way to manual/overhead. This is my current solution:
Ansible-Playbook mess: ---
- hosts: kcluster-master, kcluster-agent
serial: 1
gather_facts: no
vars_files:
- ../group_vars/all.yml
vars:
tasks:
- name: Template a file to /tmp/server.yaml
template:
src: ../templates/config_server.yaml.j2
dest: /tmp/server.yaml
run_once: true
delegate_to: localhost
- name: Template a file to /tmp/agent.yaml
template:
src: ../templates/config_agent.yaml.j2
dest: /tmp/agent.yaml
run_once: true
delegate_to: localhost
- debug:
msg:
- "{{ inventory_hostname }}"
- "{{ ansible_host }}"
- name: CLOUD-INIT | Master
local_action: "command scp /tmp/server.yaml rancher@{{ ansible_host }}:~/"
when: "'kcluster-master' in group_names"
- name: CLOUD-INIT | COPY to correct location
raw: cp /home/rancher/server.yaml /var/lib/rancher/k3os/config.yaml
when: "'kcluster-master' in group_names"
become: yes
- name: CLOUD-INIT | Agent
local_action: command scp /tmp/agent.yaml rancher@{{ ansible_host }}:~/
when: "'kcluster-agent' in group_names"
- name: CLOUD-INIT | COPY to correct location
raw: cp /home/rancher/agent.yaml /var/lib/rancher/k3os/config.yaml
when: "'kcluster-agent' in group_names"
become: yes
- name: REBOOT | TO ADD cloud-init
raw: reboot
become: yes |
As a heavy Ansible shop, we've tackled this problem in a rather different way. I don't know if it's broadly applicable, but I figured I'd throw it out there in case better minds than mine can put it to use. We're looking to spin up around sixty single-node, bare-metal clusters. Each one has it's own metadata specific to the use case, though they're functionally the same. We need to tweak some properties uniformly, like the enabled module list, and set some properties uniquely, like hostname and node labels. Fortunately, everything we need for bootstrapping is available via the I tossed together a simple API that accepts and stores a list of use-case specific configurations, one for each box. I then added a When we bootstrap a machine, all we have to do is point it to the For a small number of systems or a PoC, it's easy enough to walk through the live CD installer and just type the URL into the appropriate prompt. It takes under three minutes from boot to done. For larger numbers, it's probably worth tweaking the ISO / PXE booting / etc. to set Is this a dumb approach? Would anyone else find it useful? |
I'm in the same boat as @Moep90. It feels like a |
open-vm-tools is installed and |
@dweomer are there any plans to support any automation technology at all out of the box (ansible, puppet, chef, ...)? |
@Moep90 as of yet, not explicitly. the idea is that the |
@dweomer What about this idea: |
@ecowden I was thinking of a similar workflow, would it make sense to your use-case that the /pop endpoint be passed a unique identifier (mac address?) from the config downloader? |
@erkki Sure, you could get pretty fancy with this kind of setup. Have a full-featured config-vending API that stores and vends configs based on an identifier like a MAC address. All depends on the level of complexity you need or want for your use case. Good luck! |
@ecowden yes the reason I ask is that I'm pondering a pull-request to upstream to incorporate sending relevant local metadata (needs to be defined) up as parameters/headers (needs to be defined) of the config request. |
Just fyi for others looking for vmware support: not sure if this will be available here once it gets merged, but would seem logical |
@robertkaelin I am the one who made that PR in the hopes that it would eventually be used in K3OS. |
I saw several issues regarding usage of Ansible is not possible duo to lag of python etc. (which is fine duo to the claim of the project).
So I came up with a pretty ugly Ansible
raw
command hackaround...because I had no better idea.I would ask which possibilities you see to costumize the k3os after installation.
README.md
config.yaml
after the vm-template spun up to be either theserver
or theagent
token
environment
ortaints
ssh_pub_keys
?Are there any suggestions by @dweomer or the community?
The text was updated successfully, but these errors were encountered: