ARO-RP/pkg/api/openshiftcluster.go

872 строки
37 KiB
Go
Исходник Обычный вид История

2019-10-16 06:29:17 +03:00
package api
2019-12-17 04:16:50 +03:00
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License 2.0.
2019-10-16 06:29:17 +03:00
import (
Lay groundwork for cluster MSI usage (#3757) * Add a parameter for enabling Entra ID RBAC on key vaults * Add an RP-level feature flag for determining whether to use the mock MSI RP * Tweak the mock identity URL to play nicely with the mock MSI RP * Add Azure SDK client wrappers for new clients (federated identity credentials control plane and key vault data plane) * Vendor in new Azure SDK clients and update msi-dataplane * Lay groundwork for use of cluster MSI... - Initialize the MSI dataplane client, using the mock MSI RP/stub if appropriate - Initialize key vault store client (for MSI certificates; functionality is implemented in MSI dataplane module) - Create a cluster MSI certificate and store it in the key vault during cluster bootstrap - Instantiate an Azure SDK FederatedIdentityCredential client using the cluster MSI certificate - Delete the cluster MSI certificate as needed during cluster deletion * Don't fail during cluster deletion if the cluster MSI certificate is already gone from the key vault (or was potentially never created) * Establish an RP-Config variable for the MSI RP endpoint - Update doc comment for ensureClusterMsiCertificate - Simplify conditional logic in MSI cert deletion * Use pointer conversion functions that aren't deprecated * Respond to PR comments (and fix some other things along the way) - Move `clusterMsiResourceId` function to `OpenShiftCluster` type - When persisting the MSI cert to KV, use the `NotAfter` returned by the MSI RP (for the stub, just use an arbitrary value) - Move `getClientOptions` functionality to `AROEnvironment` type - Move logic for determining cluster MSI key vault name to `pkg/env` - Pull cloud name mapping stuff out to `AROEnvironment` type - Update msi-dataplane module to include new changes and use `UserAssignedIdentities` type to get Azure credential in `pkg/cluster/clustermsi.go` - Fix typo in https URL in comment in `pkg/cluster/delete.go` - Implement suggestion to use `errors.As` instead of a type assertion in `pkg/cluster/delete.go` * Update documentation with info about new feature flag - Move new cluster MSI steps forward in bootstrap step order - Move MSI dataplane client options stuff to pkg/env - Explicitly check for a single cluster MSI in `ClusterMsiResourceId` - Other small tweaks * Vendor in msi-dataplane update that prevents a potential nil pointer dereference * Add missing method to internal key vault client * Make error messages more specific in ClusterMsiResourceId * Add missing env vars to run-rp make target and uncomment dynamic validation bootstrap step - In newly added Azure clients, return struct types instead of interface types - Move cluster MSI certificate deletion to be after Azure resource deletion for safety just in case cx continues to use cluster that is in Failed/Deleting provisioning state * Add new env vars for MIWI to env.example for clarity/completeness * Turn check for nonzero number of user assigned identities into a utility function * Use existing constant for key vault dns suffix
2024-09-24 15:14:56 +03:00
"errors"
"sync"
2019-10-16 06:29:17 +03:00
"time"
Lay groundwork for cluster MSI usage (#3757) * Add a parameter for enabling Entra ID RBAC on key vaults * Add an RP-level feature flag for determining whether to use the mock MSI RP * Tweak the mock identity URL to play nicely with the mock MSI RP * Add Azure SDK client wrappers for new clients (federated identity credentials control plane and key vault data plane) * Vendor in new Azure SDK clients and update msi-dataplane * Lay groundwork for use of cluster MSI... - Initialize the MSI dataplane client, using the mock MSI RP/stub if appropriate - Initialize key vault store client (for MSI certificates; functionality is implemented in MSI dataplane module) - Create a cluster MSI certificate and store it in the key vault during cluster bootstrap - Instantiate an Azure SDK FederatedIdentityCredential client using the cluster MSI certificate - Delete the cluster MSI certificate as needed during cluster deletion * Don't fail during cluster deletion if the cluster MSI certificate is already gone from the key vault (or was potentially never created) * Establish an RP-Config variable for the MSI RP endpoint - Update doc comment for ensureClusterMsiCertificate - Simplify conditional logic in MSI cert deletion * Use pointer conversion functions that aren't deprecated * Respond to PR comments (and fix some other things along the way) - Move `clusterMsiResourceId` function to `OpenShiftCluster` type - When persisting the MSI cert to KV, use the `NotAfter` returned by the MSI RP (for the stub, just use an arbitrary value) - Move `getClientOptions` functionality to `AROEnvironment` type - Move logic for determining cluster MSI key vault name to `pkg/env` - Pull cloud name mapping stuff out to `AROEnvironment` type - Update msi-dataplane module to include new changes and use `UserAssignedIdentities` type to get Azure credential in `pkg/cluster/clustermsi.go` - Fix typo in https URL in comment in `pkg/cluster/delete.go` - Implement suggestion to use `errors.As` instead of a type assertion in `pkg/cluster/delete.go` * Update documentation with info about new feature flag - Move new cluster MSI steps forward in bootstrap step order - Move MSI dataplane client options stuff to pkg/env - Explicitly check for a single cluster MSI in `ClusterMsiResourceId` - Other small tweaks * Vendor in msi-dataplane update that prevents a potential nil pointer dereference * Add missing method to internal key vault client * Make error messages more specific in ClusterMsiResourceId * Add missing env vars to run-rp make target and uncomment dynamic validation bootstrap step - In newly added Azure clients, return struct types instead of interface types - Move cluster MSI certificate deletion to be after Azure resource deletion for safety just in case cx continues to use cluster that is in Failed/Deleting provisioning state * Add new env vars for MIWI to env.example for clarity/completeness * Turn check for nonzero number of user assigned identities into a utility function * Use existing constant for key vault dns suffix
2024-09-24 15:14:56 +03:00
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
2019-10-16 06:29:17 +03:00
)
// OpenShiftCluster represents an OpenShift cluster
type OpenShiftCluster struct {
MissingFields
2019-11-28 19:31:37 +03:00
// ID, Name and Type are cased as the user provided them at create time.
// ID, Name, Type and Location are immutable.
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Location string `json:"location,omitempty"`
SystemData SystemData `json:"systemData,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
Properties OpenShiftClusterProperties `json:"properties,omitempty"`
Identity *Identity `json:"identity,omitempty"`
//this property is used in the enrichers. Should not be marshalled
Lock sync.Mutex `json:"-"`
2019-10-16 06:29:17 +03:00
}
2024-07-26 19:44:14 +03:00
// UsesWorkloadIdentity checks whether a cluster is a Workload Identity cluster or a Service Principal cluster
func (oc *OpenShiftCluster) UsesWorkloadIdentity() bool {
return oc.Properties.PlatformWorkloadIdentityProfile != nil && oc.Properties.ServicePrincipalProfile == nil
}
Lay groundwork for cluster MSI usage (#3757) * Add a parameter for enabling Entra ID RBAC on key vaults * Add an RP-level feature flag for determining whether to use the mock MSI RP * Tweak the mock identity URL to play nicely with the mock MSI RP * Add Azure SDK client wrappers for new clients (federated identity credentials control plane and key vault data plane) * Vendor in new Azure SDK clients and update msi-dataplane * Lay groundwork for use of cluster MSI... - Initialize the MSI dataplane client, using the mock MSI RP/stub if appropriate - Initialize key vault store client (for MSI certificates; functionality is implemented in MSI dataplane module) - Create a cluster MSI certificate and store it in the key vault during cluster bootstrap - Instantiate an Azure SDK FederatedIdentityCredential client using the cluster MSI certificate - Delete the cluster MSI certificate as needed during cluster deletion * Don't fail during cluster deletion if the cluster MSI certificate is already gone from the key vault (or was potentially never created) * Establish an RP-Config variable for the MSI RP endpoint - Update doc comment for ensureClusterMsiCertificate - Simplify conditional logic in MSI cert deletion * Use pointer conversion functions that aren't deprecated * Respond to PR comments (and fix some other things along the way) - Move `clusterMsiResourceId` function to `OpenShiftCluster` type - When persisting the MSI cert to KV, use the `NotAfter` returned by the MSI RP (for the stub, just use an arbitrary value) - Move `getClientOptions` functionality to `AROEnvironment` type - Move logic for determining cluster MSI key vault name to `pkg/env` - Pull cloud name mapping stuff out to `AROEnvironment` type - Update msi-dataplane module to include new changes and use `UserAssignedIdentities` type to get Azure credential in `pkg/cluster/clustermsi.go` - Fix typo in https URL in comment in `pkg/cluster/delete.go` - Implement suggestion to use `errors.As` instead of a type assertion in `pkg/cluster/delete.go` * Update documentation with info about new feature flag - Move new cluster MSI steps forward in bootstrap step order - Move MSI dataplane client options stuff to pkg/env - Explicitly check for a single cluster MSI in `ClusterMsiResourceId` - Other small tweaks * Vendor in msi-dataplane update that prevents a potential nil pointer dereference * Add missing method to internal key vault client * Make error messages more specific in ClusterMsiResourceId * Add missing env vars to run-rp make target and uncomment dynamic validation bootstrap step - In newly added Azure clients, return struct types instead of interface types - Move cluster MSI certificate deletion to be after Azure resource deletion for safety just in case cx continues to use cluster that is in Failed/Deleting provisioning state * Add new env vars for MIWI to env.example for clarity/completeness * Turn check for nonzero number of user assigned identities into a utility function * Use existing constant for key vault dns suffix
2024-09-24 15:14:56 +03:00
// ClusterMsiResourceId returns the resource ID of the cluster MSI or an error
// if it encounters an issue while grabbing the resource ID from the cluster
// doc. It is written under the assumption that there is only one cluster MSI
// and will have to be refactored if we ever use more than one.
func (oc *OpenShiftCluster) ClusterMsiResourceId() (*arm.ResourceID, error) {
if !oc.HasUserAssignedIdentities() {
return nil, errors.New("could not find cluster MSI in cluster doc")
} else if len(oc.Identity.UserAssignedIdentities) > 1 {
return nil, errors.New("unexpectedly found more than one cluster MSI in cluster doc")
}
var msiResourceId string
for resourceId := range oc.Identity.UserAssignedIdentities {
msiResourceId = resourceId
}
return arm.ParseResourceID(msiResourceId)
}
// HasUserAssignedIdentities returns true if and only if the cluster doc's
// Identity.UserAssignedIdentities is non-nil and non-empty.
func (oc *OpenShiftCluster) HasUserAssignedIdentities() bool {
return oc.Identity != nil && oc.Identity.UserAssignedIdentities != nil && len(oc.Identity.UserAssignedIdentities) > 0
}
// CreatedByType by defines user type, which executed the request
// This field should match common-types field names for swagger and sdk generation
type CreatedByType string
const (
CreatedByTypeApplication CreatedByType = "Application"
CreatedByTypeKey CreatedByType = "Key"
CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
CreatedByTypeUser CreatedByType = "User"
)
// SystemData represets metadata provided by arm. Time fields inside the struct are pointers
// so we could better verify which fields are provided to use by ARM or not. Time package
// does not comply with omitempty. More details about requirements:
// https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources
type SystemData struct {
CreatedBy string `json:"createdBy,omitempty"`
CreatedByType CreatedByType `json:"createdByType,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
LastModifiedBy string `json:"lastModifiedBy,omitempty"`
LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"`
}
// SecureBytes represents an encrypted []byte
2020-01-23 14:53:53 +03:00
type SecureBytes []byte
// SecureString represents an encrypted string
2020-01-23 14:53:53 +03:00
type SecureString string
// OpenShiftClusterProperties represents an OpenShift cluster's properties
type OpenShiftClusterProperties struct {
2019-10-16 06:29:17 +03:00
MissingFields
2019-11-28 19:31:37 +03:00
// Provisioning state machine:
//
// From ARM's perspective, Succeeded and Failed are the only two terminal
// provisioning states for asynchronous operations. Clients will poll PUT,
// PATCH or DELETE operations until the resource gets to one of those
// provisioning states.
//
// ARO uses Creating, Updating and Deleting as non-terminal provisioning
// states to signal asynchronous operations from the front end to the back
// end.
//
// In case of failures, the back end sets failedProvisioningState to the
// provisioning state at the time of the failure.
//
// The ARO front end gates provisioning state machine transitions as
// follows:
//
// * no PUT, PATCH or DELETE is accepted unless the cluster is currently in
// a terminal provisioning state.
//
// * DELETE is always allowed regardless of the terminal provisioning state
// of the cluster.
//
// * PUT and PATCH are allowed as long as the cluster is in Succeeded
// provisioning state, or in a Failed provisioning state with the failed
// provisioning state to Updating.
//
// i.e. if a cluster creation or deletion fails, there is no remedy but to
// delete the cluster.
// LastProvisioningState allows the backend to see the last terminal
// ProvisioningState. When they complete, regardless of success, admin
// updates always reset the ProvisioningState to LastProvisioningState.
2020-10-31 22:42:32 +03:00
ArchitectureVersion ArchitectureVersion `json:"architectureVersion,omitempty"`
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
LastProvisioningState ProvisioningState `json:"lastProvisioningState,omitempty"`
FailedProvisioningState ProvisioningState `json:"failedProvisioningState,omitempty"`
LastAdminUpdateError string `json:"lastAdminUpdateError,omitempty"`
2021-09-28 03:50:16 +03:00
MaintenanceTask MaintenanceTask `json:"maintenanceTask,omitempty"`
2019-10-16 06:29:17 +03:00
2021-11-17 05:06:47 +03:00
// Operator feature/option flags
OperatorFlags OperatorFlags `json:"operatorFlags,omitempty"`
OperatorVersion string `json:"operatorVersion,omitempty"`
2021-11-17 05:06:47 +03:00
2021-01-13 15:31:19 +03:00
CreatedAt time.Time `json:"createdAt,omitempty"`
// CreatedBy is the RP version (Git commit hash) that created this cluster
CreatedBy string `json:"createdBy,omitempty"`
2020-11-05 18:25:04 +03:00
// ProvisionedBy is the RP version (Git commit hash) that last successfully
// admin updated this cluster
ProvisionedBy string `json:"provisionedBy,omitempty"`
2020-01-10 17:52:45 +03:00
ClusterProfile ClusterProfile `json:"clusterProfile,omitempty"`
2019-12-31 06:49:34 +03:00
FeatureProfile FeatureProfile `json:"featureProfile,omitempty"`
2020-01-16 18:16:50 +03:00
ConsoleProfile ConsoleProfile `json:"consoleProfile,omitempty"`
ServicePrincipalProfile *ServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"`
2019-11-18 06:07:44 +03:00
PlatformWorkloadIdentityProfile *PlatformWorkloadIdentityProfile `json:"platformWorkloadIdentityProfile,omitempty"`
2019-10-16 06:29:17 +03:00
NetworkProfile NetworkProfile `json:"networkProfile,omitempty"`
MasterProfile MasterProfile `json:"masterProfile,omitempty"`
// WorkerProfiles is used to store the worker profile data that was sent in the api request
2019-10-16 06:29:17 +03:00
WorkerProfiles []WorkerProfile `json:"workerProfiles,omitempty"`
// WorkerProfilesStatus is used to store the enriched worker profile data
WorkerProfilesStatus []WorkerProfile `json:"workerProfilesStatus,omitempty" swagger:"readOnly"`
2019-12-31 17:22:06 +03:00
APIServerProfile APIServerProfile `json:"apiserverProfile,omitempty"`
2019-12-31 23:45:25 +03:00
IngressProfiles []IngressProfile `json:"ingressProfiles,omitempty"`
// Install is non-nil only when an install is in progress
Install *Install `json:"install,omitempty"`
2019-10-16 06:29:17 +03:00
StorageSuffix string `json:"storageSuffix,omitempty"`
ImageRegistryStorageAccountName string `json:"imageRegistryStorageAccountName,omitempty"`
2019-10-16 06:29:17 +03:00
2021-05-12 14:11:13 +03:00
InfraID string `json:"infraId,omitempty"`
SSHKey SecureBytes `json:"sshKey,omitempty"`
2021-05-12 14:11:13 +03:00
// AdminKubeconfig is installer generated kubeconfig. It is 10 year config,
// and should never be returned to the user.
AdminKubeconfig SecureBytes `json:"adminKubeconfig,omitempty"`
// AROServiceKubeconfig is used by ARO services. In example monitor
AROServiceKubeconfig SecureBytes `json:"aroServiceKubeconfig,omitempty"`
// AROSREKubeconfig is used by portal when proxying request from SRE
AROSREKubeconfig SecureBytes `json:"aroSREKubeconfig,omitempty"`
// KubeadminPassword installer generated kube-admin password
2021-05-12 14:11:13 +03:00
KubeadminPassword SecureString `json:"kubeadminPassword,omitempty"`
// UserAdminKubeconfig is derived admin kubeConfig with shorter live span
UserAdminKubeconfig SecureBytes `json:"userAdminKubeconfig,omitempty"`
2020-03-21 04:57:07 +03:00
RegistryProfiles []*RegistryProfile `json:"registryProfiles,omitempty"`
HiveProfile HiveProfile `json:"hiveProfile,omitempty"`
2023-07-12 18:26:46 +03:00
MaintenanceState MaintenanceState `json:"maintenanceState,omitempty"`
2019-10-16 06:29:17 +03:00
}
// ProvisioningState represents a provisioning state
type ProvisioningState string
// ProvisioningState constants
// TODO: ProvisioningStateCanceled is included to pass upstream CI. It is currently unused in ARO.
2019-10-16 06:29:17 +03:00
const (
2020-01-24 14:19:56 +03:00
ProvisioningStateCreating ProvisioningState = "Creating"
ProvisioningStateUpdating ProvisioningState = "Updating"
ProvisioningStateAdminUpdating ProvisioningState = "AdminUpdating"
ProvisioningStateCanceled ProvisioningState = "Canceled"
2020-01-24 14:19:56 +03:00
ProvisioningStateDeleting ProvisioningState = "Deleting"
ProvisioningStateSucceeded ProvisioningState = "Succeeded"
ProvisioningStateFailed ProvisioningState = "Failed"
2019-10-16 06:29:17 +03:00
)
// MaintenanceState represents the maintenance state of a cluster.
// This is used by cluster monitornig stack to emit maintenance signals to customers.
type MaintenanceState string
const (
MaintenanceStateNone MaintenanceState = "None"
MaintenanceStatePending MaintenanceState = "Pending"
MaintenanceStatePlanned MaintenanceState = "Planned"
MaintenanceStateUnplanned MaintenanceState = "Unplanned"
MaintenanceStateCustomerActionNeeded MaintenanceState = "CustomerActionNeeded"
)
2021-09-28 03:50:16 +03:00
type MaintenanceTask string
const (
//
// Maintenance tasks that perform work on the cluster
//
MaintenanceTaskEverything MaintenanceTask = "Everything"
MaintenanceTaskOperator MaintenanceTask = "OperatorUpdate"
MaintenanceTaskRenewCerts MaintenanceTask = "CertificatesRenewal"
MaintenanceTaskSyncClusterObject MaintenanceTask = "SyncClusterObject"
//
// Maintenance tasks for updating customer maintenance signals
//
MaintenanceTaskPending MaintenanceTask = "Pending"
// None signal should only be used when (1) admin update fails and (2) SRE fixes the failed admin update without running another admin updates
// Admin update success should automatically set the cluster into None state
MaintenanceTaskNone MaintenanceTask = "None"
// Customer action needed signal should only be used when (1) admin update fails and (2) customer needs to take action to resolve the failure
// To remove the signal after customer takes action, use maintenance task None
MaintenanceTaskCustomerActionNeeded MaintenanceTask = "CustomerActionNeeded"
2021-09-28 03:50:16 +03:00
)
// IsMaintenanceOngoingTask returns true if the maintenance task should change state to maintenance ongoing (planned/unplanned)
func (t MaintenanceTask) IsMaintenanceOngoingTask() bool {
result := (t == MaintenanceTaskEverything) ||
(t == MaintenanceTaskOperator) ||
(t == MaintenanceTaskRenewCerts) ||
(t == "")
return result
}
2021-11-17 05:06:47 +03:00
// Cluster-scoped flags
type OperatorFlags map[string]string
2020-02-18 18:06:47 +03:00
// IsTerminal returns true if state is Terminal
func (t ProvisioningState) IsTerminal() bool {
return ProvisioningStateFailed == t || ProvisioningStateSucceeded == t
}
func (t ProvisioningState) String() string {
return string(t)
}
2021-09-07 20:16:00 +03:00
// FipsValidatedModules determines if FIPS is used.
type FipsValidatedModules string
// FipsValidatedModules constants.
const (
FipsValidatedModulesEnabled FipsValidatedModules = "Enabled"
FipsValidatedModulesDisabled FipsValidatedModules = "Disabled"
)
// OIDCIssuer represents the URL of the managed OIDC issuer in a workload identity cluster.
type OIDCIssuer string
2020-01-10 17:52:45 +03:00
// ClusterProfile represents a cluster profile.
type ClusterProfile struct {
MissingFields
PullSecret SecureString `json:"pullSecret,omitempty"`
Domain string `json:"domain,omitempty"`
Version string `json:"version,omitempty"`
ResourceGroupID string `json:"resourceGroupId,omitempty"`
FipsValidatedModules FipsValidatedModules `json:"fipsValidatedModules,omitempty"`
OIDCIssuer *OIDCIssuer `json:"oidcIssuer,omitempty"`
BoundServiceAccountSigningKey *SecureString `json:"boundServiceAccountSigningKey,omitempty"`
2020-01-10 17:52:45 +03:00
}
// FeatureProfile represents a feature profile.
type FeatureProfile struct {
MissingFields
GatewayEnabled bool `json:"gatewayEnabled,omitempty"`
}
2020-01-16 18:16:50 +03:00
// ConsoleProfile represents a console profile.
type ConsoleProfile struct {
MissingFields
URL string `json:"url,omitempty"`
}
2019-11-18 06:07:44 +03:00
// ServicePrincipalProfile represents a service principal profile.
type ServicePrincipalProfile struct {
2019-11-21 05:32:34 +03:00
MissingFields
2020-01-23 14:53:53 +03:00
ClientID string `json:"clientId,omitempty"`
ClientSecret SecureString `json:"clientSecret,omitempty"`
2021-02-15 22:22:40 +03:00
SPObjectID string `json:"spObjectId,omitempty"`
2019-11-18 06:07:44 +03:00
}
2021-08-05 10:36:13 +03:00
// SoftwareDefinedNetwork
type SoftwareDefinedNetwork string
2021-07-07 15:35:48 +03:00
2021-07-19 10:57:18 +03:00
const (
2021-08-05 10:36:13 +03:00
SoftwareDefinedNetworkOVNKubernetes SoftwareDefinedNetwork = "OVNKubernetes"
SoftwareDefinedNetworkOpenShiftSDN SoftwareDefinedNetwork = "OpenShiftSDN"
2021-07-19 10:57:18 +03:00
)
2022-01-07 01:42:44 +03:00
// MTUSize represents the MTU size of a cluster
type MTUSize int
// MTUSize constants
const (
MTU1500 MTUSize = 1500
MTU3900 MTUSize = 3900
)
// The outbound routing strategy used to provide your cluster egress to the internet.
2022-08-30 19:00:33 +03:00
type OutboundType string
// OutboundType constants
const (
OutboundTypeUserDefinedRouting OutboundType = "UserDefinedRouting"
OutboundTypeLoadbalancer OutboundType = "Loadbalancer"
)
// ResourceReference represents a reference to an Azure resource.
type ResourceReference struct {
// The fully qualified Azure resource id of an IP address resource.
ID string `json:"id,omitempty"`
}
// LoadBalancerProfile represents the profile of the cluster public load balancer.
type LoadBalancerProfile struct {
// The desired managed outbound IPs for the cluster public load balancer.
ManagedOutboundIPs *ManagedOutboundIPs `json:"managedOutboundIps,omitempty"`
// The list of effective outbound IP addresses of the public load balancer.
EffectiveOutboundIPs []EffectiveOutboundIP `json:"effectiveOutboundIps,omitempty" swagger:"readOnly"`
// The desired outbound IP resources for the cluster load balancer.
OutboundIPs []OutboundIP `json:"outboundIps,omitempty"`
// The desired outbound IP Prefix resources for the cluster load balancer.
OutboundIPPrefixes []OutboundIPPrefix `json:"outboundIpPrefixes,omitempty"`
// The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 1024.
AllocatedOutboundPorts *int `json:"allocatedOutboundPorts,omitempty"`
}
// EffectiveOutboundIP represents an effective outbound IP resource of the cluster public load balancer.
type EffectiveOutboundIP ResourceReference
// ManagedOutboundIPs represents the desired managed outbound IPs for the cluster public load balancer.
type ManagedOutboundIPs struct {
// Count represents the desired number of IPv4 outbound IPs created and managed by Azure for the cluster public load balancer. Allowed values are in the range of 1 - 20. The default value is 1.
Count int `json:"count,omitempty"`
}
// OutboundIP represents a desired outbound IP resource for the cluster load balancer.
type OutboundIP ResourceReference
// OutboundIPPrefix represents a desired outbound IP Prefix resource for the cluster load balancer.
type OutboundIPPrefix ResourceReference
2019-11-18 06:07:44 +03:00
// NetworkProfile represents a network profile
2019-10-16 06:29:17 +03:00
type NetworkProfile struct {
2019-11-21 05:32:34 +03:00
MissingFields
2021-08-05 10:36:13 +03:00
PodCIDR string `json:"podCidr,omitempty"`
ServiceCIDR string `json:"serviceCidr,omitempty"`
SoftwareDefinedNetwork SoftwareDefinedNetwork `json:"softwareDefinedNetwork,omitempty"`
2022-01-07 01:42:44 +03:00
MTUSize MTUSize `json:"mtuSize,omitempty"`
OutboundType OutboundType `json:"outboundType,omitempty"`
APIServerPrivateEndpointIP string `json:"privateEndpointIp,omitempty"`
GatewayPrivateEndpointIP string `json:"gatewayPrivateEndpointIp,omitempty"`
GatewayPrivateLinkID string `json:"gatewayPrivateLinkId,omitempty"`
PreconfiguredNSG PreconfiguredNSG `json:"preconfiguredNSG,omitempty"`
LoadBalancerProfile *LoadBalancerProfile `json:"loadBalancerProfile,omitempty"`
2019-10-16 06:29:17 +03:00
}
// IP address ranges internally used by ARO
var (
JoinCIDRRange []string = []string{
"100.64.0.0/16",
"169.254.169.0/29",
"100.88.0.0/16",
}
)
2023-05-15 21:37:59 +03:00
// PreconfiguredNSG represents whether customers want to use their own NSG attached to the subnets
type PreconfiguredNSG string
// PreconfiguredNSG constants
const (
PreconfiguredNSGEnabled PreconfiguredNSG = "Enabled"
PreconfiguredNSGDisabled PreconfiguredNSG = "Disabled"
)
2021-08-04 10:58:27 +03:00
// EncryptionAtHost represents encryption at host.
type EncryptionAtHost string
// EncryptionAtHost constants
const (
EncryptionAtHostEnabled EncryptionAtHost = "Enabled"
EncryptionAtHostDisabled EncryptionAtHost = "Disabled"
)
2019-10-16 06:29:17 +03:00
// MasterProfile represents a master profile
type MasterProfile struct {
2019-11-21 05:32:34 +03:00
MissingFields
2021-08-04 10:58:27 +03:00
VMSize VMSize `json:"vmSize,omitempty"`
SubnetID string `json:"subnetId,omitempty"`
EncryptionAtHost EncryptionAtHost `json:"encryptionAtHost,omitempty"`
DiskEncryptionSetID string `json:"diskEncryptionSetId,omitempty"`
2019-10-16 06:29:17 +03:00
}
// VMSize represents a VM size
type VMSize string
// VMSize constants
// add required resources in pkg/validate/dynamic/quota.go when adding a new VMSize
2019-10-16 06:29:17 +03:00
const (
2023-03-06 18:12:01 +03:00
VMSizeStandardD2sV3 VMSize = "Standard_D2s_v3"
VMSizeStandardD4sV3 VMSize = "Standard_D4s_v3"
VMSizeStandardD8sV3 VMSize = "Standard_D8s_v3"
VMSizeStandardD16sV3 VMSize = "Standard_D16s_v3"
VMSizeStandardD32sV3 VMSize = "Standard_D32s_v3"
VMSizeStandardD4sV4 VMSize = "Standard_D4s_v4"
VMSizeStandardD8sV4 VMSize = "Standard_D8s_v4"
VMSizeStandardD16sV4 VMSize = "Standard_D16s_v4"
VMSizeStandardD32sV4 VMSize = "Standard_D32s_v4"
VMSizeStandardD64sV4 VMSize = "Standard_D64s_v4"
VMSizeStandardD4sV5 VMSize = "Standard_D4s_v5"
VMSizeStandardD8sV5 VMSize = "Standard_D8s_v5"
VMSizeStandardD16sV5 VMSize = "Standard_D16s_v5"
VMSizeStandardD32sV5 VMSize = "Standard_D32s_v5"
VMSizeStandardD64sV5 VMSize = "Standard_D64s_v5"
VMSizeStandardD96sV5 VMSize = "Standard_D96s_v5"
2020-04-16 04:42:36 +03:00
VMSizeStandardD4asV4 VMSize = "Standard_D4as_v4"
VMSizeStandardD8asV4 VMSize = "Standard_D8as_v4"
VMSizeStandardD16asV4 VMSize = "Standard_D16as_v4"
VMSizeStandardD32asV4 VMSize = "Standard_D32as_v4"
2023-03-06 18:12:01 +03:00
VMSizeStandardD64asV4 VMSize = "Standard_D64as_v4"
VMSizeStandardD96asV4 VMSize = "Standard_D96as_v4"
VMSizeStandardD4asV5 VMSize = "Standard_D4as_v5"
VMSizeStandardD8asV5 VMSize = "Standard_D8as_v5"
VMSizeStandardD16asV5 VMSize = "Standard_D16as_v5"
VMSizeStandardD32asV5 VMSize = "Standard_D32as_v5"
VMSizeStandardD64asV5 VMSize = "Standard_D64as_v5"
VMSizeStandardD96asV5 VMSize = "Standard_D96as_v5"
VMSizeStandardD4dsV5 VMSize = "Standard_D4ds_v5"
VMSizeStandardD8dsV5 VMSize = "Standard_D8ds_v5"
VMSizeStandardD16dsV5 VMSize = "Standard_D16ds_v5"
VMSizeStandardD32dsV5 VMSize = "Standard_D32ds_v5"
VMSizeStandardD64dsV5 VMSize = "Standard_D64ds_v5"
VMSizeStandardD96dsV5 VMSize = "Standard_D96ds_v5"
2023-03-06 18:12:01 +03:00
VMSizeStandardE4sV3 VMSize = "Standard_E4s_v3"
VMSizeStandardE8sV3 VMSize = "Standard_E8s_v3"
VMSizeStandardE16sV3 VMSize = "Standard_E16s_v3"
VMSizeStandardE32sV3 VMSize = "Standard_E32s_v3"
VMSizeStandardE2sV4 VMSize = "Standard_E2s_v4"
VMSizeStandardE4sV4 VMSize = "Standard_E4s_v4"
VMSizeStandardE8sV4 VMSize = "Standard_E8s_v4"
VMSizeStandardE16sV4 VMSize = "Standard_E16s_v4"
VMSizeStandardE20sV4 VMSize = "Standard_E20s_v4"
VMSizeStandardE32sV4 VMSize = "Standard_E32s_v4"
VMSizeStandardE48sV4 VMSize = "Standard_E48s_v4"
VMSizeStandardE64sV4 VMSize = "Standard_E64s_v4"
VMSizeStandardE2sV5 VMSize = "Standard_E2s_v5"
VMSizeStandardE4sV5 VMSize = "Standard_E4s_v5"
VMSizeStandardE8sV5 VMSize = "Standard_E8s_v5"
VMSizeStandardE16sV5 VMSize = "Standard_E16s_v5"
VMSizeStandardE20sV5 VMSize = "Standard_E20s_v5"
VMSizeStandardE32sV5 VMSize = "Standard_E32s_v5"
VMSizeStandardE48sV5 VMSize = "Standard_E48s_v5"
VMSizeStandardE64sV5 VMSize = "Standard_E64s_v5"
VMSizeStandardE96sV5 VMSize = "Standard_E96s_v5"
VMSizeStandardE4asV4 VMSize = "Standard_E4as_v4"
VMSizeStandardE8asV4 VMSize = "Standard_E8as_v4"
VMSizeStandardE16asV4 VMSize = "Standard_E16as_v4"
VMSizeStandardE20asV4 VMSize = "Standard_E20as_v4"
VMSizeStandardE32asV4 VMSize = "Standard_E32as_v4"
VMSizeStandardE48asV4 VMSize = "Standard_E48as_v4"
VMSizeStandardE64asV4 VMSize = "Standard_E64as_v4"
VMSizeStandardE96asV4 VMSize = "Standard_E96as_v4"
VMSizeStandardE8asV5 VMSize = "Standard_E8as_v5"
VMSizeStandardE16asV5 VMSize = "Standard_E16as_v5"
VMSizeStandardE20asV5 VMSize = "Standard_E20as_v5"
VMSizeStandardE32asV5 VMSize = "Standard_E32as_v5"
VMSizeStandardE48asV5 VMSize = "Standard_E48as_v5"
VMSizeStandardE64asV5 VMSize = "Standard_E64as_v5"
VMSizeStandardE96asV5 VMSize = "Standard_E96as_v5"
2020-04-16 04:42:36 +03:00
VMSizeStandardE64isV3 VMSize = "Standard_E64is_v3"
VMSizeStandardE80isV4 VMSize = "Standard_E80is_v4"
VMSizeStandardE80idsV4 VMSize = "Standard_E80ids_v4"
2023-03-06 18:12:01 +03:00
VMSizeStandardE96dsV5 VMSize = "Standard_E96ds_v5"
VMSizeStandardE104isV5 VMSize = "Standard_E104is_v5"
VMSizeStandardE104idsV5 VMSize = "Standard_E104ids_v5"
2020-04-16 04:42:36 +03:00
VMSizeStandardF4sV2 VMSize = "Standard_F4s_v2"
VMSizeStandardF8sV2 VMSize = "Standard_F8s_v2"
VMSizeStandardF16sV2 VMSize = "Standard_F16s_v2"
VMSizeStandardF32sV2 VMSize = "Standard_F32s_v2"
2021-06-09 18:07:27 +03:00
VMSizeStandardF72sV2 VMSize = "Standard_F72s_v2"
VMSizeStandardM128ms VMSize = "Standard_M128ms"
2023-03-06 18:12:01 +03:00
VMSizeStandardL4s VMSize = "Standard_L4s"
VMSizeStandardL8s VMSize = "Standard_L8s"
VMSizeStandardL16s VMSize = "Standard_L16s"
VMSizeStandardL32s VMSize = "Standard_L32s"
VMSizeStandardL8sV2 VMSize = "Standard_L8s_v2"
VMSizeStandardL16sV2 VMSize = "Standard_L16s_v2"
VMSizeStandardL32sV2 VMSize = "Standard_L32s_v2"
VMSizeStandardL48sV2 VMSize = "Standard_L48s_v2"
VMSizeStandardL64sV2 VMSize = "Standard_L64s_v2"
2022-09-15 20:42:38 +03:00
2023-03-06 18:12:01 +03:00
VMSizeStandardL8sV3 VMSize = "Standard_L8s_v3"
VMSizeStandardL16sV3 VMSize = "Standard_L16s_v3"
VMSizeStandardL32sV3 VMSize = "Standard_L32s_v3"
VMSizeStandardL48sV3 VMSize = "Standard_L48s_v3"
VMSizeStandardL64sV3 VMSize = "Standard_L64s_v3"
2022-09-15 20:42:38 +03:00
// GPU VMs
VMSizeStandardNC4asT4V3 VMSize = "Standard_NC4as_T4_v3"
VMSizeStandardNC8asT4V3 VMSize = "Standard_NC8as_T4_v3"
VMSizeStandardNC16asT4V3 VMSize = "Standard_NC16as_T4_v3"
VMSizeStandardNC64asT4V3 VMSize = "Standard_NC64as_T4_v3"
2023-02-08 02:06:33 +03:00
VMSizeStandardNC6sV3 VMSize = "Standard_NC6s_v3"
VMSizeStandardNC12sV3 VMSize = "Standard_NC12s_v3"
VMSizeStandardNC24sV3 VMSize = "Standard_NC24s_v3"
VMSizeStandardNC24rsV3 VMSize = "Standard_NC24rs_v3"
2019-10-16 06:29:17 +03:00
)
2023-01-05 11:41:43 +03:00
type VMSizeStruct struct {
CoreCount int `json:"coreCount,omitempty"`
Family string `json:"family,omitempty"`
2023-01-05 11:41:43 +03:00
}
var (
2023-03-06 18:12:01 +03:00
VMSizeStandardD2sV3Struct = VMSizeStruct{CoreCount: 2, Family: standardDSv3}
VMSizeStandardD4sV3Struct = VMSizeStruct{CoreCount: 4, Family: standardDSv3}
VMSizeStandardD8sV3Struct = VMSizeStruct{CoreCount: 8, Family: standardDSv3}
VMSizeStandardD16sV3Struct = VMSizeStruct{CoreCount: 16, Family: standardDSv3}
VMSizeStandardD32sV3Struct = VMSizeStruct{CoreCount: 32, Family: standardDSv3}
VMSizeStandardD4sV4Struct = VMSizeStruct{CoreCount: 4, Family: standardDSv4}
VMSizeStandardD8sV4Struct = VMSizeStruct{CoreCount: 8, Family: standardDSv4}
VMSizeStandardD16sV4Struct = VMSizeStruct{CoreCount: 16, Family: standardDSv4}
VMSizeStandardD32sV4Struct = VMSizeStruct{CoreCount: 32, Family: standardDSv4}
VMSizeStandardD64sV4Struct = VMSizeStruct{CoreCount: 64, Family: standardDSv4}
VMSizeStandardD4sV5Struct = VMSizeStruct{CoreCount: 4, Family: standardDSv5}
VMSizeStandardD8sV5Struct = VMSizeStruct{CoreCount: 8, Family: standardDSv5}
VMSizeStandardD16sV5Struct = VMSizeStruct{CoreCount: 16, Family: standardDSv5}
VMSizeStandardD32sV5Struct = VMSizeStruct{CoreCount: 32, Family: standardDSv5}
VMSizeStandardD64sV5Struct = VMSizeStruct{CoreCount: 64, Family: standardDSv5}
VMSizeStandardD96sV5Struct = VMSizeStruct{CoreCount: 96, Family: standardDSv5}
2023-01-05 11:41:43 +03:00
VMSizeStandardD4asV4Struct = VMSizeStruct{CoreCount: 4, Family: standardDASv4}
VMSizeStandardD8asV4Struct = VMSizeStruct{CoreCount: 8, Family: standardDASv4}
VMSizeStandardD16asV4Struct = VMSizeStruct{CoreCount: 16, Family: standardDASv4}
VMSizeStandardD32asV4Struct = VMSizeStruct{CoreCount: 32, Family: standardDASv4}
2023-03-06 18:12:01 +03:00
VMSizeStandardD64asV4Struct = VMSizeStruct{CoreCount: 64, Family: standardDASv4}
VMSizeStandardD96asV4Struct = VMSizeStruct{CoreCount: 96, Family: standardDASv4}
VMSizeStandardD4asV5Struct = VMSizeStruct{CoreCount: 4, Family: standardDASv5}
VMSizeStandardD8asV5Struct = VMSizeStruct{CoreCount: 8, Family: standardDASv5}
VMSizeStandardD16asV5Struct = VMSizeStruct{CoreCount: 16, Family: standardDASv5}
VMSizeStandardD32asV5Struct = VMSizeStruct{CoreCount: 32, Family: standardDASv5}
VMSizeStandardD64asV5Struct = VMSizeStruct{CoreCount: 64, Family: standardDASv5}
VMSizeStandardD96asV5Struct = VMSizeStruct{CoreCount: 96, Family: standardDASv5}
VMSizeStandardD4dsV5Struct = VMSizeStruct{CoreCount: 4, Family: standardDDSv5}
VMSizeStandardD8dsV5Struct = VMSizeStruct{CoreCount: 8, Family: standardDDSv5}
VMSizeStandardD16dsV5Struct = VMSizeStruct{CoreCount: 16, Family: standardDDSv5}
VMSizeStandardD32dsV5Struct = VMSizeStruct{CoreCount: 32, Family: standardDDSv5}
VMSizeStandardD64dsV5Struct = VMSizeStruct{CoreCount: 64, Family: standardDDSv5}
VMSizeStandardD96dsV5Struct = VMSizeStruct{CoreCount: 96, Family: standardDDSv5}
2023-03-06 18:12:01 +03:00
VMSizeStandardE4sV3Struct = VMSizeStruct{CoreCount: 4, Family: standardESv3}
VMSizeStandardE8sV3Struct = VMSizeStruct{CoreCount: 8, Family: standardESv3}
VMSizeStandardE16sV3Struct = VMSizeStruct{CoreCount: 16, Family: standardESv3}
VMSizeStandardE32sV3Struct = VMSizeStruct{CoreCount: 32, Family: standardESv3}
VMSizeStandardE2sV4Struct = VMSizeStruct{CoreCount: 2, Family: standardESv4}
VMSizeStandardE4sV4Struct = VMSizeStruct{CoreCount: 4, Family: standardESv4}
VMSizeStandardE8sV4Struct = VMSizeStruct{CoreCount: 8, Family: standardESv4}
VMSizeStandardE16sV4Struct = VMSizeStruct{CoreCount: 16, Family: standardESv4}
VMSizeStandardE20sV4Struct = VMSizeStruct{CoreCount: 20, Family: standardESv4}
VMSizeStandardE32sV4Struct = VMSizeStruct{CoreCount: 32, Family: standardESv4}
VMSizeStandardE48sV4Struct = VMSizeStruct{CoreCount: 48, Family: standardESv4}
VMSizeStandardE64sV4Struct = VMSizeStruct{CoreCount: 64, Family: standardESv4}
VMSizeStandardE2sV5Struct = VMSizeStruct{CoreCount: 2, Family: standardESv5}
VMSizeStandardE4sV5Struct = VMSizeStruct{CoreCount: 4, Family: standardESv5}
VMSizeStandardE8sV5Struct = VMSizeStruct{CoreCount: 8, Family: standardESv5}
VMSizeStandardE16sV5Struct = VMSizeStruct{CoreCount: 16, Family: standardESv5}
VMSizeStandardE20sV5Struct = VMSizeStruct{CoreCount: 20, Family: standardESv5}
VMSizeStandardE32sV5Struct = VMSizeStruct{CoreCount: 32, Family: standardESv5}
VMSizeStandardE48sV5Struct = VMSizeStruct{CoreCount: 48, Family: standardESv5}
VMSizeStandardE64sV5Struct = VMSizeStruct{CoreCount: 64, Family: standardESv5}
VMSizeStandardE96sV5Struct = VMSizeStruct{CoreCount: 96, Family: standardESv5}
VMSizeStandardE4asV4Struct = VMSizeStruct{CoreCount: 4, Family: standardEASv4}
VMSizeStandardE8asV4Struct = VMSizeStruct{CoreCount: 8, Family: standardEASv4}
VMSizeStandardE16asV4Struct = VMSizeStruct{CoreCount: 16, Family: standardEASv4}
VMSizeStandardE20asV4Struct = VMSizeStruct{CoreCount: 20, Family: standardEASv4}
VMSizeStandardE32asV4Struct = VMSizeStruct{CoreCount: 32, Family: standardEASv4}
VMSizeStandardE48asV4Struct = VMSizeStruct{CoreCount: 48, Family: standardEASv4}
VMSizeStandardE64asV4Struct = VMSizeStruct{CoreCount: 64, Family: standardEASv4}
VMSizeStandardE96asV4Struct = VMSizeStruct{CoreCount: 96, Family: standardEASv4}
VMSizeStandardE8asV5Struct = VMSizeStruct{CoreCount: 8, Family: standardEASv5}
VMSizeStandardE16asV5Struct = VMSizeStruct{CoreCount: 16, Family: standardEASv5}
VMSizeStandardE20asV5Struct = VMSizeStruct{CoreCount: 20, Family: standardEASv5}
VMSizeStandardE32asV5Struct = VMSizeStruct{CoreCount: 32, Family: standardEASv5}
VMSizeStandardE48asV5Struct = VMSizeStruct{CoreCount: 48, Family: standardEASv5}
VMSizeStandardE64asV5Struct = VMSizeStruct{CoreCount: 64, Family: standardEASv5}
VMSizeStandardE96asV5Struct = VMSizeStruct{CoreCount: 96, Family: standardEASv5}
2023-01-05 11:41:43 +03:00
VMSizeStandardE64isV3Struct = VMSizeStruct{CoreCount: 64, Family: standardESv3}
VMSizeStandardE80isV4Struct = VMSizeStruct{CoreCount: 80, Family: standardEISv4}
VMSizeStandardE80idsV4Struct = VMSizeStruct{CoreCount: 80, Family: standardEIDSv4}
2023-03-06 18:12:01 +03:00
VMSizeStandardE96dsV5Struct = VMSizeStruct{CoreCount: 96, Family: standardEDSv5}
2023-01-05 11:41:43 +03:00
VMSizeStandardE104isV5Struct = VMSizeStruct{CoreCount: 104, Family: standardEISv5}
VMSizeStandardE104idsV5Struct = VMSizeStruct{CoreCount: 104, Family: standardEIDSv5}
VMSizeStandardF4sV2Struct = VMSizeStruct{CoreCount: 4, Family: standardFSv2}
VMSizeStandardF8sV2Struct = VMSizeStruct{CoreCount: 8, Family: standardFSv2}
VMSizeStandardF16sV2Struct = VMSizeStruct{CoreCount: 16, Family: standardFSv2}
VMSizeStandardF32sV2Struct = VMSizeStruct{CoreCount: 32, Family: standardFSv2}
VMSizeStandardF72sV2Struct = VMSizeStruct{CoreCount: 72, Family: standardFSv2}
VMSizeStandardM128msStruct = VMSizeStruct{CoreCount: 128, Family: standardMS}
2023-03-06 18:12:01 +03:00
VMSizeStandardL4sStruct = VMSizeStruct{CoreCount: 4, Family: standardLSv2}
VMSizeStandardL8sStruct = VMSizeStruct{CoreCount: 8, Family: standardLSv2}
VMSizeStandardL16sStruct = VMSizeStruct{CoreCount: 16, Family: standardLSv2}
VMSizeStandardL32sStruct = VMSizeStruct{CoreCount: 32, Family: standardLSv2}
2023-01-05 11:41:43 +03:00
VMSizeStandardL8sV2Struct = VMSizeStruct{CoreCount: 8, Family: standardLSv2}
VMSizeStandardL16sV2Struct = VMSizeStruct{CoreCount: 16, Family: standardLSv2}
VMSizeStandardL32sV2Struct = VMSizeStruct{CoreCount: 32, Family: standardLSv2}
VMSizeStandardL48sV2Struct = VMSizeStruct{CoreCount: 48, Family: standardLSv2}
VMSizeStandardL64sV2Struct = VMSizeStruct{CoreCount: 64, Family: standardLSv2}
2023-03-06 18:12:01 +03:00
VMSizeStandardL8sV3Struct = VMSizeStruct{CoreCount: 8, Family: standardLSv3}
VMSizeStandardL16sV3Struct = VMSizeStruct{CoreCount: 16, Family: standardLSv3}
VMSizeStandardL32sV3Struct = VMSizeStruct{CoreCount: 32, Family: standardLSv3}
VMSizeStandardL48sV3Struct = VMSizeStruct{CoreCount: 48, Family: standardLSv3}
VMSizeStandardL64sV3Struct = VMSizeStruct{CoreCount: 64, Family: standardLSv3}
2023-01-05 11:41:43 +03:00
//Struct GPU nodes
//Struct the formatting of the ncasv3_t4 family is different. This can be seen through a
//Struct az vm list-usage -l eastus
VMSizeStandardNC4asT4V3Struct = VMSizeStruct{CoreCount: 4, Family: standardNCAS}
VMSizeStandardNC8asT4V3Struct = VMSizeStruct{CoreCount: 8, Family: standardNCAS}
VMSizeStandardNC16asT4V3Struct = VMSizeStruct{CoreCount: 16, Family: standardNCAS}
VMSizeStandardNC64asT4V3Struct = VMSizeStruct{CoreCount: 64, Family: standardNCAS}
2023-02-08 02:06:33 +03:00
VMSizeStandardNC6sV3Struct = VMSizeStruct{CoreCount: 6, Family: standardNCSv3}
VMSizeStandardNC12sV3Struct = VMSizeStruct{CoreCount: 12, Family: standardNCSv3}
VMSizeStandardNC24sV3Struct = VMSizeStruct{CoreCount: 24, Family: standardNCSv3}
VMSizeStandardNC24rsV3Struct = VMSizeStruct{CoreCount: 24, Family: standardNCSv3}
2023-01-05 11:41:43 +03:00
)
const (
2023-03-06 18:12:01 +03:00
standardDSv3 = "standardDSv3Family"
standardDSv4 = "standardDSv4Family"
standardDSv5 = "standardDSv5Family"
standardDASv4 = "standardDASv4Family"
standardDASv5 = "standardDASv5Family"
standardDDSv5 = "standardDDSv5Family"
2023-03-06 18:12:01 +03:00
standardESv3 = "standardESv3Family"
standardESv4 = "standardESv4Family"
standardESv5 = "standardESv5Family"
standardEASv4 = "standardEASv4Family"
standardEASv5 = "standardEASv5Family"
standardEISv4 = "standardEISv4Family"
standardEIDSv4 = "standardEIDSv4Family"
standardEISv5 = "standardEISv5Family"
standardEDSv5 = "standardEDSv5Family"
standardEIDSv5 = "standardEIDSv5Family"
standardEIDv5 = "standardEIDv5Family"
standardFSv2 = "standardFSv2Family"
standardMS = "standardMSFamily"
standardLSv2 = "standardLsv2Family"
standardLSv3 = "standardLsv3Family"
standardNCAS = "Standard NCASv3_T4 Family"
standardNCSv3 = "Standard NCSv3 Family"
2023-01-05 11:41:43 +03:00
)
2019-10-16 06:29:17 +03:00
// WorkerProfile represents a worker profile
type WorkerProfile struct {
2019-11-21 05:32:34 +03:00
MissingFields
2021-08-04 10:58:27 +03:00
Name string `json:"name,omitempty"`
VMSize VMSize `json:"vmSize,omitempty"`
DiskSizeGB int `json:"diskSizeGB,omitempty"`
SubnetID string `json:"subnetId,omitempty"`
Count int `json:"count,omitempty"`
EncryptionAtHost EncryptionAtHost `json:"encryptionAtHost,omitempty"`
DiskEncryptionSetID string `json:"diskEncryptionSetId,omitempty"`
2019-10-16 06:29:17 +03:00
}
// GetEnrichedWorkerProfiles returns WorkerProfilesStatus if not nil, otherwise WorkerProfiles
// with their respective json property name
func GetEnrichedWorkerProfiles(ocp OpenShiftClusterProperties) ([]WorkerProfile, string) {
if ocp.WorkerProfilesStatus != nil {
return ocp.WorkerProfilesStatus, "workerProfilesStatus"
}
return ocp.WorkerProfiles, "workerProfiles"
}
2019-12-31 17:22:06 +03:00
// APIServerProfile represents an API server profile
type APIServerProfile struct {
MissingFields
Visibility Visibility `json:"visibility,omitempty"`
URL string `json:"url,omitempty"`
IP string `json:"ip,omitempty"`
2021-02-06 20:16:17 +03:00
IntIP string `json:"intIp,omitempty"`
2019-12-31 17:22:06 +03:00
}
// Visibility represents visibility.
type Visibility string
// Visibility constants
const (
VisibilityPublic Visibility = "Public"
VisibilityPrivate Visibility = "Private"
)
2019-12-31 23:45:25 +03:00
// IngressProfile represents an ingress profile
type IngressProfile struct {
MissingFields
Name string `json:"name,omitempty"`
Visibility Visibility `json:"visibility,omitempty"`
IP string `json:"ip,omitempty"`
2019-12-31 23:45:25 +03:00
}
// RegistryProfile represents a registry's login
type RegistryProfile struct {
MissingFields
Name string `json:"name,omitempty"`
Username string `json:"username,omitempty"`
Password SecureString `json:"password,omitempty"`
}
// Install represents an install process
type Install struct {
2019-10-16 06:29:17 +03:00
MissingFields
Now time.Time `json:"now,omitempty"`
Phase InstallPhase `json:"phase"`
2019-10-16 06:29:17 +03:00
}
// InstallPhase represents an install phase
type InstallPhase int
2019-10-16 06:29:17 +03:00
// InstallPhase constants
2019-10-16 06:29:17 +03:00
const (
InstallPhaseBootstrap InstallPhase = iota
InstallPhaseRemoveBootstrap
2019-10-16 06:29:17 +03:00
)
2020-10-31 22:42:32 +03:00
// ArchitectureVersion represents an architecture version
type ArchitectureVersion int
// ArchitectureVersion constants
const (
// ArchitectureVersionV1: 4.3, 4.4: 2 load balancers, 2 NSGs
ArchitectureVersionV1 ArchitectureVersion = iota
2020-10-31 23:31:10 +03:00
// ArchitectureVersionV2: 4.5: 1 load balancer, 1 NSG
ArchitectureVersionV2
2020-10-31 22:42:32 +03:00
)
// HiveProfile represents the hive related data of a cluster
type HiveProfile struct {
MissingFields
Namespace string `json:"namespace,omitempty"`
// CreatedByHive is used during PUCM to skip adoption and reconciliation
// of clusters that were created by Hive to avoid deleting existing
// ClusterDeployments.
CreatedByHive bool `json:"createdByHive,omitempty"`
}
// PlatformWorkloadIdentityProfile encapsulates all information that is specific to workload identity clusters.
type PlatformWorkloadIdentityProfile struct {
MissingFields
UpgradeableTo *UpgradeableTo `json:"upgradeableTo,omitempty"`
PlatformWorkloadIdentities []PlatformWorkloadIdentity `json:"platformWorkloadIdentities,omitempty"`
}
2024-05-30 20:48:54 +03:00
// UpgradeableTo stores a single OpenShift version a workload identity cluster can be upgraded to
type UpgradeableTo string
// PlatformWorkloadIdentity stores information representing a single workload identity.
type PlatformWorkloadIdentity struct {
MissingFields
OperatorName string `json:"operatorName,omitempty"`
ResourceID string `json:"resourceId,omitempty"`
ClientID string `json:"clientId,omitempty" swagger:"readOnly"`
ObjectID string `json:"objectId,omitempty" swagger:"readOnly"`
}
// ClusterUserAssignedIdentity stores information about a user-assigned managed identity in a predefined format required by Microsoft's Managed Identity team.
type ClusterUserAssignedIdentity struct {
MissingFields
ClientID string `json:"clientId,omitempty"`
PrincipalID string `json:"principalId,omitempty"`
}
// UserAssignedIdentities stores a mapping from resource IDs of managed identities to their client/principal IDs.
type UserAssignedIdentities map[string]ClusterUserAssignedIdentity
// Identity stores information about the cluster MSI(s) in a workload identity cluster.
type Identity struct {
MissingFields
Type string `json:"type,omitempty"`
UserAssignedIdentities UserAssignedIdentities `json:"userAssignedIdentities,omitempty"`
IdentityURL string `json:"identityURL,omitempty" mutable:"true"`
2024-06-28 20:36:50 +03:00
TenantID string `json:"tenantId,omitempty" mutable:"true"`
}