Browse Source
contrib/terraform/exoscale: Rework SSH public keys (#7242)
contrib/terraform/exoscale: Rework SSH public keys (#7242)
* contrib/terraform/exoscale: Rework SSH public keys Exoscale has a few limitations with `exoscale_ssh_keypair` resources. Creating several clusters with these scripts may lead to an error like: ``` Error: API error ParamError 431 (InvalidParameterValueException 4350): The key pair "lj-sc-ssh-key" already has this fingerprint ``` This patch reworks handling of SSH public keys. Specifically, we rely on the more cloud-agnostic way of configuring SSH public keys via `cloud-init`. * contrib/terraform/exoscale: terraform fmt * contrib/terraform/exoscale: Add terraform validate * contrib/terraform/exoscale: Inline public SSH keys The Terraform scripts need to install some SSH key, so that Kubespray (i.e., the "Ansible part") can take over. Initially, we pointed the Terraform scripts to `~/.ssh/id_rsa.pub`. This proved to be suboptimal: Operators sharing responbility for a cluster risk unnecessarily replacing resources. Therefore, it has been determined that it's best to inline the public SSH keys. The chosen variable `ssh_public_keys` provides some uniformity with `contrib/azurerm`. * Fix Terraform Exoscale test * Fix Terraform 0.14 testpull/7245/head
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 161 additions and 75 deletions
Unified View
Diff Options
-
14.gitlab-ci/terraform.yml
-
4contrib/terraform/exoscale/README.md
-
86contrib/terraform/exoscale/default.tfvars
-
22contrib/terraform/exoscale/main.tf
-
9contrib/terraform/exoscale/modules/kubernetes-cluster/main.tf
-
5contrib/terraform/exoscale/modules/kubernetes-cluster/templates/cloud-init.tmpl
-
4contrib/terraform/exoscale/modules/kubernetes-cluster/variables.tf
-
65contrib/terraform/exoscale/sample-inventory/cluster.tfvars
-
1contrib/terraform/exoscale/sample-inventory/group_vars
-
24contrib/terraform/exoscale/variables.tf
-
2contrib/terraform/exoscale/versions.tf
@ -0,0 +1,65 @@ |
|||||
|
prefix = "default" |
||||
|
zone = "ch-gva-2" |
||||
|
|
||||
|
inventory_file = "inventory.ini" |
||||
|
|
||||
|
ssh_public_keys = [ |
||||
|
# Put your public SSH key here |
||||
|
"ssh-rsa I-did-not-read-the-docs", |
||||
|
"ssh-rsa I-did-not-read-the-docs 2", |
||||
|
] |
||||
|
|
||||
|
machines = { |
||||
|
"master-0" : { |
||||
|
"node_type" : "master", |
||||
|
"size" : "Small", |
||||
|
"boot_disk" : { |
||||
|
"image_name" : "Linux Ubuntu 20.04 LTS 64-bit", |
||||
|
"root_partition_size" : 50, |
||||
|
"node_local_partition_size" : 0, |
||||
|
"ceph_partition_size" : 0 |
||||
|
} |
||||
|
}, |
||||
|
"worker-0" : { |
||||
|
"node_type" : "worker", |
||||
|
"size" : "Large", |
||||
|
"boot_disk" : { |
||||
|
"image_name" : "Linux Ubuntu 20.04 LTS 64-bit", |
||||
|
"root_partition_size" : 50, |
||||
|
"node_local_partition_size" : 0, |
||||
|
"ceph_partition_size" : 0 |
||||
|
} |
||||
|
}, |
||||
|
"worker-1" : { |
||||
|
"node_type" : "worker", |
||||
|
"size" : "Large", |
||||
|
"boot_disk" : { |
||||
|
"image_name" : "Linux Ubuntu 20.04 LTS 64-bit", |
||||
|
"root_partition_size" : 50, |
||||
|
"node_local_partition_size" : 0, |
||||
|
"ceph_partition_size" : 0 |
||||
|
} |
||||
|
}, |
||||
|
"worker-2" : { |
||||
|
"node_type" : "worker", |
||||
|
"size" : "Large", |
||||
|
"boot_disk" : { |
||||
|
"image_name" : "Linux Ubuntu 20.04 LTS 64-bit", |
||||
|
"root_partition_size" : 50, |
||||
|
"node_local_partition_size" : 0, |
||||
|
"ceph_partition_size" : 0 |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
nodeport_whitelist = [ |
||||
|
"0.0.0.0/0" |
||||
|
] |
||||
|
|
||||
|
ssh_whitelist = [ |
||||
|
"0.0.0.0/0" |
||||
|
] |
||||
|
|
||||
|
api_server_whitelist = [ |
||||
|
"0.0.0.0/0" |
||||
|
] |
@ -0,0 +1 @@ |
|||||
|
../../../../inventory/sample/group_vars |
Write
Preview
Loading…
Cancel
Save