oke

package
v1.0.0-rc Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2019 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDriver

func NewDriver() types.Driver

Types

type ClusterManagerClient

type ClusterManagerClient struct {
	// contains filtered or unexported fields
}

Defines / contains the OCI/OKE/Identity clients and operations.

func NewClusterManagerClient

func NewClusterManagerClient(configuration common.ConfigurationProvider) (*ClusterManagerClient, error)

NewClusterManagerClient creates a new OCI cluster manager, which has a set of clients (CE, VCN, Identity).

func (*ClusterManagerClient) CreateBastionSubnets

func (mgr *ClusterManagerClient) CreateBastionSubnets(ctx context.Context, state *State, vcnID, subnetRouteID string, isPrivate bool, securityListIds []string) ([]string, error)

CreateBastionSubnets creates the (public) bastion subnet(s), or an error.

func (*ClusterManagerClient) CreateCluster

func (mgr *ClusterManagerClient) CreateCluster(ctx context.Context, state *State, vcnID string, serviceSubnetIds, nodeSubnetIds []string) error

CreateCluster creates a new cluster with no initial node pool and attaches it to the existing network resources, or an error. TODO stop passing in state

func (*ClusterManagerClient) CreateNodePool

func (mgr *ClusterManagerClient) CreateNodePool(ctx context.Context, state *State, vcnID string, serviceSubnetIds, nodeSubnetIds []string) error

CreateNodePool creates a new node pool (i.e. a set of compute nodes) for the cluster, or an error. TODO stop passing in state

func (*ClusterManagerClient) CreateNodeSubnets

func (mgr *ClusterManagerClient) CreateNodeSubnets(ctx context.Context, state *State, vcnID, subnetRouteID string, isPrivate bool, securityListIds []string) ([]string, error)

CreateSubnets creates (public or private) node subnets in each availability domain, or an error. TODO stop passing in state

func (*ClusterManagerClient) CreateServiceSubnets

func (mgr *ClusterManagerClient) CreateServiceSubnets(ctx context.Context, state *State, vcnID, subnetRouteID string, isPrivate bool, securityListIds []string) ([]string, error)

CreateServiceSubnets creates the (public) service subnets (i.e. load balancer subnets), or an error.

func (*ClusterManagerClient) CreateSubnetWithDetails

func (mgr *ClusterManagerClient) CreateSubnetWithDetails(displayName *string, cidrBlock *string, dnsLabel *string, availableDomain *string, vcnID *string, routeTableID *string, isPrivate bool, securityListIds []string, state *State) (core.Subnet, error)

CreateSubnetWithDetails creates a new subnet in the specified VCN, or an error. TODO stop passing in state

func (*ClusterManagerClient) CreateVCNAndNetworkResources

func (mgr *ClusterManagerClient) CreateVCNAndNetworkResources(state *State) (string, []string, []string, error)

CreateVCNAndNetworkResources creates a new Virtual Cloud Network and required resources including security lists, Internet Gateway, default route rule, etc., or an error.

func (*ClusterManagerClient) DeleteCluster

func (mgr *ClusterManagerClient) DeleteCluster(ctx context.Context, clusterID string) error

DeleteCluster deletes the cluster with the specified ID, or an error.

func (*ClusterManagerClient) DeleteNodePool

func (mgr *ClusterManagerClient) DeleteNodePool(ctx context.Context, nodePoolID string) error

DeleteNodePool deletes the node pool with the specified ID, or an error

func (*ClusterManagerClient) DeleteVCN

func (mgr *ClusterManagerClient) DeleteVCN(ctx context.Context, vcnID string) error

DeleteVCN deletes the VCN and its associated resources (subnets, attached gateways, etc.) with the specified ID, or an error.

func (*ClusterManagerClient) GetClusterByID

func (mgr *ClusterManagerClient) GetClusterByID(ctx context.Context, clusterID string) (containerengine.Cluster, error)

GetClusterByID returns the cluster with the specified Id, or an error

func (*ClusterManagerClient) GetClusterByName

func (mgr *ClusterManagerClient) GetClusterByName(ctx context.Context, compartmentID, name string) (string, error)

GetClusterByName returns the Cluster ID of the Cluster with the specified name in the specified compartment or an error if it is not found.

func (*ClusterManagerClient) GetKubeconfigByClusterID

func (mgr *ClusterManagerClient) GetKubeconfigByClusterID(ctx context.Context, clusterID, region string) (store.KubeConfig, string, error)

GetKubeconfigByClusterID is a wrapper for the CreateKubeconfig operation that that handles errors and unmarshaling, or an error.

func (*ClusterManagerClient) GetNodePoolByID

func (mgr *ClusterManagerClient) GetNodePoolByID(ctx context.Context, nodePoolID string) (containerengine.NodePool, error)

GetNodePoolByID returns the node pool with the specified Id, or an error.

func (*ClusterManagerClient) GetSubnetByName

func (mgr *ClusterManagerClient) GetSubnetByName(ctx context.Context, compartmentID, vcnID, displayName string) (core.Subnet, error)

GetSubnetIDByName returns the subnet with the specified name in the specified VCN and compartment, or an error if it is not found.

func (*ClusterManagerClient) GetSubnetIDByName

func (mgr *ClusterManagerClient) GetSubnetIDByName(ctx context.Context, compartmentID, vcnID, displayName string) (string, error)

GetSubnetIDByName returns the subnet ID of the subnet with the specified name in the specified VCN and compartment, or an error if it is not found.

func (*ClusterManagerClient) GetVcnByName

func (mgr *ClusterManagerClient) GetVcnByName(ctx context.Context, compartmentID, displayName string) (core.Vcn, error)

GetVcnIDByName returns the VCN with the specified name in the specified compartment or an error if it is not found.

func (*ClusterManagerClient) GetVcnIDByClusterID

func (mgr *ClusterManagerClient) GetVcnIDByClusterID(ctx context.Context, clusterID string) (string, error)

GetVcnIDByClusterID returns the VCN ID for the existing cluster with the specified Id, or an error.

func (*ClusterManagerClient) GetVcnIDByName

func (mgr *ClusterManagerClient) GetVcnIDByName(ctx context.Context, compartmentID, displayName string) (string, error)

GetVcnIDByName returns the VCN ID of the VCN with the specified name in the specified compartment or an error if it is not found.

func (*ClusterManagerClient) ListInternetGatewayIdsInVcn

func (mgr *ClusterManagerClient) ListInternetGatewayIdsInVcn(ctx context.Context, compartmentID, vcnID string) ([]string, error)

ListInternetGatewayIdsInVcn returns the route table IDs of any and all Internet gateways in the specified VCN.

func (*ClusterManagerClient) ListNatGatewayIdsInVcn

func (mgr *ClusterManagerClient) ListNatGatewayIdsInVcn(ctx context.Context, compartmentID, vcnID string) ([]string, error)

ListNatGatewayIdsInVcn returns the NAT gateway IDs of any and all NAT gateways in the specified VCN.

func (*ClusterManagerClient) ListNodepoolIdsInCluster

func (mgr *ClusterManagerClient) ListNodepoolIdsInCluster(ctx context.Context, compartmentID, clusterID string) ([]string, error)

ListNodepoolIdsInCluster returns the node pool IDs of any and all node pools in the specified cluster.

func (*ClusterManagerClient) ListRouteTableIdsInVcn

func (mgr *ClusterManagerClient) ListRouteTableIdsInVcn(ctx context.Context, compartmentID, vcnID string) ([]string, error)

ListRouteTableIdsInVcn returns the route table IDs of any and all route tables in the specified VCN.

func (*ClusterManagerClient) ListSecurityListIdsInVcn

func (mgr *ClusterManagerClient) ListSecurityListIdsInVcn(ctx context.Context, compartmentID, vcnID string) ([]string, error)

ListSecurityListIdsInVcn returns the security list IDs of any and all security lists in the specified VCN.

func (*ClusterManagerClient) ListSubnetIdsInVcn

func (mgr *ClusterManagerClient) ListSubnetIdsInVcn(ctx context.Context, compartmentID, vcnID string) ([]string, error)

ListSubnetIdsInVcn returns the subnet IDs of any and all subnets in the specified VCN.

func (*ClusterManagerClient) ScaleNodePool

func (mgr *ClusterManagerClient) ScaleNodePool(ctx context.Context, nodePoolID string, quantityPerSubnet int) error

ScaleNodePool updates the number of nodes in each subnet, or an error.

func (*ClusterManagerClient) UpdateMasterKubernetesVersion

func (mgr *ClusterManagerClient) UpdateMasterKubernetesVersion(ctx context.Context, clusterID, version string) error

UpdateKubernetesMasterVersion updates the version of Kubernetes on the master(s), or an error.

func (*ClusterManagerClient) UpdateNodepoolKubernetesVersion

func (mgr *ClusterManagerClient) UpdateNodepoolKubernetesVersion(ctx context.Context, nodePoolID, version string) error

UpdateNodepoolKubernetesVersion updates the version of Kubernetes on (new) worker that will be added to the node pool. Be sure to call UpdateKubernetesMasterVersion before updating the version of node pools, or an error.

type NetworkConfiguration

type NetworkConfiguration struct {
	// The OCID of the compartment that contains the optional pre-existing VCN
	VcnCompartmentID string
	// Optional pre-existing VCN in which you want to create cluster
	VCNName string
	// Optional pre-existing load balancer subnets to host load balancers for services
	ServiceLBSubnet1Name string
	ServiceLBSubnet2Name string
	// The number of subnets (each are created in different availability domains)
	QuantityOfSubnets int64
}

Elements that make up the Network configuration (and state) for the OKE cluster

type NodeConfiguration

type NodeConfiguration struct {
	// The OS image that will be used for the VM
	NodeImageName string
	// The shape of the VM for the worker node
	NodeShape string
	// The optional public SSH Key path to access the worker nodes
	// Note, in order to access private nodes you need to set up a bastion host on the bastion subnet
	NodePublicSSHKeyPath string
	// The optional public SSH Key contents to access the worker nodes
	NodePublicSSHKeyContents string
	// The number of nodes in each subnet / availability domain
	QuantityPerSubnet int64
}

Elements that make up the configuration of each node in the OKE cluster

type OKEDriver

type OKEDriver struct {
	// contains filtered or unexported fields
}

func (*OKEDriver) Create

Create implements driver interface

func (*OKEDriver) ETCDRemoveSnapshot

func (d *OKEDriver) ETCDRemoveSnapshot(ctx context.Context, clusterInfo *types.ClusterInfo, opts *types.DriverOptions, snapshotName string) error

func (*OKEDriver) ETCDRestore

func (d *OKEDriver) ETCDRestore(ctx context.Context, clusterInfo *types.ClusterInfo, opts *types.DriverOptions, snapshotName string) (*types.ClusterInfo, error)

func (*OKEDriver) ETCDSave

func (d *OKEDriver) ETCDSave(ctx context.Context, clusterInfo *types.ClusterInfo, opts *types.DriverOptions, snapshotName string) error

func (*OKEDriver) GetCapabilities

func (d *OKEDriver) GetCapabilities(ctx context.Context) (*types.Capabilities, error)

func (*OKEDriver) GetClusterSize

func (d *OKEDriver) GetClusterSize(ctx context.Context, info *types.ClusterInfo) (*types.NodeCount, error)

func (*OKEDriver) GetDriverCreateOptions

func (d *OKEDriver) GetDriverCreateOptions(ctx context.Context) (*types.DriverFlags, error)

GetDriverCreateOptions implements driver interface

func (*OKEDriver) GetDriverUpdateOptions

func (d *OKEDriver) GetDriverUpdateOptions(ctx context.Context) (*types.DriverFlags, error)

GetDriverUpdateOptions implements driver interface

func (*OKEDriver) GetK8SCapabilities

func (d *OKEDriver) GetK8SCapabilities(ctx context.Context, options *types.DriverOptions) (*types.K8SCapabilities, error)

func (*OKEDriver) GetVersion

func (d *OKEDriver) GetVersion(ctx context.Context, info *types.ClusterInfo) (*types.KubernetesVersion, error)

func (*OKEDriver) PostCheck

func (d *OKEDriver) PostCheck(ctx context.Context, info *types.ClusterInfo) (*types.ClusterInfo, error)

func (*OKEDriver) Remove

func (d *OKEDriver) Remove(ctx context.Context, info *types.ClusterInfo) error

func (*OKEDriver) RemoveLegacyServiceAccount

func (d *OKEDriver) RemoveLegacyServiceAccount(ctx context.Context, info *types.ClusterInfo) error

func (*OKEDriver) SetClusterSize

func (d *OKEDriver) SetClusterSize(ctx context.Context, info *types.ClusterInfo, count *types.NodeCount) error

func (*OKEDriver) SetVersion

func (d *OKEDriver) SetVersion(ctx context.Context, info *types.ClusterInfo, version *types.KubernetesVersion) error

func (*OKEDriver) Update

Update implements driver interface

type SignRequest

type SignRequest func(*http.Request) (*http.Request, error)

type State

type State struct {
	// Should the Kubernetes dashboard be enabled
	EnableKubernetesDashboard bool

	// Should the Helm server (Tiller) be enabled
	EnableTiller bool

	PrivateNodes bool

	// The name of the cluster (and default node pool)
	Name string

	// The Oracle Cloud ID (OCID) of the tenancy
	TenancyID string

	// The OCID of the cluster compartment
	CompartmentID string

	// The user OCID
	UserOCID string

	// The path to the private API Key that is associated with the user and has access the tenancy/compartment
	PrivateKeyPath string
	// The contents the private API Key that is associated with the user and has access the tenancy/compartment
	PrivateKeyContents string

	// The API Key Fingerprint
	Fingerprint string

	// The region where the cluster will be hosted
	Region string

	// The passphrase for the private key
	PrivateKeyPassphrase string

	// The description of the cluster
	// TODO currently unused
	Description string

	// Should cluster creation operation wait until nodes are active
	// TODO currently unused
	WaitNodesActive int64

	// Optional CIDR from which to allow ingress to worker nodes
	WorkerNodeIngressCidr string

	// The labels specified during the Kubernetes creation
	// TODO currently unused
	KubernetesLabels map[string]string

	// The version of Kubernetes to run on the master and worker nodes and node pool (e.g. v1.11.9, v1.12.7)
	KubernetesVersion string

	// OCID of the cluster
	ClusterID string

	Network  NetworkConfiguration
	NodePool NodeConfiguration
	// cluster info
	ClusterInfo types.ClusterInfo
}

func GetState

func GetState(info *types.ClusterInfo) (State, error)

func GetStateFromOpts

func GetStateFromOpts(driverOptions *types.DriverOptions) (State, error)

SetDriverOptions implements driver interface

Jump to

Keyboard shortcuts

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