Building a Controller
How to build or regenerate an ACK service controller
You should have forked the
git clone’d it locally when setting up your
With the prerequisites out of the way, let’s move on to the first step: building the code generator.
Build code generator
Building an ACK service controller (or regenerating an existing one from a
newer API model file) requires the
ack-generate binary, which is the main
code generator CLI tool.
To build the latest
ack-generate binary, execute the following command from
the root directory of the
Don’t worry if you forget this step, the script in the next step will complain
with a message along the line of
ERROR: Unable to find an ack-generate binary
and will give you another opportunity to rectify the situation.
Build an ACK service controller
Now that we have the basic code generation step done we will create the respective ACK service controller and its supporting artifacts.
So first you have to select a service that you want to build and test.
You do that by setting the
SERVICE environment variable. Let’s say we want
to test the S3 service (creating an S3 bucket), so we would execute the
Now we are in a position to generate the ACK service controller for the S3 API.
make build-controller SERVICE=$SERVICE
By default, running
make build-controller will output the generated code to
ACK service controller for S3’s source code repository (the
$GOPATH/src/github.com/aws-controllers-k8s/s3-controller directory). You can
override this behaviour with the
controller-gen: command not found
controller-gen: command not foundmessage when executing
make build-controllerthen you want to check if the
controller-genbinary is available in
$GOPATH/bin, also ensure that
$GOPATH/binis part of your
$PATH, see also
#234. You can also install the required version of
In addition to the ACK service controller code, above generates the
custom resource definition (CRD) manifests as well as the necessary RBAC
settings using the
Now that we have the generation part completed, we want to see if the generated artifacts indeed are able to create an S3 bucket for us.
Learn about how to run e2e tests for an ACK controller.