commercialtribe / kube-redis Goto Github PK
View Code? Open in Web Editor NEWRedis on Kubernetes as StatefulSet
License: MIT License
Redis on Kubernetes as StatefulSet
License: MIT License
With the current config map, there is no persistence to the provisioned persistent disks.
One would need to add
appendonly yes
and/or
save XX YYYY
What do you think?
To use predis (PHP Redis Client) and maybe other clients with kube-redis, the clients need to contact the redis-sentinel to get information about masters and clients. To get this to work, the service would need to be expanded or another service needs to be implemented:
apiVersion: v1
kind: Service
metadata:
name: redis-nodes
labels:
service: redis
spec:
ports:
- port: 6379
name: redis
- port: 26379
name: redis-sentinel
selector:
name: redis-node
when shutdown master node,then kubernetes will start a new master,but the "new master" couldn't be rebuild from slaves
After start sidecar script if redis is master sidecar.sh set label correctly at first time
But after first labeled get error
root@redis-cluster-2:/app# ./sidecar.sh
pod "redis-cluster-2" labeled
(error) ERR Duplicated master name
OK
OK
OK
Ready!
pod "redis-cluster-2" labeled
./sidecar.sh: line 166: [: !=: unary operator expected
./sidecar.sh: line 166: [: !=: unary operator expected
./sidecar.sh: line 166: [: !=: unary operator expected
./sidecar.sh: line 166: [: !=: unary operator expected
^C./sidecar.sh: line 166: [: !=: unary operator expected
At line 166
# Don't ever allow multiple masters
if [ "$current_role" = "master" ] ; then
> if [ `active-master` != $ip ] ; then
# If I am a master and not the active one, then just become a slave
become-slave-of $master
fi
fi
bash -x ./sidecar.sh
++ active-master
++ master=
+++ hosts
+++ echo ''
+++ kubectl get pods -l=name=redis-cluster-node,role=none '--template={{range $i, $e :=.items}}{{$e.status.podIP}} {{end}}'
+++ sed 's/ $//'
+++ tr ' ' '\n'
+++ grep --invert-match 192.168.1.32
+++ grep -E '^[0-9]'
++ echo -n
+ '[' '!=' 192.168.1.32 ']'
./sidecar.sh: line 166: [: !=: unary operator expected
+ sleep 1
^C
I am trying to use the instructions in a Google Kubernetes Engine (1.8.4-gke.1
) without legacy auth. But the sidecar keeps crashing on me with the following error:
Error from server (Forbidden): pods "redis-0" is forbidden: User "system:serviceaccount:myNameSpace:default" cannot get pods in the namespace "myNameSpace": Unknown user "system:serviceaccount:myNameSpace:default"
Is there a known way of how to get this error resolved?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.