Skip to content

Latest commit

 

History

History
114 lines (73 loc) · 4.59 KB

development.md

File metadata and controls

114 lines (73 loc) · 4.59 KB

Development Guide

If you would like to contribute to Multicloud-Operators projects, this guide will help you get started.

Before you start


Developer Certificate of Origin

All Multicloud-Operators repositories built with probot that enforces the Developer Certificate of Origin (DCO) on Pull Requests. It requires all commit messages to contain the Signed-off-by line with an email address that matches the commit author.

Contributing A Patch

  1. Submit an issue describing your proposed change to the repo in question.
  2. The repo owners will respond to your issue promptly.
  3. Fork the desired repository, develop and test your code changes.
  4. Commit your changes with DCO to the forked repository
  5. Submit a pull request to main repository

Issue and Pull Request Management

Anyone may comment on issues and submit reviews for pull requests. However, in order to be assigned an issue or pull request, you must be a member of the IBM GitHub organization.

Repo maintainers can assign you an issue or pull request by leaving a /assign <your Github ID> comment on the issue or pull request.

Required tools/Binaries

Multcloud-Operators projects are built with following tools, use following links to get them installed in your env.

Kubernetes:

  • Version 1.13+. Use following link to find an environment or setup one.

Build:

Lint:

Test:

Build & Run


Set following variables to build your local image

  • GO111MODULE=on to enable go module
  • GIT_HOST=<your personal org> override the org from main repo. e.g: github.com/<your_account>
  • BUILD_LOCALLY=1 to build locally
  • REGISTRY=<your registry> to set registry of your image, default is quay.io/multicloudlab
  • IMG=<you image name> to set your image name, tags are generated automatically, default name is multicloud-operators-subscription

Use make to lint, test, and build your images locally. Official image built from master branch is pushed to quay.io/multicloudlab/multicloud-operators-subscription.

Multicloud-Operators repositories follow general operator-sdk practice to run the operator.

Before running the operator, required CRDs must be registered with Kubernetes apiserver:

% kubectl apply -f deploy/crds

Once this is done, there are 2 ways to run the operator

  • As a go program in development environment outside a Kubernetes cluster
  • As a Deployment inside a Kubernetes cluster

Run locally outside the cluster

Use following operator-sdk command to launch operator locally.

export OPERATOR_NAME=multicloud-operators-subscription
% operator-sdk up local

Run as a Deployment inside the cluster

Use the following kubectl command to launch operator as a deployment in a Kubernetes cluster.

% kubectl deploy -f deploy

Verify the deployment and pods with following command:

% kubectl get deploy,pods -l name=multicloud-operators-subscription
NAME                                              READY     UP-TO-DATE   AVAILABLE   AGE
deployment.apps/multicloud-operators-subscription   1/1       1            1           15m

NAME                                                   READY     STATUS    RESTARTS   AGE
pod/multicloud-operators-subscription-78c9874dff-f64pg   1/1       Running   0          15m