Giter Club home page Giter Club logo

myplatform-operator's Introduction

MyPlatform Operator

Eventual goal is to build the MyPlatform operator in Go which abstracts an internal platform for hosting opnioniated applications.

Get Started

Install the Operator SDK, it has two components:

  • operator-sdk - CLI tool and SDK facilitates development of operators
  • operator lifecycle manager - Facilitates installation, upgrade & RBAC of operators on a cluster

Installation:

Creating a project

Run below to use the operator-skd cli to scaffold a project for developing the operator.

# Create a directory to store the operator
mkdir -p $HOME/projects/myplatform-operator

# switch to the directory created
cd $HOME/projects/myplatform-operator

# Force using Go modules
export GO111MODULE=on

# Run the operator-sdk CLI to scaffold the project structure
operator-sdk init --domain=dexterposh.github.io --repo=github.com/DexterPOSH/myplatform-operator --skip-go-version-check

The operator-sdk init command generates a go.mod file to be used with Go modules. The --repo flag is required when creating a project outside of $GOPATH/src/, because generated files require a valid module path.

PROJECT file

One important file of note is the PROJECT file. All the next commands we run use the information in this file.

Manager

Quick look of the main.go file shows the code that initializes and runs the Manager. The manager is responsible for registering the scheme for all custom resource API definitions along with running controllers and webhooks.

Create an API & Controller

# Use the cli to boostrap the api and controller
operator-sdk create api --group=myplatform --version=v1alpha1 --kind=InhouseApp

Run below to update the generated code whenever the *_types.go files are modified.

Under the hood below command runs the controller-gen utility to implement runtime.Object interface automatically for our type.

make generate

Below would generate the CRDs automatically

make manifests

myplatform-operator's People

Contributors

dexterposh 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.