bored-area-23524
02/26/2024, 8:08 AM/usr/local/custom_script
. I found some (Rancher-) github issues related to a read only /usr fs, but they were related to the agent binary location itself and not the script to install the agent.
So, right now I am not sure if this is a bug, or if I am just not able to find the correct setting for this. oem service log:
Feb 22 15:26:53 test-1-controlplane-57f125f9-2b7w9 bash[1704]: 2024/02/22 15:26:53 Fetching user-data from datasource of type "waagent"
Feb 22 15:26:53 test-1-controlplane-57f125f9-2b7w9 bash[1704]: 2024/02/22 15:26:53 Attempting to read from "/var/lib/waagent/CustomData"
Feb 22 15:26:53 test-1-controlplane-57f125f9-2b7w9 bash[1704]: 2024/02/22 15:26:53 line 3: warning: unrecognized key "runcmd"
Feb 22 15:26:53 test-1-controlplane-57f125f9-2b7w9 bash[1704]: 2024/02/22 15:26:53 line 8: error: file cannot be written to a read-only filesystem
Feb 22 15:26:53 test-1-controlplane-57f125f9-2b7w9 bash[1704]: 2024/02/22 15:26:53 Set hostname to test-1-controlplane-57f125f9-2b7w9
Feb 22 15:26:53 test-1-controlplane-57f125f9-2b7w9 bash[1704]: 2024/02/22 15:26:53 Running part "cloud-config.yaml" (cloud-config)
Feb 22 15:26:53 test-1-controlplane-57f125f9-2b7w9 bash[1704]: 2024/02/22 15:26:53 Writing file to "/usr/local/custom_script/install.sh"
Feb 22 15:26:53 test-1-controlplane-57f125f9-2b7w9 bash[1704]: 2024/02/22 15:26:53 Failed to run part "cloud-config.yaml": error applying cloud-config: mkdir /usr/local/custom_script: read-only file system
If I run the script by hand (grabbing and unzipping it from the cloud-init at /var/lib/waagent/CustomData
) everything works fine and the node comes up in the rancher web interface as running after a while. I am also running the Rancher controlplane (the rancher webui, etc.) on a Flatcar Linux VM without any issues.
Now I'm searching for a way to either tell Rancher or Azure to save this file at /opt or some other writeable location. Is this possble? Am I looking in the wrong location? I could not really find answers to this in the Rancher or Azure docs.