Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Google accelerators (i.e. GPUs) on workers #161

Merged
merged 1 commit into from
Mar 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Notable changes between versions.
* Add kubelet `--volume-plugin-dir` flag to allow flexvolume plugins ([#142](https://github.com/poseidon/typhoon/pull/142))
* Add `kubeconfig` variable to `controllers` and `workers` submodules ([#147](https://github.com/poseidon/typhoon/pull/147))
* Remove `kubeconfig_*` variables from `controllers` and `workers` submodules ([#147](https://github.com/poseidon/typhoon/pull/147))
* Allow initial experimentation with accelerators (i.e. GPUs) on workers ([#161](https://github.com/poseidon/typhoon/pull/161)) (unofficial)
* Require `terraform-provider-google` v1.6.0

#### Addons

Expand Down
2 changes: 1 addition & 1 deletion google-cloud/container-linux/kubernetes/require.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ terraform {
}

provider "google" {
version = "~> 1.2"
version = "~> 1.6"
}

provider "local" {
Expand Down
14 changes: 14 additions & 0 deletions google-cloud/container-linux/kubernetes/workers/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,17 @@ variable "cluster_domain_suffix" {
type = "string"
default = "cluster.local"
}

# unofficial, undocumented, unsupported, temporary

variable "accelerator_type" {
type = "string"
default = ""
description = "Google Compute Engine accelerator type (e.g. nvidia-tesla-k80, see gcloud compute accelerator-types list)"
}

variable "accelerator_count" {
type = "string"
default = "0"
description = "Number of compute engine accelerators"
}
6 changes: 5 additions & 1 deletion google-cloud/container-linux/kubernetes/workers/workers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@ resource "google_compute_instance_template" "worker" {
}

can_ip_forward = true

tags = ["worker", "${var.cluster_name}-worker", "${var.name}-worker"]

guest_accelerator {
count = "${var.accelerator_count}"
type = "${var.accelerator_type}"
}

lifecycle {
# To update an Instance Template, Terraform should replace the existing resource
create_before_destroy = true
Expand Down