gcp

package
v0.9.0-master.0...-3485fdd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package gcp contains GCP-specific structures for installer configuration and management.

Index

Constants

View Source
const (
	// ServiceComputeEngineAPI is the GCE service URL
	ServiceComputeEngineAPI = "compute.googleapis.com"
	// ServiceIAMAPI is the IAM service URL
	ServiceIAMAPI = "iam.googleapis.com"
)
View Source
const Name string = "gcp"

Name is name for the gcp platform.

Variables

This section is empty.

Functions

func CloudControllerUID

func CloudControllerUID(infraID string) string

CloudControllerUID generates a UID used by the GCP cloud controller provider to generate certain load balancing resources

Types

type EncryptionKeyReference

type EncryptionKeyReference struct {
	// KMSKey is a reference to a KMS Key to use for the encryption.
	//
	// +optional
	KMSKey *KMSKeyReference `json:"kmsKey,omitempty"`

	// KMSKeyServiceAccount is the service account being used for the
	// encryption request for the given KMS key. If absent, the Compute
	// Engine default service account is used.
	// See https://cloud.google.com/compute/docs/access/service-accounts#compute_engine_service_account
	// for details on the default service account.
	//
	// +optional
	KMSKeyServiceAccount string `json:"kmsKeyServiceAccount,omitempty"`
}

EncryptionKeyReference describes the encryptionKey to use for a disk's encryption.

func (*EncryptionKeyReference) Set

Set sets the values from `required` to `e`.

type KMSKeyReference

type KMSKeyReference struct {
	// Name is the name of the customer managed encryption key to be used for the disk encryption.
	Name string `json:"name"`

	// KeyRing is the name of the KMS Key Ring which the KMS Key belongs to.
	KeyRing string `json:"keyRing"`

	// ProjectID is the ID of the Project in which the KMS Key Ring exists.
	// Defaults to the VM ProjectID if not set.
	//
	// +optional
	ProjectID string `json:"projectID,omitempty"`

	// Location is the GCP location in which the Key Ring exists.
	Location string `json:"location"`
}

KMSKeyReference gathers required fields for looking up a GCP KMS Key

func (*KMSKeyReference) Set

func (k *KMSKeyReference) Set(required *KMSKeyReference)

Set sets the values from `required` to `k`.

type MachinePool

type MachinePool struct {
	// Zones is list of availability zones that can be used.
	//
	// +optional
	Zones []string `json:"zones,omitempty"`

	// InstanceType defines the GCP instance type.
	// eg. n1-standard-4
	//
	// +optional
	InstanceType string `json:"type"`

	// OSDisk defines the storage for instance.
	//
	// +optional
	OSDisk `json:"osDisk"`

	// Tags defines a set of network tags which will be added to instances in the machineset
	//
	// +optional
	Tags []string `json:"tags,omitempty"`

	// SecureBoot Defines whether the instance should have secure boot enabled.
	// secure boot Verify the digital signature of all boot components, and halt the boot process if signature verification fails.
	// If omitted, the platform chooses a default, which is subject to change over time, currently that default is false.
	// +kubebuilder:validation:Enum=Enabled;Disabled
	// +optional
	SecureBoot string `json:"secureBoot,omitempty"`

	// OnHostMaintenance determines the behavior when a maintenance event occurs that might cause the instance to reboot.
	// Allowed values are "Migrate" and "Terminate".
	// If omitted, the platform chooses a default, which is subject to change over time, currently that default is "Migrate".
	// +kubebuilder:validation:Enum=Migrate;Terminate;
	// +optional
	OnHostMaintenance string `json:"onHostMaintenance,omitempty"`

	// ConfidentialCompute Defines whether the instance should have confidential compute enabled.
	// If enabled OnHostMaintenance is required to be set to "Terminate".
	// If omitted, the platform chooses a default, which is subject to change over time, currently that default is false.
	// +kubebuilder:validation:Enum=Enabled;Disabled
	// +optional
	ConfidentialCompute string `json:"confidentialCompute,omitempty"`
}

MachinePool stores the configuration for a machine pool installed on GCP.

func (*MachinePool) Set

func (a *MachinePool) Set(required *MachinePool)

Set sets the values from `required` to `a`.

type Metadata

type Metadata struct {
	Region           string `json:"region"`
	ProjectID        string `json:"projectID"`
	NetworkProjectID string `json:"networkProjectID,omitempty"`
}

Metadata contains GCP metadata (e.g. for uninstalling the cluster).

type Metric

type Metric struct {
	// Service is the Google Cloud Service to which this quota belongs (e.g. compute.googleapis.com)
	Service string `json:"service,omitempty"`
	// Limit is the name of the item that's limited (e.g. cpus)
	Limit string `json:"limit,omitempty"`
	// Dimensions are unique axes on which this Limit is applied (e.g. region: us-central-1)
	Dimensions map[string]string `json:"dimensions,omitempty"`
}

Metric identify a quota. Service/Label matches the Google Quota API names for quota metrics

func (*Metric) Matches

func (m *Metric) Matches(other *Metric) bool

Matches determines if this metric matches the other

func (*Metric) String

func (m *Metric) String() string

String formats the metric

type OSDisk

type OSDisk struct {
	// DiskType defines the type of disk.
	// For control plane nodes, the valid value is pd-ssd.
	// +optional
	// +kubebuilder:validation:Enum=pd-ssd;pd-standard
	DiskType string `json:"diskType"`

	// DiskSizeGB defines the size of disk in GB.
	//
	// +kubebuilder:validation:Minimum=16
	// +kubebuilder:validation:Maximum=65536
	DiskSizeGB int64 `json:"DiskSizeGB"`

	// EncryptionKey defines the KMS key to be used to encrypt the disk.
	//
	// +optional
	EncryptionKey *EncryptionKeyReference `json:"encryptionKey,omitempty"`
}

OSDisk defines the disk for machines on GCP.

type Platform

type Platform struct {
	// ProjectID is the the project that will be used for the cluster.
	ProjectID string `json:"projectID"`

	// Region specifies the GCP region where the cluster will be created.
	Region string `json:"region"`

	// DefaultMachinePlatform is the default configuration used when
	// installing on GCP for machine pools which do not define their own
	// platform configuration.
	// +optional
	DefaultMachinePlatform *MachinePool `json:"defaultMachinePlatform,omitempty"`

	// Network specifies an existing VPC where the cluster should be created
	// rather than provisioning a new one.
	// +optional
	Network string `json:"network,omitempty"`

	// NetworkProjectID specifies which project the network and subnets exist in when
	// they are not in the main ProjectID.
	// +optional
	NetworkProjectID string `json:"networkProjectID,omitempty"`

	// ControlPlaneSubnet is an existing subnet where the control plane will be deployed.
	// The value should be the name of the subnet.
	// +optional
	ControlPlaneSubnet string `json:"controlPlaneSubnet,omitempty"`

	// ComputeSubnet is an existing subnet where the compute nodes will be deployed.
	// The value should be the name of the subnet.
	// +optional
	ComputeSubnet string `json:"computeSubnet,omitempty"`

	// Licenses is a list of licenses to apply to the compute images
	// The value should a list of strings (https URLs only) representing the license keys.
	// When set, this will cause the installer to copy the image into user's project.
	// This option is incompatible with any mechanism that makes use of pre-built images
	// such as the current env OPENSHIFT_INSTALL_OS_IMAGE_OVERRIDE
	// +optional
	Licenses []string `json:"licenses,omitempty"`
}

Platform stores all the global configuration that all machinesets use.

type Quota

type Quota []QuotaUsage

Quota is a record of the quota in GCP consumed by a cluster

type QuotaUsage

type QuotaUsage struct {
	*Metric `json:",inline"`
	// Amount is the amount of the quota being used
	Amount int64 `json:"amount,omitempty"`
}

QuotaUsage identifies a quota metric and records the usage

func (*QuotaUsage) String

func (q *QuotaUsage) String() string

String formats the quota usage

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL