Code Monkey home page Code Monkey logo

ssp-operator's Introduction

SSP Operator

Operator that manages Scheduling, Scale and Performance addons for KubeVirt

Functionality

The operator deploys and manages resources needed by these four components:

Installation

The ssp-operator requires an Openshift cluster to run properly.

Using HCO

The Hyperconverged Cluster Operator automatically installs the SSP operator when deploying.

Manual installation

The operator can be installed manually by applying the file ssp-operator.yaml from GitHub releases:

oc apply -f ssp-operator.yaml

To install the latest released version, the following commands can be used:

export SSP_VERSION=$(curl https://api.github.com/repos/kubevirt/ssp-operator/releases/latest | jq '.name' | tr -d '"')
oc apply -f https://github.com/kubevirt/ssp-operator/releases/download/${SSP_VERSION}/ssp-operator.yaml

To activate the operator, a CR needs to be created. An example is in config/samples/ssp_v1beta1_ssp.yaml.

Building

The Make will try to install kustomize, however if it is already installed it will not reinstall it. In case of an error, make sure you are using at least v3 of kustomize, available here: https://kustomize.io/

To build the container image run:

make container-build

To upload the image to the default repository run:

make container-push

The repository and image name and tag can be changed with these variables:

export IMG_REPOSITORY=<registry>/<image_name> # for example: export IMG_REPOSITORY=quay.io/kubevirt/ssp-operator
export IMG_TAG=<image_tag> # for example: export IMG_TAG=latest

After the image is pushed to the repository, manifests and the operator can be deployed using:

make deploy

Development

Running locally

The operator can run locally on the developer's machine. It will watch the cluster configured in a file pointed to by the $KUBECONFIG.

make install                    # Install CRDs to the cluster
make run ENABLE_WEBHOOKS=false  # Start the operator locally

When running locally, the validating webhooks that check the SSP CR are disabled. It is up to the developer to use correct SSP CRs.

The CRDs can be removed using:

make uninstall 

Testing

To run unit tests, use this command:

make unittest

The functional tests can be run using command:

make functest

The following environment variables control how functional tests are run:

  • TEST_EXISTING_CR_NAME and TEST_EXISTING_CR_NAMESPACE - Can be used to set an existing SSP CR to be used during the tests. The CR will be modified, deleted and recreated during testing.
  • SKIP_UPDATE_SSP_TESTS - Skips tests that need to modify or delete the SSP CR. This is useful if the CR is owned by another operator.
  • SKIP_CLEANUP_AFTER_TESTS - Do not remove created resources when the tests are finished.
  • TIMEOUT_MINUTES and SHORT_TIMEOUT_MINUTES - Can be used to increase the timeouts used.

Changing API

When the API definition in api/v1beta1 is changed, the generated code and CRDs need to be regenerated:

make generate manifests

Pausing the operator

The reconciliation can be paused by adding the following annotation to the SSP reosurce:

kubevirt.io/operator.paused: "true"

The operator will not react to any changes to the SSP resource or any of the watched resources. If a paused SSP resource is deleted, the operator will still cleanup all the dependent resources.

ssp-operator's People

Contributors

akrejcir avatar borod108 avatar ilpinto avatar jean-edouard avatar ksimon1 avatar nunnatsa avatar omeryahud avatar shwetaap avatar sradco avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.