<p dir="auto">Given <code class="notranslate">deployment.yml</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="kind: &quot;Deployment&quot;
apiVersion: &quot;extensions/v1beta1&quot;
metadata:
  name: &quot;web&quot;
  labels:
    app: &quot;web&quot;
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: &quot;web&quot;
    spec:
      containers:
        - name: &quot;nginx&quot;
          image: &quot;REDACTED&quot;
          env:
            - name: &quot;TARGET_HOST&quot;
              value: &quot;localhost&quot;
            - name: &quot;TARGET_PORT&quot;
              value: &quot;8080&quot;
            - name: &quot;ENABLE_SSL&quot;
              value: &quot;false&quot;
          ports:
            - name: &quot;nginx-http&quot;
              containerPort: 80
            - name: &quot;nginx-https&quot;
              containerPort: 443
          resources:
            limits:
              memory: &quot;500Mi&quot;
              cpu: &quot;1000m&quot;
          volumeMounts:
            - name: &quot;ssl-credentials&quot;
              mountPath: &quot;/etc/ssl-credentials&quot;
              readOnly: true
        - name: &quot;web&quot;
          image: &quot;REDACTED&quot;
          ports:
            - containerPort: 8080
          livenessProbe:
            httpGet:
              path: &quot;/healthy&quot;
              port: 8080
            initialDelaySeconds: 30
            timeoutSeconds: 1
          resources:
            requests:
              memory: &quot;1000Mi&quot;
              cpu: &quot;250m&quot;
            limits:
              memory: &quot;7500Mi&quot;
              cpu: &quot;2000m&quot;
      volumes:
        - name: &quot;ssl-credentials&quot;
          secret:
            secretName: &quot;ssl-credentials&quot;
      imagePullSecrets:
        - name: &quot;ecr&quot;
  selector:
    matchLabels:
      app: &quot;web&quot;"><pre class="notranslate"><code class="notranslate">kind: "Deployment"
apiVersion: "extensions/v1beta1"
metadata:
  name: "web"
  labels:
    app: "web"
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: "web"
    spec:
      containers:
        - name: "nginx"
          image: "REDACTED"
          env:
            - name: "TARGET_HOST"
              value: "localhost"
            - name: "TARGET_PORT"
              value: "8080"
            - name: "ENABLE_SSL"
              value: "false"
          ports:
            - name: "nginx-http"
              containerPort: 80
            - name: "nginx-https"
              containerPort: 443
          resources:
            limits:
              memory: "500Mi"
              cpu: "1000m"
          volumeMounts:
            - name: "ssl-credentials"
              mountPath: "/etc/ssl-credentials"
              readOnly: true
        - name: "web"
          image: "REDACTED"
          ports:
            - containerPort: 8080
          livenessProbe:
            httpGet:
              path: "/healthy"
              port: 8080
            initialDelaySeconds: 30
            timeoutSeconds: 1
          resources:
            requests:
              memory: "1000Mi"
              cpu: "250m"
            limits:
              memory: "7500Mi"
              cpu: "2000m"
      volumes:
        - name: "ssl-credentials"
          secret:
            secretName: "ssl-credentials"
      imagePullSecrets:
        - name: "ecr"
  selector:
    matchLabels:
      app: "web"
</code></pre></div>
<p dir="auto"><code class="notranslate">kubectl create -f deployment.yml</code> fails with message <code class="notranslate">unable to load "deployment.yml": json: cannot unmarshal object into Go value of type string</code>.</p>
<p dir="auto">Unfortunately not a very helpful error message. Any idea what I'm doing wrong?</p>
<p dir="auto">Hey guys,</p>
<p dir="auto">I just wanted to try out the new Deployments feature and therefore tried to use one of the example deployment specs I found in this repo and the user guides:</p>
<p dir="auto"><a href="https://github.com/kubernetes/kubernetes/blob/533bc598dd451feabeff85eb1345bb9cf5265300/docs/user-guide/deployment.yaml">https://github.com/kubernetes/kubernetes/blob/533bc598dd451feabeff85eb1345bb9cf5265300/docs/user-guide/deployment.yaml</a></p>
<p dir="auto">When I run that locally against my cluster which is running v1.2.0-alpha.8 I get the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="kubectl create -f kubernetes/deployment.yaml --v=5

I0301 15:02:48.470600   12155 decoder.go:144] decoding stream as YAML

F0301 15:02:48.522049   12155 helpers.go:96] unable to load &quot;kubernetes/deployment.yaml&quot;: json: cannot unmarshal object into Go value of type string"><pre class="notranslate"><code class="notranslate">kubectl create -f kubernetes/deployment.yaml --v=5

I0301 15:02:48.470600   12155 decoder.go:144] decoding stream as YAML

F0301 15:02:48.522049   12155 helpers.go:96] unable to load "kubernetes/deployment.yaml": json: cannot unmarshal object into Go value of type string
</code></pre></div>
<p dir="auto">Any idea what could cause this and how I could possible resolve this? I know this feature is still in beta but I'm super excited for it and really would love to try it out!</p>