-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
GKE autopilot is always created with default service account #8918
GKE autopilot is always created with default service account #8918
Comments
Can you please attach the debug log, want to look at the request/response .. |
@venkykuberan sure, added. |
@tSte The service account used in the config is being passed to API on the Create request however API ignores that and associate |
@venkykuberan I'm not sure if this is the case, because using always the |
@venkykuberan this came from GCP support:
|
There is open issue on this matter... |
Great find @tSte we will likely need to track that to see what the resolution looks like before we can fix this in the provider. Until then the restriction on specifying these fields at the same time seems to be the best solution |
To be honest, I'm not sure what should be passed to GCP REST API in order to create GKE autopilot cluster with custom service account and access scopes (e.g. |
We see the same issue while attempting to create clusters even without Autopilot. It seems that the node config block is not respecting the service account definition what so ever. This causes problems when you do not utilize the default compute service account and disable it entirely. This seems very much like a regression. This is utilizing
|
@Kampe that is definitely worrying. Can you provide a config that specifies |
Using this, with a created service account supplied will create the "default cluster nodepool" with the default compute service account instead. We use this service account for the "real" node pools we standup after the default ones get sunset off the cluster create. This shows itself when attempting to create clusters google will never actually tie the nodes from the default pool to the cluster itself. Never allowing us to create our "real" node pool as the operation before it times out after 30 mins of waiting for healthchecks that never get satisfied. |
Huh, how are you checking the service account that is set on the default node pool? I'm setting up a cluster with the following config:
And I'm getting the following response from the API after creating it:
which seems to point to the service account being set correctly |
There's an update re. the autopilot issue so I'll check it out with both |
@venkykuberan, @slevenick an update:
However Terraform configuration does not allow me to create such a cluster, it still creates a cluster with What is more, when I upgraded to latest provider, Not sure if relevant, but it's possible to create GKE autopilot cluster via CLI and then import do TF, without changes. |
Hmmm, ok it looks like there has been some confusion around how this should work in the API and in Terraform. Reading some internal docs it appears that we should now be able to set custom service accounts when using autopilot. I was under the impression that this was not a supported operation, so I marked the node_config field to conflict with enable_autopilot. I'll need to do some testing on exactly how we are expected to send the custom service account when autopilot is enabled, but it should be possible now! |
Okay, I think the best solution in the short term is to remove the conflicts restriction on enable_autopilot + node_config. It seems like setting the service account via node_config now works when the cluster is in autopilot mode. |
@slevenick may I ask you how did you test this? Because when I create the cluster, it is still created with the
I'm still able to create GKE cluster with custom service account via |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Terraform v0.14.10
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/tSte/16b3bfc369242c1e0e88878d869f6f83
Panic Output
Expected Behavior
GKE autopilot cluster is created with non-default
service_account
andoauth_scopes
.Actual Behavior
GKE autopilot cluster is created with the
default
service account andoauth_scopes
.Steps to Reproduce
terraform apply
Important Factoids
gcloud CLI enables service account configuration.
I tried to use
cluster_autoscaling.auto_provisioning_defaults.service_account
, butcluster_autoscaling.enabled
conflicts with autopilot.References
The text was updated successfully, but these errors were encountered: