Skip to content

idoqo/fct

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flatcar-tag-controller (fct/fct-controller)

A Kubernetes controller that automatically adds a label (k8c.io/uses-container-linux) to Nodes running Flatcar Container Linux as their base operating system. Nodes are detected by checking for the string "flatcar" in the operating system name.

Milestones

  • Watch k8s node objects
  • Check for nodes using Flatcar Container Linux.
  • Attach a label (k8c.io/uses-container-linux:‌‌'true') to the Node if it uses FC Linux.
  • Write a Dockerfile for the controller
  • Write a Kubernetes Deployment for the controller
  • Write the RBAC manifests required for the controller

Usage

out-of-cluster

Clone the repo and in the node-label-controller folder, build the application binary by running:

make build

The command will generate the executable in $PWD/build/fct. Next, run ./build/fct to watch the nodes in your cluster.

In out-of-cluster mode, fct will prioritize the value of your $KUBECONFIG environment variable over $HOME/.kube/config. As a result, you can run it on your choice cluster by setting $KUBECONFIG appropriately.

in-cluster

Install fct in a cluster by running:

make install

The above command will:

  • create a service account named fct-sa for the controller to use.
  • a cluster role with permissions to {get, list, watch, and patch} nodes in the cluster.
  • create a cluster role-binding that binds the service account to the cluster role.
  • apply the fct-deployment that is based on the idoko/fct docker image.

You can remove the controller from the cluster by running:

make uninstall

Checks

The controller works against:

  • a fake cluster (using the unit tests in pkg/controller/controller_test.go)

Resources

About

Kubernetes controller that automatically tags node running Flatcar Container Linux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published