Edactl Toolbox Command script allows a user to leverage edactl
command that resides in the Toolbox pod as if it was installed locally for the purposes of creating/deleting/replacing and patching EDA resources.
As edactl
provides commands to create
, delete
, replace
and patch
resources from files, the script provides a way to apply leverage those commands against the files locally available on the user's machine. The undeniable benefit of edactl
is that it applies all resources in a single transaction, which not only ensures consistent application, but also allows you to dry run, rollback and preview changes before applying them.
Download the script and move it to your $PATH:
curl -o etc https://raw.githubusercontent.com/eda-labs/etc-script/refs/heads/main/etc.sh
chmod +x etc
sudo mv etc /usr/local/bin/etc
The script copies the files you want to apply to a temp dir on toolbox pod and runs edactl
command there. The copy of the files/directories is done to ensure users can refer to local paths when using the scripts.
The script supports referencing both files and directories and allows to set multiple files/directories at once.
The repo comes with a set of sample resource files in resources
directory. You can use them to test the script.
Apply all resources found in resources
directory recursively in a single transaction.
etc apply -f resources
etc apply -f resources/dir1/bd.yaml
etc apply -f resources/dir1/bd.yaml -f resources/dir2
Preview the changes that would be applied without actually applying them.
etc apply -f resources --dry-run
etc delete -f resources
etc patch -f resources/banner.yaml --patch '[{"op": "replace", "path": "/spec/loginBanner", "value": "new value from replace"}]' --dry-run