<p>I'm trying to setup Kafka in a Kubernetes cluster using helm.</p>

<p>I've used the <a href="https://docs.confluent.io/current/installation/installing_cp/cp-helm-charts/docs/index.html" rel="nofollow noreferrer">Confluent helm chart</a>, which is quite complete, to install Kafka.</p>

<p>I then tried to see how <a href="https://docs.confluent.io/current/connect/kafka-connect-elasticsearch/index.html#load-the-elasticsearch-connector" rel="nofollow noreferrer">elastic Kafka connect sink</a> is configured. One point particularly strikes me : the <code>confluent load elasticsearch-sink</code> command. How can I have it done reproducibely when container is started ?
Furthermore, to configure elastic, I have to set a properties file. Am I right to use a <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/" rel="nofollow noreferrer">ConfigMap</a> ? I'm however confused, because I'll have to change YAML configuration produced by helm, which doesn't seems so reproducable ...</p>

<p>Has someone any advice ?</p>

Riduidel
<blockquote>
  <p>One point particularly strikes me : the <code>confluent load elasticsearch-sink</code> command</p>
</blockquote>

<p>The <code>confluent</code> command is meant to be used on <code>localhost</code> development / getting started envionments <strong>only</strong>. It therefore wouldn't know about Kubernetes (e.g. you would need an Ingress controller to expose the Connect REST API). </p>

<blockquote>
  <p>Am I right to use a ConfigMap ?</p>
</blockquote>

<p>I don't think that is correct. At least not outside of an Operator Framework for Kafka Connect (if one existed). </p>

<p>Connect is <a href="https://docs.confluent.io/current/connect/references/restapi.html" rel="nofollow noreferrer">configured through a JSON REST API</a>. </p>

<p>Therefore, also isn't available to load a configuration at startup. It needs to be POST'd manually, then that config will be persisted in the <code>CONNECT_CONFIG_STORAGE_TOPIC</code> of Kafka. </p>

<p>Internally, <code>confluent load</code> is literally a <code>curl -XPOST -H 'Content-Type: application/json' -d${file} localhost:8083/connectors</code></p>
