Skip to content

Commit

Permalink
fix(redis): explicit bind to redis and sentinel for IPv4 clusters (ar…
Browse files Browse the repository at this point in the history
…goproj#11388) (argoproj#11862)

* fix(redis): explicit bind to redis and sentinel for IPv4 clusters argoproj#11388

Signed-off-by: rumstead <rjumstead@gmail.com>

* fix(redis): run manifests generate

Signed-off-by: rumstead <rjumstead@gmail.com>

* fix(redis): run manifests generate

Signed-off-by: rumstead <rjumstead@gmail.com>

* Retrigger CI pipeline

Signed-off-by: rumstead <rjumstead@gmail.com>

Signed-off-by: rumstead <rjumstead@gmail.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: schakrad <chakradari.sindhu@gmail.com>
  • Loading branch information
2 people authored and schakrad committed Mar 14, 2023
1 parent b650b3e commit 10f8108
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 161 deletions.
6 changes: 3 additions & 3 deletions docs/operator-manual/high_availability.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ A set of HA manifests are provided for users who wish to run Argo CD in a highly

[Manifests ⧉](https://github.com/argoproj/argo-cd/tree/master/manifests)

!!! note
The HA installation will require at least three different nodes due to pod anti-affinity roles in the specs.
> **NOTE:** The HA installation will require at least three different nodes due to pod anti-affinity roles in the
> specs. Additionally, IPv6 only clusters are not supported.
## Scaling Up

Expand Down Expand Up @@ -188,4 +188,4 @@ spec:
targetRevision: HEAD
path: my-application
# ...
```
```
10 changes: 6 additions & 4 deletions manifests/ha/base/redis-ha/chart/upstream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ data:
port 6379
rename-command FLUSHDB ""
rename-command FLUSHALL ""
bind 0.0.0.0
maxmemory 0
maxmemory-policy volatile-lru
min-replicas-max-lag 5
Expand All @@ -53,6 +54,7 @@ data:
sentinel.conf: |
dir "/data"
port 26379
bind 0.0.0.0
sentinel down-after-milliseconds argocd 10000
sentinel failover-timeout argocd 180000
maxclients 10000
Expand Down Expand Up @@ -618,7 +620,7 @@ data:
timeout check 2s
listen health_check_http_url
bind [::]:8888 v4v6
bind :8888
mode http
monitor-uri /healthz
option dontlognull
Expand Down Expand Up @@ -665,7 +667,7 @@ data:
# decide redis backend to use
#master
frontend ft_redis_master
bind [::]:6379 v4v6
bind :6379
use_backend bk_redis_master
# Check all redis servers to see if they think they are master
backend bk_redis_master
Expand Down Expand Up @@ -1045,7 +1047,7 @@ spec:
release: argocd
revision: "1"
annotations:
checksum/config: 1f7a9ffcacb3871ceb9b0741c0714e3f7fa656d426a398c1f727fffb01073f35
checksum/config: 718bbb277da8610063a7c0fd810984577c2e8ab215815a71211dfa6e20f67321
spec:
# Needed when using unmodified rbac-setup.yml

Expand Down Expand Up @@ -1153,7 +1155,7 @@ spec:
template:
metadata:
annotations:
checksum/init-config: 84ccf6a9b8a7fa3ae5b62a8f17d6c65a5197e9605da9b2761179bf942828eefe
checksum/init-config: 69130412bda04eacad3530cb7bcf26cf121401e725e15d0959dd71a7380afe75
labels:
release: argocd
app: redis-ha
Expand Down
5 changes: 5 additions & 0 deletions manifests/ha/base/redis-ha/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ redis-ha:
masterGroupName: argocd
config:
save: "\"\""
bind: "0.0.0.0"
haproxy:
enabled: true
IPv6:
enabled: false
image:
tag: 2.6.2-alpine
containerSecurityContext: null
Expand All @@ -17,3 +20,5 @@ redis-ha:
image:
tag: 7.0.7-alpine
containerSecurityContext: null
sentinel:
bind: "0.0.0.0"
113 changes: 36 additions & 77 deletions manifests/ha/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15943,81 +15943,38 @@ data:
fi
fi
done
haproxy.cfg: |
defaults REDIS
mode tcp
timeout connect 4s
timeout server 6m
timeout client 6m
timeout check 2s

listen health_check_http_url
bind [::]:8888 v4v6
mode http
monitor-uri /healthz
option dontlognull
# Check Sentinel and whether they are nominated master
backend check_if_redis_is_master_0
mode tcp
option tcp-check
tcp-check connect
tcp-check send PING\r\n
tcp-check expect string +PONG
tcp-check send SENTINEL\ get-master-addr-by-name\ argocd\r\n
tcp-check expect string REPLACE_ANNOUNCE0
tcp-check send QUIT\r\n
server R0 argocd-redis-ha-announce-0:26379 check inter 3s
server R1 argocd-redis-ha-announce-1:26379 check inter 3s
server R2 argocd-redis-ha-announce-2:26379 check inter 3s
# Check Sentinel and whether they are nominated master
backend check_if_redis_is_master_1
mode tcp
option tcp-check
tcp-check connect
tcp-check send PING\r\n
tcp-check expect string +PONG
tcp-check send SENTINEL\ get-master-addr-by-name\ argocd\r\n
tcp-check expect string REPLACE_ANNOUNCE1
tcp-check send QUIT\r\n
server R0 argocd-redis-ha-announce-0:26379 check inter 3s
server R1 argocd-redis-ha-announce-1:26379 check inter 3s
server R2 argocd-redis-ha-announce-2:26379 check inter 3s
# Check Sentinel and whether they are nominated master
backend check_if_redis_is_master_2
mode tcp
option tcp-check
tcp-check connect
tcp-check send PING\r\n
tcp-check expect string +PONG
tcp-check send SENTINEL\ get-master-addr-by-name\ argocd\r\n
tcp-check expect string REPLACE_ANNOUNCE2
tcp-check send QUIT\r\n
server R0 argocd-redis-ha-announce-0:26379 check inter 3s
server R1 argocd-redis-ha-announce-1:26379 check inter 3s
server R2 argocd-redis-ha-announce-2:26379 check inter 3s

# decide redis backend to use
#master
frontend ft_redis_master
bind [::]:6379 v4v6
use_backend bk_redis_master
# Check all redis servers to see if they think they are master
backend bk_redis_master
mode tcp
option tcp-check
tcp-check connect
tcp-check send PING\r\n
tcp-check expect string +PONG
tcp-check send info\ replication\r\n
tcp-check expect string role:master
tcp-check send QUIT\r\n
tcp-check expect string +OK
use-server R0 if { srv_is_up(R0) } { nbsrv(check_if_redis_is_master_0) ge 2 }
server R0 argocd-redis-ha-announce-0:6379 check inter 3s fall 1 rise 1
use-server R1 if { srv_is_up(R1) } { nbsrv(check_if_redis_is_master_1) ge 2 }
server R1 argocd-redis-ha-announce-1:6379 check inter 3s fall 1 rise 1
use-server R2 if { srv_is_up(R2) } { nbsrv(check_if_redis_is_master_2) ge 2 }
server R2 argocd-redis-ha-announce-2:6379 check inter 3s fall 1 rise 1
haproxy.cfg: "defaults REDIS\n mode tcp\n timeout connect 4s\n timeout server
6m\n timeout client 6m\n timeout check 2s\n\nlisten health_check_http_url\n
\ bind :8888 \n mode http\n monitor-uri /healthz\n option dontlognull\n#
Check Sentinel and whether they are nominated master\nbackend check_if_redis_is_master_0\n
\ mode tcp\n option tcp-check\n tcp-check connect\n tcp-check send PING\\r\\n\n
\ tcp-check expect string +PONG\n tcp-check send SENTINEL\\ get-master-addr-by-name\\
argocd\\r\\n\n tcp-check expect string REPLACE_ANNOUNCE0\n tcp-check send QUIT\\r\\n\n
\ server R0 argocd-redis-ha-announce-0:26379 check inter 3s\n server R1 argocd-redis-ha-announce-1:26379
check inter 3s\n server R2 argocd-redis-ha-announce-2:26379 check inter 3s\n#
Check Sentinel and whether they are nominated master\nbackend check_if_redis_is_master_1\n
\ mode tcp\n option tcp-check\n tcp-check connect\n tcp-check send PING\\r\\n\n
\ tcp-check expect string +PONG\n tcp-check send SENTINEL\\ get-master-addr-by-name\\
argocd\\r\\n\n tcp-check expect string REPLACE_ANNOUNCE1\n tcp-check send QUIT\\r\\n\n
\ server R0 argocd-redis-ha-announce-0:26379 check inter 3s\n server R1 argocd-redis-ha-announce-1:26379
check inter 3s\n server R2 argocd-redis-ha-announce-2:26379 check inter 3s\n#
Check Sentinel and whether they are nominated master\nbackend check_if_redis_is_master_2\n
\ mode tcp\n option tcp-check\n tcp-check connect\n tcp-check send PING\\r\\n\n
\ tcp-check expect string +PONG\n tcp-check send SENTINEL\\ get-master-addr-by-name\\
argocd\\r\\n\n tcp-check expect string REPLACE_ANNOUNCE2\n tcp-check send QUIT\\r\\n\n
\ server R0 argocd-redis-ha-announce-0:26379 check inter 3s\n server R1 argocd-redis-ha-announce-1:26379
check inter 3s\n server R2 argocd-redis-ha-announce-2:26379 check inter 3s\n\n#
decide redis backend to use\n#master\nfrontend ft_redis_master\n bind :6379 \n
\ use_backend bk_redis_master\n# Check all redis servers to see if they think
they are master\nbackend bk_redis_master\n mode tcp\n option tcp-check\n tcp-check
connect\n tcp-check send PING\\r\\n\n tcp-check expect string +PONG\n tcp-check
send info\\ replication\\r\\n\n tcp-check expect string role:master\n tcp-check
send QUIT\\r\\n\n tcp-check expect string +OK\n use-server R0 if { srv_is_up(R0)
} { nbsrv(check_if_redis_is_master_0) ge 2 }\n server R0 argocd-redis-ha-announce-0:6379
check inter 3s fall 1 rise 1\n use-server R1 if { srv_is_up(R1) } { nbsrv(check_if_redis_is_master_1)
ge 2 }\n server R1 argocd-redis-ha-announce-1:6379 check inter 3s fall 1 rise
1\n use-server R2 if { srv_is_up(R2) } { nbsrv(check_if_redis_is_master_2) ge
2 }\n server R2 argocd-redis-ha-announce-2:6379 check inter 3s fall 1 rise 1\n"
haproxy_init.sh: |
HAPROXY_CONF=/data/haproxy.cfg
cp /readonly/haproxy.cfg "$HAPROXY_CONF"
Expand Down Expand Up @@ -16316,6 +16273,7 @@ data:
port 6379
rename-command FLUSHDB ""
rename-command FLUSHALL ""
bind 0.0.0.0
maxmemory 0
maxmemory-policy volatile-lru
min-replicas-max-lag 5
Expand All @@ -16327,6 +16285,7 @@ data:
sentinel.conf: |
dir "/data"
port 26379
bind 0.0.0.0
sentinel down-after-milliseconds argocd 10000
sentinel failover-timeout argocd 180000
maxclients 10000
Expand Down Expand Up @@ -17020,7 +16979,7 @@ spec:
template:
metadata:
annotations:
checksum/config: 1f7a9ffcacb3871ceb9b0741c0714e3f7fa656d426a398c1f727fffb01073f35
checksum/config: 718bbb277da8610063a7c0fd810984577c2e8ab215815a71211dfa6e20f67321
labels:
app.kubernetes.io/name: argocd-redis-ha-haproxy
name: argocd-redis-ha-haproxy
Expand Down Expand Up @@ -17892,7 +17851,7 @@ spec:
template:
metadata:
annotations:
checksum/init-config: 84ccf6a9b8a7fa3ae5b62a8f17d6c65a5197e9605da9b2761179bf942828eefe
checksum/init-config: 69130412bda04eacad3530cb7bcf26cf121401e725e15d0959dd71a7380afe75
labels:
app.kubernetes.io/name: argocd-redis-ha
spec:
Expand Down
113 changes: 36 additions & 77 deletions manifests/ha/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -747,81 +747,38 @@ data:
fi
fi
done
haproxy.cfg: |
defaults REDIS
mode tcp
timeout connect 4s
timeout server 6m
timeout client 6m
timeout check 2s
listen health_check_http_url
bind [::]:8888 v4v6
mode http
monitor-uri /healthz
option dontlognull
# Check Sentinel and whether they are nominated master
backend check_if_redis_is_master_0
mode tcp
option tcp-check
tcp-check connect
tcp-check send PING\r\n
tcp-check expect string +PONG
tcp-check send SENTINEL\ get-master-addr-by-name\ argocd\r\n
tcp-check expect string REPLACE_ANNOUNCE0
tcp-check send QUIT\r\n
server R0 argocd-redis-ha-announce-0:26379 check inter 3s
server R1 argocd-redis-ha-announce-1:26379 check inter 3s
server R2 argocd-redis-ha-announce-2:26379 check inter 3s
# Check Sentinel and whether they are nominated master
backend check_if_redis_is_master_1
mode tcp
option tcp-check
tcp-check connect
tcp-check send PING\r\n
tcp-check expect string +PONG
tcp-check send SENTINEL\ get-master-addr-by-name\ argocd\r\n
tcp-check expect string REPLACE_ANNOUNCE1
tcp-check send QUIT\r\n
server R0 argocd-redis-ha-announce-0:26379 check inter 3s
server R1 argocd-redis-ha-announce-1:26379 check inter 3s
server R2 argocd-redis-ha-announce-2:26379 check inter 3s
# Check Sentinel and whether they are nominated master
backend check_if_redis_is_master_2
mode tcp
option tcp-check
tcp-check connect
tcp-check send PING\r\n
tcp-check expect string +PONG
tcp-check send SENTINEL\ get-master-addr-by-name\ argocd\r\n
tcp-check expect string REPLACE_ANNOUNCE2
tcp-check send QUIT\r\n
server R0 argocd-redis-ha-announce-0:26379 check inter 3s
server R1 argocd-redis-ha-announce-1:26379 check inter 3s
server R2 argocd-redis-ha-announce-2:26379 check inter 3s
# decide redis backend to use
#master
frontend ft_redis_master
bind [::]:6379 v4v6
use_backend bk_redis_master
# Check all redis servers to see if they think they are master
backend bk_redis_master
mode tcp
option tcp-check
tcp-check connect
tcp-check send PING\r\n
tcp-check expect string +PONG
tcp-check send info\ replication\r\n
tcp-check expect string role:master
tcp-check send QUIT\r\n
tcp-check expect string +OK
use-server R0 if { srv_is_up(R0) } { nbsrv(check_if_redis_is_master_0) ge 2 }
server R0 argocd-redis-ha-announce-0:6379 check inter 3s fall 1 rise 1
use-server R1 if { srv_is_up(R1) } { nbsrv(check_if_redis_is_master_1) ge 2 }
server R1 argocd-redis-ha-announce-1:6379 check inter 3s fall 1 rise 1
use-server R2 if { srv_is_up(R2) } { nbsrv(check_if_redis_is_master_2) ge 2 }
server R2 argocd-redis-ha-announce-2:6379 check inter 3s fall 1 rise 1
haproxy.cfg: "defaults REDIS\n mode tcp\n timeout connect 4s\n timeout server
6m\n timeout client 6m\n timeout check 2s\n\nlisten health_check_http_url\n
\ bind :8888 \n mode http\n monitor-uri /healthz\n option dontlognull\n#
Check Sentinel and whether they are nominated master\nbackend check_if_redis_is_master_0\n
\ mode tcp\n option tcp-check\n tcp-check connect\n tcp-check send PING\\r\\n\n
\ tcp-check expect string +PONG\n tcp-check send SENTINEL\\ get-master-addr-by-name\\
argocd\\r\\n\n tcp-check expect string REPLACE_ANNOUNCE0\n tcp-check send QUIT\\r\\n\n
\ server R0 argocd-redis-ha-announce-0:26379 check inter 3s\n server R1 argocd-redis-ha-announce-1:26379
check inter 3s\n server R2 argocd-redis-ha-announce-2:26379 check inter 3s\n#
Check Sentinel and whether they are nominated master\nbackend check_if_redis_is_master_1\n
\ mode tcp\n option tcp-check\n tcp-check connect\n tcp-check send PING\\r\\n\n
\ tcp-check expect string +PONG\n tcp-check send SENTINEL\\ get-master-addr-by-name\\
argocd\\r\\n\n tcp-check expect string REPLACE_ANNOUNCE1\n tcp-check send QUIT\\r\\n\n
\ server R0 argocd-redis-ha-announce-0:26379 check inter 3s\n server R1 argocd-redis-ha-announce-1:26379
check inter 3s\n server R2 argocd-redis-ha-announce-2:26379 check inter 3s\n#
Check Sentinel and whether they are nominated master\nbackend check_if_redis_is_master_2\n
\ mode tcp\n option tcp-check\n tcp-check connect\n tcp-check send PING\\r\\n\n
\ tcp-check expect string +PONG\n tcp-check send SENTINEL\\ get-master-addr-by-name\\
argocd\\r\\n\n tcp-check expect string REPLACE_ANNOUNCE2\n tcp-check send QUIT\\r\\n\n
\ server R0 argocd-redis-ha-announce-0:26379 check inter 3s\n server R1 argocd-redis-ha-announce-1:26379
check inter 3s\n server R2 argocd-redis-ha-announce-2:26379 check inter 3s\n\n#
decide redis backend to use\n#master\nfrontend ft_redis_master\n bind :6379 \n
\ use_backend bk_redis_master\n# Check all redis servers to see if they think
they are master\nbackend bk_redis_master\n mode tcp\n option tcp-check\n tcp-check
connect\n tcp-check send PING\\r\\n\n tcp-check expect string +PONG\n tcp-check
send info\\ replication\\r\\n\n tcp-check expect string role:master\n tcp-check
send QUIT\\r\\n\n tcp-check expect string +OK\n use-server R0 if { srv_is_up(R0)
} { nbsrv(check_if_redis_is_master_0) ge 2 }\n server R0 argocd-redis-ha-announce-0:6379
check inter 3s fall 1 rise 1\n use-server R1 if { srv_is_up(R1) } { nbsrv(check_if_redis_is_master_1)
ge 2 }\n server R1 argocd-redis-ha-announce-1:6379 check inter 3s fall 1 rise
1\n use-server R2 if { srv_is_up(R2) } { nbsrv(check_if_redis_is_master_2) ge
2 }\n server R2 argocd-redis-ha-announce-2:6379 check inter 3s fall 1 rise 1\n"
haproxy_init.sh: |
HAPROXY_CONF=/data/haproxy.cfg
cp /readonly/haproxy.cfg "$HAPROXY_CONF"
Expand Down Expand Up @@ -1120,6 +1077,7 @@ data:
port 6379
rename-command FLUSHDB ""
rename-command FLUSHALL ""
bind 0.0.0.0
maxmemory 0
maxmemory-policy volatile-lru
min-replicas-max-lag 5
Expand All @@ -1131,6 +1089,7 @@ data:
sentinel.conf: |
dir "/data"
port 26379
bind 0.0.0.0
sentinel down-after-milliseconds argocd 10000
sentinel failover-timeout argocd 180000
maxclients 10000
Expand Down Expand Up @@ -1824,7 +1783,7 @@ spec:
template:
metadata:
annotations:
checksum/config: 1f7a9ffcacb3871ceb9b0741c0714e3f7fa656d426a398c1f727fffb01073f35
checksum/config: 718bbb277da8610063a7c0fd810984577c2e8ab215815a71211dfa6e20f67321
labels:
app.kubernetes.io/name: argocd-redis-ha-haproxy
name: argocd-redis-ha-haproxy
Expand Down Expand Up @@ -2696,7 +2655,7 @@ spec:
template:
metadata:
annotations:
checksum/init-config: 84ccf6a9b8a7fa3ae5b62a8f17d6c65a5197e9605da9b2761179bf942828eefe
checksum/init-config: 69130412bda04eacad3530cb7bcf26cf121401e725e15d0959dd71a7380afe75
labels:
app.kubernetes.io/name: argocd-redis-ha
spec:
Expand Down

0 comments on commit 10f8108

Please sign in to comment.