Documentation
¶
Index ¶
- Constants
- func DefaultMasterVmSizes() []string
- func DefaultWorkerVmSizes() []string
- func GetIPRangesFromSubnet(subnet *sdknetwork.Subnet) []*net.IPNet
- type Cluster
- func (c *Cluster) Create(ctx context.Context) error
- func (c *Cluster) Delete(ctx context.Context, vnetResourceGroup, clusterName string) error
- func (c *Cluster) GetPlatformWIRoles() ([]api.PlatformWorkloadIdentityRole, error)
- func (c *Cluster) SetupServicePrincipalRoleAssignments(ctx context.Context, diskEncryptionSetID string, routeTableID string, ...) error
- func (c *Cluster) SetupWorkloadIdentity(ctx context.Context, vnetResourceGroup string, diskEncryptionSetID string, ...) error
- type ClusterConfig
- type InternalClient
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 (*Cluster) GetPlatformWIRoles ¶
func (c *Cluster) GetPlatformWIRoles() ([]api.PlatformWorkloadIdentityRole, error)
func (*Cluster) SetupServicePrincipalRoleAssignments ¶
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
Click to show internal directories.
Click to hide internal directories.