Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cmd/argocd/commands/headless/headless.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ type forwardCacheClient struct {

func (c *forwardCacheClient) doLazy(action func(client cache.CacheClient) error) error {
c.init.Do(func() {
// Check for external Redis server address to bypass in-cluster pod discovery and port-forwarding.
externalRedis := os.Getenv("ARGOCD_REDIS_SERVER")
if externalRedis != "" {
redisClient := redis.NewClient(&redis.Options{Addr: externalRedis, Password: c.redisPassword})
c.client = cache.NewRedisCache(redisClient, time.Hour, c.compression)
return
}

overrides := clientcmd.ConfigOverrides{
CurrentContext: c.context,
}
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ The following environment variables can be used with `argocd` CLI:
| `ARGOCD_REPO_SERVER_NAME` | the Argo CD Repository Server name (default "argocd-repo-server") |
| `ARGOCD_APPLICATION_CONTROLLER_NAME` | the Argo CD Application Controller name (default "argocd-application-controller") |
| `ARGOCD_REDIS_NAME` | the Argo CD Redis name (default "argocd-redis") |
| `ARGOCD_REDIS_SERVER` | the address of an external Redis server to use in --core mode. If set, the CLI bypasses in-cluster pod discovery and port-forwarding. <br> eg. `ARGOCD_REDIS_SERVER=localhost:6379` |
| `ARGOCD_REDIS_HAPROXY_NAME` | the Argo CD Redis HA Proxy name (default "argocd-redis-ha-haproxy") |
| `ARGOCD_GRPC_KEEP_ALIVE_MIN` | defines the GRPCKeepAliveEnforcementMinimum, used in the grpc.KeepaliveEnforcementPolicy. Expects a "Duration" format (default `10s`). |
Loading