Skip to content

Commit

Permalink
terraform variable ssh_username (#350)
Browse files Browse the repository at this point in the history
Signed-off-by: Artiom Diomin <kron82@gmail.com>
  • Loading branch information
kron4eg authored and kubermatic-bot committed Apr 15, 2019
1 parent b71dc10 commit 6222e1f
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 5 deletions.
24 changes: 24 additions & 0 deletions examples/terraform/aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,27 @@ $ terraform plan
$ terraform apply
$ terraform output -json > tf.json
```

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| aws\_region | AWS region to speak to | string | `"eu-west-3"` | no |
| cluster\_name | prefix for cloud resources | string | n/a | yes |
| control\_plane\_count | Number of instances | string | `"3"` | no |
| control\_plane\_type | AWS instance type | string | `"t3.medium"` | no |
| control\_plane\_volume\_size | Size of the EBS volume, in Gb | string | `"100"` | no |
| ssh\_agent\_socket | SSH Agent socket, default to grab from $SSH_AUTH_SOCK | string | `"env:SSH_AUTH_SOCK"` | no |
| ssh\_port | SSH port | string | `"22"` | no |
| ssh\_private\_key\_file | SSH private key file, only specify in absence of SSH agent | string | `""` | no |
| ssh\_public\_key\_file | SSH public key file | string | `"~/.ssh/id_rsa.pub"` | no |
| ssh\_username | SSH user, used only in output | string | `"ubuntu"` | no |
| vpc\_id | VPC to use ('default' for default VPC) | string | `"default"` | no |

## Outputs

| Name | Description |
|------|-------------|
| kubeone\_api | |
| kubeone\_hosts | |
| kubeone\_workers | |
2 changes: 1 addition & 1 deletion examples/terraform/aws/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ output "kubeone_hosts" {
ssh_agent_socket = "${var.ssh_agent_socket}"
ssh_port = "${var.ssh_port}"
ssh_private_key_file = "${var.ssh_private_key_file}"
ssh_user = "ubuntu"
ssh_user = "${var.ssh_username}"
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions examples/terraform/aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ variable "ssh_port" {
default = 22
}

variable "ssh_username" {
default = "ubuntu"
description = "SSH user, used only in output"
}

variable "control_plane_count" {
default = 3
description = "Number of instances"
Expand Down
26 changes: 26 additions & 0 deletions examples/terraform/digitalocean/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,29 @@ $ terraform plan
$ terraform apply
$ terraform output -json > tf.json
```
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| cluster\_name | Name of the cluster | string | n/a | yes |
| control\_plane\_count | Number of master instances | string | `"3"` | no |
| droplet\_image | Image to use for provisioning droplet | string | `"ubuntu-18-04-x64"` | no |
| droplet\_ipv6 | Enable IPv6 | string | `"false"` | no |
| droplet\_monitoring | Enable advance Droplet metrics | string | `"false"` | no |
| droplet\_private\_networking | Enable Private Networking on Droplets (recommended) | string | `"true"` | no |
| droplet\_size | Size of Droplets | string | `"s-2vcpu-4gb"` | no |
| region | Region to speak to | string | `"fra1"` | no |
| ssh\_agent\_socket | SSH Agent socket, default to grab from $SSH_AUTH_SOCK | string | `"env:SSH_AUTH_SOCK"` | no |
| ssh\_port | SSH port to be used to provision instances | string | `"22"` | no |
| ssh\_private\_key\_file | SSH private key file used to access instances | string | `""` | no |
| ssh\_public\_key\_file | SSH public key file | string | `"~/.ssh/id_rsa.pub"` | no |
| ssh\_username | SSH user, used only in output | string | `"root"` | no |

## Outputs

| Name | Description |
|------|-------------|
| kubeone\_api | |
| kubeone\_hosts | |
| kubeone\_workers | |

2 changes: 1 addition & 1 deletion examples/terraform/digitalocean/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ output "kubeone_hosts" {
ssh_agent_socket = "${var.ssh_agent_socket}"
ssh_port = "${var.ssh_port}"
ssh_private_key_file = "${var.ssh_private_key_file}"
ssh_user = "root"
ssh_user = "${var.ssh_username}"
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions examples/terraform/digitalocean/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ variable "ssh_port" {
description = "SSH port to be used to provision instances"
}

variable "ssh_username" {
default = "root"
description = "SSH user, used only in output"
}

variable "ssh_private_key_file" {
description = "SSH private key file used to access instances"
default = ""
Expand Down
5 changes: 3 additions & 2 deletions examples/terraform/gce/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ ether of the following ENV variables should be accessible:
| control\_plane\_count | Number of instances | string | `"3"` | no |
| control\_plane\_image\_family | Image family to use for provisioning instances | string | `"ubuntu-1804-lts"` | no |
| control\_plane\_image\_project | Project of the image to use for provisioning instances | string | `"ubuntu-os-cloud"` | no |
| control\_plane\_type | GCE instance type | string | `"n1-standard-1"` | no |
| control\_plane\_target\_pool\_members\_count | | string | `"3"` | no |
| control\_plane\_type | GCE instance type | string | `"n1-standard-2"` | no |
| control\_plane\_volume\_size | Size of the boot volume, in GB | string | `"100"` | no |
| project | Project to be used for all resources | string | n/a | yes |
| region | GCP region to speak to | string | `"europe-west3"` | no |
| ssh\_agent\_socket | SSH Agent socket, default to grab from $SSH_AUTH_SOCK | string | `"env:SSH_AUTH_SOCK"` | no |
| ssh\_port | SSH port | string | `"22"` | no |
| ssh\_public\_key\_file | SSH public key file | string | `"~/.ssh/id_rsa.pub"` | no |
| ssh\_username | Username to provision with the ssh_public_key_file | string | `"kubeadmin"` | no |
| workers\_type | GCE instance type | string | `"n1-standard-1"` | no |
| workers\_type | GCE instance type | string | `"n1-standard-2"` | no |
| workers\_volume\_size | Size of the boot volume, in GB | string | `"100"` | no |

## Outputs
Expand Down
19 changes: 19 additions & 0 deletions examples/terraform/hetzner/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| cluster\_name | prefix for cloud resources | string | n/a | yes |
| control\_plane\_count | Number of instances | string | `"3"` | no |
| control\_plane\_type | | string | `"cx21"` | no |
| datacenter | | string | `"fsn1"` | no |
| image | | string | `"ubuntu-18.04"` | no |
| ssh\_public\_key\_file | SSH public key file | string | `"~/.ssh/id_rsa.pub"` | no |
| worker\_type | | string | `"cx21"` | no |

## Outputs

| Name | Description |
|------|-------------|
| kubeone\_hosts | |
| kubeone\_workers | |

27 changes: 27 additions & 0 deletions examples/terraform/openstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,30 @@ Create a config.yaml and make sure you specify `.provider.cloud_config`.
```bash
kubeone install --tfjson tf.json config.yaml
```

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| cluster\_name | prefix for cloud resources | string | n/a | yes |
| control\_plane\_count | Number of instances | string | `"3"` | no |
| control\_plane\_flavor | OpenStack instance flavor for the control plane nodes | string | `"m1.small"` | no |
| external\_network\_name | OpenStack external network name | string | n/a | yes |
| image | OpenStack image for the control plane nodes | string | `"Ubuntu 18.04 LTS"` | no |
| ssh\_agent\_socket | SSH Agent socket, default to grab from $SSH_AUTH_SOCK | string | `"env:SSH_AUTH_SOCK"` | no |
| ssh\_port | SSH port | string | `"22"` | no |
| ssh\_private\_key\_file | SSH private key file, only specify in absence of SSH agent | string | `""` | no |
| ssh\_public\_key\_file | SSH public key file | string | `"~/.ssh/id_rsa.pub"` | no |
| ssh\_username | SSH user, used only in output | string | `"ubuntu"` | no |
| subnet\_cidr | OpenStack subnet cidr | string | `"192.168.1.0/24"` | no |
| subnet\_dns\_servers | | list | `<list>` | no |
| worker\_flavor | OpenStack instance flavor for the worker nodes | string | `"m1.small"` | no |

## Outputs

| Name | Description |
|------|-------------|
| kubeone\_api | |
| kubeone\_hosts | |
| kubeone\_workers | |

2 changes: 1 addition & 1 deletion examples/terraform/openstack/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ output "kubeone_hosts" {
ssh_agent_socket = "${var.ssh_agent_socket}"
ssh_port = "${var.ssh_port}"
ssh_private_key_file = "${var.ssh_private_key_file}"
ssh_user = "ubuntu"
ssh_user = "${var.ssh_username}"
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions examples/terraform/openstack/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ variable "ssh_port" {
default = 22
}

variable "ssh_username" {
default = "ubuntu"
description = "SSH user, used only in output"
}

variable "control_plane_count" {
default = 3
description = "Number of instances"
Expand Down

0 comments on commit 6222e1f

Please sign in to comment.