<p>I am trying to apply the <code>deployment.yaml</code> file to my Kubernetes cluster with the command:<br>
<code>kubectl apply -f .\deployment.yaml</code>
<br> but I get this error: <br>
<code>error: error parsing .\deployment.yaml: error converting YAML to JSON: yaml: line 27: could not find expected ':'</code></p>

<p>The yaml file is the exact same with the original one at <a href="https://github.com/influxdata/tick-charts" rel="nofollow noreferrer">github</a>:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: {{ template "fullname" . }}
  labels:
    app: {{ template "fullname" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: {{ template "fullname" . }}
      annotations:
        # Include a hash of the config in the pod template
        # This means that if the config changes, the deployment will be rolled
        checksum/config: {{ include (print .Template.BasePath "/config.yaml") . | sha256sum }}
    spec:
      containers:
      - name: {{ template "fullname" . }}
        image: "{{ .Values.image.repo }}:{{ .Values.image.tag }}"
        imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
        resources:
{{ toYaml .Values.resources | indent 10 }}
        ports:
        - name: api
          containerPort: {{ .Values.config.http.bind_address }}
        {{- if .Values.config.graphite.enabled }}
        - name: graphite
          containerPort: {{ .Values.config.graphite.bind_address }}
        {{- end }}
        {{- if .Values.config.collectd.enabled }}
        - name: collectd
          containerPort: {{ .Values.config.collectd.bind_address }}
        {{- end }}
        {{- if .Values.config.udp.enabled }}
        - name: udp
          containerPort: {{ .Values.config.udp.bind_address }}
        {{- end }}
        {{- if .Values.config.opentsdb.enabled }}
        - name: opentsdb
          containerPort: {{ .Values.config.opentsdb.bind_address }}
        {{- end }}
        livenessProbe:
          httpGet:
            path: /ping
            port: api
          initialDelaySeconds: 30
          timeoutSeconds: 5
        readinessProbe:
          httpGet:
            path: /ping
            port: api
          initialDelaySeconds: 5
          timeoutSeconds: 1
        volumeMounts:
        - name: data
          mountPath: {{ .Values.config.storage_directory }}
        - name: config
          mountPath: /etc/influxdb
      {{- if .Values.priorityClassName }}
      priorityClassName: {{ .Values.priorityClassName }}
      {{- end }}
    {{- with .Values.nodeSelector }}
      nodeSelector:
{{ toYaml . | indent 8 }}
    {{- end }}
    {{- with .Values.affinity }}
      affinity:
{{ toYaml . | indent 8 }}
    {{- end }}
    {{- with .Values.tolerations }}
      tolerations:
{{ toYaml . | indent 8 }}
    {{- end }}
      volumes:
      - name: data
      {{- if .Values.persistence.enabled }}
        persistentVolumeClaim:
          claimName: {{ template "fullname" . }}
      {{- else }}
        emptyDir: {}
      {{- end }}
      - name: config
        configMap:
          name: {{ template "fullname" . }}

</code></pre>

<p>So according to the error message,the line 27:<br></p>

<pre><code>26 {{ toYaml .Values.resources | indent 10 }}
27         ports:
28         - name: api
</code></pre>

<p>is missing a <code>:</code> , which according to what I see it is there. 
Why do I get this error? </p>

Flora Biletsiou
<p>Not sure why you are trying to apply simple <a href="https://helm.sh/docs/topics/chart_template_guide/" rel="nofollow noreferrer">helm's</a> <code>deployment.yaml</code>(that is skeleton for Values.yaml file)</p>

<p>In order to install it correctly I suggest you follow the latest <a href="https://github.com/influxdata/tick-charts/tree/master/influxdb" rel="nofollow noreferrer">InfluxDB</a> documentation and install with Helm from stable/influxdb repo.</p>

<hr>

<p>Install helm: </p>

<pre><code>curl https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash
kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller / helm init --service-account tiller --upgrade(in case you have already done heln init)
helm repo update
</code></pre>

<hr>

<p>Install chart:</p>

<pre><code>helm install --name my-release stable/influxdb

LAST DEPLOYED: Fri Nov 22 14:10:41 2019
NAMESPACE: default
STATUS: DEPLOYED

RESOURCES:
==&gt; v1/ConfigMap
NAME                 DATA  AGE
my-release-influxdb  1     1s

==&gt; v1/Pod(related)
NAME                   READY  STATUS   RESTARTS  AGE
my-release-influxdb-0  0/1    Pending  0         1s

==&gt; v1/Service
NAME                 TYPE       CLUSTER-IP  EXTERNAL-IP  PORT(S)            AGE
my-release-influxdb  ClusterIP  *.*.*.*   &lt;none&gt;       8086/TCP,8088/TCP  1s

==&gt; v1/StatefulSet
NAME                 READY  AGE
my-release-influxdb  0/1    1s


NOTES:
InfluxDB can be accessed via port 8086 on the following DNS name from within your cluster:

- http://my-release-influxdb.default:8086

You can easily connect to the remote instance with your local influx cli. To forward the API port to localhost:8086 run the following:

- kubectl port-forward --namespace default $(kubectl get pods --namespace default -l app=my-release-influxdb -o jsonpath='{ .items[0].metadata.name }') 8086:8086

You can also connect to the influx cli from inside the container. To open a shell session in the InfluxDB pod run the following:

- kubectl exec -i -t --namespace default $(kubectl get pods --namespace default -l app=my-release-influxdb -o jsonpath='{.items[0].metadata.name}') /bin/sh

To tail the logs for the InfluxDB pod run the following:

- kubectl logs -f --namespace default $(kubectl get pods --namespace default -l app=my-release-influxdb -o jsonpath='{ .items[0].metadata.name }')



kubectl get all -l app=my-release-influxdb
NAME                        READY   STATUS    RESTARTS   AGE
pod/my-release-influxdb-0   1/1     Running   0          11m

NAME                          TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)             AGE
service/my-release-influxdb   ClusterIP   CLUSTER-IP  EXTERNAL-IP  PORT(S)            AGE
my-release-influxdb  ClusterIP  *.*.*.*    &lt;none&gt;        8086/TCP,8088/TCP   11m

NAME                                   READY   AGE
statefulset.apps/my-release-influxdb   1/1     11m
</code></pre>
