Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading CRDs #944

Closed
MaciekLeks opened this issue Sep 1, 2022 · 6 comments
Closed

Upgrading CRDs #944

MaciekLeks opened this issue Sep 1, 2022 · 6 comments
Labels
question stale upstream-helm Issue is in Helm not the provider

Comments

@MaciekLeks
Copy link

MaciekLeks commented Sep 1, 2022

The problem is generic but I will use istio example just because it's my task to cope with.

Terraform version, Kubernetes provider version and Kubernetes version

Terraform version: latest stable
Helm Provider version: latest stable
Kubernetes version: latest stable

Terraform configuration

not needed here

Question

I've wrapped Install Istio with Helm using the provider and now I need to upgrade not only the version Istio but most of all its CRDs. According to the istio documenations on this task I need to:

Upgrade the Kubernetes custom resource definitions (CRDs):

$ kubectl apply -f manifests/charts/base/crds

Upgrade the Istio base chart:

$ helm upgrade istio-base manifests/charts/base -n istio-system --skip-crds

Regular upgrading with helm_release does not upgrade CRDs of course, so the problems stays: How to do this in fully automated environment?
Do we have any pattern on this problem while it seems to be a common problem with helm?

@alexsomesan
Copy link
Member

I would normally recommend to render the CRDs via the helm_template data-source and apply them using kubernetes_manifest and otherwise follow the Istio recommended steps.

However, Helm seems to have a bug that is preventing the correct rendering of CRDs from the Istio project. Even attempting this with helm CLI yelds the wrong results.

I've raised the issue with Helm. Let's see how they resolve it and then I can share an example of how to implement these steps in Terraform.

@alexsomesan alexsomesan added the upstream-helm Issue is in Helm not the provider label Sep 9, 2022
@MaciekLeks
Copy link
Author

MaciekLeks commented Sep 10, 2022

Thank you Alex.

I've figured out the same, but I've been waiting for dealing with my VPC Service Control in GCP (could not get istio charts from outside GCS Bucket).So I did not even test the code:

data "helm_template" "istio_crds" {
  name       = "istio-base"
  repository = var.istio_helm_charts_repository
  chart      = "base"
  version    = var.chart_version
  namespace  = var.ns

  set {
    name  = "base.enableCRDTemplates"
    value = true
  }

  show_only = [
    "templates/crds.yaml",
  ]
}


resource "kubectl_manifest" "istio_crds" {
  for_each  = data.helm_template.istio_crds.manifests
  yaml_body = each.value
}

So it would end with many bugs. I confirm your observations. I've added comment tothe related issue.

jmeridth added a commit to jmeridth/argo-helm that referenced this issue Sep 21, 2022
Fixes argoproj#1430 argoproj#1468

Due to multiple instances where new/changed CRDs for argo-workflows do not
get installed/updated I believe it is time to move the crds folder into
the templates folder like our other helm charts.

I'm aware helm 3 is supposed to handle the crds folder but it seems there
are a few known issues currently [here](hashicorp/terraform-provider-helm#944), [here](helm/helm#11321) and [here](helm/helm#11330) that show that may still
need some work.

Signed-off-by: jmeridth <jmeridth@gmail.com>
jmeridth added a commit to argoproj/argo-helm that referenced this issue Sep 21, 2022
Fixes #1430 #1468

Due to multiple instances where new/changed CRDs for argo-workflows do not
get installed/updated I believe it is time to move the crds folder into
the templates folder like our other helm charts.

I'm aware helm 3 is supposed to handle the crds folder but it seems there
are a few known issues currently [here](hashicorp/terraform-provider-helm#944), [here](helm/helm#11321) and [here](helm/helm#11330) that show that may still
need some work.

Signed-off-by: jmeridth <jmeridth@gmail.com>

Signed-off-by: jmeridth <jmeridth@gmail.com>
@MaciekLeks
Copy link
Author

MaciekLeks commented Dec 14, 2022

@alexsomesan as far as I see there is no progress in this matter on the helm side. Do we have any workaround?

Copy link

Marking this issue as stale due to inactivity. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. This helps our maintainers find and focus on the active issues. Maintainers may also remove the stale label at their discretion. Thank you!

@github-actions github-actions bot added the stale label Dec 15, 2023
@MaciekLeks
Copy link
Author

Waiting for a resolution to helm/helm#11321

Copy link

Marking this issue as stale due to inactivity. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. This helps our maintainers find and focus on the active issues. Maintainers may also remove the stale label at their discretion. Thank you!

@github-actions github-actions bot added the stale label Dec 16, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question stale upstream-helm Issue is in Helm not the provider
Projects
None yet
Development

No branches or pull requests

2 participants