Giter Club home page Giter Club logo

k8s-operator-skeleton's Introduction

Kubernetes Operator Skeleton

Based on the Third Party Resources Example in the k8s.io/client-go codebase.

Building

Dependencies are vendored, using vndr.

$ make deps

To build:

$ make build

Running

To run the operator outside the cluster, pointing at it, there are two options: providing a kube config file or providing an API URL.

For the former, run with --kubeconfig, passing a path to a kube config file, remembering to mount in the volume. E.g.:

$ docker run --rm --net=host -v /home/luke/.kube:/home/luke/.kube -v /home/luke/.minikube:/home/luke/.minikube quay.io/lukebond/k8s-operator-skeleton:v1.0.0 --kubeconfig=/home/luke/.kube/config

For the latter, pass a URL, e.g. like the following to point to a local kube proxy:

$ docker run --rm --net=host quay.io/lukebond/k8s-operator-skeleton:v1.0.0 -master=http://127.0.0.1:8080

Omit both these arguments to run in-cluster and use the service account token.

Development Workflow

I suggest having a minikube cluster running, with kubectl configured to point thereto, and work like so:

  • In a separate terminal in the current directory, run minikube mount . and keep it running
  • Edit code
  • Run make build, then make save and make clean-minikube
    • The last command will remove previous deployments from minikube so that you can start afresh
  • Run minikube ssh then type docker load -i /mount-9p/k8s-operator-skeleton.tar
  • Run kubectl create -f kube/deployment.yaml to launch the operator
  • Run kubectl create -f kube/example-cluster.yaml to create an instance of the TPR

k8s-operator-skeleton's People

Contributors

lukebond avatar

Stargazers

Murat Kabilov avatar

Watchers

James Cloos avatar  avatar

Forkers

dwardu89 ssinha3

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.