<p>I got an error in my Deoloyment.ysml file. I have made env in this file and assign values in values file. I got a syntax error in this file</p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Release.Name }}
  labels:
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/name: {{ include "name" . }}
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/instance: {{ .Release.Name }}
      app.kubernetes.io/name: {{ include "name" . }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: {{ .Release.Name }}
        app.kubernetes.io/name: {{ include "name" . }}
    spec:
      containers:
        - name: {{ .Release.Name }}
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          resources: {}
          env:
            - name: MONGODB_ADDRESS
              value: {{ .Values.mongodb.db.address }}
            - name: MONGODB
              value: "akira-article"
            - name: MONGODB_USER
              value: {{ .Values.mongodb.db.user | quote }}
            - name: MONGODB_PASS
              valueFrom:
                secretKeyRef:
                  name: {{ include "name" . }}
                  key: mongodb-password
            - name: MONGODB_AUTH_DB
              value: {{ .Values.mongodb.db.name | quote }}
            - name: DAKEN_USERID
              value: {{ .Values.mongodb.db.userId | quote }}
            - name: DAKEN_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: {{ include "name" . }}
                  key: daken-pass
            - name: JWT_PRIVATE_KEY
              valueFrom:
                secretKeyRef:
                  name: {{ include "name" . }}
                  key: jwt-Privat-Key
            - name: WEBSITE_NAME
              value: {{ .Values.website.Name }}
            - name: WEBSITE_SHORT_NAME
              value: {{ .Values.website.shortName }}
            - name: AKIRA_HTTP_PORT
              value: {{ .Values.website.port }}
          ports:
            - containerPort: {{ .Values.service.port }}
</code></pre>

<p><strong>I got this error:</strong></p>

<blockquote>
  <p>Error: Deployment in version "v1" cannot be handled as a Deployment:
  v1.Deployment.Spec: v1.DeploymentSpec.Template:
  v1.PodTemplateSpec.Spec: v1.PodSpec.Containers: []v1.Container:
  v1.Container.Env: []v1.EnvVar: v1.EnvVar.Value: ReadString: expects "
  or n, but found 8, error found in #10 byte of
  ...|,"value":8080}],"ima|..., bigger context
  ...|,"value":"AA"},{"name":"AKIRA_HTTP_PORT","value":8080}],"image":"dr.xenon.team/websites/akira-fronte|...</p>
</blockquote>

<p>Answer to your problem is available in Helm documentation <a href="https://helm.sh/docs/howto/charts_tips_and_tricks/#quote-strings-don-t-quote-integers" rel="nofollow noreferrer">QUOTE STRINGS, DON’T QUOTE INTEGERS</a>.</p>

<blockquote>
  <p>When you are working with string data, you are always safer quoting the strings than leaving them as bare words:</p>
  
  <pre><code>name: {{ .Values.MyName | quote }}
</code></pre>
  
  <p>But when working with integers  <em>do not quote the values.</em>  That can, in many cases, cause parsing errors inside of Kubernetes.</p>
  
  <pre><code>port: {{ .Values.Port }}
</code></pre>
  
  <p>This remark does not apply to env variables values which are expected to be string, even if they represent integers:</p>
  
  <pre><code>env:
 - name: HOST
   value: "http://host"
 - name: PORT
   value: "1234"
</code></pre>
</blockquote>

<p>I'm assuming you have put the port value of <code>AKIRA_HTTP_PORT</code> inside quotes, that's why you are getting the error.</p>

<p>You can read the docs about <a href="https://helm.sh/docs/chart_template_guide/functions_and_pipelines/" rel="nofollow noreferrer">Template Functions and Pipelines</a>.</p>
