Skip to content
New issue

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

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

Already on GitHub? # to your account

google_container_cluster Disable the kubelet read-only port #15208

Closed
oscar-b opened this issue Jul 18, 2023 · 15 comments · Fixed by GoogleCloudPlatform/magic-modules#11272, hashicorp/terraform-provider-google-beta#8071 or #19312

Comments

@oscar-b
Copy link

oscar-b commented Jul 18, 2023

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

Port 10255 should be disabled, which can be done using --no-enable-insecure-kubelet-readonly-port

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

New or Affected Resource(s)

  • google_container_cluster

Potential Terraform Configuration

# Propose what you think the configuration to take advantage of this feature should look like.
# We may not use it verbatim, but it's helpful in understanding your intent.

References

  • #0000

b/292264600

@ramondeklein
Copy link

ramondeklein commented Jul 20, 2023

Adding no_enable_insecure_kubelet_readonly_port to google_container_cluster is just the basic functionality. Google also added the insecureKubeletReadonlyPortEnabled flag in the kubelet_config block for both clusters and node-pools (source). I guess this needs to be added as well.

@gabegorelick
Copy link

Google Cloud is sunsetting the insecure kubelet port. They've begun emailing customers about migrating off of it. So I expect a lot of renewed interest in the ability to disable it via Terraform.

@wyardley
Copy link

With the announcement going out to customers (https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port#migrate-apps) this probably becomes more urgent / critical.

wyardley added a commit to wyardley/magic-modules that referenced this issue Jul 27, 2024
- Add `no_enable_insecure_kubelet_readonly_port` to google_container_cluster
- Allow setting `insecure_kubelet_readonly_port_enabled` for
  `container_node_pool`

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

Fixes hashicorp/terraform-provider-google#15208
@wyardley
Copy link

I started a draft; the node_pool updates look slightly easier than the container_cluster ones (adding NodeKubeletConfig defaults) are; if anyone's got some thoughts / ideas, feel free to comment. I will hopefully have some more time to dig into it a bit more in a week or two.

@wyardley
Copy link

ps - I'm guessing implementing this as a non default or optional option will be easier to get released vs. a technically breaking one, even if the breaking way is better from a security standpoint?

wyardley added a commit to wyardley/magic-modules that referenced this issue Jul 27, 2024
- Add `no_enable_insecure_kubelet_readonly_port` to google_container_cluster
- Allow setting `insecure_kubelet_readonly_port_enabled` for
  `container_node_pool`

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

Fixes hashicorp/terraform-provider-google#15208
wyardley added a commit to wyardley/magic-modules that referenced this issue Jul 27, 2024
- Add `no_enable_insecure_kubelet_readonly_port` to google_container_cluster
- Allow setting `insecure_kubelet_readonly_port_enabled` for
  `container_node_pool`

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

Fixes hashicorp/terraform-provider-google#15208
wyardley added a commit to wyardley/magic-modules that referenced this issue Jul 27, 2024
- Add `no_enable_insecure_kubelet_readonly_port` to google_container_cluster
- Allow setting `insecure_kubelet_readonly_port_enabled` for
  `container_node_pool`

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

Fixes hashicorp/terraform-provider-google#15208
@shinji62
Copy link

Impacted as well, received the notification ... But can't disable using TF.

@enricojonas
Copy link

Same here - doing this through TF would be the preferred way for us.

@felipesbs
Copy link

We agree, using Terraform for this would be ideal.

@kustodian
Copy link

I also received an email. This is the first thing I found when I didn't see it implemented in TF. Hopefully, it will be ready soon. There is a lot of progress in GoogleCloudPlatform/magic-modules#11272 :)

wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 7, 2024
- Add `no_enable_insecure_kubelet_readonly_port` to google_container_cluster
- Allow setting `insecure_kubelet_readonly_port_enabled` for
  `container_node_pool`

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

Fixes hashicorp/terraform-provider-google#15208
@otherguy
Copy link

otherguy commented Aug 8, 2024

I've done this manually now but would like the change reflected in Terraform.

wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 9, 2024
- Add `no_enable_insecure_kubelet_readonly_port` to google_container_cluster
- Allow setting `insecure_kubelet_readonly_port_enabled` for
  `container_node_pool`

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

Fixes hashicorp/terraform-provider-google#15208
wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 10, 2024
- Add `no_enable_insecure_kubelet_readonly_port` to google_container_cluster
- Allow setting `insecure_kubelet_readonly_port_enabled` for
  `container_node_pool`

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

Fixes hashicorp/terraform-provider-google#15208
wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 10, 2024
- Add `no_enable_insecure_kubelet_readonly_port` to google_container_cluster
- Allow setting `insecure_kubelet_readonly_port_enabled` for
  `container_node_pool`

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

Fixes hashicorp/terraform-provider-google#15208
wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 10, 2024
- Add `no_enable_insecure_kubelet_readonly_port` to google_container_cluster
- Allow setting `insecure_kubelet_readonly_port_enabled` for
  `container_node_pool`

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

Fixes hashicorp/terraform-provider-google#15208
wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 11, 2024
- Add `no_enable_insecure_kubelet_readonly_port` to google_container_cluster
- Allow setting `insecure_kubelet_readonly_port_enabled` for
  `container_node_pool`

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

Fixes hashicorp/terraform-provider-google#15208
wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 12, 2024
- Add `no_enable_insecure_kubelet_readonly_port` to google_container_cluster
- Allow setting `insecure_kubelet_readonly_port_enabled` for
  `container_node_pool`

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

Fixes hashicorp/terraform-provider-google#15208
wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 16, 2024
- Add `no_enable_insecure_kubelet_readonly_port` to google_container_cluster
- Allow setting `insecure_kubelet_readonly_port_enabled` for
  `container_node_pool`

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

Fixes hashicorp/terraform-provider-google#15208
@hoskeri
Copy link

hoskeri commented Aug 20, 2024

Thanks for the PR! Just one comment about an additional field. everything else LGTM.

node_kubelet_config field is also available in node_pool_auto_config.

Could you update that in a similar manner as node_config_defaults as well?

https://github.com/wyardley/magic-modules/blob/46909c20c7a2dc63b5c6ea80be1b276d36f34dd2/mmv1/third_party/terraform/services/container/go/resource_container_cluster.go.tmpl#L1509

What's the behavior when the value goes from unset -> set outside of terraform?

@wyardley
Copy link

@hoskeri good call, I can take a look at updating that as well. However, there are still some kinks in the PR in progress.

What's the behavior when the value goes from unset -> set outside of terraform?

I think as they've asked me to implement it (see the bit about using an enum instead of a bool), if it goes from unset to set (to true), if the user doesn't have it set in the config, they will probably see drift (i.e., if the setting goes from unset (false) to true at the API level, the user will see permadrift unless they add "TRUE" .

However, if the API default changes, I think it will be a noop if the user doesn't have it set.

@wyardley
Copy link

node_kubelet_config field is also available in node_pool_auto_config.

I see it in the library / API docs: https://pkg.go.dev/google.golang.org/api/container/v1#NodeKubeletConfig

However, from what I can see, node_kubelet_config isn't implemented at all (with or without this setting) in the provider as of now.

https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#nested_node_pool_auto_config

My initial thought is that it probably is better to implement this without that at first, and for someone to add node_kublet_config support separately, just in the sense that it's already a very large set of changes with a lot of moving parts.

@hoskeri
Copy link

hoskeri commented Aug 20, 2024

Thanks, a follow up is fine. Thanks!

wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 21, 2024
- Add `no_enable_insecure_kubelet_readonly_port` to google_container_cluster
- Allow setting `insecure_kubelet_readonly_port_enabled` for
  `container_node_pool`

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

Fixes hashicorp/terraform-provider-google#15208
wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 21, 2024
- Add `no_enable_insecure_kubelet_readonly_port` to google_container_cluster
- Allow setting `insecure_kubelet_readonly_port_enabled` for
  `container_node_pool`

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

Fixes hashicorp/terraform-provider-google#15208
wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 21, 2024
- Add `no_enable_insecure_kubelet_readonly_port` to google_container_cluster
- Allow setting `insecure_kubelet_readonly_port_enabled` for
  `container_node_pool`

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

Fixes hashicorp/terraform-provider-google#15208
wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 22, 2024
- Add `no_enable_insecure_kubelet_readonly_port` to google_container_cluster
- Allow setting `insecure_kubelet_readonly_port_enabled` for
  `container_node_pool`

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

Fixes hashicorp/terraform-provider-google#15208
wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 22, 2024
- Add `no_enable_insecure_kubelet_readonly_port` to google_container_cluster
- Allow setting `insecure_kubelet_readonly_port_enabled` for
  `container_node_pool`

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

Fixes hashicorp/terraform-provider-google#15208
wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 26, 2024
- Add `no_enable_insecure_kubelet_readonly_port` to google_container_cluster
- Allow setting `insecure_kubelet_readonly_port_enabled` for
  `container_node_pool`

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

Fixes hashicorp/terraform-provider-google#15208
wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 27, 2024
- Add `no_enable_insecure_kubelet_readonly_port` to google_container_cluster
- Allow setting `insecure_kubelet_readonly_port_enabled` for
  `container_node_pool`

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

Fixes hashicorp/terraform-provider-google#15208
wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 27, 2024
- Add `no_enable_insecure_kubelet_readonly_port` to google_container_cluster
- Allow setting `insecure_kubelet_readonly_port_enabled` for
  `container_node_pool`

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

Fixes hashicorp/terraform-provider-google#15208
wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 27, 2024
- Add `no_enable_insecure_kubelet_readonly_port` to google_container_cluster
- Allow setting `insecure_kubelet_readonly_port_enabled` for
  `container_node_pool`

https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port

Fixes hashicorp/terraform-provider-google#15208
wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 29, 2024
wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 29, 2024
wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 29, 2024
wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 29, 2024
wyardley added a commit to wyardley/magic-modules that referenced this issue Aug 29, 2024
Copy link

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.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 29, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.