gcp

package
v1.4.12 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 3 Imported by: 29

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 CreateFirewallRules added in v1.4.12

type CreateFirewallRules string

CreateFirewallRules specifies if the installer should create firewall rules. +kubebuilder:validation:Enum="Enabled";"Disabled"

const (
	// CreateFirewallRulesEnabled is Enabled
	CreateFirewallRulesEnabled CreateFirewallRules = "Enabled"
	// CreateFirewallRulesDisabled is Disabled
	CreateFirewallRulesDisabled CreateFirewallRules = "Disabled"
)

type DNSZone added in v1.4.12

type DNSZone struct {
	// ID Technology Preview.
	// ID or name of the zone.
	// +optional
	ID string `json:"id,omitempty"`

	// ProjectID Technology Preview.
	// When the ProjectID is provided, the zone will exist in this project. When the ProjectID is
	// empty, the ProjectID defaults to the Service Project (GCP.ProjectID).
	// +optional
	ProjectID string `json:"project,omitempty"`
}

DNSZone stores the information common and required to create DNS zones including the project and id/name of the zone.

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"`
}

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"`

	// CreateFirewallRules specifies if the installer should create the
	// cluster firewall rules in the gcp cloud network.
	// +optional
	CreateFirewallRules CreateFirewallRules `json:"createFirewallRules,omitempty"`

	// 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 is currently TechPreview.
	// 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"`

	// PrivateDNSZone Technology Preview.
	// PrivateDNSZone contains the zone ID and project where the Private DNS zone records will be created.
	// +optional
	PrivateDNSZone *DNSZone `json:"privateDNSZone,omitempty"`

	// PublicDNSZone Technology Preview.
	// PublicDNSZone contains the zone ID and project where the Public DNS zone records will be created.
	// +optional
	PublicDNSZone *DNSZone `json:"publicDNSZone,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