fluxctl snap cannot exec auth helpers (ex: aws-iam-authenticator) #2523
Description
Describe the bug
It's not possible to auth with KUBECONFIG
's that specify an exec for auth tokens.
This is true in the case of EKS, GKE, and likely many other IaaS/KaaS providers.
To Reproduce
- configure your
KUBECONFIG
to point to an EKS cluster /w fluxd running - install the
fluxctl
snap - attempt to run
fluxctl sync
Expected behavior
It's unreasonable to expect that the snap could have every binary needed to perform exec's for auth tokens for every single cluster provider.
The fluxctl snap should be able to exec other binaries on the system.
It likely needs to respect the user's PATH
as well.
This mirror's kubectl's needs.
I'm not sure if there are more precise ways to accomplish this level of access.
kubectl
uses classic confinement.
I believe we also need to have fluxctl
be a classic snap for similar reasons.
Logs
# `eksctl utils write-kubeconfig` produced this kubeconfig:
tail -n9 ~/.kube/config
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
args:
- token
- -i
- stealthybox-appmesh
command: aws-iam-authenticator
env: null
fluxctl sync --k8s-fwd-ns flux
Error: Could not create a dialer: Could not get pod name: Listing pods in kubernetes: Get https://0EE43986120C1158DFB3B283D67144C6.sk1.eu-west-2.eks.amazonaws.com/api/v1/namespaces/flux/pods?fieldSelector=status.phase%3DRunning&labelSelector=app%3Dflux: getting credentials: exec: exec: "aws-iam-authenticator": executable file not found in $PATH
Run 'fluxctl sync --help' for usage.
Versions
fluxd: docker.io/fluxcd/flux:1.15.0
fluxctl: v1.15.1 (https://snapcraft.io/fluxctl)
kubectl version
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.1", GitCommit:"d647ddbd755faf07169599a625faf302ffc34458", GitTreeState:"clean", BuildDate:"2019-10-07T14:30:40Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14+", GitVersion:"v1.14.6-eks-5047ed", GitCommit:"5047edce664593832e9b889e447ac75ab104f527", GitTreeState:"clean", BuildDate:"2019-08-21T22:32:40Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
/cc @dholbach
Activity