Error: unknown command «diff» for «helm»
Been running into this issue for a few days, not sure what is happening.
- helm 3.8.0
- go 1.17.5
resource_type
- name: helm type: docker-image source: repository: ghcr.io/typositoire/concourse-helm3-resource tag: v1.19.1
resource
- name: some-helm-repo type: helm check_every: 10s source: cluster_url: ((common-secrets.control_plane)) cluster_ca: ((common-secrets.cad)) token: ((common-secrets.token)) repos: - name: company url: 'https://helm.repo/chartrepo/library' username: ((common-secrets.harbor_username)) password: ((common-secrets.harbor_password)) - name: bitnami url: 'https://charts.bitnami.com/bitnami'
task
- put: some-helm-repo params: chart: bitnami/redis values: community-helm-values-bucket-redis/redis.yml version: 14.4.0 atomic: true namespace: x61e3ff9f timeout: 3m0s show_diff: true release: redis
Output in concourse:
Resource setup successful.
Installing redis
Release diff:
Error: unknown command "diff" for "helm"
Run 'helm --help' for usage.
So far I tried:
- resource type without tag (original state)
- using resource type with tag v1.20.0
- using resource type with tag v1.19.1
Somehow I feel this is an issue higher up, but I can’t really pin it. Advice would really be great 🙏
Thanks for letting me know. Sorry I haven’t been super responsive :/
No problem. To be honest I still don’t know what happened that caused this error to occur. But changing anything wasn’t reflected in our pipelines and that was the least promising. Once changes were again applied the error resolved itself.
Thanks for all you do!
deploy_to_mwdebug failing with Error: unknown command «diff» for «helm»
deploy_to_mwdebug failing with Error: unknown command «diff» for «helm»
- Edit Task
- Edit Related Tasks…
- Edit Related Objects…
- Mute Notifications
- Protect as security issue
- Award Token
- Flag For Later
deploy_to_mwdebug failed with an error, so I tried rerunning it with —force:
legoktm@deploy1002:~$ sudo deploy-mwdebug --force INFO:root:Fetching tags for restricted/mediawiki-multiversion INFO:root:Found the most recent release, 2021-08-10-222753-publish INFO:root:Fetching tags for restricted/mediawiki-webserver INFO:root:Found the most recent release, 2021-08-04-134912-webserver INFO:root:Updating the values file INFO:root:Deploying to eqiad skipping missing values file matching "values-pinkunicorn.yaml" Comparing release=pinkunicorn, chart=wmf-stable/mediawiki in ./helmfile.yaml: command "/usr/bin/helm" exited with non-zero status: PATH: /usr/bin/helm ARGS: 0: helm (4 bytes) 1: diff (4 bytes) 2: upgrade (7 bytes) 3: --reset-values (14 bytes) 4: --allow-unreleased (18 bytes) 5: pinkunicorn (11 bytes) 6: wmf-stable/mediawiki (20 bytes) 7: --tiller-namespace (18 bytes) 8: mwdebug (7 bytes) 9: --namespace (11 bytes) 10: mwdebug (7 bytes) 11: --values (8 bytes) 12: /tmp/values002011164 (20 bytes) 13: --values (8 bytes) 14: /tmp/values867137739 (20 bytes) 15: --values (8 bytes) 16: /tmp/values828486062 (20 bytes) 17: --values (8 bytes) 18: /tmp/values921421109 (20 bytes) 19: --values (8 bytes) 20: /tmp/values793428752 (20 bytes) 21: --values (8 bytes) 22: /tmp/values412677423 (20 bytes) 23: --values (8 bytes) 24: /tmp/values436405442 (20 bytes) 25: --values (8 bytes) 26: /tmp/values172011321 (20 bytes) 27: --values (8 bytes) 28: /tmp/values127172420 (20 bytes) 29: --detailed-exitcode (19 bytes) 30: --kubeconfig=/etc/kubernetes/mwdebug-eqiad.config (49 bytes) ERROR: exit status 1 EXIT STATUS 1 STDERR: Error: unknown command "diff" for "helm" Run 'helm --help' for usage. COMBINED OUTPUT: Error: unknown command "diff" for "helm" Run 'helm --help' for usage.
Some PATH issue maybe? Manually running helmfile -e eqiad apply as my own user displayed the diff correctly.
Event Timeline
Comment Actions
Closing considering we are migrating from this script and associated systemd::timer::job to scap deployments for the different mw-on-k8s services. Feel free to reopen if this script would be needed in other circumstances.
Content licensed under Creative Commons Attribution-ShareAlike 3.0 (CC-BY-SA) unless otherwise noted; code licensed under GNU General Public License (GPL) or other open source licenses. By using this site, you agree to the Terms of Use, Privacy Policy, and Code of Conduct. · Wikimedia Foundation · Privacy Policy · Code of Conduct · Terms of Use · Disclaimer · CC-BY-SA · GPL
In this blog, we will see what are Helm plugins.
As we saw, our Helm tool can do many things. But just in case there’s something extra we’d find useful, Helm is extensible. We can add more features, on top of its core functionality, by installing plugins. You can see examples of such plugins on this page.
Plugins are managed with the helm plugin subcommand. As we learned in the first few lessons, we can see detailed info about how we can use this subcommand with:
[email protected]:~$ helm plugin -- help
Manage client-side Helm plugins.
Usage:
helm plugin [command]
Available Commands:
install install one or more Helm plugins
list list installed Helm plugins
uninstall uninstall one or more Helm plugins
update update one or more Helm plugins
Flags:
-h, --help help for plugin
Global Flags:
--debug enable verbose output
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-as-group stringArray group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--kube-as-user string username to impersonate for the operation
--kube-ca-file string the certificate authority file for the Kubernetes API server connection
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "/home/user/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "/home/user/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "/home/user/.config/helm/repositories.yaml")
Use "helm plugin [command] --help" for more information about a command.
There are various ways we can install plugins, but the most often used (and easiest) is:
helm plugin install https://example.com/path/to/plugin
Instead of providing the URL to a plugin hosted somewhere on the Internet, we can also provide the path to a local directory where we have extracted the plugin’s files (usually from a .tgz or .tar.gz archive we previously downloaded).
helm plugin install path/to/plugin
As usual, though, it’s much easier to understand this through practical exercises, so let’s explore how this works.
Installing and Using a Helm Plugin
When we upgrade a release with Helm, we normally just “trust” that the new chart will do the proper job. But it can be useful if we could actually see what would change. We can do this with the Helm Diff plugin hosted here.
We’ve learned in our previous lessons how with commands such as:
helm install --dry-run nginx-release bitnami/nginx
or
helm template bitnami/nginx
We can actually see the manifests that these charts would generate and send to Kubernetes, without installing anything (a sort of preview).
Let’s install Nginx from Bitnami’s Nginx chart:
helm install nginx-release bitnami/nginx --version 7.1.0
Now imagine we want to upgrade this to the newest available version. A simple helm upgrade command would do the trick, but as mentioned, we just have to blindly trust that it will perform the correct changes. We do have a way to check what manifests this upgrade would send to Kubernetes (without actually upgrading), with a command like:
helm upgrade --dry-run nginx-release bitnami/nginx
But this shows us the final manifests, the end result of the upgrade. It would be more useful if we could actually see the differences between our current manifests deployed into Kubernetes and the new manifests that would get deployed. This is what the Helm Diff plugin can do for us. So let’s install it with:
helm plugin install https://github.com/databus23/helm-diff
The output is very helpful:
[email protected]:~$ helm plugin install https://github.com/databus23/helm-diff
Downloading https://github.com/databus23/helm-diff/releases/download/v3.1.3/helm-diff-linux.tgz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 625 100 625 0 0 3188 0 --:--:-- --:--:-- --:--:-- 3188
100 14.9M 100 14.9M 0 0 6025k 0 0:00:02 0:00:02 --:--:-- 6860k
Preparing to install into /home/user/.local/share/helm/plugins/helm-diff
helm-diff installed into /home/user/.local/share/helm/plugins/helm-diff/helm-diff
The Helm Diff Plugin
* Shows a diff explaining what a helm upgrade would change:
This fetches the currently deployed version of a release
and compares it to a local chart plus values. This can be
used visualize what changes a helm upgrade will perform.
* Shows a diff explaining what had changed between two revisions:
This fetches previously deployed versions of a release
and compares them. This can be used visualize what changes
were made during revision change.
* Shows a diff explaining what a helm rollback would change:
This fetches the currently deployed version of a release
and compares it to adeployed versions of a release, that you
want to rollback. This can be used visualize what changes a
helm rollback will perform.
Usage:
diff [flags]
diff [command]
Available Commands:
release Shows diff between release's manifests
revision Shows diff between revision's manifests
rollback Show a diff explaining what a helm rollback could perform
upgrade Show a diff explaining what a helm upgrade would change.
version Show version of the helm diff plugin
Flags:
--allow-unreleased enables diffing of releases that are not yet deployed via Helm
-C, --context int output NUM lines of context around changes (default -1)
--detailed-exitcode return a non-zero exit code when there are changes
--devel use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored.
--disable-openapi-validation disables rendered templates validation against the Kubernetes OpenAPI Schema
--disable-validation disables rendered templates validation against the Kubernetes cluster you are currently pointing to. This is the same validation performed on an install
--dry-run disables cluster access and show diff as if it was install. Implies --install, --reset-values, and --disable-validation
-h, --help help for diff
--include-tests enable the diffing of the helm test hooks
--install enables diffing of releases that are not yet deployed via Helm (equivalent to --allow-unreleased, added to match "helm upgrade --install" command
--kubeconfig string This flag is ignored, to allow passing of this top level flag to helm
--no-color remove colors from the output
--no-hooks disable diffing of hooks
--output string Possible values: diff, simple, json, template. When set to "template", use the env var HELM_DIFF_TPL to specify the template. (default "diff")
--post-renderer string the path to an executable to be used for post rendering. If it exists in $PATH, the binary will be used, otherwise it will try to look for the executable at the given path
--reset-values reset the values to the ones built into the chart and merge in any new values
--reuse-values reuse the last release's values and merge in any new values. If '--reset-values' is specified, this is ignored
--set stringArray set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--set-file stringArray set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
--set-string stringArray set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
--show-secrets do not redact secret values in the output
--suppress stringArray allows suppression of the values listed in the diff output
-q, --suppress-secrets suppress secrets in the output
-f, --values valueFiles specify values in a YAML file (can specify multiple) (default [])
--version string specify the exact chart version to use. If this is not specified, the latest version is used
Additional help topics:
diff
Use "diff [command] --help" for more information about a command.
Installed plugin: diff
First of all, this shows us the new subcommands that this plugin adds to Helm. In this case it’s helm diff. We can consult the plugin’s help page whenever we need with:
helm diff --help
We see that we’re not only able to compare the differences an upgrade would generate, but also the differences when we rollback to a different revision, or the differences between two revisions.
Available Commands:
release Shows diff between release's manifests
revision Shows diff between revision's manifests
rollback Show a diff explaining what a helm rollback could perform
upgrade Show a diff explaining what a helm upgrade would change.
version Show version of the helm diff plugin
But we might wonder, what’s the command syntax to compare between two revisions? Well, plugins mimic Helm’s core functionality. So that means that just like we can display help info about a Helm sub-sub-command, we can do the same for a plugin’s sub-sub-command. So to see how we would use the helm diff revision command, we just enter:
[email protected]:~$ helm diff revision --help
This command compares the manifests details of a named release.
It can be used to compare the manifests of
- lastest REVISION with specified REVISION
$ helm diff revision [flags] RELEASE REVISION1
Example:
$ helm diff revision my-release 2
- REVISION1 with REVISION2
$ helm diff revision [flags] RELEASE REVISION1 REVISION2
Example:
$ helm diff revision my-release 2 3
Usage:
diff revision [flags] RELEASE REVISION1 [REVISION2]
Flags:
-C, --context int output NUM lines of context around changes (default -1)
--detailed-exitcode return a non-zero exit code when there are changes
-h, --help help for revision
--include-tests enable the diffing of the helm test hooks
--output string Possible values: diff, simple, template. When set to "template", use the env var HELM_DIFF_TPL to specify the template. (default "diff")
--show-secrets do not redact secret values in the output
--suppress stringArray allows suppression of the values listed in the diff output
-q, --suppress-secrets suppress secrets in the output
Global Flags:
--no-color remove colors from the outpu
And we can see in one example how we would compare revision 2 with revision 3 of some release.
But let’s return to our scenario, seeing what differences an upgrade of our release would generate.
helm diff upgrade nginx-release bitnami/nginx
And we see the differences nicely highlighted with different colors:
In this case, the minus “-” sign signals that the line would get removed by the upgrade, and the “+” sign shows what the upgrade would add to the new manifest. Although the output is a bit long, it’s very easy to read since changes are highlighted this way. We can see that in our case, most of the changes revolve around upgrading nginx-7.1.0 to a newer nginx-9.3.0. In a real scenario, we would be satisfied that the upgrade indeed does what we need it to do.
Listing and Removing Plugins
To see what plugins we currently have installed, we use the following command:
[email protected]:~$ helm plugin list
NAME VERSION DESCRIPTION
diff 3.1.3 Preview helm upgrade changes as a diff
To remove the plugin:
helm plugin uninstall diff
Now if we try the helm diff
command again we see that the functionality was indeed removed from Helm.
[email protected]:~$ helm diff
Error: unknown command "diff" for "helm"
Run 'helm --help' for usage.
Checkout the Helm for the Absolute Beginners course here
Checkout the Complete Kubernetes learning path here
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.