Skip to content
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

Enable Non-RFC 1918 Addresses in 100.64.0.0/10 #6133

Closed
spirrello opened this issue Apr 17, 2020 · 6 comments
Closed

Enable Non-RFC 1918 Addresses in 100.64.0.0/10 #6133

spirrello opened this issue Apr 17, 2020 · 6 comments
Assignees

Comments

@spirrello
Copy link

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

It would be great to allow for creating VPC subnets on the 100.64.0.0/10 (non-rfc 1918) address space. This is a private reserved address space that can be used for internal use cases.

Error message

Error: Error creating Subnetwork: googleapi: Error 400: Invalid value for field 'resource.secondaryIpRanges[0].ipCidrRange': '100.64.0.0/22'. IpCidrRange must specify a range contained in RFC 1918 spaces., invalid

  on .terraform/modules/network-1/terraform-google-network-2.3.0/modules/subnets/main.tf line 28, in resource "google_compute_subnetwork" "subnetwork":
  28: resource "google_compute_subnetwork" "subnetwork" {

New or Affected Resource(s)

  • google_compute_network

Potential Terraform Configuration

module "network-1" {
  source = "terraform-google-modules/network/google//modules/subnets-beta"
  project_id   = var.project_name
  network_name = "network-1"
  routing_mode = "REGIONAL"


  subnets = [
    {
      subnet_name               = "gke-2"
      subnet_ip                 = "10.0.2.0/24"
      subnet_region             = "us-central1"
      subnet_private_access     = "true"
      description               = "subnet for GKE"
      subnet_flow_logs          = "true"
      subnet_flow_logs_interval = "INTERVAL_10_MIN"
      subnet_flow_logs_sampling = 0.7
      subnet_flow_logs_metadata = "INCLUDE_ALL_METADATA"
    },
  ]

  secondary_ranges = {

    gke-1 = [
      {
        range_name    = "pods-1"
        ip_cidr_range = "100.64.0.0/22"
      },
      {
        range_name    = "services-1"
        ip_cidr_range = "100.64.4.0/23"
      },
    ]
  }
}

References

  • #0000
@ghost ghost added the enhancement label Apr 17, 2020
@danawillow
Copy link
Contributor

@spirrello do you have any pointers to docs that state this is possible in GCP today? https://cloud.google.com/vpc/docs/vpc#manually_created_subnet_ip_ranges and https://cloud.google.com/vpc/docs/using-vpc#subnet-rules both state that the subnet IP address needs to be RFC-1918.

@spirrello
Copy link
Author

I don't have any documentation to point to but it's possible through the UI.

image

@ghost ghost removed the waiting-response label Apr 20, 2020
@danawillow
Copy link
Contributor

Hey @spirrello, I'm pretty sure this should work as-is as long as you're using the beta provider (since this is a beta feature). Can you give that a try and let me know? If you do try it and it doesn't work, would you mind showing me debug logs (the API request/response is all I need) from a failed run?

@skydalriol
Copy link

skydalriol commented May 26, 2021

FYI:

documentation is here: https://cloud.google.com/architecture/configuring-privately-used-public-ips-for-GKE

From a network point of view, it is now possible to add secondary ranges even if non RFC-1918 compliant (eg:1.1.0.0/23 for Pods on a GKE cluster).

@megan07
Copy link
Contributor

megan07 commented Jun 2, 2021

I'm going to close this as it appears to be working now. If you experience any issues, please feel free to open a new issue. Thanks!

@megan07 megan07 closed this as completed Jun 2, 2021
@github-actions
Copy link

github-actions bot commented Jul 3, 2021

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 Jul 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants