Skip to content

Commit

Permalink
Fix openstack external API
Browse files Browse the repository at this point in the history
  • Loading branch information
kron4eg committed Mar 12, 2019
1 parent 6216f42 commit 6536c4b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 19 deletions.
23 changes: 9 additions & 14 deletions examples/terraform/openstack/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@ resource "openstack_networking_secgroup_rule_v2" "secgroup_allow_internal_ipv4"
security_group_id = "${openstack_networking_secgroup_v2.securitygroup.id}"
}

resource "openstack_networking_secgroup_rule_v2" "secgroup_allow_internal_ipv6" {
description = "Allow security group internal IPv6 traffic"
direction = "ingress"
ethertype = "IPv6"
remote_group_id = "${openstack_networking_secgroup_v2.securitygroup.id}"
security_group_id = "${openstack_networking_secgroup_v2.securitygroup.id}"
}

resource "openstack_networking_secgroup_rule_v2" "secgroup_ssh" {
description = "Allow SSH"
direction = "ingress"
Expand Down Expand Up @@ -139,12 +131,15 @@ resource "openstack_lb_pool_v2" "pool" {
}

resource "openstack_lb_monitor_v2" "monitor" {
name = "${var.cluster_name}-cluster"
pool_id = "${openstack_lb_pool_v2.pool.id}"
type = "TCP"
delay = "60"
timeout = "10"
max_retries = "3"
name = "${var.cluster_name}-cluster"
pool_id = "${openstack_lb_pool_v2.pool.id}"
type = "HTTPS"
url_path = "/healthz"
http_method = "GET"
expected_codes = "200"
delay = 5
timeout = 2
max_retries = 2
}

resource "openstack_networking_floatingip_v2" "lb" {
Expand Down
7 changes: 3 additions & 4 deletions examples/terraform/openstack/output.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
output "kubeone_api" {
value = {
endpoint = "${openstack_networking_floatingip_v2.lb.fixed_ip}"
endpoint = "${openstack_networking_floatingip_v2.lb.address}"
}
}

Expand Down Expand Up @@ -28,9 +28,8 @@ output "kubeone_workers" {
floatingIPPool = "${var.external_network_name}"
network = "${openstack_networking_network_v2.network.name}"
subnet = "${openstack_networking_subnet_v2.subnet.name}"

operatingSystem = "ubuntu"
replicas = 1
operatingSystem = "ubuntu"
replicas = 1
}
}
}
1 change: 1 addition & 0 deletions examples/terraform/openstack/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ variable "cluster_name" {

variable "ssh_public_key_file" {
description = "SSH public key file"
default = "~/.ssh/id_rsa.pub"
}

variable "ssh_private_key_file" {
Expand Down
10 changes: 9 additions & 1 deletion pkg/config/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,15 @@ type ProviderConfig struct {
// Validate checks the ProviderConfig for errors
func (p *ProviderConfig) Validate() error {
switch p.Name {
case ProviderNameAWS, ProviderNameOpenStack, ProviderNameHetzner, ProviderNameDigitalOcean, ProviderNameVSphere, ProviderNameNone:
case ProviderNameAWS:
case ProviderNameOpenStack:
if p.CloudConfig == "" {
return errors.New("`provider.cloud_config` is required for openstack provider")
}
case ProviderNameHetzner:
case ProviderNameDigitalOcean:
case ProviderNameVSphere:
case ProviderNameNone:
default:
return errors.Errorf("unknown provider name %q", p.Name)
}
Expand Down
1 change: 1 addition & 0 deletions pkg/installer/installation/reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@ fi

const resetScript = `
sudo kubeadm reset --force
sudo rm /etc/kubernetes/cloud-config
rm -rf "{{ .WORK_DIR }}"
`

0 comments on commit 6536c4b

Please sign in to comment.