|
1 | 1 | /** |
2 | | - * Copyright 2020 Google LLC |
| 2 | + * Copyright 2020-2023 Google LLC |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -30,6 +30,8 @@ module "enabled_google_apis" { |
30 | 30 | "monitoring.googleapis.com", |
31 | 31 | "container.googleapis.com", |
32 | 32 | "stackdriver.googleapis.com", |
| 33 | + "gkehub.googleapis.com", |
| 34 | + "connectgateway.googleapis.com", |
33 | 35 | ] |
34 | 36 | } |
35 | 37 |
|
@@ -97,7 +99,42 @@ module "kubectl-local-yaml" { |
97 | 99 | cluster_name = module.gke.name |
98 | 100 | cluster_location = module.gke.location |
99 | 101 | module_depends_on = [module.kubectl-imperative.wait, module.gke.endpoint] |
100 | | - kubectl_create_command = "kubectl apply -f ${local.manifest_path}" |
101 | | - kubectl_destroy_command = "kubectl delete -f ${local.manifest_path}" |
| 102 | + kubectl_create_command = "kubectl apply -f ${local.manifest_path}/nginx.yaml" |
| 103 | + kubectl_destroy_command = "kubectl delete -f ${local.manifest_path}/nginx.yaml" |
102 | 104 | skip_download = false |
103 | 105 | } |
| 106 | + |
| 107 | +module "fleet" { |
| 108 | + source = "terraform-google-modules/kubernetes-engine/google//modules/fleet-membership" |
| 109 | + version = "~> 28.0" |
| 110 | + |
| 111 | + depends_on = [module.gke] |
| 112 | + |
| 113 | + project_id = var.project_id |
| 114 | + cluster_name = module.gke.name |
| 115 | + location = module.gke.location |
| 116 | +} |
| 117 | + |
| 118 | +module "kubectl-fleet-imperative" { |
| 119 | + source = "../../modules/kubectl-fleet-wrapper" |
| 120 | + |
| 121 | + membership_name = module.fleet.cluster_membership_id |
| 122 | + membership_project_id = module.fleet.project_id |
| 123 | + membership_location = module.fleet.location |
| 124 | + module_depends_on = [module.kubectl-local-yaml.wait, module.fleet.wait] |
| 125 | + kubectl_create_command = "kubectl run nginx-fleet-imperative --image=nginx" |
| 126 | + kubectl_destroy_command = "kubectl delete pod nginx-fleet-imperative" |
| 127 | + skip_download = false |
| 128 | +} |
| 129 | + |
| 130 | +module "kubectl-fleet-local-yaml" { |
| 131 | + source = "../../modules/kubectl-fleet-wrapper" |
| 132 | + |
| 133 | + membership_name = module.fleet.cluster_membership_id |
| 134 | + membership_project_id = module.fleet.project_id |
| 135 | + membership_location = module.fleet.location |
| 136 | + module_depends_on = [module.kubectl-fleet-imperative.wait, module.gke.endpoint] |
| 137 | + kubectl_create_command = "kubectl apply -f ${local.manifest_path}/nginx-fleet.yaml" |
| 138 | + kubectl_destroy_command = "kubectl delete -f ${local.manifest_path}/nginx-fleet.yaml" |
| 139 | + skip_download = true |
| 140 | +} |
0 commit comments