kubernetes-helmmicrok8s

Why helm chart cannot be install on Microk8s?


I am using microk8s to run Kubernetes on my Ubuntu server. I am using the helm v3 as my helm command.

This is the result of the helm version command:

version.BuildInfo{Version:"v3.9.2", GitCommit:"1addefbfe665c350f4daf868a9adc5600cc064fd", GitTreeState:"clean", GoVersion:"go1.17.12"}

I am trying to run this helm chart on this K8s instance:

apiVersion: v2
name: myTest
description: The test daemon (test) helm chart
type: application
version: 1.4.0
appVersion: v1.18.0
kubeVersion: ">= 1.19.0"
...

But I am getting this error:

INSTALLATION FAILED: chart requires kubeVersion: >= 1.19.0 which is incompatible with Kubernetes v1.19.15-34+c064bb32deff78

I tried different versions of Microk8s as 1.21, 1.24, and 1.19 but there is the same result.

I installed this service on minikube without any problem :(


Solution

  • According to the Semantic Versioning specification you have a pre-release version of Kubernetes. (This is possibly an issue in microk8s's release process.) The Helm documentation for the kubeVersion: field states that it depends on the Go github.com/Masterminds/semver package. Its documentation notes:

    SemVer comparisons using constraints without a prerelease comparator will skip prerelease versions. For example, >=1.2.3 will skip prereleases when looking at a list of releases while >=1.2.3-0 will evaluate and find prereleases.

    So setting in your Chart.yaml that you're willing to tolerate pre-release versions should address this:

    kubeVersion: ">= 1.19.0-0" # adding a -0 on the end