Provisioning Scripts
Provisioning scripts can be used to override some of Rancher Desktop's internal processes. For example, scripts can be used to provide certain command line parameters to K3s, add additional mounts, increase ulimit value etc. This guide will explain how to set up your provisioning scripts for macOS, Linux, and Windows.
macOS & Linux​
On macOS and Linux, you can use lima override.yaml to write provisioning scripts.
- Run Rancher Desktop at least once to allow it to create the
_configdirectory.
note
Please note that the directory will be deleted during a factory-reset, so ensure a backup for your provisioning scripts in case you need them after a factory-reset.
- Create
override.yamlfile at below path
- macOS
- Linux
~/Library/Application\ Support/rancher-desktop/lima/_config/override.yaml
~/.local/share/rancher-desktop/lima/_config/override.yaml
- Write a provisioning script in the
override.yamlfile created in the previous step. For example, you can use the below script to increase ulimit for containers.
provision:
- mode: system
script: |
#!/bin/sh
cat <<'EOF' > /etc/security/limits.d/rancher-desktop.conf
* soft nofile 82920
* hard nofile 82920
EOF
- You can also use
override.yamlto override/modify a lima configuration setting, for example, to create additional mounts as shown below.
mounts:
- location: /some/path
writable: true
- Another example uses the
override.yamlfile to allow users to implement custom settings forK3senvironments using Rancher Desktop'sK3S_EXECsyntax (Similar to theK3ssyntaxINSTALL_K3S_EXEC). Please see the agent and server command line flags documentation for further installation options. Below is an example setting using the--tls-san valueflag to add additional hostnames as Subject Alternative Names on the TLS certification:
env:
K3S_EXEC: --tls-san value