New add-ons should be added to a source directory following the format
That directory must have at least two files:
The Manifest file specifies a list of images required for the add-on.
These will be pulled during CI and saved to the directory
The install.sh script must define a function named
<add-on> that will perform the install.
/addons/weave/2.5.2/install.sh defines the function named
Most add-ons include yaml files that will be applied to the cluster.
These should be copied to the directory
kustomize/<name> and applied with
kubectl apply -k rather than applied directly with
kubectl apply -f.
This will allow users to easily review all applied yaml, add their own patches and re-apply after the script completes.
All files and directories in the add-on's source directory will be included in the package built for the add-on.
The package will be built and uploaded to
s3://kurl-sh/dist/<name>-<version>.tar.gz during CI.
It can be downloaded directly from S3 or by redirect from
The built package will include the images from the Manifest saved as tar archives.
The install.sh script may also define the functions
The pre_init function will be called prior to initializing the Kubernetes cluster.
This may be used to modify the configuration that will be passed to
The join function will be called on remote nodes before they join the cluster and is useful for host configuration tasks such as loading a kernel module.
For online installs, the add-on package will be downloaded and extracted at runtime. For airgap installs, the add-on package will already be included in the installer bundle.
The add-on function in kURL will first load all images from the add-on's
images/ directory and create the directory
It will then dynamically source the
install.sh script and execute the function named
DIR env var will be defined to the install root.
Any yaml that is ready to be applied unmodified should be copied from the add-on directory to the kustomize directory.
cp "$DIR/addons/weave/2.5.2/kustomization.yaml" "$DIR/kustomize/weave/kustomization.yaml"
insert_resources function can be used to add an item to the resources object of a kustomization.yaml:
insert_resources "$DIR/kustomize/weave/kustomization.yaml" secret.yaml
insert_patches_strategic_merge function can be used to add an item to the
patchesStrategicMerge object of a kustomization.yaml:
insert_patches_strategic_merge "$DIR/kustomize/weave/kustomization.yaml" ip-alloc-range.yaml
render_yaml_file function can be used to substitute env vars in a yaml file at runtime:
render_yaml_file "$DIR/addons/weave/2.5.2/tmpl-secret.yaml" > "$DIR/kustomize/weave/secret.yaml"