banzaicloud / thanos-operator

Kubernetes operator for deploying Thanos
Apache License 2.0
280 stars 48 forks source link

Ingress API version downgrade breaks helm chart #148

Open d-shi opened 3 years ago

d-shi commented 3 years ago

Describe the bug It looks to me like this commit downgrades the ingress to v1beta1, but does not undo the field name changes from this commit. This results in the following error when applying:

Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: ValidationError(Ingress.spec.rules[0].http.paths[0].backend): unknown field "service" in io.k8s.api.networking.v1beta1.IngressBackend

Steps to reproduce the issue: I am applying the helm chart via Terraform:

resource "helm_release" "thanos-operator" {
  repository = "https://kubernetes-charts.banzaicloud.com"
  chart      = "thanos-operator"
  name       = "thanos"
  namespace  = "my-namespace"
  values     = [file("${path.module}/data/values.yaml")]
}

Setting ingress.enabled = true in values.yaml should trigger this bug.

Expected behavior The ingress should be created.

pepov commented 3 years ago

Thanks for reporting! Are you actually using the ingress to access operator metrics? I'm not sure about the original intent when creating the chart, but I'm not sure that it's (setting up an ingress) that useful at all.

d-shi commented 3 years ago

I'm mostly in the exploratory phase with Thanos at the moment, so wasn't sure exactly what to expect. I wanted to see if adding the ingress gave me anything useful to look at out of the operator.

I was able to get around this by disabling creating the ingress in the chart and just using Terraform to create the ingress instead.

I ran into some other issues with the operator after that (seems like some NPE issue in the operator after I created the example CRDs), so have put using the operator on hold for now, while I just get the various Thanos components up and running.

pepov commented 3 years ago

Thanks again! I'm going to remove the ingress, since it wasn't intentional just part of the default helm create template. I guess you don't have the logs for the NPE anymore but I will check the example CRs to see if I can reproduce.

d-shi commented 3 years ago

If you are open to troubleshooting the operator, I would love to be able to use it at some point. I am going to be traveling abroad for the next 3 weeks starting tomorrow, but can open a new issue for that when I get back if you'd like.

ServerNinja commented 3 years ago

List of API changes for K8s 1.22: https://kubernetes.io/blog/2021/07/14/upcoming-changes-in-kubernetes-1-22/#api-changes