Skip to content

Commit

Permalink
update types_gcprovider.go
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelStuchly committed Oct 28, 2021
1 parent c497013 commit d9eb7d1
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
20 changes: 20 additions & 0 deletions machine/v1beta1/types_gcpprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,20 @@ type GCPMachineProviderSpec struct {
// ProjectID is the project in which the GCP machine provider will create the VM.
// +optional
ProjectID string `json:"projectID,omitempty"`
// GuestAccelerators is a list of GPUs to be attached to the VM.
// +optional
GuestAccelerators []*GCPAcceleratorConfig `json:"guestAccelerators,omitempty"`
// Preemptible indicates if created instance is preemptible
// +optional
Preemptible bool `json:"preemptible,omitempty"`
// OnHostMaintenance Determines the behavior when a maintenance event occurs that might cause the instance to reboot (default MIGRATE).
// This is required to be set to TERMINATE if you want to provision machine with attached GPUs.
// +optional
OnHostMaintenance string `json:"onHostMaintenance,omitempty"`
// AutomaticRestart Determines the behavior when an instance crashes or is stopped by the system (default true).
// Can not be true with preepmtible instances.
// +optional
AutomaticRestart *bool `json:"automaticRestart,omitempty"`
}

// GCPDisk describes disks for GCP.
Expand Down Expand Up @@ -134,6 +145,15 @@ type GCPKMSKeyReference struct {
Location string `json:"location"`
}

// GCPAcceleratorConfig describes type and count of accelerator cards attached to the instance on GCP.
type GCPAcceleratorConfig struct {
// AcceleratorCount is number of AcceleratorType accelerators (GPUs) to be attached to an instance
AcceleratorCount int64 `json:"acceleratorCount,omitempty"`
// AcceleratorType is the type of accelerator (GPU) to be attached to an instance.
// Supported accelerator types are: nvidia-tesla-k80, nvidia-tesla-p100, nvidia-tesla-v100, nvidia-tesla-a100, nvidia-tesla-p4, nvidia-tesla-t4
AcceleratorType string `json:"acceleratorType,omitempty"`
}

// GCPMachineProviderStatus is the type that will be embedded in a Machine.Status.ProviderStatus field.
// It contains GCP-specific status information.
// Compatibility level 2: Stable within a major release for a minimum of 9 months or 3 minor releases (whichever is longer).
Expand Down
32 changes: 32 additions & 0 deletions machine/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions machine/v1beta1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d9eb7d1

Please sign in to comment.