apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "diagrid-dashboard.fullname" . }}-statestore
data:
  statestore.yaml: |
    apiVersion: dapr.io/v1alpha1
    kind: Component
    metadata:
      name: statestore
      namespace: {{ .Values.statestore.namespace | default "default" }}
    scopes:
      - {{ .Values.statestore.scope }}
    spec:
      metadata:
        - name: redisHost
          value: {{ .Values.statestore.redis }}:6379
        - name: redisUsername
          value: default
        - name: redisPassword
          value: {{ .Values.statestore.password | default "secret" }}
        - name: actorStateStore
          value: "true"
        - name: redisDB
          value: "{{ .Values.statestore.redisDB | default "0" }}"
      type: state.redis
      version: v1
