Installation

This page describes how to install Metacontroller, either to develop your own controllers or just to run third-party controllers that depend on it.

Prerequisites

  • Kubernetes v1.16
  • You should have kubectl available and configured to talk to the desired cluster.

Running on kubernetes older than 1.16

Metacontroller should work fine (as for now - December 2020) running on 1.9+, as it does not have direct dependency on kubernetes API version. In this case you should use 0.4.5 release manifests, just put current (or any fixed) image version in metacontroller.yaml. However there is no gurantee that this will work forever - the goal is to make it compatibile with supported kubernetes releases. Please update your cluster in that case.

Grant yourself cluster-admin (GKE only)

Due to a known issue in GKE, you'll need to first grant yourself cluster-admin privileges before you can install the necessary RBAC manifests.

kubectl create clusterrolebinding <user>-cluster-admin-binding --clusterrole=cluster-admin --user=<user>@<domain>

Replace <user> and <domain> above based on the account you use to authenticate to GKE.

Install Metacontroller

# Create metacontroller namespace.
kubectl create namespace metacontroller
# Create metacontroller service account and role/binding.
kubectl apply -f {{ site.repo_raw }}/manifests/metacontroller-rbac.yaml
# Create CRDs for Metacontroller APIs, and the Metacontroller StatefulSet.
kubectl apply -f {{ site.repo_raw }}/manifests/metacontroller.yaml

If you prefer to build and host your own images, please see the build instructions in the contributor guide.

Configuration

The Metacontroller server has a few settings that can be configured with command-line flags (by editing the Metacontroller StatefulSet in manifests/metacontroller.yaml):

FlagDescription
-vSet the logging verbosity level (e.g. -v=4). Level 4 logs Metacontroller's interaction with the API server. Levels 5 and up additionally log details of Metacontroller's invocation of lambda hooks. See the troubleshooting guide for more.
--discovery-intervalHow often to refresh discovery cache to pick up newly-installed resources (e.g. --discovery-interval=10s).
--cache-flush-intervalHow often to flush local caches and relist objects from the API server (e.g. --cache-flush-interval=30m).
--client-config-pathPath to kubeconfig file (same format as used by kubectl); if not specified, use in-cluster config (e.g. --client-config-path=/path/to/kubeconfig).
--client-go-qpsNumber of queries per second client-go is allowed to make (default 5, e.g. --client-go-qps=100)
--client-go-burstAllowed burst queries for client-go (default 10, e.g. --client-go-burst=200)
--workersNumber of sync workers to run (default 5, e.g. --workers=100)