Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extra config to Kaniko docs #2019

Merged
merged 3 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ zenml image-builder register <NAME> \
--kubernetes_context=<KUBERNETES_CONTEXT> \
--kubernetes_namespace=<KUBERNETES_NAMESPACE> \
--service_account_name=<KUBERNETES_SERVICE_ACCOUNT_NAME>
# --executor_args='["--compressed-caching=false", "--use-new-run=true"]'

# or update an existing one
zenml image-builder update <NAME> \
Expand Down Expand Up @@ -139,6 +140,7 @@ zenml image-builder register <NAME> \
--kubernetes_context=<KUBERNETES_CONTEXT> \
--volume_mounts='[{"name": "docker-config", "mountPath": "/kaniko/.docker/"}]' \
--volumes='[{"name": "docker-config", "configMap": {"name": "docker-config"}}]'
# --executor_args='["--compressed-caching=false", "--use-new-run=true"]'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why has this been commented out?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just there as an illustration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes exactly because the options are only needed for specific cases


# or update an existing one
zenml image-builder update <NAME> \
Expand All @@ -153,8 +155,7 @@ information.

#### Passing additional parameters to the Kaniko build

If you want to pass [additional flags](https://github.com/GoogleContainerTools/kaniko#additional-flags) to the Kaniko
build, pass them as a JSON string when registering your image builder in the stack:
You can pass additional parameters to the Kaniko build by setting the `executor_args` attribute of the image builder.

```shell
zenml image-builder register <NAME> \
Expand All @@ -163,5 +164,16 @@ zenml image-builder register <NAME> \
--executor_args='["--label", "key=value"]' # Adds a label to the final image
```

List of some possible additional flags:

* `--cache`: Set to `false` to disable caching. Defaults to `true`.
* `--cache-dir`: Set the directory where to store cached layers. Defaults to `/cache`.
* `--cache-repo`: Set the repository where to store cached layers. Defaults to `gcr.io/kaniko-project/executor`.
* `--cache-ttl`: Set the cache expiration time. Defaults to `24h`.
* `--cleanup`: Set to `false` to disable cleanup of the working directory. Defaults to `true`.
* `--compressed-caching`: Set to `false` to disable compressed caching. Defaults to `true`.

For a full list of possible flags, check out the [Kaniko additional flags](https://github.com/GoogleContainerTools/kaniko#additional-flags)

<!-- For scarf -->
<figure><img alt="ZenML Scarf" referrerpolicy="no-referrer-when-downgrade" src="https://static.scarf.sh/a.png?x-pxid=f0b4f458-0a54-4fcd-aa95-d5ee424815bc" /></figure>
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class KanikoImageBuilderConfig(BaseImageBuilderConfig):
executor_args: Additional arguments to forward to the Kaniko executor.
See https://github.com/GoogleContainerTools/kaniko#additional-flags
for a full list of available arguments.
Example: `["--compressed-caching=false"]`

"""

kubernetes_context: str
Expand Down
Loading