cluster

package
v0.0.0-...-4873e18 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: Apache-2.0 Imports: 49 Imported by: 2

Documentation

Index

Constants

View Source
const (
	GraphApiMaxRetries    int           = 5
	GraphApiRetryInterval time.Duration = 5 * time.Second
)
View Source
const (
	GenerateSubnetMaxTries = 100
)

Variables

This section is empty.

Functions

func DefaultMasterVmSizes

func DefaultMasterVmSizes() []string

func DefaultWorkerVmSizes

func DefaultWorkerVmSizes() []string

func GetIPRangesFromSubnet

func GetIPRangesFromSubnet(subnet *sdknetwork.Subnet) []*net.IPNet

GetIPRangesFromSubnet converts a given azure subnet to a list if IPNets. Because an az subnet can cover multiple ipranges, we need to return a slice instead of just a single ip range. This function never errors. If something goes wrong, it instead returns an empty list.

Types

type Cluster

type Cluster struct {
	Config *ClusterConfig
	// contains filtered or unexported fields
}

func New

func New(log *logrus.Entry, conf *ClusterConfig) (*Cluster, error)

func (*Cluster) Create

func (c *Cluster) Create(ctx context.Context) error

func (*Cluster) Delete

func (c *Cluster) Delete(ctx context.Context, vnetResourceGroup, clusterName string) error

func (*Cluster) GetPlatformWIRoles

func (c *Cluster) GetPlatformWIRoles() ([]api.PlatformWorkloadIdentityRole, error)

func (*Cluster) SetupServicePrincipalRoleAssignments

func (c *Cluster) SetupServicePrincipalRoleAssignments(ctx context.Context, diskEncryptionSetID string, routeTableID string, principalIDs []string) error

func (*Cluster) SetupWorkloadIdentity

func (c *Cluster) SetupWorkloadIdentity(ctx context.Context, vnetResourceGroup string, diskEncryptionSetID string, routeTableID string) error

type ClusterConfig

type ClusterConfig struct {
	ClusterName           string `mapstructure:"CLUSTER"`
	SubscriptionID        string `mapstructure:"AZURE_SUBSCRIPTION_ID"`
	TenantID              string `mapstructure:"AZURE_TENANT_ID"`
	Location              string `mapstructure:"LOCATION"`
	AzureEnvironment      string `mapstructure:"AZURE_ENVIRONMENT"`
	UseWorkloadIdentity   bool   `mapstructure:"USE_WI"`
	WorkloadIdentityRoles string `mapstructure:"PLATFORM_WORKLOAD_IDENTITY_ROLE_SETS"`
	IsCI                  bool   `mapstructure:"CI"`
	RpMode                string `mapstructure:"RP_MODE"`
	VnetResourceGroup     string `mapstructure:"CLUSTER_RESOURCEGROUP"`
	RPResourceGroup       string `mapstructure:"RESOURCEGROUP"`
	OSClusterVersion      string `mapstructure:"OS_CLUSTER_VERSION"`
	FPServicePrincipalID  string `mapstructure:"AZURE_FP_SERVICE_PRINCIPAL_ID"`
	IsPrivate             bool   `mapstructure:"PRIVATE_CLUSTER"`
	NoInternet            bool   `mapstructure:"NO_INTERNET"`
	MockMSIObjectID       string `mapstructure:"MOCK_MSI_OBJECT_ID"`

	MasterVMSize  string   `mapstructure:"MASTER_VM_SIZE"`
	WorkerVMSize  string   `mapstructure:"WORKER_VM_SIZE"`
	MasterVMSizes []string `mapstructure:"MASTER_VM_SIZES"`
	WorkerVMSizes []string `mapstructure:"WORKER_VM_SIZES"`
}

func NewClusterConfigFromEnv

func NewClusterConfigFromEnv() (*ClusterConfig, error)

func (*ClusterConfig) IsLocalDevelopmentMode

func (cc *ClusterConfig) IsLocalDevelopmentMode() bool

type InternalClient

type InternalClient interface {
	Get(ctx context.Context, resourceGroupName string, resourceName string) (*api.OpenShiftCluster, error)
	CreateOrUpdateAndWait(ctx context.Context, resourceGroupName string, resourceName string, parameters *api.OpenShiftCluster) error
	DeleteAndWait(ctx context.Context, resourceGroupName string, resourceName string) error
}

func NewInternalClient

func NewInternalClient(log *logrus.Entry, environment env.Core, authorizer autorest.Authorizer) InternalClient

Jump to

Keyboard shortcuts

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