Helm Support in the V2 Kubernetes Provider


#21

Hi,
I follow the tutorial (https://www.spinnaker.io/guides/user/kubernetes-v2/deploy-helm/ 62), but got error in Bake stage:

Exception ( Create Bake )
An artifact to bake into a manifest must be supplied.

I trigger the pipeline using webhook and provide artifacts as payload. In pipeline configuration, I also specify expected artifacts, but still got above error.

The payload:

{
	"artifacts": [
		{
		"artifactAccount": "artifact-staging",
		"type": "gcs/object",
		"reference": "gs://fancy-artifact.tgz",
		"name": "gs://fancy-artifact.tgz",
		"version": "",
		"location": "asia-east1"
		}
	]
}

Is there something that I may miss?


#22

How have you configured the bake stage? The bake stage needs to be told to use that input artifact. (Imagine a scenario where you have multiple input templates, and you want to use separate bake stages to turn them into manifests).


#23

Here’s the pipeline configuration:

Bake stage configuration:


#24

Thanks – can you show the JSON payload for that stage as well?


#25

Here’s the full source of Bake (manifest) stage:

{
	"application": "myapp",
	"authentication": {
		"allowedAccounts": [],
		"user": null
	},
	"buildTime": 1528969215786,
	"canceled": false,
	"canceledBy": null,
	"cancellationReason": null,
	"description": null,
	"endTime": 1528969225738,
	"id": "1d1070f0-fda6-45d4-9672-d0785a92fcf7",
	"initialConfig": {},
	"keepWaitingPipelines": false,
	"limitConcurrent": true,
	"name": "Deploy to STAGING",
	"notifications": [
		{
			"address": "arief-playground",
			"level": "pipeline",
			"type": "slack",
			"when": [
				"pipeline.starting",
				"pipeline.complete",
				"pipeline.failed"
			]
		}
	],
	"origin": "unknown",
	"paused": null,
	"pipelineConfigId": "306ea101-9bbd-4fc3-91b3-178f3e1b4cea",
	"stages": [
		{
			"context": {
				"account": "myaccount",
				"cloudProvider": "kubernetes",
				"kinds": [],
				"labelSelectors": {
					"selectors": []
				},
				"location": "",
				"manifestArtifactAccount": "embedded-artifact",
				"manifests": [],
				"moniker": {
					"app": "myapp",
					"cluster": "testing",
					"stack": "dev"
				},
				"options": {
					"cascading": true
				},
				"refId": "4",
				"relationships": {
					"loadBalancers": [],
					"securityGroups": []
				},
				"requisiteStageRefIds": [
					"5"
				],
				"source": "artifact"
			},
			"endTime": null,
			"id": "086929f5-7a40-42ac-8603-a61fbdeed161",
			"lastModified": null,
			"name": "Deploy (Manifest)",
			"outputs": {},
			"parentStageId": null,
			"refId": "4",
			"requisiteStageRefIds": [
				"5"
			],
			"scheduledTime": null,
			"startTime": null,
			"startTimeExpiry": null,
			"status": "NOT_STARTED",
			"syntheticStageOwner": null,
			"tasks": [],
			"type": "deployManifest"
		},
		{
			"context": {
				"exception": {
					"details": {
						"error": "Internal Server Error",
						"errors": [
							"Bake of BakeManifestRequest(templateRenderer=HELM2, outputName=myapp, inputArtifact=Artifact(type=gcs/object, name=gs://myartifact.tgz, version=1, location=asia-east1, reference=gs://myartifact.tgz, metadata={kind=gcs}, artifactAccount=artifact-staging, provenance=null, uuid=null), values=null, overrides={}) failed: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program \"helm\" (in directory \".\"): error=2, No such file or directory)"
						],
						"kind": "HTTP",
						"responseBody": "{\"timestamp\":1528969225488,\"status\":500,\"error\":\"Internal Server Error\",\"exception\":\"java.lang.IllegalStateException\",\"message\":\"Bake of BakeManifestRequest(templateRenderer=HELM2, outputName=myapp, inputArtifact=Artifact(type=gcs/object, name=gs://myartifact.tgz, version=1, location=asia-east1, reference=gs://myartifact.tgz, metadata={kind=gcs}, artifactAccount=artifact-staging, provenance=null, uuid=null), values=null, overrides={}) failed: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program \\\"helm\\\" (in directory \\\".\\\"): error=2, No such file or directory)\"}",
						"rootException": "java.lang.IllegalStateException",
						"status": 500,
						"url": "http://spin-rosco.spinnaker:8087/api/v2/manifest/bake"
					},
					"exceptionType": "RetrofitError",
					"operation": "createBake",
					"shouldRetry": false,
					"timestamp": 1528969225546
				},
				"expectedArtifactAccount": "artifact-staging",
				"expectedArtifactId": "ce6c15d9-c3e3-43e6-ba7a-ef16971c7b0e",
				"expectedArtifacts": [
					{
						"matchArtifact": {
							"name": "",
							"type": "embedded/base64"
						}
					}
				],
				"outputName": "myapp",
				"overrides": {},
				"templateRenderer": "HELM2"
			},
			"endTime": 1528969225706,
			"id": "c1bf07c1-94d9-4790-b942-8d0b56cca360",
			"lastModified": null,
			"name": "Bake (Manifest)",
			"outputs": {},
			"parentStageId": null,
			"refId": "5",
			"requisiteStageRefIds": [],
			"scheduledTime": null,
			"startTime": 1528969215848,
			"startTimeExpiry": null,
			"status": "TERMINAL",
			"syntheticStageOwner": null,
			"tasks": [
				{
					"endTime": 1528969225659,
					"id": "1",
					"implementingClass": "com.netflix.spinnaker.orca.bakery.tasks.manifests.CreateBakeManifestTask",
					"loopEnd": false,
					"loopStart": false,
					"name": "createBake",
					"stageEnd": false,
					"stageStart": true,
					"startTime": 1528969215866,
					"status": "TERMINAL"
				},
				{
					"endTime": null,
					"id": "2",
					"implementingClass": "com.netflix.spinnaker.orca.pipeline.tasks.artifacts.BindProducedArtifactsTask",
					"loopEnd": false,
					"loopStart": false,
					"name": "bindProducedArtifacts",
					"stageEnd": true,
					"stageStart": false,
					"startTime": null,
					"status": "NOT_STARTED"
				}
			],
			"type": "bakeManifest"
		}
	],
	"startTime": 1528969215836,
	"startTimeExpiry": null,
	"status": "TERMINAL",
	"trigger": {
		"account": null,
		"artifacts": [
			{
				"artifactAccount": "artifact-staging",
				"location": "asia-east1",
				"metadata": {
					"kind": "gcs"
				},
				"name": "gs://myartifact.tgz",
				"reference": "gs://myartifact.tgz",
				"type": "gcs/object",
				"version": "1"
			}
		],
		"attributeConstraints": null,
		"branch": null,
		"buildNumber": null,
		"correlationId": null,
		"cronExpression": null,
		"digest": null,
		"dryRun": false,
		"enabled": true,
		"expectedArtifactIds": [
			"ce6c15d9-c3e3-43e6-ba7a-ef16971c7b0e"
		],
		"hash": null,
		"id": null,
		"job": null,
		"lastSuccessfulExecution": null,
		"master": null,
		"notifications": [],
		"parameters": {},
		"payload": {
			"artifacts": [
				{
					"artifactAccount": "artifact-staging",
					"kind": "gcs",
					"location": "asia-east1",
					"name": "gs://myartifact.tgz",
					"reference": "gs://myartifact.tgz",
					"type": "gcs/object",
					"version": "1"
				}
			],
			"fruit": "banana"
		},
		"payloadConstraints": {},
		"project": null,
		"propertyFile": null,
		"pubsubSystem": null,
		"rebake": false,
		"repository": null,
		"resolvedExpectedArtifacts": [
			{
				"boundArtifact": {
					"artifactAccount": "artifact-staging",
					"location": "asia-east1",
					"metadata": {
						"kind": "gcs"
					},
					"name": "gs://myartifact.tgz",
					"reference": "gs://myartifact.tgz",
					"type": "gcs/object",
					"version": "1"
				},
				"defaultArtifact": {
					"location": "asia-east1",
					"name": "gs://myartifact.tgz",
					"reference": "gs://myartifact.tgz",
					"type": "gcs/object"
				},
				"id": "ce6c15d9-c3e3-43e6-ba7a-ef16971c7b0e",
				"matchArtifact": {
					"name": "gs://myartifact.tgz",
					"type": "gcs/object"
				},
				"useDefaultArtifact": true,
				"usePriorArtifact": false
			}
		],
		"runAsUser": null,
		"secret": null,
		"slug": null,
		"source": "myapp",
		"strategy": false,
		"subscriptionName": null,
		"tag": null,
		"type": "webhook",
		"user": "[anonymous]"
	},
	"type": "PIPELINE"
}

#26

Looks like the deploy stage is missing a the “manifestArtifact” field. Is this set in the UI?


#27

Sorry for late reply. I already set “manifestArtifact” in deploy stage.

The pipeline stop in Bake (Manifest) stage. Here’s the error in web UI:

Exception ( Create Bake )
Bake of BakeManifestRequest(templateRenderer=HELM2, outputName=franklistranking,
inputArtifact=Artifact(type=gcs/object, name=gs://my-artifact.tgz,
version=null, location=asia-east1, reference=gs://my-artifact.tgz,
metadata={kind=default.gcs}, artifactAccount=artifact-staging, provenance=null, uuid=null),
values=null, overrides={}) failed: Execution failed (Exit value: -559038737. 
Caused by java.io.IOException: Cannot run program "helm" (in directory "."): error=2,
No such file or directory)

#28

Where is Spinnaker installed? It seems odd that helm isn’t shipped w/ it.


#29

Kubernetes GKE. In new cluster.
GKE Master Version: 1.10.2-gke.3
Region: asia-east1-a


#30

And at which version? Was this using a custom build? Our dockerfile for rosco ships with helm. The helm support isn’t properly landing until version 1.8 – the release candidate is available with hal config version edit --version release-1.8.x-latest-unvalidated.


#31

I use Spinnaker 1.7.6
I didn’t change any service settings, so Rosco still use the one from BOM:

rosco:
    version: 0.6.0-20180414022806
    commit: f86b04133b42c34a37c260f59352e957a0ea865b

#32

I have same error on 1.7.6.
I have installed hal config version edit --version release-1.8.x-latest-unvalidated.
But I catched the error on bake stage:
"java.lang.IllegalArgumentException: Cannot deserialize instance ofjava.util.ArrayListout of START_OBJECT token\n at [Source: UNKNOWN; line: -1, column: -1]\n\tat com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:3738)\n\tat com.fasterxml.jackson.databind.ObjectMapper.convertValue(ObjectMapper.java:3666)\n\tat com.netflix.spinnaker.orca.bakery.tasks.manifests.CreateBakeManifestTask.execute(CreateBakeManifestTask.java:69)\n\tat com.netflix.spinnaker.orca.q.handler.RunTaskHandler$handle$1$1.invoke(RunTaskHandler.kt:88)\n\tat com.netflix.spinnaker.orca.q.handler.RunTaskHandler$handle$1$1.invoke(RunTaskHandler.kt:52)\n\tat com.netflix.spinnaker.orca.q.handler.AuthenticationAware$sam$java_util_concurrent_Callable$0.call(AuthenticationAware.kt)\n\tat com.netflix.spinnaker.security.AuthenticatedRequest.lambda$propagate$1(AuthenticatedRequest.java:79)\n\tat com.netflix.spinnaker.orca.q.handler.AuthenticationAware$DefaultImpls.withAuth(AuthenticationAware.kt:49)\n\tat com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withAuth(RunTaskHandler.kt:52)\n\tat com.netflix.spinnaker.orca.q.handler.RunTaskHandler$handle$1.invoke(RunTaskHandler.kt:87)\n\tat com.netflix.spinnaker.orca.q.handler.RunTaskHandler$handle$1.invoke(RunTaskHandler.kt:52)\n\tat com.netflix.spinnaker.orca.q.handler.RunTaskHandler$withTask$1.invoke(RunTaskHandler.kt:161)\n\tat com.netflix.spinnaker.orca.q.handler.RunTaskHandler$withTask$1.invoke(RunTaskHandler.kt:52)\n\tat com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$withTask$1.invoke(OrcaMessageHandler.kt:48)\n\tat com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$withTask$1.invoke(OrcaMessageHandler.kt:32)\n\tat com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$withStage$1.invoke(OrcaMessageHandler.kt:58)\n\tat com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$withStage$1.invoke(OrcaMessageHandler.kt:32)\n\tat com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$DefaultImpls.withExecution(OrcaMessageHandler.kt:67)\n\tat com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withExecution(RunTaskHandler.kt:52)\n\tat com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$DefaultImpls.withStage(OrcaMessageHandler.kt:54)\n\tat com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withStage(RunTaskHandler.kt:52)\n\tat com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$DefaultImpls.withTask(OrcaMessageHandler.kt:41)\n\tat com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withTask(RunTaskHandler.kt:52)\n\tat com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withTask(RunTaskHandler.kt:154)\n\tat com.netflix.spinnaker.orca.q.handler.RunTaskHandler.handle(RunTaskHandler.kt:64)\n\tat com.netflix.spinnaker.orca.q.handler.RunTaskHandler.handle(RunTaskHandler.kt:52)\n\tat com.netflix.spinnaker.q.MessageHandler$DefaultImpls.invoke(MessageHandler.kt:36)\n\tat com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$DefaultImpls.invoke(OrcaMessageHandler.kt)\n\tat com.netflix.spinnaker.orca.q.handler.RunTaskHandler.invoke(RunTaskHandler.kt:52)\n\tat com.netflix.spinnaker.orca.q.audit.ExecutionTrackingMessageHandlerPostProcessor$ExecutionTrackingMessageHandlerProxy.invoke(ExecutionTrackingMessageHandlerPostProcessor.kt:47)\n\tat com.netflix.spinnaker.q.QueueProcessor$pollOnce$1$1.run(QueueProcessor.kt:83)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\nCaused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance ofjava.util.ArrayListout of START_OBJECT token\n at [Source: UNKNOWN; line: -1, column: -1]\n\tat com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:63)\n\tat com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1342)\n\tat com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1138)\n\tat com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1092)\n\tat com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.handleNonArray(CollectionDeseriaPreformatted textlizer.java:336)\n\tat com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:264)\n\tat com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:244)\n\tat com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27)\n\tat com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:3733)\n\t... 33 more\n"