Giter Site home page Giter Site logo

devopsconsole-operator's Introduction

Quick Start

Install the operator-sdk CLI:

$ mkdir -p $GOPATH/src/github.com/operator-framework
$ cd $GOPATH/src/github.com/operator-framework
$ git clone https://github.com/operator-framework/operator-sdk
$ cd operator-sdk
$ git checkout master
$ make dep
$ make install

Add a new API for the custom resource AppService

$ operator-sdk add api --api-version=devconsole.openshift.io/v1alpha1 --kind=AppService

Add a new controller that watches for AppService

$ operator-sdk add controller --api-version=devconsole.openshift.io/v1alpha1 --kind=AppService

Apply the app-operator CRD.

$ kubectl apply -f deploy/crds/app_v1alpha1_appservice_crd.yaml

Set the OPERATOR_NAME variable

$ export OPERATOR_NAME=app-operator

Run the operator from outside the Minishift environment.

$ operator-sdk up local --namespace myproject

Your operator is now watching for the existence of an object that matches: GroupVersionKind(app.example.com/v1alpha1, Kind=App)

Apply the provided CR.yaml to your cluster. This should trigger the default logic specified in the handler.

$ kubectl create -f deploy/examples/app_v1alpha1_appservice_cr.yaml

Directory layout

Please consult the documentation in order to learn about this project's structure:

File/Folders Purpose
cmd Contains manager/main.go which is the main program of the operator. This instantiates a new manager which registers all custom resource definitions under pkg/apis/... and starts all controllers under pkg/controllers/....
pkg/apis Contains the directory tree that defines the APIs of the Custom Resource Definitions(CRD). Users are expected to edit the pkg/apis/<group>/<version>/<kind>_types.go files to define the API for each resource type and import these packages in their controllers to watch for these resource types.
pkg/controller This pkg contains the controller implementations. Users are expected to edit the pkg/controller/<kind>/<kind>_controller.go to define the controller's reconcile logic for handling a resource type of the specified kind.
build Contains the Dockerfile and build scripts used to build the operator.
deploy Contains various YAML manifests for registering CRDs, setting up RBAC, and deploying the operator as a Deployment.
Gopkg.toml Gopkg.lock The dep manifests that describe the external dependencies of this operator.
vendor The golang Vendor folder that contains the local copies of the external dependencies that satisfy the imports of this project. dep manages the vendor directly.

devopsconsole-operator's People

Contributors

alexeykazakov avatar kwk avatar

Watchers

James Cloos 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.