-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Auto-detect missing/duplicate messages (#369)
Signed-off-by: Alex Collins <alex_collins@intuit.com>
- Loading branch information
Showing
15 changed files
with
768 additions
and
22 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,105 @@ | ||
apiVersion: v1 | ||
data: | ||
master.conf: | | ||
bind 0.0.0.0 | ||
protected-mode yes | ||
port 6379 | ||
tcp-backlog 511 | ||
timeout 0 | ||
tcp-keepalive 300 | ||
daemonize no | ||
supervised no | ||
pidfile /var/run/redis_6379.pid | ||
loglevel notice | ||
logfile "" | ||
slave.conf: slaveof redis-0.redis 6379 | ||
kind: ConfigMap | ||
metadata: | ||
name: redis | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: redis | ||
name: redis | ||
spec: | ||
clusterIP: None | ||
ports: | ||
- name: redis | ||
port: 6379 | ||
targetPort: redis | ||
selector: | ||
app: redis | ||
role: master | ||
type: ClusterIP | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
labels: | ||
app: redis | ||
name: redis | ||
spec: | ||
replicas: 2 | ||
selector: | ||
matchLabels: | ||
app: redis | ||
role: master | ||
serviceName: redis | ||
template: | ||
metadata: | ||
labels: | ||
app: redis | ||
role: master | ||
spec: | ||
containers: | ||
- args: | ||
- /etc/redis.conf | ||
command: | ||
- redis-server | ||
env: | ||
- name: ALLOW_EMPTY_PASSWORD | ||
value: "yes" | ||
image: redis:6 | ||
name: redis | ||
ports: | ||
- containerPort: 6379 | ||
name: redis | ||
volumeMounts: | ||
- mountPath: /data | ||
name: redis-data | ||
- mountPath: /etc/ | ||
name: conf | ||
subPath: redis.conf | ||
initContainers: | ||
- command: | ||
- bash | ||
- -c | ||
- | | ||
set -ex | ||
# Generate mysql server-id from pod ordinal index. | ||
[[ `hostname` =~ -([0-9]+)$ ]] || exit 1 | ||
ordinal=${BASH_REMATCH[1]} | ||
# Copy appropriate conf.d files from config-map to emptyDir. | ||
if [[ $ordinal -eq 0 ]]; then | ||
cp /mnt/config-map/master.conf /etc/redis.conf | ||
else | ||
cp /mnt/config-map/slave.conf /etc/redis.conf | ||
fi | ||
image: redis:6 | ||
name: init-redis | ||
volumeMounts: | ||
- mountPath: /etc | ||
name: conf | ||
subPath: redis.conf | ||
- mountPath: /mnt/config-map | ||
name: config-map | ||
volumes: | ||
- emptyDir: {} | ||
name: redis-data | ||
- emptyDir: {} | ||
name: conf | ||
- configMap: | ||
name: redis | ||
name: config-map |
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,4 @@ | ||
resources: | ||
- redis-cm.yaml | ||
- redis-sts.yaml | ||
- redis-svc.yaml |
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,19 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: redis | ||
data: | ||
master.conf: | | ||
bind 0.0.0.0 | ||
protected-mode yes | ||
port 6379 | ||
tcp-backlog 511 | ||
timeout 0 | ||
tcp-keepalive 300 | ||
daemonize no | ||
supervised no | ||
pidfile /var/run/redis_6379.pid | ||
loglevel notice | ||
logfile "" | ||
slave.conf: | | ||
slaveof redis-0.redis 6379 |
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,67 @@ | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: redis | ||
labels: | ||
app: redis | ||
spec: | ||
selector: | ||
matchLabels: | ||
role: master | ||
app: redis | ||
serviceName: "redis" | ||
replicas: 2 | ||
template: | ||
metadata: | ||
labels: | ||
role: master | ||
app: redis | ||
spec: | ||
initContainers: | ||
- name: init-redis | ||
image: redis:6 | ||
command: | ||
- bash | ||
- "-c" | ||
- | | ||
set -ex | ||
# Generate mysql server-id from pod ordinal index. | ||
[[ `hostname` =~ -([0-9]+)$ ]] || exit 1 | ||
ordinal=${BASH_REMATCH[1]} | ||
# Copy appropriate conf.d files from config-map to emptyDir. | ||
if [[ $ordinal -eq 0 ]]; then | ||
cp /mnt/config-map/master.conf /etc/redis.conf | ||
else | ||
cp /mnt/config-map/slave.conf /etc/redis.conf | ||
fi | ||
volumeMounts: | ||
- name: conf | ||
mountPath: /etc | ||
subPath: redis.conf | ||
- name: config-map | ||
mountPath: /mnt/config-map | ||
containers: | ||
- name: redis | ||
image: redis:6 | ||
command: [ "redis-server" ] | ||
args: [ "/etc/redis.conf" ] | ||
env: | ||
- name: ALLOW_EMPTY_PASSWORD | ||
value: "yes" | ||
ports: | ||
- name: redis | ||
containerPort: 6379 | ||
volumeMounts: | ||
- name: redis-data | ||
mountPath: /data | ||
- name: conf | ||
mountPath: /etc/ | ||
subPath: redis.conf | ||
volumes: | ||
- name: "redis-data" | ||
emptyDir: { } | ||
- name: conf | ||
emptyDir: { } | ||
- name: config-map | ||
configMap: | ||
name: redis |
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: Service | ||
metadata: | ||
name: redis | ||
labels: | ||
app: redis | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- name: redis | ||
port: 6379 | ||
targetPort: redis | ||
clusterIP: None | ||
selector: | ||
app: redis | ||
role: master |
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.