helm-charts icon indicating copy to clipboard operation
helm-charts copied to clipboard

Starting from release 0.7.30 and higher. Issue when deploying Ingress to k8s < 1.19

Open avtalabirchuk opened this issue 2 years ago • 1 comments

I have k8s cluster < 1.19 version. When updating a version starting from 0.7.30 vm/victoria-metrics-agent.

Helm chart is not updated. log: Error: UPGRADE FAILED: unable to recognize "": no matches for kind "Ingress" in version "networking.k8s.io/v1"

I look at the code https://github.com/VictoriaMetrics/helm-charts/blob/master/charts/victoria-metrics-agent/templates/_helpers.tpl#L84, the version should be determined automatically depending on the cluster. but that doesn't happen.

Tell me how you can update the used version of vm/victoria-metrics-agent. In k8s < 1.19

I have ingress apiVersion: extensions/v1beta1

avtalabirchuk avatar Mar 02 '22 10:03 avtalabirchuk

Same problem here with k8s 1.17. The problem seems to be that k8s claims to support both networking.k8s.io/v1 and networking.k8s.io/v1beta1 while Ingress only started to support the networking.k8s.io/v1 API version since k8s 1.19 (see https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22)

$ kubectl get --raw /apis/networking.k8s.io | python -m json.tool
{
    "apiVersion": "v1",
    "kind": "APIGroup",
    "name": "networking.k8s.io",
    "preferredVersion": {
        "groupVersion": "networking.k8s.io/v1",
        "version": "v1"
    },
    "versions": [
        {
            "groupVersion": "networking.k8s.io/v1",
            "version": "v1"
        },
        {
            "groupVersion": "networking.k8s.io/v1beta1",
            "version": "v1beta1"
        }
    ]
}

$ kubectl api-resources | grep ingress
ingresses                         ing          extensions/v1beta1                true         Ingress
ingresses                         ing          networking.k8s.io/v1beta1         true         Ingress

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.5", GitCommit:"....}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.9", GitCommit:"....}

So all in all, (for VM-single), it regressed at commit 096f7e68f and downgrading to chart 0.8.6 or lower makes it work again. I'm not sure how to properly fix the helm chart though, except by adding an extra test in there..

{{- if lt (int .Capabilities.KubeVersion.Minor) 19 }}
{{- print "networking.k8s.io/v1beta1" -}}
{{- end -}}

Should I submit a patch?

/Fabien

ftagada avatar Sep 30 '22 16:09 ftagada

Hello, this patch looks good to me.

f41gh7 avatar Jul 20 '23 08:07 f41gh7

@Haleygo @Amper should we adopt this patch?

hagen1778 avatar Nov 20 '23 15:11 hagen1778

@Haleygo @Amper should we adopt this patch?

I'm not sure we should do this patch now, since we already changed our compatibility versions claim from 1.13 to 1.22 to 1.23 to 1.27 and 1.22 release is EoL. Of course, users who using k8s<1.23 can still install our charts, but they might need to change some default values. In this case, as @ftagada commented, when k8s's version<1.19, it can't get the right API version for ingress, so they will need to disable ingress for all.

Haleygo avatar Nov 21 '23 02:11 Haleygo

Close this according to https://github.com/VictoriaMetrics/helm-charts/issues/292#issuecomment-1820099886.

Haleygo avatar Dec 07 '23 12:12 Haleygo