Skip to content

feat(GKE): Add secondary boot disk sample for preloaded data #684

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

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions gke/standard/zonal/secondary-boot-disk/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

# [START gke_standard_zonal_secondary_boot_disk]
# [START gke_standard_zonal_secondary_boot_disk_cluster]
resource "google_container_cluster" "default" {
name = "default"
location = "us-central1-a"
Expand All @@ -25,9 +25,11 @@ resource "google_container_cluster" "default" {
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}
# [END gke_standard_zonal_secondary_boot_disk_cluster]

resource "google_container_node_pool" "default" {
name = "default"
# [START gke_standard_zonal_secondary_boot_disk_container]
resource "google_container_node_pool" "secondary_boot_disk_container" {
name = "secondary_boot_disk_container"
location = "us-central1-a"
cluster = google_container_cluster.default.name
initial_node_count = 1
Expand All @@ -44,4 +46,24 @@ resource "google_container_node_pool" "default" {
}
}
}
# [END gke_standard_zonal_secondary_boot_disk]
# [END gke_standard_zonal_secondary_boot_disk_container]

# [START gke_standard_zonal_secondary_boot_disk_data]
resource "google_container_node_pool" "secondary_boot_disk_data" {
name = "secondary_boot_disk_data"
location = "us-central1-a"
cluster = google_container_cluster.default.name
initial_node_count = 1

node_config {
machine_type = "e2-medium"
image_type = "COS_CONTAINERD"
gcfs_config {
enabled = true
}
secondary_boot_disks {
disk_image = ""
}
}
}
# [END gke_standard_zonal_secondary_boot_disk_data]