apiVersion: v1
kind: ConfigMap
metadata:
  name: fluvio-config-map
data:
  fluvioClientConfig: |
    version = "2.0"
    current_profile = "k8-config-map-deployment"

    [profile.k8-config-map-deployment]
    cluster = "k8-config-map-deployment"

    [cluster.k8-config-map-deployment]
    endpoint = "fluvio-sc-public:9003"
    use_spu_local_address = true

    {{ if .Values.tls }}

    [cluster.k8-config-map-deployment.tls]
    tls_policy = "verified"
    tls_source = "files"

    [cluster.k8-config-map-deployment.tls.certs]
    domain = "{{ .Values.cert.domain }}"
    key = "/var/certs/client-tls/tls.key"
    cert = "/var/certs/client-tls/tls.crt"
    ca_cert = "/var/certs/ca/ca.crt"

    {{else}}

    [cluster.k8-config-map-deployment.tls]
    tls_policy = "disabled"

    {{end}}