Commit e70a8164 authored by George Papathanail's avatar George Papathanail
Browse files

fix: integrate official NATS Helm chart

parent bb4d79a6
Loading
Loading
Loading
Loading
+13 −11
Original line number Diff line number Diff line
@@ -111,17 +111,19 @@ portal:
    nodePort: 30082


databus:
  nats:
    enabled: true

nats:
  service:
    type: NodePort
    client:
    ports:
      nats:
        enabled: true
        port: 4222
        nodePort: 30222
    monitoring:
      monitor:
        enabled: true
        port: 8222
        nodePort: 30822
 No newline at end of file
  config:
    jetstream:
      enabled: false
    auth:
      enabled: false
 No newline at end of file
+3 −2
Original line number Diff line number Diff line
@@ -45,5 +45,6 @@ dependencies:
    version: "1.0.0"
    condition: portal.enabled
  - name: nats
    version: "1.0.0"
    condition: nats.enabled
 No newline at end of file
    version: "1.2.10"
    repository: "https://nats-io.github.io/k8s/helm/charts/"
    condition: databus.nats.enabled
 No newline at end of file
+0 −6
Original line number Diff line number Diff line
apiVersion: v2
name: nats
description: NATS message broker for the Open Operator Platform DataBus
type: application
version: 1.0.0
appVersion: "2.10"
 No newline at end of file
+0 −27
Original line number Diff line number Diff line
{{- define "nats.name" -}}
{{- default .Chart.Name .Values.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "nats.fullname" -}}
{{- .Values.name | default (include "nats.name" .) | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "nats.namespace" -}}
{{- default .Release.Namespace .Values.global.namespace -}}
{{- end -}}

{{- define "nats.labels" -}}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
app.kubernetes.io/name: {{ include "nats.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.commonLabels }}
{{ toYaml . }}
{{- end }}
{{- end -}}

{{- define "nats.selectorLabels" -}}
app.kubernetes.io/name: {{ include "nats.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
 No newline at end of file
+0 −28
Original line number Diff line number Diff line
{{- if .Values.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "nats.fullname" . }}-config
  namespace: {{ include "nats.namespace" . }}
  labels:
    {{- include "nats.labels" . | nindent 4 }}
data:
  nats.conf: |
    port: {{ .Values.service.client.port }}
    http_port: {{ .Values.service.monitoring.port }}

    {{- if .Values.config.auth.enabled }}
    authorization {
      user: {{ .Values.config.auth.username | quote }}
      password: {{ .Values.config.auth.password | quote }}
    }
    {{- end }}

    {{- if .Values.config.jetstream.enabled }}
    jetstream {
      store_dir: {{ .Values.config.jetstream.storeDir | quote }}
      max_memory_store: {{ .Values.config.jetstream.maxMemoryStore }}
      max_file_store: {{ .Values.config.jetstream.maxFileStore }}
    }
    {{- end }}
{{- end }}
 No newline at end of file
Loading