Skip to content

Commit

Permalink
Add support for TLS redis connection (#2310)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramanan-ravi committed Sep 17, 2024
1 parent eec2b42 commit c56fb4b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
13 changes: 7 additions & 6 deletions deepfence_utils/directory/directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ const (
type NamespaceID string

type RedisConfig struct {
Endpoint string
Password string
Database int
Endpoint string
Password string
Database int
TLSConfig string
}

type Neo4jConfig struct {
Expand Down Expand Up @@ -182,9 +183,9 @@ func initRedis() RedisConfig {
}
redisTLSConfig := os.Getenv("DEEPFENCE_REDIS_TLS")
return RedisConfig{
Endpoint: redisEndpoint,
Password: redisPassword,
Database: redisDBNumber,
Endpoint: redisEndpoint,
Password: redisPassword,
Database: redisDBNumber,
TLSConfig: redisTLSConfig,
}
}
Expand Down
1 change: 1 addition & 0 deletions deepfence_utils/directory/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package directory

import (
"context"
"crypto/tls"
"sync"

"github.com/redis/go-redis/v9"
Expand Down
1 change: 1 addition & 0 deletions deployment-scripts/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ x-service-variables: &common-creds
# set aws s3 bucket region if using s3 buckets
DEEPFENCE_FILE_SERVER_REGION: ""
DEEPFENCE_REDIS_DB_NUMBER: 0
DEEPFENCE_REDIS_TLS: "" # Disable: "", Enable: "1"
DEEPFENCE_REDIS_HOST: deepfence-redis
DEEPFENCE_REDIS_PORT: 6379
DEEPFENCE_SAAS_DEPLOYMENT: "false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ metadata:
component: redis
stringData:
DEEPFENCE_REDIS_DB_NUMBER: "0"
DEEPFENCE_REDIS_TLS: ""
DEEPFENCE_REDIS_PORT: "6379"
DEEPFENCE_REDIS_HOST: {{ include "deepfence-console.fullname" . }}-redis.{{ .Release.Namespace }}.svc.{{ .Values.global.cluster_domain }}
{{- end }}

0 comments on commit c56fb4b

Please sign in to comment.