Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
67 lines (41 sloc) 2.04 KB

Running an apiserver and controller-manager in-cluster

This document describes how to run an apiserver and controller-manager in cluster using API aggregation.

For details on the underlying concepts applied by the commands, see the auth concept page.

TL;DR version

Running the following command will automatically invoke each of the commands covered in the long version

apiserver-boot build config --name <servicename> --namespace <namespace to run in> --image <image to run>

Long version

Build the container image

Note: If your apiserver and controller-manager were not created with the apiserver-builder framework, you made need to manually build your container image.

apiserver-boot build container --image <image>

This will generate code, build the apiserver and controller-manager binaries and then build a container image.

Push the image with:

docker push <image>

Build the config

apiserver-boot build config --name <servicename> --namespace <namespace to run in> --image <image to run>

This will perform the following:

  • create a CA + certificate for the service to use
    • under config/certificates
  • locate each API group/version based on the directory structure
  • create config for the APIServices, Deployment, Service, and Secret
    • in config/apiserver.yaml

Note: This relies on the container have the binaries apiserver and controller-manager present and runnable from "./". You may need to manually edit the config if your container looks differently.

You can also provide optional flags:

  • image-pull-secrets secrets that will be used by k8s cluster if your image is stored in private registry
  • service-account service account name that will be used by deployment, can be used to provide additional rights for running container

Run the apiserver

kubectl apply -f config/apiserver.yaml

Clear the discovery cache:

rm -rf ~/.kube/cache/discovery/

Look for your API:

kubectl api-versions

Create an instance of your resource

kubectl apply -f sample/<type>.yaml

You can’t perform that action at this time.