raspbernetes/k8s-cluster-installation

Initial Creation Fails

Closed this issue · 2 comments

Details

What steps did you take and what happened:

I'm creating a new k8s cluster on a clean set of raspberry pis (3 control plane, 18 workers)
Using Ubuntu 20.04

  1. I cloned the repo to my workstation pi
  2. Updated the inventories.ini based on the instructions here: https://raspbernetes.github.io/docs/installation
  3. One note, I could no longer find a "masters.yml". Likewise there are some syntactical differences. I will issue a pull request to fix those separately
  4. As stated in the guide, I ran the line:
env ANSIBLE_CONFIG=ansible/ansible.cfg ansible-playbook ansible/playbooks/all.yml
  1. I received the error below:
pi@mcp01:~/src/k8s-cluster-installation$ env ANSIBLE_CONFIG=ansible/ansible.cfg ansible-playbook ansible/playbooks/all.yml
[WARNING]: Unable to parse /home/pi/src/k8s-cluster-installation/ansible/inventory as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match
'all'
ERROR! this task 'ansible.builtin.command' has extra params, which is only allowed in the following modules: command, shell, import_tasks, import_role, set_fact, include_vars, script, win_shell, include_role, include, win_command, add_host, group_by, meta, include_tasks, raw

The error appears to be in '/home/pi/src/k8s-cluster-installation/ansible/roles/container-runtime/containerd/tasks/main.yml': line 57, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: 'containerd | generate default configuration file'
  ^ here

What did you expect to happen:

I expected the file to be able to read inventory.ini at the least and then maybe bomb out because there was no masters.yml.

Anything else you would like to add:

I'm pretty new to Ansible so this could totally be on my side. Apologies if it is - any guidance is welcome.

Additional Information:

Just in case here is the directory structure:

pi@mcp01:~/src/k8s-cluster-installation/ansible$ ls -al
total 44
drwxr-xr-x  8 pi users 4096 Aug 29 19:50 .
drwxr-xr-x  8 pi users 4096 Aug 29 19:04 ..
-rw-r--r--  1 pi users  422 Aug 29 19:04 ansible.cfg
drwxr-xr-x  2 pi users 4096 Aug 29 19:04 family_vars
drwxr-xr-x  2 pi users 4096 Aug 29 19:04 group_vars
drwxr-xr-x  2 pi users 4096 Aug 29 19:04 host_vars
-rw-r--r--  1 pi users 2227 Aug 29 19:50 inventory.ini
drwxr-xr-x  2 pi users 4096 Aug 29 19:04 library
drwxr-xr-x  2 pi users 4096 Aug 29 19:04 playbooks
-rw-r--r--  1 pi users  212 Aug 29 19:04 requirements.yml
drwxr-xr-x 12 pi users 4096 Aug 29 19:04 roles
rkage commented

The guide is a bit out of sync the template in the repo's inventory.ini

the format should look like this;

This section contains all your node definitions/hostnames/ip/ansible_user etc.

[all]
k8s-controlplane-01 hostname=k8s-controlplane-01 ansible_host=192.168.1.161 ansible_user=pi
k8s-controlplane-02 hostname=k8s-controlplane-02 ansible_host=192.168.1.162 ansible_user=pi
k8s-controlplane-03 hostname=k8s-controlplane-03 ansible_host=192.168.1.163 ansible_user=pi
k8s-node-01 hostname=k8s-node-01 ansible_host=192.168.1.171 ansible_user=pi
k8s-node-02 hostname=k8s-node-02 ansible_host=192.168.1.172 ansible_user=pi

References to your control plane nodes

[controlplane]
k8s-controlplane-01
k8s-controlplane-02
k8s-controlplane-03

The remaining nodes here

[nodes]
k8s-node-01
k8s-node-02

@rkage much obliged for the quick reply - figured it out - had to update ansible.cfg and set the inventory path to "inventory.ini". That got past the first error. I'll get a pull request for that (and will also get one done for the docs as I find mismatches).

I'll dig into the next error, but for now I'm going to close this issue.

ERROR! this task 'ansible.builtin.command' has extra params, which is only allowed in the following modules: command, include_tasks, include_vars, win_command, raw, include, script, import_role, meta, win_shell, add_host, shell, group_by, import_tasks, set_fact, include_role

The error appears to be in '/home/pi/src/k8s-cluster-installation/ansible/roles/container-runtime/containerd/tasks/main.yml': line 57, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: 'containerd | generate default configuration file'
  ^ here