Make Helm Plugins available to all users#62
Make Helm Plugins available to all users#62Angelin01 wants to merge 1 commit intoalpine-docker:masterfrom
Conversation
|
@ozbillwang Sorry, I noticed you gave it a 👍 but I don't know if you need anything else to merge this. If you do, feel free to share here and I'll get on it right away. |
Thank you for the PR; it shows promise. I'll need some time to verify the changes, so please be patient. |
|
So the default path is second, I didn't see the different with the Dockerfile you changed |
|
That is strange. Did you build the image with a newer version of Helm? I've noticed that the default version on the Dockerfile is too old and does not support the environment variable: Maybe we should consider updating the default versions on the ARGs? |
|
Also, as a separate suggestion, maybe we can introduce some smoke tests during image build to help with these base verifications. Something like this: RUN helm plugin install https://github.com/helm-unittest/helm-unittest && \
rm -rf /tmp/helm-* && \
helm unittest --help # This command will fail if the plugin is not installed properly and break the docker build.I can probably whip this up in another PR. |
|
let me check, seems I build with old version of helm. The latest is: The Dockerfile need be reviewed, because several part has hardcoding the path of helm plugin and try to clean it. We need adjust them as well. https://github.com/alpine-docker/k8s/blob/master/Dockerfile#L40-L42 |
|
I've adjusted the removal of /apps $ helm env
HELM_BIN="helm"
HELM_BURST_LIMIT="100"
HELM_CACHE_HOME="/.cache/helm"
HELM_CONFIG_HOME="/.config/helm"
HELM_DATA_HOME="/.local/share/helm"
HELM_DEBUG="false"
HELM_KUBEAPISERVER=""
HELM_KUBEASGROUPS=""
HELM_KUBEASUSER=""
HELM_KUBECAFILE=""
HELM_KUBECONTEXT=""
HELM_KUBEINSECURE_SKIP_TLS_VERIFY="false"
HELM_KUBETLS_SERVER_NAME=""
HELM_KUBETOKEN=""
HELM_MAX_HISTORY="10"
HELM_NAMESPACE="default"
HELM_PLUGINS="/helm-plugins"
HELM_REGISTRY_CONFIG="/.config/helm/registry/config.json"
HELM_REPOSITORY_CACHE="/.cache/helm/repository"
HELM_REPOSITORY_CONFIG="/.config/helm/repositories.yaml"and as the root user: /apps # helm env
HELM_BIN="helm"
HELM_BURST_LIMIT="100"
HELM_CACHE_HOME="/root/.cache/helm"
HELM_CONFIG_HOME="/root/.config/helm"
HELM_DATA_HOME="/root/.local/share/helm"
HELM_DEBUG="false"
HELM_KUBEAPISERVER=""
HELM_KUBEASGROUPS=""
HELM_KUBEASUSER=""
HELM_KUBECAFILE=""
HELM_KUBECONTEXT=""
HELM_KUBEINSECURE_SKIP_TLS_VERIFY="false"
HELM_KUBETLS_SERVER_NAME=""
HELM_KUBETOKEN=""
HELM_MAX_HISTORY="10"
HELM_NAMESPACE="default"
HELM_PLUGINS="/helm-plugins"
HELM_REGISTRY_CONFIG="/root/.config/helm/registry/config.json"
HELM_REPOSITORY_CACHE="/root/.cache/helm/repository"
HELM_REPOSITORY_CONFIG="/root/.config/helm/repositories.yaml" |
|
Hi, it's been a few days, I believe I've adjusted what needs adjusting, unless you want me to update the default versions for the |
|
Just hit this issue.... |
Unfortunately, I never got a reply back. Since that time, I have already even moved jobs. If you need a workaround, simply install the plugin during your pipeline with whatever user you are using. You can probably configure some caching to avoid reinstalling it every time. Or fork the image. |
|
@ozbillwang Hey, this is a really really old pull request. If I were to rebase and bring these changes up to speed with the current master branch, would you be willing to review? |
When running the image as a non-root user, the helm plugins can't be found because they are normally located at the user's home folder. During installation, they are installed to
/root, which is not globally readable:But if we configure the
HELM_PLUGINSenvironment variable, Helm will install AND look for the plugins at that folder. By making the folder globally readable, we allow any user to use the plugins (without being able to modify them):This is a much simpler change than #55 but should already help with people using the image in CI/CD environments where one can't use the root user.