<p>i am struggling to create a custom subject when receiving alerts from my AlertManager, i am doing it with manifest file:</p>
<pre><code>apiVersion: monitoring.coreos.com/v1alpha1
kind: AlertmanagerConfig
metadata:
  name: my-name
  labels:
    alertmanagerConfig: email
    alertconfig: email-config
spec:
  route:
    groupBy:
      - node
    groupWait: 30s
    groupInterval: 5m
    repeatInterval: 12h
    receiver: 'myReceiver'
  receivers:
  - name: 'Name'
    emailConfigs:
      - to: myemail@example.com
</code></pre>
<p>i have read that i need to add headers under the emailConfigs tab, but when i do like follows:</p>
<pre><code>apiVersion: monitoring.coreos.com/v1alpha1
kind: AlertmanagerConfig
metadata:
  name: my-name
  labels:
    alertmanagerConfig: email
    alertconfig: email-config
spec:
  route:
    groupBy:
      - node
    groupWait: 30s
    groupInterval: 5m
    repeatInterval: 12h
    receiver: 'myReceiver'
  receivers:
  - name: 'Name'
    emailConfigs:
      - to: myemail@example.com
        headers:
          - subject: &quot;MyTestSubject&quot;
</code></pre>
<p>or</p>
<pre><code>apiVersion: monitoring.coreos.com/v1alpha1
kind: AlertmanagerConfig
metadata:
  name: my-name
  labels:
    alertmanagerConfig: email
    alertconfig: email-config
spec:
  route:
    groupBy:
      - node
    groupWait: 30s
    groupInterval: 5m
    repeatInterval: 12h
    receiver: 'myReceiver'
  receivers:
  - name: 'Name'
    emailConfigs:
      - to: myemail@example.com
        headers:
          subject: &quot;MyTestSubject&quot;
</code></pre>
<p>I receive following errors:</p>
<p>either:</p>
<p>com.coreos.monitoring.v1alpha1.AlertmanagerConfig.spec.receivers.emailConfigs.headers, ValidationError(AlertmanagerConfig.spec.receivers[0].emailConfigs[0].headers[0]): missing required field &quot;key&quot; in com.coreos.monitoring.v1alpha1.AlertmanagerConfig.spec.receivers.emailConfigs.headers, ValidationError(AlertmanagerConfig.spec.receivers[0].emailConfigs[0].headers[0]): missing required field &quot;value&quot; in com.coreos.monitoring.v1alpha1.AlertmanagerConfig.spec.receivers.emailConfigs.headers];</p>
<p>or</p>
<p>error: error validating &quot;alert-config.yaml&quot;: error validating data: ValidationError(AlertmanagerConfig.spec.receivers[0].emailConfigs[0].headers): invalid type for com.coreos.monitoring.v1alpha1.AlertmanagerConfig.spec.receivers.emailConfigs.headers: got &quot;map&quot;, expected &quot;array&quot;</p>
<p>i have checked other solutions and everyone is doing it like
headers:
subject: mySubject<br />
but for some reason to me, it doesn't work</p>

Blackhat
<p>I managed to get it working:</p>
<pre><code>    emailConfigs:
      - to: myreceiver@mail
        headers:
          - key: subject
            value: &quot;Custom subject goes here&quot;

</code></pre>
<p>cheers :)</p>
