Skip to content

flatcar, cannot finish deployment #12270

Open
@paulj2000ro

Description

@paulj2000ro

What happened?

Hi!
I have created three instances on GCE with flatcar stable channel (image name flatcar-stable-4152-2-2) and I have created a simple inventory file like this:

flatcar-container-linux-4-vm ansible_host=172.26.232.3
flatcar-container-linux-5-vm ansible_host=172.26.232.4
flatcar-container-linux-6-vm ansible_host=172.26.232.5
[kube_control_plane]
flatcar-container-linux-4-vm
flatcar-container-linux-5-vm
flatcar-container-linux-6-vm
[etcd]
flatcar-container-linux-4-vm
flatcar-container-linux-5-vm
flatcar-container-linux-6-vm
[kube_node]
flatcar-container-linux-4-vm
flatcar-container-linux-5-vm
flatcar-container-linux-6-vm

I also have some customizations in mycluster/group_vars/all/all.yml:

bin_dir: /opt/bin
ansible_python_interpreter: /opt/bin/python
resolvconf_mode: host_resolvconf
ansible_remote_tmp: /tmp/ansible-${USER}
override_system_hostname: false

I got errors at creating tmp directory but i could get past it by using become when deploying:

ansible-playbook -i /inventory/mycluster/inventory.ini --private-key /root/.ssh/id_rsa cluster.yml -u username -b

After playbook is stared it get errors at:

TASK [kubernetes/preinstall : Hosts | create hosts list from inventory] ********************************************************************************************************************************************************************************************************
ok: [pjurco-container-linux-4-vm -> localhost]
Thursday 29 May 2025 10:33:02 +0000 (0:00:00.380) 0:01:54.874 **********

TASK [kubernetes/preinstall : Hosts | populate inventory into hosts file] ******************************************************************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: OSError: [Errno 30] Read-only file system: b'/usr/share/gce/hosts'
fatal: [flatcar-container-linux-4-vm]: FAILED! => {"changed": false, "msg": "Could not write data to file (b'/usr/share/gce/hosts') from (b'/tmp/ansible-root/ansible-moduletmp-1748514784.8171709-dsvxp7lh/tmp97o27kst'): [Errno 30] Read-only file system: b'/usr/share/gce/hosts'"}
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: OSError: [Errno 30] Read-only file system: b'/usr/share/gce/hosts'
fatal: [flatcar-container-linux-5-vm]: FAILED! => {"changed": false, "msg": "Could not write data to file (b'/usr/share/gce/hosts') from (b'/tmp/ansible-root/ansible-moduletmp-1748514784.9854934-qd955gnz/tmp4679qk1q'): [Errno 30] Read-only file system: b'/usr/share/gce/hosts'"}
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: OSError: [Errno 30] Read-only file system: b'/usr/share/gce/hosts'
fatal: [flatcar-container-linux-6-vm]: FAILED! => {"changed": false, "msg": "Could not write data to file (b'/usr/share/gce/hosts') from (b'/tmp/ansible-root/ansible-moduletmp-1748514784.7516584-c4w59lic/tmplizj_mua'): [Errno 30] Read-only file system: b'/usr/share/gce/hosts'"}

I know /usr is RO, but, how to overcome this situation?
Thank you!

What did you expect to happen?

Succes in kubespray execution, full cluster functional.

How can we reproduce it (as minimally and precisely as possible)?

  • deploy 3 instances of flatcar-stable-4152-2-2 in GCE
  • create a simple inventory
  • create customizations in mycluster/group_vars/all/all.yml
  • run kubespray in docker:

docker run --rm -it --mount type=bind,source="$(pwd)"/inventory/sample,dst=/inventory
--mount type=bind,source="${HOME}"/.ssh/id_rsa,dst=/root/.ssh/id_rsa
quay.io/kubespray/kubespray:v2.28.0 bash

  • run ansible playbook:

ansible-playbook -i /inventory/mycluster/inventory.ini --private-key /root/.ssh/id_rsa cluster.yml -u user -b

OS

Flatcar Container Linux

Version of Ansible

ansible [core 2.16.14]
config file = /kubespray/ansible.cfg
configured module search path = ['/kubespray/library']
ansible python module location = /usr/local/lib/python3.10/dist-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.10.12 (main, Feb 4 2025, 14:57:36) [GCC 11.4.0] (/usr/bin/python3)
jinja version = 3.1.6
libyaml = True

Version of Python

Python 3.10.12

Version of Kubespray (commit)

docker image: quay.io/kubespray/kubespray:v2.28.0

Network plugin used

calico

Full inventory with variables

https://gist.github.com/paulj2000ro/f4e1202859f59f0585923e9907cd1e5f

Command used to invoke ansible

ansible-playbook -i /inventory/mycluster/inventory.ini --private-key /root/.ssh/id_rsa cluster.yml -u user -b

Output of ansible run

https://gist.github.com/paulj2000ro/32fef0e0d2217212315a0109734b847e

Anything else we need to know

thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions