|
1 | 1 | {{- define "splunk-connect-for-snmp.mongo_uri" -}} |
| 2 | + |
| 3 | +{{- if and .Values.mongodb.auth.enabled .Values.mongodb.auth.existingSecret }} |
| 4 | + {{- $mongoSecretName := .Values.mongodb.auth.existingSecret }} |
| 5 | + {{- $mongoSecret := lookup "v1" "Secret" .Release.Namespace $mongoSecretName }} |
| 6 | + |
| 7 | + {{- if not $mongoSecret }} |
| 8 | + {{- fail (printf "Secret '%s' not found in namespace '%s'. Please create it before deploying." $mongoSecretName .Release.Namespace) }} |
| 9 | + {{- end }} |
| 10 | + |
| 11 | + {{- $mongoPassword := get $mongoSecret.data "mongodb-root-password" | b64dec }} |
| 12 | + |
| 13 | + {{- if eq .Values.mongodb.architecture "replicaset" }} |
| 14 | + {{- printf "mongodb+srv://root:%s@%s-mongodb-headless.%s.svc.%s/?tls=false&ssl=false&replicaSet=rs0" $mongoPassword .Release.Name .Release.Namespace .Values.mongodb.clusterDomain}} |
| 15 | + {{- else }} |
| 16 | + {{- printf "mongodb://root:%s@%s-mongodb:27017" $mongoPassword .Release.Name }} |
| 17 | + {{- end }} |
| 18 | +{{- else }} |
| 19 | + |
2 | 20 | {{- if eq .Values.mongodb.architecture "replicaset" }} |
3 | 21 | {{- printf "mongodb+srv://%s-mongodb-headless.%s.svc.%s/?tls=false&ssl=false&replicaSet=rs0" .Release.Name .Release.Namespace .Values.mongodb.clusterDomain}} |
4 | 22 | {{- else }} |
5 | 23 | {{- printf "mongodb://%s-mongodb:27017" .Release.Name }} |
6 | | -{{- end }} |
7 | | -{{- end }} |
| 24 | +{{- end }} |
| 25 | + |
| 26 | +{{- end }} |
| 27 | +{{- end }} |
8 | 28 |
|
9 | 29 | {{- define "splunk-connect-for-snmp.mongodbHost" -}} |
10 | 30 | {{- if .Values.mongodbHost }} |
|
15 | 35 | {{- end }} |
16 | 36 |
|
17 | 37 | {{- define "splunk-connect-for-snmp.celery_url" -}} |
| 38 | + |
| 39 | +{{- if and .Values.redis.auth.enabled .Values.redis.auth.existingSecret }} |
| 40 | + {{- $redisSecretName := .Values.redis.auth.existingSecret }} |
| 41 | + {{- $redisSecret := lookup "v1" "Secret" .Release.Namespace $redisSecretName }} |
| 42 | + |
| 43 | + {{- if not $redisSecret }} |
| 44 | + {{- fail (printf "Secret '%s' not found in namespace '%s'. Please create it before deploying." $redisSecretName .Release.Namespace) }} |
| 45 | + {{- end }} |
| 46 | + |
| 47 | + {{- $redisPassword := get $redisSecret.data "redis-password" | b64dec }} |
| 48 | + |
| 49 | + {{- if and ( eq .Values.redis.architecture "replication" ) .Values.redis.sentinel.enabled }} |
| 50 | + {{- printf "redis://:%s@%s-redis:6379/0" $redisPassword .Release.Name }} |
| 51 | + {{- else }} |
| 52 | + {{- printf "redis://:%s@%s-redis-master:6379/0" $redisPassword .Release.Name }} |
| 53 | + {{- end }} |
| 54 | +{{- else }} |
| 55 | + |
| 56 | + |
18 | 57 | {{- if and ( eq .Values.redis.architecture "replication" ) .Values.redis.sentinel.enabled }} |
19 | 58 | {{- printf "redis://%s-redis:6379/0" .Release.Name }} |
20 | 59 | {{- else }} |
21 | 60 | {{- printf "redis://%s-redis-master:6379/0" .Release.Name }} |
| 61 | +{{- end }} |
| 62 | + |
22 | 63 | {{- end }} |
23 | 64 | {{- end }} |
24 | 65 |
|
25 | 66 | {{- define "splunk-connect-for-snmp.redis_url" -}} |
| 67 | + |
| 68 | +{{- if and .Values.redis.auth.enabled .Values.redis.auth.existingSecret }} |
| 69 | + {{- $redisSecretName := .Values.redis.auth.existingSecret }} |
| 70 | + {{- $redisSecret := lookup "v1" "Secret" .Release.Namespace $redisSecretName }} |
| 71 | + |
| 72 | + {{- if not $redisSecret }} |
| 73 | + {{- fail (printf "Secret '%s' not found in namespace '%s'. Please create it before deploying." $redisSecretName .Release.Namespace) }} |
| 74 | + {{- end }} |
| 75 | + |
| 76 | + {{- $redisPassword := get $redisSecret.data "redis-password" | b64dec }} |
| 77 | + |
| 78 | + {{- if and ( eq .Values.redis.architecture "replication" ) .Values.redis.sentinel.enabled }} |
| 79 | + {{- printf "redis://:%s@%s-redis:6379/1" $redisPassword .Release.Name }} |
| 80 | + {{- else }} |
| 81 | + {{- printf "redis://:%s@%s-redis-master:6379/1" $redisPassword .Release.Name }} |
| 82 | + {{- end }} |
| 83 | +{{- else }} |
| 84 | + |
26 | 85 | {{- if and ( eq .Values.redis.architecture "replication" ) .Values.redis.sentinel.enabled }} |
27 | 86 | {{- printf "redis://%s-redis:6379/1" .Release.Name }} |
28 | 87 | {{- else }} |
29 | 88 | {{- printf "redis://%s-redis-master:6379/1" .Release.Name }} |
| 89 | +{{- end }} |
| 90 | + |
30 | 91 | {{- end }} |
31 | 92 | {{- end }} |
32 | 93 |
|
|
0 commit comments