Merge pull request #3019 from holmsten/terraform-ops-worker-groups

[contrib/terraform/openstack] Add supplementary node groups
pull/3118/merge
Antoine Legrand 2018-08-16 16:06:53 +02:00 committed by GitHub
commit a642931422
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 2 deletions

View File

@ -223,6 +223,7 @@ For your cluster, edit `inventory/$CLUSTER/cluster.tf`.
|`number_of_gfs_nodes_no_floating_ip` | Number of gluster servers to provision. | |`number_of_gfs_nodes_no_floating_ip` | Number of gluster servers to provision. |
| `gfs_volume_size_in_gb` | Size of the non-ephemeral volumes to be attached to store the GlusterFS bricks | | `gfs_volume_size_in_gb` | Size of the non-ephemeral volumes to be attached to store the GlusterFS bricks |
|`supplementary_master_groups` | To add ansible groups to the masters, such as `kube-node` for tainting them as nodes, empty by default. | |`supplementary_master_groups` | To add ansible groups to the masters, such as `kube-node` for tainting them as nodes, empty by default. |
|`supplementary_node_groups` | To add ansible groups to the nodes, such as `kube-ingress` for running ingress controller pods, empty by default. |
#### Terraform state files #### Terraform state files

View File

@ -51,6 +51,7 @@ module "compute" {
k8s_node_fips = "${module.ips.k8s_node_fips}" k8s_node_fips = "${module.ips.k8s_node_fips}"
bastion_fips = "${module.ips.bastion_fips}" bastion_fips = "${module.ips.bastion_fips}"
supplementary_master_groups = "${var.supplementary_master_groups}" supplementary_master_groups = "${var.supplementary_master_groups}"
supplementary_node_groups = "${var.supplementary_node_groups}"
network_id = "${module.network.router_id}" network_id = "${module.network.router_id}"
} }

View File

@ -249,7 +249,7 @@ resource "openstack_compute_instance_v2" "k8s_node" {
metadata = { metadata = {
ssh_user = "${var.ssh_user}" ssh_user = "${var.ssh_user}"
kubespray_groups = "kube-node,k8s-cluster" kubespray_groups = "kube-node,k8s-cluster,${var.supplementary_node_groups}"
depends_on = "${var.network_id}" depends_on = "${var.network_id}"
} }
@ -278,7 +278,7 @@ resource "openstack_compute_instance_v2" "k8s_node_no_floating_ip" {
metadata = { metadata = {
ssh_user = "${var.ssh_user}" ssh_user = "${var.ssh_user}"
kubespray_groups = "kube-node,k8s-cluster,no-floating" kubespray_groups = "kube-node,k8s-cluster,no-floating,${var.supplementary_node_groups}"
depends_on = "${var.network_id}" depends_on = "${var.network_id}"
} }

View File

@ -63,3 +63,7 @@ variable "bastion_fips" {
variable "supplementary_master_groups" { variable "supplementary_master_groups" {
default = "" default = ""
} }
variable "supplementary_node_groups" {
default = ""
}

View File

@ -128,3 +128,8 @@ variable "supplementary_master_groups" {
description = "supplementary kubespray ansible groups for masters, such kube-node" description = "supplementary kubespray ansible groups for masters, such kube-node"
default = "" default = ""
} }
variable "supplementary_node_groups" {
description = "supplementary kubespray ansible groups for worker nodes, such as kube-ingress"
default = ""
}