krkn-operator

command module
v0.0.0-...-dd82b76 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

README

GitHub GitHub language count GitHub top language Go Report Card Docker Image CI

krkn-operator

The krkn-operator provides a way to run krkn chaos test scenarios in various predefined deployment configurations.

Use

Create a benchmark CRD, choosing one of the predefined scenarios of krkn-hub, i.e.:

apiVersion: perf.chaos.io/v1
kind: Benchmark
metadata:
  name: benchmark-sample
spec:
  scenario: pod-scenarios
$ kubectl apply -f config/samples/perf_v1_benchmark.yaml
benchmark.perf.chaos.io/benchmark-sample created

$ kubectl get benchmark
NAME               AGE
benchmark-sample   7s

Getting Started

You’ll need a Kubernetes cluster to run against. You can use kind to get a local cluster for testing, or run against a remote cluster.

Note: Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster kubectl cluster-info shows).

Running on the cluster
  1. Deploy the controller to the cluster:
make deploy IMG=quay.io/jcastillolema/krkn-operator:0.0.1
  1. Verify that the krkn-operator is up and running:
$ kubectl get po -n krkn-operator-system
NAME                                               READY   STATUS    RESTARTS   AGE
krkn-operator-controller-manager-b8585c7cb-88xjh   2/2     Running   0          18m
  1. Install instances of Custom Resources:
kubectl apply -f config/samples/perf_v1_benchmark.yaml
Uninstall CRDs

To delete the CRDs from the cluster:

make uninstall
Undeploy controller

Undeploy the controller from the cluster:

make undeploy

Contributing

How it works

This project aims to follow the Kubernetes Operator pattern.

It uses Controllers, which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.

Test It Out
  1. Install the CRDs into the cluster:
make install
  1. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):
make run

NOTE: You can also run this in one step by running: make install run

Modifying the API definitions

If you are editing the API definitions, generate the manifests such as CRs or CRDs using:

make manifests

NOTE: Run make --help for more information on all potential make targets

More information can be found via the Kubebuilder Documentation

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1
Package v1 contains API Schema definitions for the perf v1 API group +kubebuilder:object:generate=true +groupName=perf.chaos.io
Package v1 contains API Schema definitions for the perf v1 API group +kubebuilder:object:generate=true +groupName=perf.chaos.io

Jump to

Keyboard shortcuts

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