<p>Team, I am trying to create a secret using job.yaml but it’s failing below with validation error. Can anyone have a look. Thank you. </p>

<p>I am attaching my yaml and output too. </p>

<pre><code>▶ kubectl version
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.2", GitCommit:"c97fe5036ef3df2967d086711e6c0c405941e14b", GitTreeState:"clean", BuildDate:"2019-10-15T19:18:23Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.3", GitCommit:"d2835416544f298c919e2ead3be3d0864b52323b", GitTreeState:"clean", BuildDate:"2018-02-07T11:55:20Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
dtlu @ dtlu16 ~/kops/deployments/


└─ $ ▶ kubectl create -f ~/backup/hp-job.yaml
</code></pre>

<pre><code>error: error validating "/home/user/backup/hp-job.yaml": error validating data: [ValidationError(Job): unknown field "backoffLimit" in io.k8s.api.batch.v1.Job, ValidationError(Job): unknown field "labels" in io.k8s.api.batch.v1.Job, ValidationError(Job): unknown field "name" in io.k8s.api.batch.v1.Job, ValidationError(Job): unknown field "namespace" in io.k8s.api.batch.v1.Job, ValidationError(Job): unknown field "template" in io.k8s.api.batch.v1.Job]; if you choose to ignore these errors, turn validation off with --validate=false
</code></pre>

<p>My job.yaml is </p>

<pre><code>
---
apiVersion: batch/v1
backoffLimit: 4
kind: Job
labels:
  release: testportal
metadata:
name: testportal-certutil
namespace: test-portal
spec:
template:
  metadata:
    labels:
      release: testportal
  spec:
    containers:
      -
        command:
          - /bin/k8sutils
          - cert
          - create
          - "--namespace"
          - test-portal
          - "--secret"
          - testportal
          - "--force"
        image: "account.dkr.ecr.us-west-1.amazonaws.com/test/platform/k8sutils:053aae617ecff8aaf986f465f491ad1d8bb7e78c"
        imagePullPolicy: Always
        name: testportal-certutil
    restartPolicy: Never
    serviceAccount: testportal-certutil
</code></pre>

<p>Resolved it by addressing syntax and alignment</p>

<pre><code>
---
apiVersion: batch/v1
kind: Job
metadata:
  labels:
    release: testportal
  name: testportal-certutil
  namespace: test-portal
spec:
  backoffLimit: 4
  template:
    metadata:
      labels:
        release: testportal
    spec:
      containers:
        -
          command:
            - /bin/k8sutils
            - cert
            - create
            - "--namespace"
            - test-portal
            - "--secret"
            - testportal
            - "--force"
          image: “account.dkr.ecr.us-west-1.amazonaws.com/team/platform/k8sutils:053aae617ecff8aaf986f465f491ad1d8bb7e78c"
          imagePullPolicy: Always
          name: team-certutil
      restartPolicy: Never
      serviceAccount: team-certutil

</code></pre>
