Giter Site home page Giter Site logo

moensch / redis-operator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kube-incubator/redis-operator

0.0 1.0 0.0 37.08 MB

A redis-operator based on operator-sdk.

License: Apache License 2.0

Dockerfile 0.41% Shell 0.82% Go 98.17% Smarty 0.60%

redis-operator's Introduction

redis-operator

A redis-operator based on operator-sdk (operator-sdk version v0.5.0+git)

asciicast

Build

Prerequisites

  • dep version v0.5.0+.
  • git
  • go version v1.12+.
  • docker version 17.03+.
  • kubectl version v1.11.3+.
  • Access to a Kubernetes v1.11.3+ cluster.

Build redis-operator

$ git clone https://github.com/kube-incubator/redis-operator.git
$ cd redis-operator
$ dep ensure
$ operator-sdk build shidaqiu/redis-operator:1.0

Deploy

Deploy redis-operator

$ kubectl apply -f deploy/service_account.yaml
$ kubectl apply -f deploy/role.yaml
$ kubectl apply -f deploy/role_binding.yaml
$ kubectl apply -f deploy/crds/redis_v1alpha1_redis_crd.yaml
$ kubectl apply -f deploy/operator.yaml

Deploy sample redis cluster

$ kubectl apply -f deploy/samples/basic.yaml
$ kubectl get pod
NAME                                   READY   STATUS    RESTARTS   AGE
bc-redis-example-0                     1/1     Running   0          2m15s
bc-redis-example-1                     1/1     Running   0          93s
bc-redis-example-2                     1/1     Running   0          58s
bc-sentinel-example-6587886489-72zmr   1/1     Running   0          2m16s
bc-sentinel-example-6587886489-d2nlb   1/1     Running   0          2m16s
bc-sentinel-example-6587886489-wmfs7   1/1     Running   0          2m16s
redis-operator-799b6fdff-9q2w5         1/1     Running   0          2m27s

Connect to the redis cluster

$ kubectl exec -it $(kubectl get pod -l sentinel=example -o jsonpath='{.items[0].metadata.name}') -- redis-cli -p 26379 SENTINEL get-master-addr-by-name master
1) "172.17.0.8"
2) "6379"
$ kubectl exec -it $(kubectl get pod -l sentinel=example -o jsonpath='{.items[0].metadata.name}') -- redis-cli -h 172.17.0.8 -p 6379 SET hello world!
OK
$ kubectl exec -it $(kubectl get pod -l sentinel=example -o jsonpath='{.items[0].metadata.name}') -- redis-cli -h 172.17.0.8 -p 6379 GET hello
"world!"

Contribution

If you are interested in contributing to the Redis-Operator project, feel free to send your Pull Request and Issue.

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.