Skip to content

Latest commit

 

History

History
109 lines (76 loc) · 4.55 KB

File metadata and controls

109 lines (76 loc) · 4.55 KB

Contributing

This document explains how to install and run the project on a local minikube cluster.

Signing commits using gpg

Requirements

To get started, we need to have the following software installed:

Developing Locally

Quick start with Minikube

Once you have installed the above requirements, run the following commands:

  • start minikube with containerd engine
    • make minikube-start
  • deploy cert-manager
    • kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.3.0/cert-manager.yaml
  • build the new image of the controller with your local files
    • make minikube-build
  • deploy the CRD and the controller on the minikube cluster
    • make install

Deploying Local Changes to Minikube

To deploy a new version of your local controller code when a version is already deployed, run:

  • make minikube-build
  • make install
  • make restart

To deploy a new version of the CRD by modifying your local api/v1beta1/disruption_types.go (or a particular Subspec by modifying api/v1beta1/disruption_types.go), run:

  • make install
  • make restart

Testing Local Changes in Minikube

The samples contains sample data which can be used to test your changes.

demo.yaml contains testing resources you can apply directly to your cluster in whatever namespace you choose (chaos-demo by default) by running:

  • kubectl apply -f examples/demo.yaml

To see whether curls are succeeding, by using kubectl to tail the pod's logs, run:

  • kubectl -n chaos-demo logs -f <curl pod> curl

Once you define your test manifest, run:

  • kubectl apply -f examples/<manifest>.yaml

To remove the disruption, run:

  • kubectl delete -f examples/<manifest>.yaml

See development guide for more robust documentation and tips!

Available commands

Running, installing & generating

  • make generate: generate boilerplate code.
  • make install: install CRDs and controller into a cluster
  • make manifests: generate manifests e.g. CRD, RBAC etc.
  • make uninstall: uninstall CRDs and controller from a cluster
  • make restart: restart the controller

Building

  • make minikube-build: build both images and load them into minikube
    • make minikube-build-injector: build the injector image and load it into minikube
    • make minikube-build-manager: build the manager image and load it into minikube
  • make injector: build injector binary
  • make manager: build manager binary
  • make minikube-start: start minikube with our ISO and containerd runtime

Testing, checking & linting

  • make fmt: run go fmt against the codebase.
  • make header-check: check all files if they contain the correct header.
  • make license-check: check if all third party modules contain a license and build the license database.
  • make lint: run golangci-lint against codebase.
  • make test: run tests
  • make vet: run go vet against the codebase.

Minikube ISO

See minikube_image.md

3rd-party licenses

3rd-party references and licenses are kept in the LICENSE-3rdparty.csv file. This file has been generated by the tasks/3rdparty.py script. If any vendor is updated, added or removed, this file must be updated as well.