Documentation ¶
Index ¶
- Constants
- func CheckLimits(c *gcorecloud.ServiceClient, opts CheckLimitsOptsBuilder) (r quotas.CommonResult)
- func Create(c *gcorecloud.ServiceClient, opts CreateOptsBuilder) (r tasks.Result)
- func Delete(c *gcorecloud.ServiceClient, clusterName string) (r tasks.Result)
- func ExtractClustersInto(r pagination.Page, v interface{}) error
- func ExtractVersionInto(r pagination.Page, v interface{}) error
- func List(c *gcorecloud.ServiceClient) pagination.Pager
- func ListInstances(c *gcorecloud.ServiceClient, clusterID string) pagination.Pager
- func ListInstancesAll(c *gcorecloud.ServiceClient, clusterID string) ([]instances.Instance, error)
- func Update(c *gcorecloud.ServiceClient, clusterID string, opts UpdateOptsBuilder) (r tasks.Result)
- func Upgrade(c *gcorecloud.ServiceClient, clusterID string, opts UpgradeOptsBuilder) (r tasks.Result)
- func Versions(c *gcorecloud.ServiceClient) pagination.Pager
- type Authentication
- type AuthenticationCreateOpts
- type AuthenticationUpdateOpts
- type CNI
- type CNICreateOpts
- type CNIProvider
- func (cn CNIProvider) IsValid() error
- func (cn CNIProvider) List() []CNIProvider
- func (cn *CNIProvider) MarshalJSON() ([]byte, error)
- func (cn CNIProvider) String() string
- func (cn CNIProvider) StringList() []string
- func (cn *CNIProvider) UnmarshalJSON(data []byte) error
- func (cn CNIProvider) ValidOrNil() (*CNIProvider, error)
- type Certificate
- type CertificateResult
- type CheckLimitsOpts
- type CheckLimitsOptsBuilder
- type CheckLimitsPoolOpts
- type Cilium
- type CiliumCreateOpts
- type Cluster
- type ClusterPage
- type Config
- type ConfigResult
- type CreateOpts
- type CreateOptsBuilder
- type GetResult
- type LBModeType
- func (t LBModeType) IsValid() error
- func (t LBModeType) List() []LBModeType
- func (t *LBModeType) MarshalJSON() ([]byte, error)
- func (t LBModeType) String() string
- func (t LBModeType) StringList() []string
- func (t *LBModeType) UnmarshalJSON(data []byte) error
- func (t LBModeType) ValidOrNil() (*LBModeType, error)
- type OIDC
- type OIDCCreateOpts
- type RoutingModeType
- func (t RoutingModeType) IsValid() error
- func (t RoutingModeType) List() []RoutingModeType
- func (t *RoutingModeType) MarshalJSON() ([]byte, error)
- func (t RoutingModeType) String() string
- func (t RoutingModeType) StringList() []string
- func (t *RoutingModeType) UnmarshalJSON(data []byte) error
- func (t RoutingModeType) ValidOrNil() (*RoutingModeType, error)
- type TunnelType
- func (t TunnelType) IsValid() error
- func (t TunnelType) List() []TunnelType
- func (t *TunnelType) MarshalJSON() ([]byte, error)
- func (t TunnelType) String() string
- func (t TunnelType) StringList() []string
- func (t *TunnelType) UnmarshalJSON(data []byte) error
- func (t TunnelType) ValidOrNil() (*TunnelType, error)
- type UpdateOpts
- type UpdateOptsBuilder
- type UpgradeOpts
- type UpgradeOptsBuilder
- type Version
- type VersionPage
Constants ¶
const ( CalicoProvider CNIProvider = "calico" CiliumProvider CNIProvider = "cilium" VXLANTunnel TunnelType = "vxlan" GeneveTunnel TunnelType = "geneve" EmptyTunnel TunnelType = "" SNATLBMode LBModeType = "snat" DSRLBMode LBModeType = "dsr" HybridLBMode LBModeType = "hybrid" NativeRoutingMode RoutingModeType = "native" TunnelRoutingMode RoutingModeType = "tunnel" )
Variables ¶
This section is empty.
Functions ¶
func CheckLimits ¶ added in v0.7.16
func CheckLimits(c *gcorecloud.ServiceClient, opts CheckLimitsOptsBuilder) (r quotas.CommonResult)
CheckLimits checks quota limits for the values provided and returns the diff for exceeded quota.
func Create ¶
func Create(c *gcorecloud.ServiceClient, opts CreateOptsBuilder) (r tasks.Result)
Create accepts a CreateOpts struct and creates a new cluster using the values provided.
func Delete ¶
func Delete(c *gcorecloud.ServiceClient, clusterName string) (r tasks.Result)
Delete accepts cluster name and deletes the cluster associated with it.
func ExtractClustersInto ¶
func ExtractClustersInto(r pagination.Page, v interface{}) error
func ExtractVersionInto ¶
func ExtractVersionInto(r pagination.Page, v interface{}) error
func List ¶
func List(c *gcorecloud.ServiceClient) pagination.Pager
List returns a Pager which allows you to iterate over a collection of clusters.
func ListInstances ¶
func ListInstances(c *gcorecloud.ServiceClient, clusterID string) pagination.Pager
ListInstances returns a Pager which allows you to iterate over a collection of cluster instances.
func ListInstancesAll ¶
func ListInstancesAll(c *gcorecloud.ServiceClient, clusterID string) ([]instances.Instance, error)
ListInstancesAll is a convenience function that returns all cluster instances.
func Update ¶ added in v0.7.17
func Update(c *gcorecloud.ServiceClient, clusterID string, opts UpdateOptsBuilder) (r tasks.Result)
Update accepts a UpdateOpts struct and updates an existing cluster using the values provided.
func Upgrade ¶
func Upgrade(c *gcorecloud.ServiceClient, clusterID string, opts UpgradeOptsBuilder) (r tasks.Result)
Upgrade accepts a UpgradeOpts struct and upgrades an existing cluster using the values provided.
func Versions ¶
func Versions(c *gcorecloud.ServiceClient) pagination.Pager
Versions returns a Pager which allows you to iterate over a collection of supported cluster versions.
Types ¶
type Authentication ¶ added in v0.7.17
type Authentication struct {
OIDC *OIDC `json:"oidc,omitempty"`
}
type AuthenticationCreateOpts ¶ added in v0.7.17
type AuthenticationCreateOpts struct {
OIDC *OIDCCreateOpts `json:"oidc,omitempty" validate:"omitempty"`
}
type AuthenticationUpdateOpts ¶ added in v0.7.17
type AuthenticationUpdateOpts = AuthenticationCreateOpts
type CNI ¶ added in v0.6.33
type CNI struct { Provider CNIProvider `json:"provider"` Cilium *Cilium `json:"cilium,omitempty"` }
type CNICreateOpts ¶ added in v0.6.33
type CNICreateOpts struct { Provider CNIProvider `json:"provider" required:"true" validate:"required"` Cilium *CiliumCreateOpts `json:"cilium,omitempty"` }
type CNIProvider ¶ added in v0.6.33
type CNIProvider string
func (CNIProvider) IsValid ¶ added in v0.6.33
func (cn CNIProvider) IsValid() error
func (CNIProvider) List ¶ added in v0.6.33
func (cn CNIProvider) List() []CNIProvider
func (*CNIProvider) MarshalJSON ¶ added in v0.6.33
func (cn *CNIProvider) MarshalJSON() ([]byte, error)
MarshalJSON - implements Marshaler interface for CNIProvider
func (CNIProvider) String ¶ added in v0.6.33
func (cn CNIProvider) String() string
func (CNIProvider) StringList ¶ added in v0.6.33
func (cn CNIProvider) StringList() []string
func (*CNIProvider) UnmarshalJSON ¶ added in v0.6.33
func (cn *CNIProvider) UnmarshalJSON(data []byte) error
UnmarshalJSON - implements Unmarshaler interface for CNIProvider
func (CNIProvider) ValidOrNil ¶ added in v0.6.33
func (cn CNIProvider) ValidOrNil() (*CNIProvider, error)
type Certificate ¶
Certificate represents a cluster CA certificate.
type CertificateResult ¶
type CertificateResult struct {
gcorecloud.Result
}
CertificateResult represents the result of a get certificate operation. Call its Extract method to interpret it as a Certificate.
func GetCertificate ¶
func GetCertificate(c *gcorecloud.ServiceClient, clusterName string) (r CertificateResult)
GetCertificate accepts cluster name and returns the cluster CA certificate.
func (CertificateResult) Extract ¶
func (r CertificateResult) Extract() (*Certificate, error)
Extract is a function that accepts a result and extracts a cluster CA certificate.
type CheckLimitsOpts ¶ added in v0.7.16
type CheckLimitsOpts struct {
Pools []CheckLimitsPoolOpts `json:"pools,omitempty"`
}
func (CheckLimitsOpts) ToCheckLimitsMap ¶ added in v0.7.16
func (opts CheckLimitsOpts) ToCheckLimitsMap() (map[string]interface{}, error)
ToCheckLimitsMap builds a request body from CheckLimitsOpts.
type CheckLimitsOptsBuilder ¶ added in v0.7.16
type CheckLimitsPoolOpts ¶ added in v0.7.16
type CheckLimitsPoolOpts struct { Name string `json:"name,omitempty" validate:"omitempty"` FlavorID string `json:"flavor_id" required:"true" validate:"required"` MinNodeCount int `json:"min_node_count,omitempty" validate:"omitempty,gt=0,ltefield=MaxNodeCount"` MaxNodeCount int `json:"max_node_count,omitempty" validate:"omitempty,gt=0,gtefield=MinNodeCount"` NodeCount int `json:"node_count,omitempty" validate:"omitempty"` BootVolumeSize int `json:"boot_volume_size,omitempty" validate:"omitempty,gt=0"` ServerGroupPolicy servergroups.ServerGroupPolicy `json:"servergroup_policy,omitempty" validate:"omitempty,enum"` }
type Cilium ¶ added in v0.6.33
type Cilium struct { MaskSize int `json:"mask_size,omitempty"` MaskSizeV6 int `json:"mask_size_v6,omitempty"` Tunnel TunnelType `json:"tunnel,omitempty"` Encryption bool `json:"encryption"` LoadBalancerMode LBModeType `json:"lb_mode,omitempty"` LoadBalancerAcceleration bool `json:"lb_acceleration"` RoutingMode RoutingModeType `json:"routing_mode,omitempty"` HubbleRelay bool `json:"hubble_relay"` HubbleUI bool `json:"hubble_ui"` }
type CiliumCreateOpts ¶ added in v0.6.33
type CiliumCreateOpts struct { MaskSize int `json:"mask_size,omitempty"` MaskSizeV6 int `json:"mask_size_v6,omitempty"` Tunnel TunnelType `json:"tunnel"` Encryption bool `json:"encryption"` LoadBalancerMode LBModeType `json:"lb_mode,omitempty"` LoadBalancerAcceleration bool `json:"lb_acceleration"` RoutingMode RoutingModeType `json:"routing_mode,omitempty"` HubbleRelay bool `json:"hubble_relay"` HubbleUI bool `json:"hubble_ui"` }
type Cluster ¶
type Cluster struct { ID string `json:"id"` Name string `json:"name"` KeyPair string `json:"keypair"` NodeCount int `json:"node_count"` FlavorID string `json:"flavor_id"` Status string `json:"status"` Pools []pools.ClusterPool `json:"pools"` Version string `json:"version"` IsPublic bool `json:"is_public"` Authentication *Authentication `json:"authentication,omitempty"` AutoscalerConfig map[string]string `json:"autoscaler_config,omitempty"` CNI *CNI `json:"cni,omitempty"` FixedNetwork string `json:"fixed_network"` FixedSubnet string `json:"fixed_subnet"` PodsIPPool *gcorecloud.CIDR `json:"pods_ip_pool,omitempty" validate:"omitempty,cidr"` ServicesIPPool *gcorecloud.CIDR `json:"services_ip_pool,omitempty" validate:"omitempty,cidr"` PodsIPV6Pool *gcorecloud.CIDR `json:"pods_ipv6_pool,omitempty" validate:"omitempty,cidr"` ServicesIPV6Pool *gcorecloud.CIDR `json:"services_ipv6_pool,omitempty" validate:"omitempty,cidr"` IsIPV6 bool `json:"is_ipv6,omitempty"` CreatedAt time.Time `json:"created_at"` CreatorTaskID string `json:"creator_task_id"` TaskID string `json:"task_id"` ProjectID int `json:"project_id"` RegionID int `json:"region_id"` Region string `json:"region"` }
Cluster represents a cluster structure.
func ExtractClusters ¶
func ExtractClusters(r pagination.Page) ([]Cluster, error)
ExtractCluster accepts a Page struct, specifically a ClusterPage struct, and extracts the elements into a slice of ClusterListWithPool structs. In other words, a generic collection is mapped into a relevant slice.
func ListAll ¶
func ListAll(c *gcorecloud.ServiceClient) ([]Cluster, error)
ListALL is a convenience function that returns all clusters.
type ClusterPage ¶
type ClusterPage struct {
pagination.LinkedPageBase
}
ClusterPage is the page returned by a pager when traversing over a collection of clusters.
func (ClusterPage) IsEmpty ¶
func (r ClusterPage) IsEmpty() (bool, error)
IsEmpty checks whether a ClusterPage struct is empty.
func (ClusterPage) NextPageURL ¶
func (r ClusterPage) NextPageURL() (string, error)
NextPageURL is invoked when a paginated collection of clusters has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.
type Config ¶
type Config struct {
Config string `json:"config"`
}
Config represents a kubeconfig structure.
type ConfigResult ¶
type ConfigResult struct {
gcorecloud.Result
}
ConfigResult represents the result of a get config operation. Call its Extract method to interpret it as a Config.
func GetConfig ¶
func GetConfig(c *gcorecloud.ServiceClient, clusterName string) (r ConfigResult)
GetConfig accepts cluster name and returns the cluster kubeconfig.
func (ConfigResult) Extract ¶
func (r ConfigResult) Extract() (*Config, error)
Extract is a function that accepts a result and extracts a cluster config.
type CreateOpts ¶
type CreateOpts struct { Name string `json:"name" required:"true" validate:"required,gt=0,lte=20"` Authentication *AuthenticationCreateOpts `json:"authentication,omitempty" validate:"omitempty"` AutoscalerConfig map[string]string `json:"autoscaler_config,omitempty" validate:"omitempty"` CNI *CNICreateOpts `json:"cni,omitempty" validate:"omitempty"` FixedNetwork string `json:"fixed_network" validate:"omitempty,uuid4"` FixedSubnet string `json:"fixed_subnet" validate:"omitempty,uuid4"` PodsIPPool *gcorecloud.CIDR `json:"pods_ip_pool,omitempty" validate:"omitempty,cidr"` ServicesIPPool *gcorecloud.CIDR `json:"services_ip_pool,omitempty" validate:"omitempty,cidr"` PodsIPV6Pool *gcorecloud.CIDR `json:"pods_ipv6_pool,omitempty" validate:"omitempty,cidr"` ServicesIPV6Pool *gcorecloud.CIDR `json:"services_ipv6_pool,omitempty" validate:"omitempty,cidr"` KeyPair string `json:"keypair" required:"true" validate:"required"` Version string `json:"version" required:"true" validate:"required"` IsIPV6 bool `json:"is_ipv6,omitempty"` Pools []pools.CreateOpts `json:"pools" required:"true" validate:"required,min=1,dive"` }
CreateOpts represents options used to create a cluster.
func (CreateOpts) ToClusterCreateMap ¶
func (opts CreateOpts) ToClusterCreateMap() (map[string]interface{}, error)
ToClusterCreateMap builds a request body from CreateOpts.
type CreateOptsBuilder ¶
CreateOptsBuilder allows extensions to add additional parameters to the Create request.
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult represents the result of a get operation. Call its Extract method to interpret it as a Cluster.
func Get ¶
func Get(c *gcorecloud.ServiceClient, clusterName string) (r GetResult)
Get retrieves a specific cluster based on its name.
func (GetResult) Extract ¶
Extract is a function that accepts a result and extracts a cluster resource.
func (GetResult) ExtractInto ¶
func (r GetResult) ExtractInto(v interface{}) error
type LBModeType ¶ added in v0.6.33
type LBModeType string
func (LBModeType) IsValid ¶ added in v0.6.33
func (t LBModeType) IsValid() error
func (LBModeType) List ¶ added in v0.6.33
func (t LBModeType) List() []LBModeType
func (*LBModeType) MarshalJSON ¶ added in v0.6.33
func (t *LBModeType) MarshalJSON() ([]byte, error)
MarshalJSON - implements Marshaler interface for LBModeType
func (LBModeType) String ¶ added in v0.6.33
func (t LBModeType) String() string
func (LBModeType) StringList ¶ added in v0.6.33
func (t LBModeType) StringList() []string
func (*LBModeType) UnmarshalJSON ¶ added in v0.6.33
func (t *LBModeType) UnmarshalJSON(data []byte) error
UnmarshalJSON - implements Unmarshaler interface for LBModeType
func (LBModeType) ValidOrNil ¶ added in v0.6.33
func (t LBModeType) ValidOrNil() (*LBModeType, error)
type OIDC ¶ added in v0.7.17
type OIDC struct { ClientID string `json:"client_id,omitempty"` GroupsClaim string `json:"groups_claim,omitempty"` GroupsPrefix string `json:"groups_prefix,omitempty"` IssuerURL string `json:"issuer_url,omitempty"` RequiredClaims map[string]string `json:"required_claims,omitempty"` SigningAlgs []string `json:"signing_algs,omitempty"` UsernameClaim string `json:"username_claim,omitempty"` UsernamePrefix string `json:"username_prefix,omitempty"` }
type OIDCCreateOpts ¶ added in v0.7.17
type OIDCCreateOpts struct { ClientID string `json:"client_id,omitempty" validate:"omitempty"` GroupsClaim string `json:"groups_claim,omitempty" validate:"omitempty"` GroupsPrefix string `json:"groups_prefix,omitempty" validate:"omitempty"` IssuerURL string `json:"issuer_url,omitempty" validate:"omitempty"` RequiredClaims map[string]string `json:"required_claims,omitempty" validate:"omitempty"` SigningAlgs []string `json:"signing_algs,omitempty" validate:"omitempty"` UsernameClaim string `json:"username_claim,omitempty" validate:"omitempty"` UsernamePrefix string `json:"username_prefix,omitempty" validate:"omitempty"` }
type RoutingModeType ¶ added in v0.6.33
type RoutingModeType string
func (RoutingModeType) IsValid ¶ added in v0.6.33
func (t RoutingModeType) IsValid() error
func (RoutingModeType) List ¶ added in v0.6.33
func (t RoutingModeType) List() []RoutingModeType
func (*RoutingModeType) MarshalJSON ¶ added in v0.6.33
func (t *RoutingModeType) MarshalJSON() ([]byte, error)
MarshalJSON - implements Marshaler interface for RoutingModeType
func (RoutingModeType) String ¶ added in v0.6.33
func (t RoutingModeType) String() string
func (RoutingModeType) StringList ¶ added in v0.6.33
func (t RoutingModeType) StringList() []string
func (*RoutingModeType) UnmarshalJSON ¶ added in v0.6.33
func (t *RoutingModeType) UnmarshalJSON(data []byte) error
UnmarshalJSON - implements Unmarshaler interface for RoutingModeType
func (RoutingModeType) ValidOrNil ¶ added in v0.6.33
func (t RoutingModeType) ValidOrNil() (*RoutingModeType, error)
type TunnelType ¶ added in v0.6.33
type TunnelType string
func (TunnelType) IsValid ¶ added in v0.6.33
func (t TunnelType) IsValid() error
func (TunnelType) List ¶ added in v0.6.33
func (t TunnelType) List() []TunnelType
func (*TunnelType) MarshalJSON ¶ added in v0.6.33
func (t *TunnelType) MarshalJSON() ([]byte, error)
MarshalJSON - implements Marshaler interface for TunnelType
func (TunnelType) String ¶ added in v0.6.33
func (t TunnelType) String() string
func (TunnelType) StringList ¶ added in v0.6.33
func (t TunnelType) StringList() []string
func (*TunnelType) UnmarshalJSON ¶ added in v0.6.33
func (t *TunnelType) UnmarshalJSON(data []byte) error
UnmarshalJSON - implements Unmarshaler interface for TunnelType
func (TunnelType) ValidOrNil ¶ added in v0.6.33
func (t TunnelType) ValidOrNil() (*TunnelType, error)
type UpdateOpts ¶ added in v0.7.17
type UpdateOpts struct { Authentication *AuthenticationUpdateOpts `json:"authentication,omitempty" validate:"omitempty"` AutoscalerConfig map[string]string `json:"autoscaler_config,omitempty" validate:"omitempty"` CNI *CNICreateOpts `json:"cni,omitempty" validate:"omitempty"` }
UpdateOpts represents options used to upgrade a cluster.
func (UpdateOpts) ToClusterUpdateMap ¶ added in v0.7.17
func (opts UpdateOpts) ToClusterUpdateMap() (map[string]interface{}, error)
ToClusterUpdateMap builds a request body from UpdateOpts.
type UpdateOptsBuilder ¶ added in v0.7.17
UpdateOptsBuilder allows extensions to add additional parameters to the Update request.
type UpgradeOpts ¶
type UpgradeOpts struct {
Version string `json:"version" required:"true"`
}
UpgradeOpts represents options used to upgrade a cluster.
func (UpgradeOpts) ToClusterUpgradeMap ¶
func (opts UpgradeOpts) ToClusterUpgradeMap() (map[string]interface{}, error)
ToClusterUpgradeMap builds a request body from UpgradeOpts.
type UpgradeOptsBuilder ¶
UpgradeOptsBuilder allows extensions to add additional parameters to the Upgrade request.
type Version ¶
type Version struct {
Version string `json:"version"`
}
Version represents a cluster version structure.
func ExtractVersions ¶
func ExtractVersions(r pagination.Page) ([]Version, error)
ExtractVersions accepts a Page struct, specifically a VersionPage struct, and extracts the elements into a slice of Version structs.. In other words, a generic collection is mapped into a relevant slice.
func VersionsAll ¶
func VersionsAll(c *gcorecloud.ServiceClient) ([]Version, error)
VersionsAll is a convenience function that returns all supported cluster versions.
type VersionPage ¶
type VersionPage struct {
pagination.LinkedPageBase
}
VersionPage is the page returned by a pager when traversing over a collection of cluster versions.
func (VersionPage) IsEmpty ¶
func (r VersionPage) IsEmpty() (bool, error)
IsEmpty checks whether a VersionPage struct is empty.
func (VersionPage) NextPageURL ¶
func (r VersionPage) NextPageURL() (string, error)
NextPageURL is invoked when a paginated collection of clusters has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.