Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Provider produced inconsistent result after apply for deployment resource limits/requests for cpu/memory #248

@mattduguid

Description

@mattduguid

Terraform, Provider, Kubernetes versions

Cluster
aks v1.19.11 (azure kubernetes service)

Providers
terraform v0.15.1
kubernetes-alpha provider v0.5.0

Affected Resource(s)

  • kubernetes_manifest (deployment resource limits/requests for cpu/memory)

Terraform Configuration Files

Issues using fractional values greater than 999 or decimal values for cpu,

"resources" = {
  "limits" = {
    "cpu" = "1.0" <--- BREAKS
    "memory" = "128Mi"
  }
  "requests" = {
    "cpu" = "0.5" <--- BREAKS
    "memory" = "64Mi"
  }
}

Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to
│ module.k8s-deployment-helloworld.kubernetes_manifest.deployment_application_1,
│ provider
│ "module.k8s-deployment-helloworld.provider[\"registry.terraform.io/hashicorp/kubernetes-alpha\"]"
│ produced an unexpected new value:.object.spec.template.spec.containers[0].resources.requests["cpu"]: was
│ cty.StringVal("0.25"), but now cty.StringVal("250m").
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to
│ module.k8s-deployment-helloworld.kubernetes_manifest.deployment_application_1,
│ provider
│ "module.k8s-deployment-helloworld.provider[\"registry.terraform.io/hashicorp/kubernetes-alpha\"]"
│ produced an unexpected new value:.object.spec.template.spec.containers[0].resources.limits["cpu"]: was
│ cty.StringVal("0.5"), but now cty.StringVal("500m").
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

"resources" = {
  "limits" = {
    "cpu" = "1000m" <--- BREAKS
    "memory" = "128Mi"
  }
  "requests" = {
    "cpu" = "500m" 
    "memory" = "64Mi"
  }
}

│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to
│ module.k8s-deployment-helloworld.kubernetes_manifest.deployment_application_1,
│ provider
│ "module.k8s-deployment-helloworld.provider[\"registry.terraform.io/hashicorp/kubernetes-alpha\"]"
│ produced an unexpected new value:.object.spec.template.spec.containers[0].resources.limits["cpu"]: was
│ cty.StringVal("1000m"), but now cty.StringVal("1").
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

"resources" = {
  "limits" = {
    "cpu" = "999m" <--- WORKS
    "memory" = "128Mi"
  }
  "requests" = {
    "cpu" = "500m" 
    "memory" = "64Mi"
  }
}

Affects the memory values as well accepts less than or equal to 1023 but not anything greater than or equal to 1024,

"resources" = {
  "limits" = {
    "cpu" = "999m" 
    "memory" = "1024Mi" <--- BREAKS
  }
  "requests" = {
    "cpu" = "500m" 
    "memory" = "64Mi"
  }
}

│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to
│ module.k8s-deployment-helloworld.kubernetes_manifest.deployment_application_1,
│ provider
│ "module.k8s-deployment-helloworld.provider[\"registry.terraform.io/hashicorp/kubernetes-alpha\"]"
│ produced an unexpected new value:.object.spec.template.spec.containers[0].resources.limits["memory"]: was
│ cty.StringVal("1024Mi"), but now cty.StringVal("1Gi").
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

"resources" = {
  "limits" = {
    "cpu" = "999m" 
    "memory" = "1023Mi" <--- WORKS
  }
  "requests" = {
    "cpu" = "500m" 
    "memory" = "64Mi" 
  }
}

Debug Output

As above

Panic Output

None

Steps to Reproduce

  1. terraform apply

Expected Behavior

Would expect to be able to use values as per https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes

Actual Behavior

As above

Important Factoids

Can work around issue by not specifying resource limits or limits equal to or lower than the limits found with tests as above.

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions