59 lines
1.6 KiB
YAML
59 lines
1.6 KiB
YAML
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: {{ .Chart.Name }}-nats-config
|
|
data:
|
|
nats.conf: |
|
|
# PID file shared with configuration reloader.
|
|
pid_file: "/var/run/nats/nats.pid"
|
|
|
|
###############
|
|
# #
|
|
# Monitoring #
|
|
# #
|
|
###############
|
|
http: 8222
|
|
server_name: $POD_NAME
|
|
|
|
{{- if .Values.nats.jetstream.enabled }}
|
|
###################################
|
|
# #
|
|
# NATS JetStream #
|
|
# #
|
|
###################################
|
|
jetstream {
|
|
{{- if .Values.nats.jetstream.memStorage.enabled }}
|
|
max_mem: {{ .Values.nats.jetstream.memStorage.size }}
|
|
{{- end }}
|
|
|
|
{{- if .Values.nats.jetstream.fileStorage.enabled }}
|
|
store_dir: {{ .Values.nats.jetstream.fileStorage.storageDirectory }}
|
|
max_file: {{ .Values.nats.jetstream.fileStorage.size }}
|
|
{{- end }}
|
|
}
|
|
{{- end }}
|
|
|
|
{{- if .Values.nats.cluster.enabled }}
|
|
###################################
|
|
# #
|
|
# NATS Full Mesh Clustering Setup #
|
|
# #
|
|
###################################
|
|
cluster {
|
|
port: 6222
|
|
name: {{ .Chart.Name }}-nats-cluster
|
|
|
|
routes = [
|
|
{{- range $i := until (int .Values.nats.cluster.replicas) }}
|
|
nats://{{ $.Chart.Name }}-nats-{{ $i }}.{{ $.Chart.Name }}-nats.{{ $.Release.Namespace }}.svc.cluster.local:6222,
|
|
{{- end }}
|
|
]
|
|
|
|
cluster_advertise: $CLUSTER_ADVERTISE
|
|
connect_retries: 120
|
|
}
|
|
{{- end }}
|
|
|
|
lame_duck_duration: 120s
|