spinnaker create application in default namespace with helm chart

11/7/2018

I trying to create a CD pipeline on spinnaker, and my applications were packaged as helm chart.

I set k8s namespace in following page, but when i trigger pipeline, spinnaker did't create applications in that namespace, actually applications were created in default namespace "spinnaker" which i setup spinnaker.

Is it a spinnaker bug or configuration mistake? Can someone point me on how to troubleshoot/solve this?

configuration of spinnaker pipeline

And i found below log info from spin-rosco:

2018-11-07 06:48:49.146  INFO 1 --- [0.0-8087-exec-6] c.n.s.rosco.jobs.local.JobExecutorLocal  : Starting job: [helm, template, /tmp/52a04675-210e-44a4-a0d8-d008222d527a/84C4D3AF1AA88C049E8175B4F068D7EE, --name, mytest, --namespace, mynamespace]...
2018-11-07 06:48:49.147  INFO 1 --- [0.0-8087-exec-6] c.n.s.rosco.jobs.local.JobExecutorLocal  : Polling state for e8521f11-ef81-4d72-a172-b578a8c4c10a...
2018-11-07 06:48:49.148  INFO 1 --- [ionThreadPool-1] c.n.s.rosco.jobs.local.JobExecutorLocal  : Executing e8521f11-ef81-4d72-a172-b578a8c4c10a with tokenized command: [helm, template, /tmp/52a04675-210e-44a4-a0d8-d008222d527a/84C4D3AF1AA88C049E8175B4F068D7EE, --name, mytest, --namespace, mynamespace]
2018-11-07 06:48:50.147  INFO 1 --- [0.0-8087-exec-6] c.n.s.rosco.jobs.local.JobExecutorLocal  : Polling state for e8521f11-ef81-4d72-a172-b578a8c4c10a...
2018-11-07 06:48:50.149  INFO 1 --- [0.0-8087-exec-6] c.n.s.rosco.jobs.local.JobExecutorLocal  : State for e8521f11-ef81-4d72-a172-b578a8c4c10a changed with exit code 0.
-- wilala
kubernetes
kubernetes-helm
spinnaker

1 Answer

11/8/2018

Solved! My mistake, the helm template should contain namespace as offical website's note:

The release namespace (optional)

The Kubernetes namespace to install release into. If parameter is not specified default namespace will be used.

Note: Not all Helm charts contain namespace definitions in their manifests. Make sure that your manifests contain the following code:

metadata:
  namespace: *{{ .Release.Namespace }}*
-- wilala
Source: StackOverflow