fip-results-controller

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2021 License: BSD-3-Clause

README

| Fury Logo | fip-results-controller |

GitHub release (latest SemVer) GitHub go.mod Go version GitHub Go Report Card

Table of Contents

Overview

The results-controller is a tool that listens for Kubernetes job events to create a new CRD based on the result of the job performing checks in the intelligent platform.

The tool can be used as:

  • A standalone tool to connect to the local Kubernetes cluster.
  • A standalone tool to connect to a remote Kubernetes cluster.
  • A Kubernetes deployment accessing jobs in the same cluster authorized using RBAC.

Getting Started

Installation

The simplest way to use the tool is to install the binary from the source repo as follows:

  • Using Go get
$ go get -u github.com/sighupio/fip-results-controller/cmd/results-controller
#

You should find the CLI installed in the $GOPATH. From this point mentioned as results-controller

Usage

The basic usage info of the tool can be seen by using the following command:

$ results-controller -h
The Result Controller is in charge of listening Kubernetes Events, filter the Job events, then
create and update a new custom resource (CheckResult) with the relevant information about the Job.

Usage:
  results-controller [flags]

Flags:
  -h, --help                help for results-controller
      --kubeconfig string   kubeconfig file. default: in-cluster configuration, Fallback $HOME/.kube/config
      --log-level string    logging level (debug, info...) (default "info")
      --resync int          default synchronization period. (seconds) (default 60)

Refer this extended documentation on CLI usage for more

Usage from inside a docker image

There is a Dockerfile bundled with this repo which can be used to build a Docker image and that can be used to run the binary. To build docker image one can use the make rule build. You can read more about Makefile in CONTRIBUTING.md. To build the image:

$ make build
# The docker image will be created by the name fip-results-controller:local-build

The above image can be run exactly the same way the CLI is used like shown by the code block below:

$ docker run -it fip-results-controller:local-build ./results-controller -h
The Result Controller is in charge of listening Kubernetes Events, filter the Job events, then
create and update a new custom resource (CheckResult) with the relevant information about the Job.

Usage:
  results-controller [flags]

Flags:
  -h, --help                help for results-controller
      --kubeconfig string   kubeconfig file. default: in-cluster configuration, Fallback $HOME/.kube/config
      --log-level string    logging level (debug, info...) (default "info")
      --resync int          default synchronization period. (seconds) (default 60)

$ docker run -v .kube/:/root/.kube/ -it fip-results-controller:local-build ./fip-results-controller \
                                            --kubeconfig=/root/.kube/config
Deploy in a cluster as a Deployment

As a part of the Fury Intelligence Platform, this tool is primary built to work as a Kubernetes Custom Controller. In order to do so, our preferred way of deployment is by using a kustomization file that deploys the RBAC policy letting the job look into the events, jobs and the CRD the controller creates by itself.

We ship the deployment files under the deployment directory. To understand the usage of these files in detail head over to the README of the directory.

Examples

There are some example resulting CRD that are created by this results-controller tool. They can be found in the examples directory. Follow the information in the corresponding README for more info.

Developer Guide

To set the code up locally, build, run tests, etc. Please refer the contributor's guide.

License

Check the License here

Directories

Path Synopsis
cmd
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL