Skip to content

Commit

Permalink
Use persistent paths for disks (#187)
Browse files Browse the repository at this point in the history
* Use persistent paths for disks

Requires CoreOS 1995.0.0.

We can not use predictable disk names with ignition
as coreos/bugs#2481 was fixed.

TODO: Enable docker disk wipe

* Wipe docker disks for master VMs

* Use 1995.0.0 in CI
  • Loading branch information
Roma Sokolkov committed Dec 24, 2018
1 parent 5089508 commit a23956a
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 13 deletions.
3 changes: 3 additions & 0 deletions misc/e2e-aws.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ export TF_VAR_root_dns_zone_id=${E2E_AWS_ROUTE53_ZONE}
export TF_VAR_nodes_vault_token=
export TF_VAR_aws_customer_gateway_id=
export TF_VAR_worker_count=${WORKER_COUNT}
# TODO: Remove this as soon as 1995.0.0 available.
export TF_VAR_container_linux_version=1995.0.0
export TF_VAR_container_linux_channel=alpha
EOF
}

Expand Down
3 changes: 3 additions & 0 deletions misc/e2e-azure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ export TF_VAR_root_dns_zone_name="azure.gigantic.io"
export TF_VAR_nodes_vault_token=
export TF_VAR_worker_count=${WORKER_COUNT}
export TF_VAR_delete_data_disks_on_termination="true"
# TODO: Remove this as soon as 1995.0.0 available.
export TF_VAR_container_linux_version=1995.0.0
export TF_VAR_container_linux_channel=alpha
EOF
}

Expand Down
2 changes: 1 addition & 1 deletion modules/aws/master/master.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ resource "aws_ebs_volume" "master_docker" {
}

resource "aws_volume_attachment" "master_docker" {
device_name = "/dev/xvdc"
device_name = "${var.volume_docker}"
volume_id = "${aws_ebs_volume.master_docker.id}"
instance_id = "${aws_instance.master.id}"

Expand Down
4 changes: 4 additions & 0 deletions modules/aws/master/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ variable "volume_size_root" {
default = 8
}

variable "volume_docker" {
type = "string"
}

variable "volume_etcd" {
type = "string"
}
Expand Down
7 changes: 4 additions & 3 deletions platforms/aws/giantnetes/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ locals {
"K8SAPIIP" = "${var.k8s_api_ip}"
"K8SDNSIP" = "${var.k8s_dns_ip}"
"K8SServiceCIDR" = "${var.k8s_service_cidr}"
"MasterMountDocker" = "${var.master_instance["mount_docker"]}"
"MasterMountETCD" = "${var.master_instance["mount_etcd"]}"
"MasterMountDocker" = "${var.master_instance["volume_docker"]}"
"MasterMountETCD" = "${var.master_instance["volume_etcd"]}"
"PodInfraImage" = "${var.pod_infra_image}"
"Provider" = "aws"
"Users" = "${file("${path.module}/../../../ignition/users.yaml")}"
"VaultDomainName" = "${var.vault_dns}.${var.base_domain}"
"WorkerMountDocker" = "${var.worker_instance["mount_docker"]}"
"WorkerMountDocker" = "${var.worker_instance["volume_docker"]}"
}
}

Expand Down Expand Up @@ -230,6 +230,7 @@ module "master" {
route53_enabled = "${var.route53_enabled}"
user_data = "${data.ct_config.master.rendered}"
master_subnet_ids = "${module.vpc.worker_subnet_ids}"
volume_docker = "${var.master_instance["volume_docker"]}"
volume_etcd = "${var.master_instance["volume_etcd"]}"
vpc_cidr = "${var.vpc_cidr}"
vpc_id = "${module.vpc.vpc_id}"
Expand Down
8 changes: 3 additions & 5 deletions platforms/aws/giantnetes/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,9 @@ variable "master_instance" {
type = "map"

default = {
type = "m5.large"
mount_docker = "/dev/nvme1n1"
mount_etcd = "/dev/nvme2n1"
volume_etcd = "/dev/xvdh"
type = "m5.large"
volume_docker = "/dev/xvdc"
volume_etcd = "/dev/xvdh"
}
}

Expand All @@ -89,7 +88,6 @@ variable "worker_instance" {

default = {
type = "m5.xlarge"
mount_docker = "/dev/nvme1n1"
volume_docker = "/dev/xvdc"
}
}
Expand Down
6 changes: 3 additions & 3 deletions templates/master.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3130,13 +3130,13 @@ storage:
filesystems:
- name: docker
mount:
device: {{if eq .Provider "azure" }}/dev/sdc{{else}}{{ .MasterMountDocker }}{{end}}
device: {{if eq .Provider "azure" }}/dev/disk/azure/scsi1/lun0{{else}}{{ .MasterMountDocker }}{{end}}
format: xfs
wipe_filesystem: false
wipe_filesystem: true
label: docker
- name: etcd
mount:
device: {{if eq .Provider "azure" }}/dev/sdd{{else}}{{ .MasterMountETCD }}{{end}}
device: {{if eq .Provider "azure" }}/dev/disk/azure/scsi1/lun1{{else}}{{ .MasterMountETCD }}{{end}}
format: ext4
wipe_filesystem: false
label: var-lib-etcd
Expand Down
2 changes: 1 addition & 1 deletion templates/worker.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ storage:
filesystems:
- name: docker
mount:
device: {{if eq .Provider "azure" }}/dev/sdc{{else}}{{ .WorkerMountDocker }}{{end}}
device: {{if eq .Provider "azure" }}/dev/disk/azure/scsi1/lun0{{else}}{{ .WorkerMountDocker }}{{end}}
format: xfs
wipe_filesystem: true
label: docker
Expand Down

0 comments on commit a23956a

Please sign in to comment.