cloudprovider

package
v0.5.2-beta.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package cloudprovider contains API types for the vSphere cloud provider.

The configuration may be unmarshalled from an INI-style configuration using the "gopkg.in/gcfg.v1" package.

The configuration may be marshalled to an INI-style configuration using a Go template.

The "gopkg.in/go-ini/ini.v1" package was investigated, but it does not support reflecting a struct with a field of type "map[string]TYPE" to INI.

+kubebuilder:object:generate=true

Package cloudprovider contains API types for the vSphere cloud provider.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEmpty

func IsEmpty(obj interface{}) bool

IsEmpty returns true if an object is its empty value or if a struct, all of its fields are their empty values.

func IsNotEmpty

func IsNotEmpty(obj interface{}) bool

IsNotEmpty returns true when IsEmpty returns false.

func WarnAsFatal

func WarnAsFatal(opts *UnmarshalINIOptions)

WarnAsFatal sets the option to treat warnings as fatal errors when unmarshalling INI data.

Types

type CloudConfig

type CloudConfig struct {
	ControllerImage string `json:"controllerImage,omitempty"`
}

func (*CloudConfig) DeepCopy

func (in *CloudConfig) DeepCopy() *CloudConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudConfig.

func (*CloudConfig) DeepCopyInto

func (in *CloudConfig) DeepCopyInto(out *CloudConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Config

type Config struct {
	// Global is the vSphere cloud provider's global configuration.
	// +optional
	Global GlobalConfig `gcfg:"Global,omitempty" json:"global,omitempty"`

	// VCenter is a list of vCenter configurations.
	// +optional
	VCenter map[string]VCenterConfig `gcfg:"VirtualCenter,omitempty" json:"virtualCenter,omitempty"`

	// Network is the vSphere cloud provider's network configuration.
	// +optional
	Network NetworkConfig `gcfg:"Network,omitempty" json:"network,omitempty"`

	// Disk is the vSphere cloud provider's disk configuration.
	// +optional
	Disk DiskConfig `gcfg:"Disk,omitempty" json:"disk,omitempty"`

	// Workspace is the vSphere cloud provider's workspace configuration.
	// +optional
	Workspace WorkspaceConfig `gcfg:"Workspace,omitempty" json:"workspace,omitempty"`

	// Labels is the vSphere cloud provider's zone and region configuration.
	// +optional
	Labels LabelConfig `gcfg:"Labels,omitempty" json:"labels,omitempty"`

	// ProviderConfig contains extra information used to configure the
	// vSphere cloud provider.
	ProviderConfig ProviderConfig `json:"providerConfig,omitempty"`
}

Config is the vSphere cloud provider's configuration.

func (*Config) DeepCopy

func (in *Config) DeepCopy() *Config

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Config.

func (*Config) DeepCopyInto

func (in *Config) DeepCopyInto(out *Config)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Config) MarshalINI

func (c *Config) MarshalINI() ([]byte, error)

MarshalINI marshals the cloud provider configuration to INI-style configuration data.

func (*Config) UnmarshalINI

func (c *Config) UnmarshalINI(data []byte, optFuncs ...UnmarshalINIOptionFunc) error

UnmarshalINI unmarshals the cloud provider configuration from INI-style configuration data.

type DiskConfig

type DiskConfig struct {
	// SCSIControllerType defines SCSI controller to be used.
	// +optional
	SCSIControllerType string `gcfg:"scsicontrollertype,omitempty" json:"scsiControllerType,omitempty"`
}

DiskConfig defines the disk configuration for the vSphere cloud provider.

func (*DiskConfig) DeepCopy

func (in *DiskConfig) DeepCopy() *DiskConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiskConfig.

func (*DiskConfig) DeepCopyInto

func (in *DiskConfig) DeepCopyInto(out *DiskConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GlobalConfig

type GlobalConfig struct {
	// Insecure is a flag that disables TLS peer verification.
	// +optional
	Insecure bool `gcfg:"insecure-flag,omitempty" json:"insecure,omitempty"`

	// RoundTripperCount specifies the SOAP round tripper count
	// (retries = RoundTripper - 1)
	// +optional
	RoundTripperCount int32 `gcfg:"soap-roundtrip-count,omitempty" json:"roundTripperCount,omitempty"`

	// Username is the username used to access a vSphere endpoint.
	// +optional
	Username string `gcfg:"user,omitempty" json:"username,omitempty"`

	// Password is the password used to access a vSphere endpoint.
	// +optional
	Password string `gcfg:"password,omitempty" json:"password,omitempty"`

	// SecretName is the name of the Kubernetes secret in which the vSphere
	// credentials are located.
	// +optional
	SecretName string `gcfg:"secret-name,omitempty" json:"secretName,omitempty"`

	// SecretNamespace is the namespace for SecretName.
	// +optional
	SecretNamespace string `gcfg:"secret-namespace,omitempty" json:"secretNamespace,omitempty"`

	// Port is the port on which the vSphere endpoint is listening.
	// Defaults to 443.
	// +optional
	Port string `gcfg:"port,omitempty" json:"port,omitempty"`

	// CAFile Specifies the path to a CA certificate in PEM format.
	// If not configured, the system's CA certificates will be used.
	// +optional
	CAFile string `gcfg:"ca-file,omitempty" json:"caFile,omitempty"`

	// Thumbprint is the cryptographic thumbprint of the vSphere endpoint's
	// certificate.
	// +optional
	Thumbprint string `gcfg:"thumbprint,omitempty" json:"thumbprint,omitempty"`

	// Datacenters is a CSV string of the datacenters in which VMs are located.
	// +optional
	Datacenters string `gcfg:"datacenters,omitempty" json:"datacenters,omitempty"`

	// ServiceAccount is the Kubernetes service account used to launch the cloud
	// controller manager.
	// Defaults to cloud-controller-manager.
	// +optional
	ServiceAccount string `gcfg:"service-account,omitempty" json:"serviceAccount,omitempty"`

	// SecretsDirectory is a directory in which secrets may be found. This
	// may used in the event that:
	// 1. It is not desirable to use the K8s API to watch changes to secrets
	// 2. The cloud controller manager is not running in a K8s environment,
	//    such as DC/OS. For example, the container storage interface (CSI) is
	//    container orcehstrator (CO) agnostic, and should support non-K8s COs.
	// Defaults to /etc/cloud/credentials.
	// +optional
	SecretsDirectory string `gcfg:"secrets-directory,omitempty" json:"secretsDirectory,omitempty"`

	// APIDisable disables the vSphere cloud controller manager API.
	// Defaults to true.
	// +optional
	APIDisable *bool `gcfg:"api-disable,omitempty" json:"apiDisable,omitempty"`

	// APIBindPort configures the vSphere cloud controller manager API port.
	// Defaults to 43001.
	// +optional
	APIBindPort string `gcfg:"api-binding,omitempty" json:"apiBindPort,omitempty"`

	// ClusterID is a unique identifier for a cluster used by the vSphere CSI driver (CNS)
	// NOTE: This field is set internally by CAPV and should not be set by any other consumer of this API
	ClusterID string `gcfg:"cluster-id,omitempty" json:"-"`
}

GlobalConfig is the vSphere cloud provider's global configuration.

func (*GlobalConfig) DeepCopy

func (in *GlobalConfig) DeepCopy() *GlobalConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalConfig.

func (*GlobalConfig) DeepCopyInto

func (in *GlobalConfig) DeepCopyInto(out *GlobalConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LabelConfig

type LabelConfig struct {
	// Zone is the zone in which VMs are created/located.
	// +optional
	Zone string `gcfg:"zone,omitempty" json:"zone,omitempty"`

	// Region is the region in which VMs are created/located.
	// +optional
	Region string `gcfg:"region,omitempty" json:"region,omitempty"`
}

LabelConfig defines the categories and tags which correspond to built-in node labels, zone and region.

func (*LabelConfig) DeepCopy

func (in *LabelConfig) DeepCopy() *LabelConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LabelConfig.

func (*LabelConfig) DeepCopyInto

func (in *LabelConfig) DeepCopyInto(out *LabelConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NetworkConfig

type NetworkConfig struct {
	// Name is the name of the network to which VMs are connected.
	// +optional
	Name string `gcfg:"public-network,omitempty" json:"name,omitempty"`
}

NetworkConfig is the network configuration for the vSphere cloud provider.

func (*NetworkConfig) DeepCopy

func (in *NetworkConfig) DeepCopy() *NetworkConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkConfig.

func (*NetworkConfig) DeepCopyInto

func (in *NetworkConfig) DeepCopyInto(out *NetworkConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ProviderConfig

type ProviderConfig struct {
	Cloud   CloudConfig   `json:"cloud,omitempty"`
	Storage StorageConfig `json:"storage,omitempty"`
}

ProviderConfig defines any extra information used to configure the vSphere external cloud provider

func (*ProviderConfig) DeepCopy

func (in *ProviderConfig) DeepCopy() *ProviderConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderConfig.

func (*ProviderConfig) DeepCopyInto

func (in *ProviderConfig) DeepCopyInto(out *ProviderConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StorageConfig

type StorageConfig struct {
	ControllerImage     string `json:"controllerImage,omitempty"`
	NodeDriverImage     string `json:"nodeDriverImage,omitempty"`
	AttacherImage       string `json:"attacherImage,omitempty"`
	ProvisionerImage    string `json:"provisionerImage,omitempty"`
	MetadataSyncerImage string `json:"metadataSyncerImage,omitempty"`
}

func (*StorageConfig) DeepCopy

func (in *StorageConfig) DeepCopy() *StorageConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageConfig.

func (*StorageConfig) DeepCopyInto

func (in *StorageConfig) DeepCopyInto(out *StorageConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type UnmarshalINIOptionFunc

type UnmarshalINIOptionFunc func(*UnmarshalINIOptions)

UnmarshalINIOptionFunc is used to set unmarshal options.

+kubebuilder:object:generate=false

type UnmarshalINIOptions

type UnmarshalINIOptions struct {
	// WarnAsFatal indicates that warnings that occur when unmarshalling INI
	// data should be treated as fatal errors.
	WarnAsFatal bool
}

UnmarshalINIOptions defines the options used to influence how INI data is unmarshalled.

+kubebuilder:object:generate=false

type VCenterConfig

type VCenterConfig struct {
	// Username is the username used to access a vSphere endpoint.
	// +optional
	Username string `gcfg:"user,omitempty" json:"username,omitempty"`

	// Password is the password used to access a vSphere endpoint.
	// +optional
	Password string `gcfg:"password,omitempty" json:"password,omitempty"`

	// Port is the port on which the vSphere endpoint is listening.
	// Defaults to 443.
	// +optional
	Port string `gcfg:"port,omitempty" json:"port,omitempty"`

	// Datacenters is a CSV string of the datacenters in which VMs are located.
	// +optional
	Datacenters string `gcfg:"datacenters,omitempty" json:"datacenters,omitempty"`

	// RoundTripperCount specifies the SOAP round tripper count
	// (retries = RoundTripper - 1)
	// +optional
	RoundTripperCount int32 `gcfg:"soap-roundtrip-count,omitempty" json:"roundTripperCount,omitempty"`

	// Thumbprint is the cryptographic thumbprint of the vSphere endpoint's
	// certificate.
	// +optional
	Thumbprint string `gcfg:"thumbprint,omitempty" json:"thumbprint,omitempty"`
}

VCenterConfig is a vSphere cloud provider's vCenter configuration.

func (*VCenterConfig) DeepCopy

func (in *VCenterConfig) DeepCopy() *VCenterConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VCenterConfig.

func (*VCenterConfig) DeepCopyInto

func (in *VCenterConfig) DeepCopyInto(out *VCenterConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WorkspaceConfig

type WorkspaceConfig struct {
	// Server is the IP address or FQDN of the vSphere endpoint.
	// +optional
	Server string `gcfg:"server,omitempty" json:"server,omitempty"`

	// Datacenter is the datacenter in which VMs are created/located.
	// +optional
	Datacenter string `gcfg:"datacenter,omitempty" json:"datacenter,omitempty"`

	// Folder is the folder in which VMs are created/located.
	// +optional
	Folder string `gcfg:"folder,omitempty" json:"folder,omitempty"`

	// Datastore is the datastore in which VMs are created/located.
	// +optional
	Datastore string `gcfg:"default-datastore,omitempty" json:"datastore,omitempty"`

	// ResourcePool is the resource pool in which VMs are created/located.
	// +optional
	ResourcePool string `gcfg:"resourcepool-path,omitempty" json:"resourcePool,omitempty"`
}

WorkspaceConfig defines a workspace configuration for the vSphere cloud provider.

func (*WorkspaceConfig) DeepCopy

func (in *WorkspaceConfig) DeepCopy() *WorkspaceConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceConfig.

func (*WorkspaceConfig) DeepCopyInto

func (in *WorkspaceConfig) DeepCopyInto(out *WorkspaceConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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