File tree Expand file tree Collapse file tree 9 files changed +18
-23
lines changed
infra/gcp/terraform/k8s-infra-gcp-gcve Expand file tree Collapse file tree 9 files changed +18
-23
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,9 @@ limitations under the License.
15
15
*/
16
16
17
17
variable "project_id" {
18
- description = " The project ID to use for the maintenance jumphost ."
18
+ description = " The project ID to use for the gcve cluster ."
19
19
default = " broadcom-451918"
20
+ type = string
20
21
}
21
22
22
23
# Read the secret from Secret Manager which contains the wireguard server configuration.
@@ -25,7 +26,7 @@ data "google_secret_manager_secret_version_access" "wireguard-config" {
25
26
secret = " maintenance-vm-wireguard-config"
26
27
}
27
28
28
- # Creates the maintenance jumphost which runs SSH and a wireguard server.
29
+ # Create the maintenance jumphost which runs SSH and a wireguard server.
29
30
resource "google_compute_instance" "jumphost" {
30
31
project = var. project_id
31
32
name = " maintenance-jumphost"
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ This file defines:
21
21
*/
22
22
23
23
terraform {
24
+ required_version = " 1.10.5"
24
25
25
26
backend "gcs" {
26
27
bucket = " k8s-infra-tf-gcp-gcve"
Original file line number Diff line number Diff line change @@ -22,12 +22,12 @@ This file defines:
22
22
23
23
terraform {
24
24
required_version = " 1.10.5"
25
+
25
26
backend "gcs" {
26
27
bucket = " k8s-infra-tf-gcp-gcve"
27
28
prefix = " k8s-infra-gcp-gcve"
28
29
}
29
30
30
-
31
31
required_providers {
32
32
google = {
33
33
source = " hashicorp/google"
Original file line number Diff line number Diff line change @@ -17,4 +17,5 @@ limitations under the License.
17
17
variable "project_id" {
18
18
description = " The project ID to use for the gcve cluster."
19
19
default = " broadcom-451918"
20
+ type = string
20
21
}
Original file line number Diff line number Diff line change @@ -32,23 +32,11 @@ data "vsphere_datastore" "datastore" {
32
32
datacenter_id = data. vsphere_datacenter . datacenter . id
33
33
}
34
34
35
- data "vsphere_role" "read-only" {
36
- label = " Read-only"
37
- }
38
-
39
- data "vsphere_role" "no-access" {
40
- label = " No access"
41
- }
42
-
43
35
data "vsphere_network" "network" {
44
36
name = var. vsphere_network_name
45
37
datacenter_id = data. vsphere_datacenter . datacenter . id
46
38
}
47
39
48
- data "vsphere_folder" "global" {
49
- path = " /"
50
- }
51
-
52
40
# Resources from NSX-T.
53
41
54
42
data "nsxt_policy_tier1_gateway" "tier1_gw" {
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ limitations under the License.
15
15
*/
16
16
17
17
terraform {
18
+ required_version = " 1.10.5"
19
+
18
20
required_providers {
19
21
vsphere = {
20
22
source = " vmware/vsphere"
Original file line number Diff line number Diff line change @@ -14,14 +14,20 @@ See the License for the specific language governing permissions and
14
14
limitations under the License.
15
15
*/
16
16
17
+ /*
18
+ This file defines:
19
+ - Required provider versions
20
+ - Storage backend details
21
+ */
22
+
17
23
terraform {
24
+ required_version = " 1.10.5"
18
25
19
26
backend "gcs" {
20
27
bucket = " k8s-infra-tf-gcp-gcve"
21
28
prefix = " k8s-infra-gcp-gcve-vcenter"
22
29
}
23
30
24
-
25
31
required_providers {
26
32
google = {
27
33
source = " hashicorp/google"
Original file line number Diff line number Diff line change @@ -47,13 +47,9 @@ function initBoskosResourceUserData() {
47
47
boskos_data=' {"ipPool":"' " ${ipPool} " ' ","resourcePool":"' " ${resourcePool} " ' ","folder":"' " ${folder} " ' "}'
48
48
49
49
# acquire from "dirty" or "free" state
50
- ACQUIRED=1
51
50
curl -s -X POST " ${BOSKOS_HOST} /acquirebystate?names=${resourceName} &state=dirty&dest=busy&owner=$( whoami) " | grep -q " ${resourceName} " \
52
51
|| curl -s -X POST " ${BOSKOS_HOST} /acquirebystate?names=${resourceName} &state=free&dest=busy&owner=$( whoami) " | grep -q " ${resourceName} " \
53
- || ( echo " Failed to acquire ${resourceName} " ; ACQUIRED=0)
54
- if [[ " ${ACQUIRED} " -eq 0 ]]; then
55
- echo " Failed to acquire project ${resourceName} "
56
- fi
52
+ || echo " Failed to acquire ${resourceName} "
57
53
58
54
# update resource
59
55
echo " Updating resource ${resourceName} with following data: ${boskos_data} "
Original file line number Diff line number Diff line change @@ -39,13 +39,13 @@ resource "vsphere_tag_category" "category_k8s_zone" {
39
39
# Creates the Datacenter tag for the k8s-region tag category for failure domain testing.
40
40
resource "vsphere_tag" "tag_k8s_region" {
41
41
name = var. vsphere_datacenter
42
- category_id = " ${ vsphere_tag_category . category_k8s_region . id } "
42
+ category_id = vsphere_tag_category. category_k8s_region . id
43
43
description = " Managed by Terraform"
44
44
}
45
45
46
46
# Creates the Compute Cluster tag for the k8s-zone tag category for failure domain testing.
47
47
resource "vsphere_tag" "tag_k8s_zone" {
48
48
name = var. vsphere_cluster
49
- category_id = " ${ vsphere_tag_category . category_k8s_zone . id } "
49
+ category_id = vsphere_tag_category. category_k8s_zone . id
50
50
description = " Managed by Terraform"
51
51
}
You can’t perform that action at this time.
0 commit comments