github.com/openshift/installer@v1.4.17/pkg/asset/manifests/azure/types.go (about)

     1  package azure
     2  
     3  import (
     4  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
     5  	"k8s.io/apimachinery/pkg/util/sets"
     6  )
     7  
     8  // authConfig is part of the CloudProviderConfig as defined in https://github.com/kubernetes/kubernetes/blob/v1.13.5/pkg/cloudprovider/providers/azure/auth/azure_auth.go#L32
     9  // resourceManagerEndpoint has been added based on https://github.com/kubernetes-sigs/cloud-provider-azure/blob/v1.0.3/pkg/auth/azure_auth.go
    10  type authConfig struct {
    11  	// The cloud environment identifier. Takes values from https://github.com/Azure/go-autorest/blob/ec5f4903f77ed9927ac95b19ab8e44ada64c1356/autorest/azure/environments.go#L13
    12  	Cloud string `json:"cloud" yaml:"cloud"`
    13  	// The AAD Tenant ID for the Subscription that the cluster is deployed in
    14  	TenantID string `json:"tenantId" yaml:"tenantId"`
    15  	// The ClientID for an AAD application with RBAC access to talk to Azure RM APIs
    16  	AADClientID string `json:"aadClientId" yaml:"aadClientId"`
    17  	// The ClientSecret for an AAD application with RBAC access to talk to Azure RM APIs
    18  	AADClientSecret string `json:"aadClientSecret" yaml:"aadClientSecret"`
    19  	// The path of a client certificate for an AAD application with RBAC access to talk to Azure RM APIs
    20  	AADClientCertPath string `json:"aadClientCertPath" yaml:"aadClientCertPath"`
    21  	// The password of the client certificate for an AAD application with RBAC access to talk to Azure RM APIs
    22  	AADClientCertPassword string `json:"aadClientCertPassword" yaml:"aadClientCertPassword"`
    23  	// Use managed service identity for the virtual machine to access Azure ARM APIs
    24  	UseManagedIdentityExtension bool `json:"useManagedIdentityExtension" yaml:"useManagedIdentityExtension"`
    25  	// UserAssignedIdentityID contains the Client ID of the user assigned MSI which is assigned to the underlying VMs. If empty the user assigned identity is not used.
    26  	// More details of the user assigned identity can be found at: https://docs.microsoft.com/en-us/azure/active-directory/managed-service-identity/overview
    27  	// For the user assigned identity specified here to be used, the UseManagedIdentityExtension has to be set to true.
    28  	UserAssignedIdentityID string `json:"userAssignedIdentityID" yaml:"userAssignedIdentityID"`
    29  	// The ID of the Azure Subscription that the cluster is deployed in
    30  	SubscriptionID string `json:"subscriptionId" yaml:"subscriptionId"`
    31  	// ResourceManagerEndpoint is the cloud's resource manager endpoint. If set, cloud provider queries this endpoint
    32  	// in order to generate an autorest.Environment instance instead of using one of the pre-defined Environments.
    33  	ResourceManagerEndpoint string `json:"resourceManagerEndpoint,omitempty" yaml:"resourceManagerEndpoint,omitempty"`
    34  }
    35  
    36  // config is the cloud provider config as defined in https://raw.githubusercontent.com/openshift/cloud-provider-azure/75ed9a21c1f0e2acfb5b27da395fdb02c918d56f/pkg/provider/azure.go
    37  type config struct {
    38  	authConfig
    39  
    40  	// The name of the resource group that the cluster is deployed in
    41  	ResourceGroup string `json:"resourceGroup,omitempty" yaml:"resourceGroup,omitempty"`
    42  	// The location of the resource group that the cluster is deployed in
    43  	Location string `json:"location,omitempty" yaml:"location,omitempty"`
    44  	// The name of site where the cluster will be deployed to that is more granular than the region specified by the "location" field.
    45  	// Currently only public ip, load balancer and managed disks support this.
    46  	ExtendedLocationName string `json:"extendedLocationName,omitempty" yaml:"extendedLocationName,omitempty"`
    47  	// The type of site that is being targeted.
    48  	// Currently only public ip, load balancer and managed disks support this.
    49  	ExtendedLocationType string `json:"extendedLocationType,omitempty" yaml:"extendedLocationType,omitempty"`
    50  	// The name of the VNet that the cluster is deployed in
    51  	VnetName string `json:"vnetName,omitempty" yaml:"vnetName,omitempty"`
    52  	// The name of the resource group that the Vnet is deployed in
    53  	VnetResourceGroup string `json:"vnetResourceGroup,omitempty" yaml:"vnetResourceGroup,omitempty"`
    54  	// The name of the subnet that the cluster is deployed in
    55  	SubnetName string `json:"subnetName,omitempty" yaml:"subnetName,omitempty"`
    56  	// The name of the security group attached to the cluster's subnet
    57  	SecurityGroupName string `json:"securityGroupName,omitempty" yaml:"securityGroupName,omitempty"`
    58  	// The name of the resource group that the security group is deployed in
    59  	SecurityGroupResourceGroup string `json:"securityGroupResourceGroup,omitempty" yaml:"securityGroupResourceGroup,omitempty"`
    60  	// (Optional in 1.6) The name of the route table attached to the subnet that the cluster is deployed in
    61  	RouteTableName string `json:"routeTableName,omitempty" yaml:"routeTableName,omitempty"`
    62  	// The name of the resource group that the RouteTable is deployed in
    63  	RouteTableResourceGroup string `json:"routeTableResourceGroup,omitempty" yaml:"routeTableResourceGroup,omitempty"`
    64  	// (Optional) The name of the availability set that should be used as the load balancer backend
    65  	// If this is set, the Azure cloudprovider will only add nodes from that availability set to the load
    66  	// balancer backend pool. If this is not set, and multiple agent pools (availability sets) are used, then
    67  	// the cloudprovider will try to add all nodes to a single backend pool which is forbidden.
    68  	// In other words, if you use multiple agent pools (availability sets), you MUST set this field.
    69  	PrimaryAvailabilitySetName string `json:"primaryAvailabilitySetName,omitempty" yaml:"primaryAvailabilitySetName,omitempty"`
    70  	// The type of azure nodes. Candidate values are: vmss, standard and vmssflex.
    71  	// If not set, it will be default to vmss.
    72  	VMType string `json:"vmType,omitempty" yaml:"vmType,omitempty"`
    73  	// The name of the scale set that should be used as the load balancer backend.
    74  	// If this is set, the Azure cloudprovider will only add nodes from that scale set to the load
    75  	// balancer backend pool. If this is not set, and multiple agent pools (scale sets) are used, then
    76  	// the cloudprovider will try to add all nodes to a single backend pool which is forbidden in the basic sku.
    77  	// In other words, if you use multiple agent pools (scale sets), and loadBalancerSku is set to basic, you MUST set this field.
    78  	PrimaryScaleSetName string `json:"primaryScaleSetName,omitempty" yaml:"primaryScaleSetName,omitempty"`
    79  	// Tags determines what tags shall be applied to the shared resources managed by controller manager, which
    80  	// includes load balancer, security group and route table. The supported format is `a=b,c=d,...`. After updated
    81  	// this config, the old tags would be replaced by the new ones.
    82  	// Because special characters are not supported in "tags" configuration, "tags" support would be removed in a future release,
    83  	// please consider migrating the config to "tagsMap".
    84  	Tags string `json:"tags,omitempty" yaml:"tags,omitempty"`
    85  	// TagsMap is similar to Tags but holds tags with special characters such as `=` and `,`.
    86  	TagsMap map[string]string `json:"tagsMap,omitempty" yaml:"tagsMap,omitempty"`
    87  	// SystemTags determines the tag keys managed by cloud provider. If it is not set, no tags would be deleted if
    88  	// the `Tags` is changed. However, the old tags would be deleted if they are neither included in `Tags` nor
    89  	// in `SystemTags` after the update of `Tags`.
    90  	SystemTags string `json:"systemTags,omitempty" yaml:"systemTags,omitempty"`
    91  	// Sku of Load Balancer and Public IP. Candidate values are: basic and standard.
    92  	// If not set, it will be default to basic.
    93  	LoadBalancerSku string `json:"loadBalancerSku,omitempty" yaml:"loadBalancerSku,omitempty"`
    94  	// LoadBalancerName determines the specific name of the load balancer user want to use, working with
    95  	// LoadBalancerResourceGroup
    96  	LoadBalancerName string `json:"loadBalancerName,omitempty" yaml:"loadBalancerName,omitempty"`
    97  	// LoadBalancerResourceGroup determines the specific resource group of the load balancer user want to use, working
    98  	// with LoadBalancerName
    99  	LoadBalancerResourceGroup string `json:"loadBalancerResourceGroup,omitempty" yaml:"loadBalancerResourceGroup,omitempty"`
   100  	// PreConfiguredBackendPoolLoadBalancerTypes determines whether the LoadBalancer BackendPool has been preconfigured.
   101  	// Candidate values are:
   102  	//   "": exactly with today (not pre-configured for any LBs)
   103  	//   "internal": for internal LoadBalancer
   104  	//   "external": for external LoadBalancer
   105  	//   "all": for both internal and external LoadBalancer
   106  	PreConfiguredBackendPoolLoadBalancerTypes string `json:"preConfiguredBackendPoolLoadBalancerTypes,omitempty" yaml:"preConfiguredBackendPoolLoadBalancerTypes,omitempty"`
   107  
   108  	// DisableAvailabilitySetNodes disables VMAS nodes support when "VMType" is set to "vmss".
   109  	DisableAvailabilitySetNodes bool `json:"disableAvailabilitySetNodes,omitempty" yaml:"disableAvailabilitySetNodes,omitempty"`
   110  	// EnableVmssFlexNodes enables vmss flex nodes support when "VMType" is set to "vmss".
   111  	EnableVmssFlexNodes bool `json:"enableVmssFlexNodes,omitempty" yaml:"enableVmssFlexNodes,omitempty"`
   112  	// DisableAzureStackCloud disables AzureStackCloud support. It should be used
   113  	// when setting AzureAuthConfig.Cloud with "AZURESTACKCLOUD" to customize ARM endpoints
   114  	// while the cluster is not running on AzureStack.
   115  	DisableAzureStackCloud bool `json:"disableAzureStackCloud,omitempty" yaml:"disableAzureStackCloud,omitempty"`
   116  	// Enable exponential backoff to manage resource request retries
   117  	CloudProviderBackoff bool `json:"cloudProviderBackoff,omitempty" yaml:"cloudProviderBackoff,omitempty"`
   118  	// Use instance metadata service where possible
   119  	UseInstanceMetadata bool `json:"useInstanceMetadata,omitempty" yaml:"useInstanceMetadata,omitempty"`
   120  
   121  	// Backoff exponent
   122  	CloudProviderBackoffExponent float64 `json:"cloudProviderBackoffExponent,omitempty" yaml:"cloudProviderBackoffExponent,omitempty"`
   123  	// Backoff jitter
   124  	CloudProviderBackoffJitter float64 `json:"cloudProviderBackoffJitter,omitempty" yaml:"cloudProviderBackoffJitter,omitempty"`
   125  
   126  	// ExcludeMasterFromStandardLB excludes master nodes from standard load balancer.
   127  	// If not set, it will be default to true.
   128  	ExcludeMasterFromStandardLB *bool `json:"excludeMasterFromStandardLB,omitempty" yaml:"excludeMasterFromStandardLB,omitempty"`
   129  	// DisableOutboundSNAT disables the outbound SNAT for public load balancer rules.
   130  	// It should only be set when loadBalancerSku is standard. If not set, it will be default to false.
   131  	DisableOutboundSNAT *bool `json:"disableOutboundSNAT,omitempty" yaml:"disableOutboundSNAT,omitempty"`
   132  
   133  	// Maximum allowed LoadBalancer Rule Count is the limit enforced by Azure Load balancer
   134  	MaximumLoadBalancerRuleCount int `json:"maximumLoadBalancerRuleCount,omitempty" yaml:"maximumLoadBalancerRuleCount,omitempty"`
   135  	// Backoff retry limit
   136  	CloudProviderBackoffRetries int `json:"cloudProviderBackoffRetries,omitempty" yaml:"cloudProviderBackoffRetries,omitempty"`
   137  	// Backoff duration
   138  	CloudProviderBackoffDuration int `json:"cloudProviderBackoffDuration,omitempty" yaml:"cloudProviderBackoffDuration,omitempty"`
   139  	// NonVmssUniformNodesCacheTTLInSeconds sets the Cache TTL for NonVmssUniformNodesCacheTTLInSeconds
   140  	// if not set, will use default value
   141  	NonVmssUniformNodesCacheTTLInSeconds int `json:"nonVmssUniformNodesCacheTTLInSeconds,omitempty" yaml:"nonVmssUniformNodesCacheTTLInSeconds,omitempty"`
   142  	// AvailabilitySetNodesCacheTTLInSeconds sets the Cache TTL for availabilitySetNodesCache
   143  	// if not set, will use default value
   144  	AvailabilitySetNodesCacheTTLInSeconds int `json:"availabilitySetNodesCacheTTLInSeconds,omitempty" yaml:"availabilitySetNodesCacheTTLInSeconds,omitempty"`
   145  	// VmssCacheTTLInSeconds sets the cache TTL for VMSS
   146  	VmssCacheTTLInSeconds int `json:"vmssCacheTTLInSeconds,omitempty" yaml:"vmssCacheTTLInSeconds,omitempty"`
   147  	// VmssVirtualMachinesCacheTTLInSeconds sets the cache TTL for vmssVirtualMachines
   148  	VmssVirtualMachinesCacheTTLInSeconds int `json:"vmssVirtualMachinesCacheTTLInSeconds,omitempty" yaml:"vmssVirtualMachinesCacheTTLInSeconds,omitempty"`
   149  
   150  	// VmssFlexCacheTTLInSeconds sets the cache TTL for VMSS Flex
   151  	VmssFlexCacheTTLInSeconds int `json:"vmssFlexCacheTTLInSeconds,omitempty" yaml:"vmssFlexCacheTTLInSeconds,omitempty"`
   152  	// VmssFlexVMCacheTTLInSeconds sets the cache TTL for vmss flex vms
   153  	VmssFlexVMCacheTTLInSeconds int `json:"vmssFlexVMCacheTTLInSeconds,omitempty" yaml:"vmssFlexVMCacheTTLInSeconds,omitempty"`
   154  
   155  	// VmCacheTTLInSeconds sets the cache TTL for vm
   156  	VMCacheTTLInSeconds int `json:"vmCacheTTLInSeconds,omitempty" yaml:"vmCacheTTLInSeconds,omitempty"`
   157  	// LoadBalancerCacheTTLInSeconds sets the cache TTL for load balancer
   158  	LoadBalancerCacheTTLInSeconds int `json:"loadBalancerCacheTTLInSeconds,omitempty" yaml:"loadBalancerCacheTTLInSeconds,omitempty"`
   159  	// NsgCacheTTLInSeconds sets the cache TTL for network security group
   160  	NsgCacheTTLInSeconds int `json:"nsgCacheTTLInSeconds,omitempty" yaml:"nsgCacheTTLInSeconds,omitempty"`
   161  	// RouteTableCacheTTLInSeconds sets the cache TTL for route table
   162  	RouteTableCacheTTLInSeconds int `json:"routeTableCacheTTLInSeconds,omitempty" yaml:"routeTableCacheTTLInSeconds,omitempty"`
   163  	// PlsCacheTTLInSeconds sets the cache TTL for private link service resource
   164  	PlsCacheTTLInSeconds int `json:"plsCacheTTLInSeconds,omitempty" yaml:"plsCacheTTLInSeconds,omitempty"`
   165  	// AvailabilitySetsCacheTTLInSeconds sets the cache TTL for VMAS
   166  	AvailabilitySetsCacheTTLInSeconds int `json:"availabilitySetsCacheTTLInSeconds,omitempty" yaml:"availabilitySetsCacheTTLInSeconds,omitempty"`
   167  	// PublicIPCacheTTLInSeconds sets the cache TTL for public ip
   168  	PublicIPCacheTTLInSeconds int `json:"publicIPCacheTTLInSeconds,omitempty" yaml:"publicIPCacheTTLInSeconds,omitempty"`
   169  	// RouteUpdateWaitingInSeconds is the delay time for waiting route updates to take effect. This waiting delay is added
   170  	// because the routes are not taken effect when the async route updating operation returns success. Default is 30 seconds.
   171  	RouteUpdateWaitingInSeconds int `json:"routeUpdateWaitingInSeconds,omitempty" yaml:"routeUpdateWaitingInSeconds,omitempty"`
   172  	// The user agent for Azure customer usage attribution
   173  	UserAgent string `json:"userAgent,omitempty" yaml:"userAgent,omitempty"`
   174  	// LoadBalancerBackendPoolConfigurationType defines how vms join the load balancer backend pools. Supported values
   175  	// are `nodeIPConfiguration`, `nodeIP` and `podIP`.
   176  	// `nodeIPConfiguration`: vm network interfaces will be attached to the inbound backend pool of the load balancer (default);
   177  	// `nodeIP`: vm private IPs will be attached to the inbound backend pool of the load balancer;
   178  	// `podIP`: pod IPs will be attached to the inbound backend pool of the load balancer (not supported yet).
   179  	LoadBalancerBackendPoolConfigurationType string `json:"loadBalancerBackendPoolConfigurationType,omitempty" yaml:"loadBalancerBackendPoolConfigurationType,omitempty"`
   180  	// PutVMSSVMBatchSize defines how many requests the client send concurrently when putting the VMSS VMs.
   181  	// If it is smaller than or equal to zero, the request will be sent one by one in sequence (default).
   182  	PutVMSSVMBatchSize int `json:"putVMSSVMBatchSize" yaml:"putVMSSVMBatchSize"`
   183  	// PrivateLinkServiceResourceGroup determines the specific resource group of the private link services user want to use
   184  	PrivateLinkServiceResourceGroup string `json:"privateLinkServiceResourceGroup,omitempty" yaml:"privateLinkServiceResourceGroup,omitempty"`
   185  
   186  	// EnableMigrateToIPBasedBackendPoolAPI uses the migration API to migrate from NIC-based to IP-based backend pool.
   187  	// The migration API can provide a migration from NIC-based to IP-based backend pool without service downtime.
   188  	// If the API is not used, the migration will be done by decoupling all nodes on the backend pool and then re-attaching
   189  	// node IPs, which will introduce service downtime. The downtime increases with the number of nodes in the backend pool.
   190  	EnableMigrateToIPBasedBackendPoolAPI bool `json:"enableMigrateToIPBasedBackendPoolAPI" yaml:"enableMigrateToIPBasedBackendPoolAPI"`
   191  
   192  	// MultipleStandardLoadBalancerConfigurations stores the properties regarding multiple standard load balancers.
   193  	// It will be ignored if LoadBalancerBackendPoolConfigurationType is nodeIPConfiguration.
   194  	// If the length is not 0, it is assumed the multiple standard load balancers mode is on. In this case,
   195  	// there must be one configuration named "<clustername>" or an error will be reported.
   196  	MultipleStandardLoadBalancerConfigurations []MultipleStandardLoadBalancerConfiguration `json:"multipleStandardLoadBalancerConfigurations,omitempty" yaml:"multipleStandardLoadBalancerConfigurations,omitempty"`
   197  
   198  	// DisableAPICallCache disables the cache for Azure API calls. It is for ARG support and not all resources will be disabled.
   199  	DisableAPICallCache bool `json:"disableAPICallCache,omitempty" yaml:"disableAPICallCache,omitempty"`
   200  
   201  	// RouteUpdateIntervalInSeconds is the interval for updating routes. Default is 30 seconds.
   202  	RouteUpdateIntervalInSeconds int `json:"routeUpdateIntervalInSeconds,omitempty" yaml:"routeUpdateIntervalInSeconds,omitempty"`
   203  	// LoadBalancerBackendPoolUpdateIntervalInSeconds is the interval for updating load balancer backend pool of local services. Default is 30 seconds.
   204  	LoadBalancerBackendPoolUpdateIntervalInSeconds int `json:"loadBalancerBackendPoolUpdateIntervalInSeconds,omitempty" yaml:"loadBalancerBackendPoolUpdateIntervalInSeconds,omitempty"`
   205  }
   206  
   207  // MultipleStandardLoadBalancerConfiguration stores the properties regarding multiple standard load balancers.
   208  type MultipleStandardLoadBalancerConfiguration struct {
   209  	// Name of the public load balancer. There will be an internal load balancer
   210  	// created if needed, and the name will be `<name>-internal`. The internal lb
   211  	// shares the same configurations as the external one. The internal lbs
   212  	// are not needed to be included in `MultipleStandardLoadBalancerConfigurations`.
   213  	// There must be a name of "<clustername>" in the load balancer configuration list.
   214  	Name string `json:"name" yaml:"name"`
   215  
   216  	MultipleStandardLoadBalancerConfigurationSpec
   217  
   218  	MultipleStandardLoadBalancerConfigurationStatus
   219  }
   220  
   221  // MultipleStandardLoadBalancerConfigurationSpec stores the properties regarding multiple standard load balancers.
   222  type MultipleStandardLoadBalancerConfigurationSpec struct {
   223  	// This load balancer can have services placed on it. Defaults to true,
   224  	// can be set to false to drain and eventually remove a load balancer.
   225  	// This only affects services that will be using the LB. For services
   226  	// that is currently using the LB, they will not be affected.
   227  	AllowServicePlacement *bool `json:"allowServicePlacement" yaml:"allowServicePlacement"`
   228  
   229  	// A string value that must specify the name of an existing vmSet.
   230  	// All nodes in the given vmSet will always be added to this load balancer.
   231  	// A vmSet can only be the primary vmSet for a single load balancer.
   232  	PrimaryVMSet string `json:"primaryVMSet" yaml:"primaryVMSet"`
   233  
   234  	// Services that must match this selector can be placed on this load balancer. If not supplied,
   235  	// services with any labels can be created on the load balancer.
   236  	ServiceLabelSelector *metav1.LabelSelector `json:"serviceLabelSelector" yaml:"serviceLabelSelector"`
   237  
   238  	// Services created in namespaces with the supplied label will be allowed to select that load balancer.
   239  	// If not supplied, services created in any namespaces can be created on that load balancer.
   240  	ServiceNamespaceSelector *metav1.LabelSelector `json:"serviceNamespaceSelector" yaml:"serviceNamespaceSelector"`
   241  
   242  	// Nodes matching this selector will be preferentially added to the load balancers that
   243  	// they match selectors for. NodeSelector does not override primaryAgentPool for node allocation.
   244  	NodeSelector *metav1.LabelSelector `json:"nodeSelector" yaml:"nodeSelector"`
   245  }
   246  
   247  // MultipleStandardLoadBalancerConfigurationStatus stores the properties regarding multiple standard load balancers.
   248  type MultipleStandardLoadBalancerConfigurationStatus struct {
   249  	// ActiveServices stores the services that are supposed to use the load balancer.
   250  	ActiveServices sets.Set[string] `json:"activeServices" yaml:"activeServices"`
   251  
   252  	// ActiveNodes stores the nodes that are supposed to be in the load balancer.
   253  	// It will be used in EnsureHostsInPool to make sure the given ones are in the backend pool.
   254  	ActiveNodes sets.Set[string] `json:"activeNodes" yaml:"activeNodes"`
   255  }