How can I have helm post upgrade hooks not cause the entire install to fail? - kubernetes-helm

I'm trying to run a helm install and a post-install hook is error'ing out. But I don't want it to fail the entire deployment for that reason, I want to know about it and fix the issue but I need all of the other parts of the chart to succeed. Is there a way to just ignore just the post-hook errors? Or downgrade them to warnings?

After looking at this more, I don't think I actually want to ignore the post upgrade hook failure. I just need to ensure that the pod that is failing is not failing for unexpected reasons during the post-upgrade hook phase.

Related

Run "helm upgrade" but suppress warnings

I want to upgrade a Helm chart but have warnings about deprecated API's be suppressed from being sent to standard error. I still want errors to appear.
Is there a built-in way to do this, something like "help upgrade --suppress-warnings"?
No, there is no built-in way to do this in Helm. You will have to use a workaround such as redirecting standard error to /dev/null when running the Helm upgrade command. For example:
helm upgrade 2>/dev/null

How to ensure that CRDs defined in a Helm subchart are stored before being used?

I have a helm chart A which depends on a third-party subchart B.
Chart B defines some CRDs which are used by chart A.
However, when I install chart A (hence B too), I get an error saying that the CRDs are not recognized. It seems that the CRs are being stored before CRDs.
Helm documentation about CRD
describes two ways to handle this order, either put the CRDs in a folder called crds, or use two separate charts and install them one after the other.
My questions are the following:
Why doesn't Helm apply first the CRDs regardless of where they are? Why is the crds folder needed? What if the CRDs are in a chart that you don't wish to modify (like in my case)?
Doesn't the second option make the dependencies specification useless. Can't there be an order of execution for dependencies?
Is there a way, that I might have overlooked, to still keep 1 chart with a dependency and somehow make sure that the CRDs defined in the dependency are stored before being used? (hooks?)
(you don't have to answer all the questions, an answer to any of them is appreciated)
Full reasoning on how Helm handles CRDs can be found in hip-0011.
I recommend reading it, but in short:
1.
"The core problem is that CRDs (being a globally shared resource) are fragile. Once a CRD is installed, we typically have to assume that it is shared across namespaces and groups of users.
For that reason, installing, modifying, and deleting CRDs is a process that has ramifications for all users and systems of that cluster."
and
"This was an explicit decision after much community discussion due to the danger for unintentional data loss"
No, dependencies can and are used for other purposes too.
I'm afraid it will be complicated, check the discussion here.
There's a pretty simple way to let your main chart install the objects defined by your dependency chart's CRDs. Just make them installed and upgraded with the post-install and post-upgrade hooks.
Just a simple example for you. Let's imagine, you need to install a cert-manager as a subchart and then your main chart needs to install an Issuer. Obviously, the initial installation fails, as the CRDs aren't installed yet, so the Issuer doesn't pass validation. But if you use the hook (by adding the following annotation to the template of your Issuer: "helm.sh/hook": post-install,post-upgrade), then the Issuer will be installed only in the very end of the installation procedure, when cert-manager is up and kicking.

What would I need to run in order to install task "fix scss"?

I am working on a team task. When instructed by a piece of documentation to run grunt fix scss I did so, and I received the following message:
jit-grunt: Plugin for the "fix" task not found. If you have installed
the plugin already, please setting the static mapping. See
https://github.com/shootaroo/jit-grunt#static-mappings
Warning: Task "fix" failed. Use --force to continue.
The problem is that I have no idea whether the plugin they mention is installed. What command would I need to run in order to install this plugin?
The problem was that I was running grunt fix scss rather than grunt fix-scss (with a hyphen).
Once I did the latter, I got more meaningful output.

How can I restart just one job on Appveyor

One of a very kind volunteers helped to get M2Crypto almost to the shape that it builds on Windows. We use Appveyor CI for testing (I am a Linux guy, so I don't even have an access to a Windows machine), everything works well, when it does, but it is quite unreliable. M2Crypto is using swig and downloading it for every job seems quite unreliable. Any ideas how to make choco more reliable?
Or, would it be possible to restart just one job (not whole commit), so that when this happens, I could get passing commit with restarting a job?
Thank you for great service.
I would recommend Caching chocolatey packages.
Restarting a single job in the matrix is still not implemented.

snyk wizard error while creating MEAN app

i am new to MEAN stack development. while i am running snyk wizard i am getting the following error. What does it actually mean and how to solve it?
Snyk couldn't patch the specified vulnerabilities because GNU's patch is not available. Please install 'patch' and try again.
I assume you are using gnu/Linux and don’t have patch installed. I am also assuming that snyk uses patch to fix files for vulnerabilities. Try installing patch and running the command again