<p>_helper.tpl</p>
<pre><code>{{- define &quot;fluentd-config&quot; -}}
image: {{ .Values.fluentd.kinesis_image }}
resources:
  limits:
    memory: 200Mi
  requests:
    cpu: 100m
    memory: 200Mi
{{- end -}}
</code></pre>
<p>deployment.yaml</p>
<pre><code>- name: log-agent
  {{ include &quot;fluentd-configuration&quot; . | indent 2 }}
</code></pre>
<p>But I encountered, following error message</p>
<pre><code>Error: UPGRADE FAILED: error validating &quot;&quot;: error validating data: ValidationError(Deployment.spec): unknown field &quot;resources&quot; in io.k8s.api.apps.v1.DeploymentSpec
</code></pre>
<p>Please let me know why I got that one. Thanks.</p>

PPShein
<p>Your Deployment file should look something like below:</p>
<p>deployment.yaml:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: demo-name
  namespace: {{ .Release.Namespace }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      apps: my-demo-app # &lt;-- here
  template:
    metadata:
      labels:
        apps: my-demo-app # &lt;-- make sure it match the `matchLabels`
    spec:
      containers:
      - name: log-agent
{{include &quot;fluentd-config&quot; .| indent 8}} # (8 spaces added) 
</code></pre>
