terraform-provider-kubernetes icon indicating copy to clipboard operation
terraform-provider-kubernetes copied to clipboard

ETA of support of features > 1.28. K8s already at 1.32.

Open DaazKu opened this issue 8 months ago • 4 comments

Question

K8s is already at version 1.32.... When will the provider start supporting features > 1.28. This is getting more and more of a pain to work with.

We can't use sidecars unless we use kubernetes_manifest -> https://github.com/hashicorp/terraform-provider-kubernetes/issues/2446

~The go provider is so old than even with kubernetes_manifest we can't create a sidecar with a startup probe..~ Edit: that part was actually a mistake/one off.

...
              "startupProbe" = {
                "exec" = {
                  "command" = [
                    "sh", "-c", "nc -z localhost 8000"
                  ]
                }
                "initialDelaySeconds" = 3
                "periodSeconds"       = 2
                "failureThreshold"    = 30
              }
...
 │ Error: spec.template.spec.initContainers[1].startupProbe
 ...
  │   13: resource "kubernetes_manifest" "deployment" {
  │
  │ Required value: must specify a handler type

DaazKu avatar Mar 18 '25 16:03 DaazKu

Hi and thanks for raising this issue. We're aware that restart_policy is missing from init_container and this isn't the only schema inconsistency in the provider. We're working on a comprehensive solution to cover all of the missing attributes consistently, through code generation.

In the example you shared, the error message that you are getting ("Required value: must specify a handler type") is actually coming from the Kubernetes API and not the provider itself. One possible reason is the PodLifecycleSleepAction API feature gate not being ON for cluster versions up to 1.29.

Which version are you running this example on?

alexsomesan avatar Mar 19 '25 13:03 alexsomesan

Hi and thanks for raising this issue. We're aware that restart_policy is missing from init_container and this isn't the only schema inconsistency in the provider. We're working on a comprehensive solution to cover all of the missing attributes consistently, through code generation.

But still no ETA on that?

At least it's a good news that you guys are working on something that will automate that process so that in the future you can keep up with K8s release more easily.

In the example you shared, the error message that you are getting ("Required value: must specify a handler type") is actually coming from the Kubernetes API and not the provider itself. One possible reason is the PodLifecycleSleepAction API feature gate not being ON for cluster versions up to 1.29.

Which version are you running this example on?

We're using 1.31. I made a simple test this morning to show the issue and I couldn't reproduce. It's actually working. I've asked my coworker to try to reproduce that error again and he can't....

DaazKu avatar Mar 19 '25 14:03 DaazKu

@alexsomesan Still we cannot use sidecars with the current version of the provider.

Even with kubernetes_manifest there are blockers on resources that are as complex as deployments:

  • https://github.com/hashicorp/terraform-provider-kubernetes/issues/2259
  • https://github.com/hashicorp/terraform-provider-kubernetes/issues/2681
  • https://github.com/hashicorp/terraform-provider-kubernetes/issues/2639
  • https://github.com/hashicorp/terraform-provider-kubernetes/issues/2436

TL;DR; Always cause drift, startup probe not working, etc ...

DaazKu avatar Mar 20 '25 14:03 DaazKu

We're working on a comprehensive solution to cover all of the missing attributes consistently, through code generation.

Is there any update on this future solution?

gabegorelick avatar Jun 21 '25 17:06 gabegorelick

Also blocked by lack of restart_policy.

djmcgreal-cc avatar Jul 14 '25 10:07 djmcgreal-cc

@alexsomesan we are currently trying to use PodLifecycleSleepAction instead of exec based preStop hooks since our images no longer provide a shell/sleep. Could you please share when we can expect an update to the terraform provider so that we can make use of the feature? (Our cluster already runs version 1.33.x - so the terraform provider is the only blocker atm)

DarkAtra avatar Aug 21 '25 12:08 DarkAtra

We're also blocked by this. Any progress?

techdragon avatar Oct 15 '25 05:10 techdragon

Just to throw another name on the list, we would love to use the deployment resource but are forced to use the manifest escape hatch because of the sidecar pattern not being supported.

MathieuDR avatar Oct 31 '25 10:10 MathieuDR

@jrhouston you seem to be the most active reviewer on this repository. Can you give us any information related to this issue? Can we expect anything any time soon?

DaazKu avatar Oct 31 '25 13:10 DaazKu