You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* kubernetes_service.mqtt: Failed to update service: Service "svc" is invalid: spec.ports[0].nodePort: Invalid value: 30883: may not be used when `type` is 'ClusterIP'
Expected Behavior
spec.ports[0].nodePort should have been detected as removed. It should show up as removed in the plan.
Actual Behavior
After spec.ports[0].nodePort has been removed, terraform does not see that the property has disappeared.
Terraform will perform the following actions:
~ kubernetes_service.mqtt
spec.0.type: "NodePort" => "ClusterIP"
Plan: 0 to add, 1 to change, 0 to destroy.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
Remove the # in front of all lines
terraform apply
Add the # again at the two lines which had them
terraform apply
The text was updated successfully, but these errors were encountered:
My impression is that there are more than this field that is not propagating. Does that make sense to you?
I'll come back to this when I find more. Pretty sure I've seen some already
Yes, I guess that could be the case. This is where Terraform's resource model isn't quite compatible with Kubernetes. Terraform expects values to either be configurable or computed server side. The node_port value is actually both ( if none is specified the server will randomly choose a value ).
Because the server sometimes supplies a value, the attribute needs to be set as computed in the Terraform resource definition, but this cause diff problems when you had previously been setting a value, then remove it from the config. Terraform ignores the change.
As you can see from your diff above, Terraform has detected it needs to change spec.0.type: "NodePort" => "ClusterIP" but there is no change for the node_port (even though there should be).
I found a way to workaround it for the node_port attribute, and will likely need something similar for all the attributes that have these characteristics.
Terraform Version
Terraform v0.11.7
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Debug Output
Expected Behavior
spec.ports[0].nodePort
should have been detected as removed. It should show up as removed in the plan.Actual Behavior
After
spec.ports[0].nodePort
has been removed, terraform does not see that the property has disappeared.Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
#
in front of all linesterraform apply
#
again at the two lines which had themterraform apply
The text was updated successfully, but these errors were encountered: