New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snap helm cannot read configs #10

Open
ryan-peachey-seon opened this Issue Nov 22, 2017 · 14 comments

Comments

Projects
None yet
@ryan-peachey-seon

ryan-peachey-seon commented Nov 22, 2017

There seems to be something weird with the snap version of helm as it's not properly reading cluster configs. The default via environment config is ignored, and even the manually specified parameter is also ignored.

config location:
Specific: ~/.kube/dev-k8s
Generic: ~/.kube/<env>-k8s

Environment Variable set:

$ echo $KUBECONFIG
/home/rpeachey/.kube/dev-k8s

Installation:

$ sudo snap refresh helm --edge
helm (edge) 2.6.2 from 'snapcrafters' refreshed
$ which helm
/snap/bin/helm

but the helm app is completely broken without forcing a single config file in a single location?

$ helm version
Please copy Kubernetes config to /home/rpeachey/snap/helm/common/kube/config.

This completely ignores the env variable KUBECONFIG and also completely ignores the --kubeconfig parameter introduced in what I believe was v 2.6.1

$ helm --kubeconfig ~/.kube/dev-k8s version
Please copy Kubernetes config to /home/rpeachey/snap/helm/common/kube/config.

When I manually install helm from tgz, this non-default configuration is not required
Installation:

$ mkdir helm && cd helm
$ wget https://storage.googleapis.com/kubernetes-helm/helm-v2.6.2-linux-amd64.tar.gz
$ tar -zxvf helm-v2.6.2-linux-amd64.tar.gz
$ cd ~ && mkdir bin
$ ln -sf ~/helm/linux-amd64/helm ~/bin/helm

helm just works with my config via environment variable

$ helm init
Creating /home/rpeachey/.helm 
Creating /home/rpeachey/.helm/repository 
Creating /home/rpeachey/.helm/repository/cache 
Creating /home/rpeachey/.helm/repository/local 
Creating /home/rpeachey/.helm/plugins 
Creating /home/rpeachey/.helm/starters 
Creating /home/rpeachey/.helm/cache/archive 
Creating /home/rpeachey/.helm/repository/repositories.yaml 
$HELM_HOME has been configured at /home/rpeachey/.helm.

Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster.
Happy Helming!
$ helm version
Client: &version.Version{SemVer:"v2.6.2", GitCommit:"be3ae4ea91b2960be98c07e8f73754e67e87963c", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.6.2", GitCommit:"be3ae4ea91b2960be98c07e8f73754e67e87963c", GitTreeState:"clean"}
@joedborg

This comment has been minimized.

Contributor

joedborg commented Nov 28, 2017

Hi @ryan-peachey-seon,

To my knowledge of Snapd, even with the home plug, snapped apps cannot read hidden dirs and files. A workaround would be to set $KUBECONFIG to a non-hidden directory.

@ryan-peachey-seon

This comment has been minimized.

ryan-peachey-seon commented Nov 28, 2017

@joedborg That doesn't sound right. kubectl is also installed through snap and it doesn't seem to have any issues accessing the specified config file(s). That being said, I'm not 100% sure that I've only ever used the snap kubectl binary and not inadvertently used a different binary that happened to get installed outside of snap. I'll keep an eye out going forward to see if I can confirm this or not.

@FredericLeroy

This comment has been minimized.

FredericLeroy commented Mar 7, 2018

Same issue here with helm v2.7.2, Kubectl installed with snap can access ~/.kube/config.

Is this because helm confinment is set to strict whereas kubectl confinment is set to classic ?
Do you plan to fix the issue ?

± snap info --verbose helm
name:      helm
summary:   The Kubernetes package manager
publisher: snapcrafters
contact:   https://github.com/snapcrafters/helm/issues
license:   unknown
description: |
  Helm is a tool for managing Kubernetes
  charts. Charts are packages of
  pre-configured Kubernetes resources.
snap-id: VY12auPDSljUlac4CZaOdMExw7IASsgB
commands:
  - helm
notes:               
  private:           false
  confinement:       strict
  devmode:           false
  jailmode:          false
  trymode:           false
  enabled:           true
  broken:            false
  ignore-validation: false
tracking:            stable
installed:           2.7.2 (26) 9MB 
refreshed:           2017-11-28 13:13:52 +0100 CET
channels:                       
  stable:            2.7.2 (26) 9MB -
  candidate:         2.7.2 (26) 9MB -
  beta:              2.7.2 (26) 9MB -
  edge:              2.7.2 (26) 9MB -
@joedborg

This comment has been minimized.

Contributor

joedborg commented Mar 7, 2018

Hi @FredericLeroy, @ryan-peachey-seon,

I have opened https://forum.snapcraft.io/t/classic-confinement-for-existing-helm-snap/4375/1 to get the snap moved to classic confinement as I agree that it should be as kubectl.

@jcassee

This comment has been minimized.

jcassee commented Jul 1, 2018

After installing using --classic, calling helm without the wrapper seems to work fine. No need for ~/snap/helm/common/kube/config.

Envek added a commit to Envek/helm that referenced this issue Aug 4, 2018

Change confinement to classic for helm snap
Helm should be packaged as classic snap (as kubectl snap does)
to be able to access kubectl configurations in `~/.kube/config`.

Already approved at https://forum.snapcraft.io/t/classic-confinement-for-existing-helm-snap/4375

Fixes snapcrafters#10
@matohavo

This comment has been minimized.

matohavo commented Aug 9, 2018

sudo snap install --classic helm didn't help, does this need to be merged first?

@gjergjkastrioti

This comment has been minimized.

gjergjkastrioti commented Aug 13, 2018

sudo snap install --classic helm didn't work. I gave up trying Snap and used the Script installation instead, works fine.

@PaulineLc

This comment has been minimized.

PaulineLc commented Aug 14, 2018

The issue does not seem fixed indeed.

$ snap install helm --classic
helm 2.9.1 from 'snapcrafters' installed
$ helm 
Please copy Kubernetes config to /home/pauline/snap/helm/common/kube/config.

Downloading the binaries and placing them in your path works fine though.

@mhjort

This comment has been minimized.

mhjort commented Aug 23, 2018

Same issue here

@Oblynx

This comment has been minimized.

Oblynx commented Aug 29, 2018

same here

@jpnarkinsky

This comment has been minimized.

jpnarkinsky commented Sep 1, 2018

here as well. Finally just copied the file in desperation, but this is a serious pain in the neck.

@dankirkpatrick

This comment has been minimized.

dankirkpatrick commented Sep 7, 2018

This is still an issue in 2.9.1 Helm, on both Stable and Edge. Why was this closed?

@ricardofbarros

This comment has been minimized.

ricardofbarros commented Sep 8, 2018

My current workaround for this:

sudo snap install helm --classic
ln -s /home/$(whoami)/.kube/config /home/$(whoami)/snap/helm/common/kube/config
@codycraven

This comment has been minimized.

codycraven commented Sep 13, 2018

This is still an issue in 2.9.1 Helm, on both Stable and Edge. Why was this closed?

This isn't closed. The reference above your comment is for another repository by jonashackt having to do with Ansible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment