Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

AutoUpdate (autoupdate/v1-alpha)

Keeping your Kubebuilder project up to date with the latest improvements shouldn’t be a chore. With a small amount of setup, you can receive automatic Pull Request suggestions whenever a new Kubebuilder release is available — keeping your project maintained, secure, and aligned with ecosystem changes.

This automation uses the kubebuilder alpha update command with a 3-way merge strategy to refresh your project scaffold, and wraps it in a GitHub Actions workflow that opens an Issue with a Pull Request compare link so you can create the PR and review it.

When to use it

  • When you want to reduce the burden of keeping the project updated and well-maintained.

How to use it

  • If you want to add the autoupdate plugin to your project:
kubebuilder edit --plugins="autoupdate/v1-alpha"

How it works

The plugin scaffolds a GitHub Actions workflow that checks for new Kubebuilder releases every week. When an update is available, it:

  1. Creates a new branch with the merged changes
  2. Opens a GitHub Issue with a PR compare link

Example Issue:

Example Issue

Conflict help (when needed):

Conflicts

Customizing the workflow

The generated workflow uses the kubebuilder alpha update command with default flags. You can customize the workflow by editing .github/workflows/auto_update.yml to add additional flags:

Default flags used:

  • --force - Continue even if conflicts occur (automation-friendly)
  • --push - Automatically push the output branch to remote
  • --restore-path .github/workflows - Preserve CI workflows from base branch
  • --open-gh-issue - Create a GitHub Issue with PR compare link

Additional available flags:

  • --merge-message - Custom commit message for clean merges
  • --conflict-message - Custom commit message when conflicts occur
  • --from-version - Specify the version to upgrade from
  • --to-version - Specify the version to upgrade to
  • --output-branch - Custom output branch name
  • --show-commits - Keep full history instead of squashing
  • --git-config - Pass per-invocation Git config

For complete documentation on all available flags, see the kubebuilder alpha update reference.

Example: Customize commit messages

Edit .github/workflows/auto_update.yml:

- name: Run kubebuilder alpha update
  run: |
    kubebuilder alpha update \
      --force \
      --push \
      --restore-path .github/workflows \
      --open-gh-issue \
      --merge-message "chore: update kubebuilder scaffold" \
      --conflict-message "chore: update with conflicts - review needed"

Demonstration