Giter Site home page Giter Site logo

memcached-operator's Introduction

memcached-operator

Simple memcached operator

A simple Go-based memcached operator for GHC demo. For more information: https://sdk.operatorframework.io/docs/installation/install-operator-sdk/

How to build and deploy

Prereq:

  1. operator-sdk v0.18.2
  2. docker
  3. kubectl v1.11.3+
  4. Kubernetes test cluster

Download the code

git clone [email protected]:swatishr/memcached-operator.git

cd memcached-operator

Run operator from your local system on a cluster, usually used during dev testing:

  • Create CRD: cat deploy/crds/cache.demo.com_memcacheds_crd.yaml | kubectl create -f -
  • Run operator from this project's root directory: operator-sdk run local --watch-namespace=demo
  • Apply CR: cat deploy/crds/cache.demo.com_v1alpha1_memcached_cr.yaml | kubectl -n <namespace> apply -f -

Build operator image:

operator-sdk build <image-repo/image-name:tag>

docker push <image-repo/image-name:tag>

Run operator as a kubernetes deployment:

  • In operator.yaml, replace the REPLACE_IMAGE with <image-repo/image-name:tag> used while building the image
  • Deploy CRD: cat deploy/crds/cache.demo.com_memcacheds_crd.yaml | kubectl create -f -
  • If you want to deploy it in a new namespace, create namespace first and create pull secret if needed and add it in imagePullSecrets section in service_account.yaml
  • cat deploy/service_account.yaml | kubectl -n <namespace> create -f -
  • cat deploy/role.yaml | kubectl -n <namespace> create -f -
  • cat deploy/role_binding.yaml | kubectl -n <namespace> create -f -
  • cat deploy/operator.yaml | kubectl -n <namespace> create -f -
  • Verify that operator deployment is in running state: kubectl -n <namespace> get deployment |grep memcached-operator
  • Apply CR: cat deploy/crds/cache.demo.com_v1alpha1_memcached_cr.yaml | kubectl -n <namespace> apply -f -
  • Verify that the memcached pods are in running state: kubectl -n <namespace> get pods |grep example-memcached

memcached-operator's People

Contributors

swatishr avatar

Watchers

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