spinnaker: Halyard: Failed to backup user kubeconfig file

Issue Summary:

when enabling Kubeconfig via helm charts in already installed spinnaker. Haylard container is logging a Error “Failed to backup user file /opt/kube/config”

Cloud Provider(s):

AWES EKS

Environment:

I am using spinnaker in EKS and installing spinnaker via helm and halyard

Description:

Adding a kubeconfig file to spinnaker for adding Kubernetes cluster as deployment target (accounts) via helm charts . Issue is happening when spinnaker is already installed in EKS cluster via helm and halyard without the “kubeconfig” enabled. Later when we try to enable the kubeconfig with secret and context in the helm chart and apply Installation is failing with below error (logs from halyard container)

Steps to Reproduce:

1.Install spinnaker in EKS via helm and halyard. Make sure below values in helm value.yml while installing

kubeConfig:
  enabled: false
  1. Make sure spinnaker is installed and running
  2. change to below value in your helm chart value.yml and install the helm chart again.[pls make sure to create secret with your kubeconfig in your spinnaker cluster]
kubeConfig:
  enabled: true
  secretName: your-kubeconfig
  secretKey: config
  contexts:
  - yourcontext

Additional Details:

com.netflix.spinnaker.halyard.core.error.v1.HalException: Failed to backup user file: /opt/kube/config
	at com.netflix.spinnaker.halyard.config.model.v1.node.Node.lambda$null$5(Node.java:469) ~[halyard-config-1.20.2-20190520111848.jar:1.20.2-20190520111848]
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[na:1.8.0_212]
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) ~[na:1.8.0_212]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[na:1.8.0_212]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[na:1.8.0_212]
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[na:1.8.0_212]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:1.8.0_212]
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[na:1.8.0_212]
	at com.netflix.spinnaker.halyard.config.model.v1.node.Node.lambda$backupLocalFiles$6(Node.java:473) ~[halyard-config-1.20.2-20190520111848.jar:1.20.2-20190520111848]
	at com.netflix.spinnaker.halyard.config.model.v1.node.Node.recursiveConsume(Node.java:227) ~[halyard-config-1.20.2-20190520111848.jar:1.20.2-20190520111848]
	at com.netflix.spinnaker.halyard.config.model.v1.node.Node.recursiveConsume(Node.java:232) ~[halyard-config-1.20.2-20190520111848.jar:1.20.2-20190520111848]
	at com.netflix.spinnaker.halyard.config.model.v1.node.Node.recursiveConsume(Node.java:232) ~[halyard-config-1.20.2-20190520111848.jar:1.20.2-20190520111848]
	at com.netflix.spinnaker.halyard.config.model.v1.node.Node.backupLocalFiles(Node.java:474) ~[halyard-config-1.20.2-20190520111848.jar:1.20.2-20190520111848]
	at com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.ProfileFactory.backupRequiredFiles(ProfileFactory.java:112) ~[halyard-deploy-1.20.2-20190520111848.jar:1.20.2-20190520111848]
	at com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.ClouddriverProfileFactory.setProfile(ClouddriverProfileFactory.java:78) ~[halyard-deploy-1.20.2-20190520111848.jar:1.20.2-20190520111848]
	at com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.ProfileFactory.getProfile(ProfileFactory.java:84) ~[halyard-deploy-1.20.2-20190520111848.jar:1.20.2-20190520111848]
	at com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.ClouddriverService.getProfiles(ClouddriverService.java:86) ~[halyard-deploy-1.20.2-20190520111848.jar:1.20.2-20190520111848]
	at com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.distributed.kubernetes.v2.KubernetesV2ClouddriverService.getProfiles(KubernetesV2ClouddriverService.java:72) ~[halyard-deploy-1.20.2-20190520111848.jar:1.20.2-20190520111848]
	at com.netflix.spinnaker.halyard.deploy.services.v1.GenerateService.generateConfig(GenerateService.java:141) ~[halyard-deploy-1.20.2-20190520111848.jar:1.20.2-20190520111848]
	at com.netflix.spinnaker.halyard.deploy.services.v1.DeployService.deploy(DeployService.java:275) ~[halyard-deploy-1.20.2-20190520111848.jar:1.20.2-20190520111848]
	at com.netflix.spinnaker.halyard.controllers.v1.DeploymentController.lambda$deploy$14(DeploymentController.java:210) ~[halyard-web-1.20.2-20190520111848.jar:1.20.2-20190520111848]
	at com.netflix.spinnaker.halyard.core.DaemonResponse$StaticRequestBuilder.build(DaemonResponse.java:127) ~[halyard-core-1.20.2-20190520111848.jar:1.20.2-20190520111848]
	at com.netflix.spinnaker.halyard.core.tasks.v1.TaskRepository.lambda$submitTask$1(TaskRepository.java:48) ~[halyard-core-1.20.2-20190520111848.jar:1.20.2-20190520111848]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_212]
Caused by: java.nio.file.NoSuchFileException: /opt/kube/config
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86) ~[na:1.8.0_212]
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[na:1.8.0_212]
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[na:1.8.0_212]
	at sun.nio.fs.UnixCopyFile.copy(UnixCopyFile.java:526) ~[na:1.8.0_212]
	at sun.nio.fs.UnixFileSystemProvider.copy(UnixFileSystemProvider.java:253) ~[na:1.8.0_212]
	at java.nio.file.Files.copy(Files.java:1274) ~[na:1.8.0_212]
	at com.netflix.spinnaker.halyard.config.model.v1.node.Node.lambda$null$5(Node.java:462) ~[halyard-config-1.20.2-20190520111848.jar:1.20.2-20190520111848]
	... 23 common frames omitted

2019-08-13 09:38:29.139  INFO 8 --- [     Thread-138] c.n.s.halyard.core.tasks.v1.DaemonTask   : [Apply deployment] (3f45a12e-3ec0-49d7-9100-c2cd3685373d) - FAILED killing all jobs created by this task 
2019-08-13 09:38:29.139  INFO 8 --- [     Thread-138] c.n.s.h.core.tasks.v1.TaskRepository     : Task [Apply deployment] (3f45a12e-3ec0-49d7-9100-c2cd3685373d) - FAILED completed'''
```

---

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 5
  • Comments: 15

Most upvoted comments

I’m experiencing this issue attempting to deploy Spinnaker onto EKS via the helm chart as well.

I met the same issue. I fixed it by chmod 777 ~/.kube/config

@joshk132 sure.

The the key under the “data” section in the secret must be the same as the secretKey value in the values file. In your example, they are different (a typo in the key): “conifg” vs “config”.