Run 'terraform fmt' in contrib/terraform/openstack (#4242)

This commit is contained in:
Ted Wexler 2019-02-18 00:04:41 -05:00 committed by Kubernetes Prow Robot
parent 23685b4537
commit b5a895d1ec
4 changed files with 88 additions and 85 deletions

View file

@ -87,7 +87,6 @@ resource "openstack_compute_instance_v2" "bastion" {
provisioner "local-exec" { provisioner "local-exec" {
command = "sed s/USER/${var.ssh_user}/ contrib/terraform/openstack/ansible_bastion_template.txt | sed s/BASTION_ADDRESS/${var.bastion_fips[0]}/ > contrib/terraform/group_vars/no-floating.yml" command = "sed s/USER/${var.ssh_user}/ contrib/terraform/openstack/ansible_bastion_template.txt | sed s/BASTION_ADDRESS/${var.bastion_fips[0]}/ > contrib/terraform/group_vars/no-floating.yml"
} }
} }
resource "openstack_compute_instance_v2" "k8s_master" { resource "openstack_compute_instance_v2" "k8s_master" {
@ -117,7 +116,6 @@ resource "openstack_compute_instance_v2" "k8s_master" {
provisioner "local-exec" { provisioner "local-exec" {
command = "sed s/USER/${var.ssh_user}/ contrib/terraform/openstack/ansible_bastion_template.txt | sed s/BASTION_ADDRESS/${element( concat(var.bastion_fips, var.k8s_master_fips), 0)}/ > contrib/terraform/group_vars/no-floating.yml" command = "sed s/USER/${var.ssh_user}/ contrib/terraform/openstack/ansible_bastion_template.txt | sed s/BASTION_ADDRESS/${element( concat(var.bastion_fips, var.k8s_master_fips), 0)}/ > contrib/terraform/group_vars/no-floating.yml"
} }
} }
resource "openstack_compute_instance_v2" "k8s_master_no_etcd" { resource "openstack_compute_instance_v2" "k8s_master_no_etcd" {
@ -146,7 +144,6 @@ resource "openstack_compute_instance_v2" "k8s_master_no_etcd" {
provisioner "local-exec" { provisioner "local-exec" {
command = "sed s/USER/${var.ssh_user}/ contrib/terraform/openstack/ansible_bastion_template.txt | sed s/BASTION_ADDRESS/${element( concat(var.bastion_fips, var.k8s_master_fips), 0)}/ > contrib/terraform/group_vars/no-floating.yml" command = "sed s/USER/${var.ssh_user}/ contrib/terraform/openstack/ansible_bastion_template.txt | sed s/BASTION_ADDRESS/${element( concat(var.bastion_fips, var.k8s_master_fips), 0)}/ > contrib/terraform/group_vars/no-floating.yml"
} }
} }
resource "openstack_compute_instance_v2" "etcd" { resource "openstack_compute_instance_v2" "etcd" {
@ -168,7 +165,6 @@ resource "openstack_compute_instance_v2" "etcd" {
kubespray_groups = "etcd,vault,no-floating" kubespray_groups = "etcd,vault,no-floating"
depends_on = "${var.network_id}" depends_on = "${var.network_id}"
} }
} }
resource "openstack_compute_instance_v2" "k8s_master_no_floating_ip" { resource "openstack_compute_instance_v2" "k8s_master_no_floating_ip" {
@ -193,7 +189,6 @@ resource "openstack_compute_instance_v2" "k8s_master_no_floating_ip" {
kubespray_groups = "etcd,kube-master,${var.supplementary_master_groups},k8s-cluster,vault,no-floating" kubespray_groups = "etcd,kube-master,${var.supplementary_master_groups},k8s-cluster,vault,no-floating"
depends_on = "${var.network_id}" depends_on = "${var.network_id}"
} }
} }
resource "openstack_compute_instance_v2" "k8s_master_no_floating_ip_no_etcd" { resource "openstack_compute_instance_v2" "k8s_master_no_floating_ip_no_etcd" {
@ -217,7 +212,6 @@ resource "openstack_compute_instance_v2" "k8s_master_no_floating_ip_no_etcd" {
kubespray_groups = "kube-master,${var.supplementary_master_groups},k8s-cluster,vault,no-floating" kubespray_groups = "kube-master,${var.supplementary_master_groups},k8s-cluster,vault,no-floating"
depends_on = "${var.network_id}" depends_on = "${var.network_id}"
} }
} }
resource "openstack_compute_instance_v2" "k8s_node" { resource "openstack_compute_instance_v2" "k8s_node" {
@ -247,7 +241,6 @@ resource "openstack_compute_instance_v2" "k8s_node" {
provisioner "local-exec" { provisioner "local-exec" {
command = "sed s/USER/${var.ssh_user}/ contrib/terraform/openstack/ansible_bastion_template.txt | sed s/BASTION_ADDRESS/${element( concat(var.bastion_fips, var.k8s_node_fips), 0)}/ > contrib/terraform/group_vars/no-floating.yml" command = "sed s/USER/${var.ssh_user}/ contrib/terraform/openstack/ansible_bastion_template.txt | sed s/BASTION_ADDRESS/${element( concat(var.bastion_fips, var.k8s_node_fips), 0)}/ > contrib/terraform/group_vars/no-floating.yml"
} }
} }
resource "openstack_compute_instance_v2" "k8s_node_no_floating_ip" { resource "openstack_compute_instance_v2" "k8s_node_no_floating_ip" {
@ -272,7 +265,6 @@ resource "openstack_compute_instance_v2" "k8s_node_no_floating_ip" {
kubespray_groups = "kube-node,k8s-cluster,no-floating,${var.supplementary_node_groups}" kubespray_groups = "kube-node,k8s-cluster,no-floating,${var.supplementary_node_groups}"
depends_on = "${var.network_id}" depends_on = "${var.network_id}"
} }
} }
resource "openstack_compute_floatingip_associate_v2" "bastion" { resource "openstack_compute_floatingip_associate_v2" "bastion" {
@ -321,7 +313,6 @@ resource "openstack_compute_instance_v2" "glusterfs_node_no_floating_ip" {
kubespray_groups = "gfs-cluster,network-storage,no-floating" kubespray_groups = "gfs-cluster,network-storage,no-floating"
depends_on = "${var.network_id}" depends_on = "${var.network_id}"
} }
} }
resource "openstack_compute_volume_attach_v2" "glusterfs_volume" { resource "openstack_compute_volume_attach_v2" "glusterfs_volume" {

View file

@ -4,7 +4,6 @@ output "router_id" {
output "router_internal_port_id" { output "router_internal_port_id" {
value = "${element(concat(openstack_networking_router_interface_v2.k8s.*.id, list("")), 0)}" value = "${element(concat(openstack_networking_router_interface_v2.k8s.*.id, list("")), 0)}"
} }
output "subnet_id" { output "subnet_id" {

View file

@ -6,11 +6,13 @@ public_key_path = "~/.ssh/id_rsa.pub"
# image to use for bastion, masters, standalone etcd instances, and nodes # image to use for bastion, masters, standalone etcd instances, and nodes
image = "<image name>" image = "<image name>"
# user on the node (ex. core on Container Linux, ubuntu on Ubuntu, etc.) # user on the node (ex. core on Container Linux, ubuntu on Ubuntu, etc.)
ssh_user = "<cloud-provisioned user>" ssh_user = "<cloud-provisioned user>"
# 0|1 bastion nodes # 0|1 bastion nodes
number_of_bastions = 0 number_of_bastions = 0
#flavor_bastion = "<UUID>" #flavor_bastion = "<UUID>"
# standalone etcds # standalone etcds
@ -18,14 +20,20 @@ number_of_etcd = 0
# masters # masters
number_of_k8s_masters = 1 number_of_k8s_masters = 1
number_of_k8s_masters_no_etcd = 0 number_of_k8s_masters_no_etcd = 0
number_of_k8s_masters_no_floating_ip = 0 number_of_k8s_masters_no_floating_ip = 0
number_of_k8s_masters_no_floating_ip_no_etcd = 0 number_of_k8s_masters_no_floating_ip_no_etcd = 0
flavor_k8s_master = "<UUID>" flavor_k8s_master = "<UUID>"
# nodes # nodes
number_of_k8s_nodes = 2 number_of_k8s_nodes = 2
number_of_k8s_nodes_no_floating_ip = 4 number_of_k8s_nodes_no_floating_ip = 4
#flavor_k8s_node = "<UUID>" #flavor_k8s_node = "<UUID>"
# GlusterFS # GlusterFS
@ -40,7 +48,11 @@ number_of_k8s_nodes_no_floating_ip = 4
# networking # networking
network_name = "<network>" network_name = "<network>"
external_net = "<UUID>" external_net = "<UUID>"
subnet_cidr = "<cidr>" subnet_cidr = "<cidr>"
floatingip_pool = "<pool>" floatingip_pool = "<pool>"
bastion_allowed_remote_ips = ["0.0.0.0/0"] bastion_allowed_remote_ips = ["0.0.0.0/0"]

View file

@ -147,12 +147,13 @@ variable "bastion_allowed_remote_ips" {
variable "worker_allowed_ports" { variable "worker_allowed_ports" {
type = "list" type = "list"
default = [ default = [
{ {
"protocol" = "tcp" "protocol" = "tcp"
"port_range_min" = 30000 "port_range_min" = 30000
"port_range_max" = 32767 "port_range_max" = 32767
"remote_ip_prefix" = "0.0.0.0/0" "remote_ip_prefix" = "0.0.0.0/0"
} },
] ]
} }