Skip to content

controller-gen

Code generator for Kubernetes controllers and CRDs

Kubebuilder makes use of this tool for generating utility code and Kubernetes YAML. This code and config generation is controlled by the presence of special "marker comments" in Go code.

Controller-gen is built out of different "generators" (which specify what to generate) and "output rules" (which specify how and where to write the results).

dev

https://book.kubebuilder.io

arm64 amd64

Installation

1. Add WakeMeOps repository

curl -sSL https://raw.githubusercontent.com/upciti/wakemeops/main/assets/install_repository | sudo bash

2. Install controller-gen

sudo apt install controller-gen

Snippets

FROM wakemeops/minideb:bullseye

RUN install_packages \
    controller-gen=0.19.0*

USER 1001
- name: Install dependencies
  uses: upciti/wakemeops-action@v1
  with:
    packages: |
      controller-gen=0.19.0*

Download URLs

Version SHA256 Size (KB)
0.19.0 86a3409552296160ee20badab761ae713195cd6d92818811927454e0b65c30d1 6298
0.18.0 1a04125f4a549413cb847691b000100047fad94a5446886dacd071d28425a1c9 6227
Version SHA256 Size (KB)
0.19.0 e6b782f492a885327e9c26a1879d04455b72431df58b9336c09e53968fb3e6af 5316
0.18.0 77a314d5b65e1ee85ccfe4100a2b487f42f38ced0810926913d35093d744af7a 5252

Blueprints

Debian packages listed on this page are generated from op2deb YAML blueprints. Blueprints for controller-gen are versioned here.

Click here to see controller-gen ops2deb blueprints
https://github.com/upciti/wakemeops/blob/main/blueprints/dev/controller-gen/ops2deb.yml
name: controller-gen
matrix:
  architectures:
    - amd64
    - arm64
  versions:
    - 0.18.0
    - 0.19.0
homepage: https://book.kubebuilder.io
summary: code generator for Kubernetes controllers and CRDs
description: |-
  Kubebuilder makes use of this tool for generating utility code and Kubernetes
  YAML. This code and config generation is controlled by the presence of special
  "marker comments" in Go code.

  Controller-gen is built out of different "generators" (which specify what to
  generate) and "output rules" (which specify how and where to write the
  results).
fetch: https://github.com/kubernetes-sigs/controller-tools/releases/download/v{{version}}/controller-gen-linux-{{arch}}
install:
  - controller-gen-linux-{{arch}}:/usr/bin/controller-gen

The blueprint fetch keyword contains a URL template pointing to controller-gen releases. Downloaded files are locked in a lockfile versioned here.

Click here to see controller-gen release hashes
https://github.com/upciti/wakemeops/blob/main/blueprints/dev/controller-gen/ops2deb.lock.yml
- url: https://github.com/kubernetes-sigs/controller-tools/releases/download/v0.18.0/controller-gen-linux-amd64
  sha256: d191eea7a8471a99105a0cf0686e5bfbe13a7d1838287287d251b755e5c54d9b
  timestamp: 2025-06-03 14:34:06+00:00
- url: https://github.com/kubernetes-sigs/controller-tools/releases/download/v0.18.0/controller-gen-linux-arm64
  sha256: a7e21df58b107f8ccba7e07fea9e60cdff561c3d27da93e6db84fa2ea014a2c4
  timestamp: 2025-06-03 14:34:06+00:00
- url: https://github.com/kubernetes-sigs/controller-tools/releases/download/v0.19.0/controller-gen-linux-amd64
  sha256: 5df5d2cced0621d7d8d8040ef20482f5c6e2ced32f1b1ad825f1bdf52f433161
  timestamp: 2025-11-12 00:08:21+00:00
- url: https://github.com/kubernetes-sigs/controller-tools/releases/download/v0.19.0/controller-gen-linux-arm64
  sha256: 50dc28b10d4080e0bc547f8de91b26054fd58d51147f5cb36fd632400a3c5f4f
  timestamp: 2025-11-12 00:08:21+00:00

Badge

WakeMeOps

[![WakeMeOps](https://docs.wakemeops.com/badges/controller-gen.svg)](https://docs.wakemeops.com/packages/controller-gen)
<a href="https://docs.wakemeops.com/packages/controller-gen">
  <img src="https://docs.wakemeops.com/badges/controller-gen.svg"/>
</a>
.. image:: https://docs.wakemeops.com/badges/controller-gen.svg
:target: https://docs.wakemeops.com/packages/controller-gen