forked from kelseyhightower/kubernetes-redis-cluster
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kubernetes deployment - Moved to Redis-4.0.0
It supports cluster-announce-ip and cluster-announce-port redis/redis#2527
- Loading branch information
Shekhar Bansal
committed
Jul 17, 2017
1 parent
a9ee0c1
commit a1d34c6
Showing
18 changed files
with
203 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM alpine:3.6 | ||
LABEL maintainer "Adrian B. Danieli - https://github.com/sickp" | ||
|
||
EXPOSE 6379 | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
CMD ["redis-server", "/etc/redis/redis.conf"] | ||
VOLUME ["/data"] | ||
WORKDIR /data | ||
|
||
COPY rootfs / | ||
|
||
ENV REDIS_VERSION=4.0.0 | ||
|
||
RUN set -exo pipefail \ | ||
&& apk add --no-cache --virtual .build-deps \ | ||
build-base \ | ||
linux-headers \ | ||
openssl \ | ||
&& wget -O /usr/local/bin/gosu https://github.com/tianon/gosu/releases/download/1.10/gosu-amd64 \ | ||
&& chmod +x /usr/local/bin/gosu \ | ||
&& cd /tmp \ | ||
&& wget https://github.com/antirez/redis/archive/${REDIS_VERSION}.tar.gz \ | ||
&& tar xzf ${REDIS_VERSION}.tar.gz \ | ||
&& cd /tmp/redis-${REDIS_VERSION} \ | ||
&& make \ | ||
&& make install \ | ||
&& cp redis.conf /etc/redis.conf \ | ||
&& sed -i -e 's/bind 127.0.0.1/bind 0.0.0.0/' /etc/redis.conf \ | ||
&& adduser -D redis \ | ||
&& apk del .build-deps \ | ||
&& rm -rf /tmp/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/ash | ||
if [[ "$1" == "redis-server" ]]; then | ||
chown -R redis:redis /data | ||
exec gosu redis "$@" | ||
fi | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/ash | ||
echo "* $(redis-server --version)" | ||
echo "* Alpine Linux $(cat /etc/alpine-release)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Kubernetes Redis Cluster | ||
|
||
### Build docker image | ||
|
||
``` | ||
cd Docker-image | ||
docker build -t redis-4.0.0 . | ||
``` | ||
|
||
### Push docker image to your repo | ||
|
||
``` | ||
docker tag redis-4.0.0 localrepo:5000/redis/redis-4.0.0:v1 | ||
docker push localrepo:5000/redis/redis-4.0.0:v1 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: redis-1-cm | ||
data: | ||
redis.conf: | | ||
appendonly no | ||
protected-mode no | ||
cluster-enabled yes | ||
cluster-config-file /var/lib/redis/nodes.conf | ||
cluster-node-timeout 5000 | ||
dir /var/lib/redis | ||
port 6379 | ||
cluster-announce-port 6379 | ||
cluster-announce-bus-port 16379 | ||
cluster-announce-ip 10.111.103.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: redis-2-cm | ||
data: | ||
redis.conf: | | ||
appendonly no | ||
protected-mode no | ||
cluster-enabled yes | ||
cluster-config-file /var/lib/redis/nodes.conf | ||
cluster-node-timeout 5000 | ||
dir /var/lib/redis | ||
port 6379 | ||
cluster-announce-port 6379 | ||
cluster-announce-bus-port 16379 | ||
cluster-announce-ip 10.111.103.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: redis-3-cm | ||
data: | ||
redis.conf: | | ||
appendonly no | ||
protected-mode no | ||
cluster-enabled yes | ||
cluster-config-file /var/lib/redis/nodes.conf | ||
cluster-node-timeout 5000 | ||
dir /var/lib/redis | ||
port 6379 | ||
cluster-announce-port 6379 | ||
cluster-announce-bus-port 16379 | ||
cluster-announce-ip 10.111.103.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: redis-4-cm | ||
data: | ||
redis.conf: | | ||
appendonly no | ||
protected-mode no | ||
cluster-enabled yes | ||
cluster-config-file /var/lib/redis/nodes.conf | ||
cluster-node-timeout 5000 | ||
dir /var/lib/redis | ||
port 6379 | ||
cluster-announce-port 6379 | ||
cluster-announce-bus-port 16379 | ||
cluster-announce-ip 10.111.103.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: redis-5-cm | ||
data: | ||
redis.conf: | | ||
appendonly no | ||
protected-mode no | ||
cluster-enabled yes | ||
cluster-config-file /var/lib/redis/nodes.conf | ||
cluster-node-timeout 5000 | ||
dir /var/lib/redis | ||
port 6379 | ||
cluster-announce-port 6379 | ||
cluster-announce-bus-port 16379 | ||
cluster-announce-ip 10.111.103.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: redis-6-cm | ||
data: | ||
redis.conf: | | ||
appendonly no | ||
protected-mode no | ||
cluster-enabled yes | ||
cluster-config-file /var/lib/redis/nodes.conf | ||
cluster-node-timeout 5000 | ||
dir /var/lib/redis | ||
port 6379 | ||
cluster-announce-port 6379 | ||
cluster-announce-bus-port 16379 | ||
cluster-announce-ip 10.111.103.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.