Unable to deploy "Run Job" stage using Kubernetes V1 provider


#1

Hey there, as title says i’m currently unable to deploy run job stages using K8s v1 provider, by default when the stage is created i’m unable to choose the Account, by editing as JSON, noticed that 'cloudProvider: 'titus' is set by default, although i don’t have anything related to a Titus provider configured.

Changed that key to ‘kubernetes’, then interface changes and allows me to choose which account, namespace, image, command and plenty of other settings i wish to use.

Then when I try to execute that pipeline it terminates inmediately, throwing the following error in spin-orca:

[handlers-18] c.n.s.orca.q.handler.RunTaskHandler : Error running RunJobTask for pipeline[01CWF8DSF15F5EWY915YTKCYKD] java.lang.NullPointerException: Cannot get property ‘imageDescription’ on null object at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:60) at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:174) at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:47) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296) at com.netflix.spinnaker.orca.clouddriver.tasks.providers.kubernetes.KubernetesContainerFinder$_populateFromStage_closure1.doCall(KubernetesContainerFinder.groovy:68) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022) at groovy.lang.Closure.call(Closure.java:414) at org.codehaus.groovy.runtime.ConvertedClosure.invokeCustom(ConvertedClosure.java:54) at org.codehaus.groovy.runtime.ConversionHandler.invoke(ConversionHandler.java:124) at com.sun.proxy.$Proxy154.accept(Unknown Source) at java.util.ArrayList.forEach(ArrayList.java:1257) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrap.invoke(PojoMetaMethodSite.java:213) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) at com.netflix.spinnaker.orca.clouddriver.tasks.providers.kubernetes.KubernetesContainerFinder.populateFromStage(KubernetesContainerFinder.groovy:67) at com.netflix.spinnaker.orca.clouddriver.tasks.providers.kubernetes.KubernetesContainerFinder$populateFromStage.call(Unknown Source) at com.netflix.spinnaker.orca.clouddriver.tasks.providers.kubernetes.KubernetesJobRunner.getOperations(KubernetesJobRunner.groovy:47) at com.netflix.spinnaker.orca.clouddriver.tasks.job.JobRunner$getOperations.call(Unknown Source) at com.netflix.spinnaker.orca.clouddriver.tasks.job.RunJobTask.execute(RunJobTask.groovy:65) at com.netflix.spinnaker.orca.q.handler.RunTaskHandler$handle$1$2$1.invoke(RunTaskHandler.kt:97) at com.netflix.spinnaker.orca.q.handler.RunTaskHandler$handle$1$2$1.invoke(RunTaskHandler.kt:55) at com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withLoggingContext(RunTaskHandler.kt:308) at com.netflix.spinnaker.orca.q.handler.RunTaskHandler.access$withLoggingContext(RunTaskHandler.kt:55) at com.netflix.spinnaker.orca.q.handler.RunTaskHandler$handle$1$2.invoke(RunTaskHandler.kt:96) at com.netflix.spinnaker.orca.q.handler.RunTaskHandler$handle$1$2.invoke(RunTaskHandler.kt:55) at com.netflix.spinnaker.orca.q.handler.AuthenticationAware$sam$java_util_concurrent_Callable$0.call(AuthenticationAware.kt) at com.netflix.spinnaker.security.AuthenticatedRequest.lambda$propagate$0(AuthenticatedRequest.java:94) at com.netflix.spinnaker.orca.q.handler.AuthenticationAware$DefaultImpls.withAuth(AuthenticationAware.kt:49) at com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withAuth(RunTaskHandler.kt:55) at com.netflix.spinnaker.orca.q.handler.RunTaskHandler$handle$1.invoke(RunTaskHandler.kt:95) at com.netflix.spinnaker.orca.q.handler.RunTaskHandler$handle$1.invoke(RunTaskHandler.kt:55) at com.netflix.spinnaker.orca.q.handler.RunTaskHandler$withTask$1.invoke(RunTaskHandler.kt:179) at com.netflix.spinnaker.orca.q.handler.RunTaskHandler$withTask$1.invoke(RunTaskHandler.kt:55) at com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$withTask$1.invoke(OrcaMessageHandler.kt:48) at com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$withTask$1.invoke(OrcaMessageHandler.kt:32) at com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$withStage$1.invoke(OrcaMessageHandler.kt:58) at com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$withStage$1.invoke(OrcaMessageHandler.kt:32) at com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$DefaultImpls.withExecution(OrcaMessageHandler.kt:67) at com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withExecution(RunTaskHandler.kt:55) at com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$DefaultImpls.withStage(OrcaMessageHandler.kt:54) at com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withStage(RunTaskHandler.kt:55) at com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$DefaultImpls.withTask(OrcaMessageHandler.kt:41) at com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withTask(RunTaskHandler.kt:55) at com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withTask(RunTaskHandler.kt:172) at com.netflix.spinnaker.orca.q.handler.RunTaskHandler.handle(RunTaskHandler.kt:68) at com.netflix.spinnaker.orca.q.handler.RunTaskHandler.handle(RunTaskHandler.kt:55) at com.netflix.spinnaker.q.MessageHandler$DefaultImpls.invoke(MessageHandler.kt:36) at com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$DefaultImpls.invoke(OrcaMessageHandler.kt) at com.netflix.spinnaker.orca.q.handler.RunTaskHandler.invoke(RunTaskHandler.kt:55) at com.netflix.spinnaker.orca.q.audit.ExecutionTrackingMessageHandlerPostProcessor$ExecutionTrackingMessageHandlerProxy.invoke(ExecutionTrackingMessageHandlerPostProcessor.kt:47) at com.netflix.spinnaker.q.QueueProcessor$pollOnce$1$1.run(QueueProcessor.kt:82) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

From my understanding, the containers array is not being passed into Orca, but its showing properly constructed on the JSON editor.

{
      "account": "example-account",
      "annotations": {},
      "application": "website",
      "cloudProvider": "kubernetes",
      "cloudProviderType": "kubernetes",
      "cluster": {
        "application": "website",
        "capacity": {
          "desired": 1,
          "max": 1,
          "min": 1
        },
        "env": {},
        "resources": {
          "cpu": 1,
          "disk": 10000,
          "gpu": 0,
          "memory": 512,
          "networkMbps": 128
        },
        "retries": 0,
        "runtimeLimitSecs": 3600,
        "securityGroups": []
      },
      "containers": [
        {
          "args": [],
          "command": [],
          "envFrom": [],
          "envVars": [],
          "imageDescription": {
            "account": "gcr-docker-registry",
            "fromTrigger": true,
            "imageId": "gcr.io/example/example-backend (Tag resolved at runtime)",
            "registry": "gcr.io",
            "repository": "example/example-backend",
            "tag": ""
          },
          "imagePullPolicy": "IFNOTPRESENT",
          "limits": {
            "cpu": null,
            "memory": null
          },
          "livenessProbe": null,
          "name": "example-web-backend",
          "ports": [
            {
              "containerPort": 80,
              "hostIp": null,
              "hostPort": null,
              "name": "http",
              "protocol": "TCP"
            }
          ],
          "readinessProbe": null,
          "requests": {
            "cpu": null,
            "memory": null
          },
          "volumeMounts": []
        }
      ],
      "deferredInitialization": true,
      "dnsPolicy": "ClusterFirst",
      "labels": {},
      "name": "Run Job",
      "namespace": "staging",
      "nodeSelector": {},
      "organization": "",
      "refId": "3",
      "registry": "",
      "repository": "",
      "requisiteStageRefIds": [],
      "tag": "",
      "type": "runJob",
      "volumeSources": [],
      "waitForCompletion": true
  }

Currently running Spinnaker version 1.10.5, installed using Halyard 1.12.0-20181024113436, over a Google Kubernetes Engine cluster.

Please help me out!