Skip to content

Commit

Permalink
feat: Auto-detect missing/duplicate messages (#369)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Collins <alex_collins@intuit.com>
  • Loading branch information
alexec authored Sep 22, 2021
1 parent 504a63d commit 9e7332a
Show file tree
Hide file tree
Showing 15 changed files with 768 additions and 22 deletions.
105 changes: 105 additions & 0 deletions config/apps/redis.yaml
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
4 changes: 4 additions & 0 deletions config/apps/redis/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resources:
- redis-cm.yaml
- redis-sts.yaml
- redis-svc.yaml
19 changes: 19 additions & 0 deletions config/apps/redis/redis-cm.yaml
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
67 changes: 67 additions & 0 deletions config/apps/redis/redis-sts.yaml
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
16 changes: 16 additions & 0 deletions config/apps/redis/redis-svc.yaml
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
109 changes: 109 additions & 0 deletions config/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14031,6 +14031,26 @@ subjects:
namespace: argo-dataflow-system
---
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
namespace: argo-dataflow-system
---
apiVersion: v1
kind: Secret
metadata:
name: ssh
Expand Down Expand Up @@ -14059,6 +14079,24 @@ spec:
---
apiVersion: v1
kind: Service
metadata:
labels:
app: redis
name: redis
namespace: argo-dataflow-system
spec:
clusterIP: None
ports:
- name: redis
port: 6379
targetPort: redis
selector:
app: redis
role: master
type: ClusterIP
---
apiVersion: v1
kind: Service
metadata:
name: testapi
namespace: argo-dataflow-system
Expand Down Expand Up @@ -14140,6 +14178,77 @@ spec:
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: redis
name: redis
namespace: argo-dataflow-system
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
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: testapi
namespace: argo-dataflow-system
Expand Down
Loading

0 comments on commit 9e7332a

Please sign in to comment.