Documentation ¶
Overview ¶
Package common stores helpers and utility functions.
Index ¶
- Constants
- Variables
- func CidrFirstIP(cidr net.IP) net.IP
- func CidrStringFirstIP(ip string) (net.IP, error)
- func ContainerdKubenetOverride(config *ContainerdConfig) error
- func ContainerdSandboxImageOverrider(image string) func(*ContainerdConfig) error
- func DockerNvidiaOverride(config *DockerConfig) error
- func GetAllSupportedKubernetesVersions(isUpdate, hasWindows bool, isAzureStackCloud bool) []string
- func GetContainerdConfig(opts map[string]string, overrides []func(*ContainerdConfig) error) (string, error)
- func GetContainerdConfigTestCases() map[string]string
- func GetDCSeriesVMCasesForTesting() []struct{ ... }
- func GetDefaultKubernetesVersion(hasWindows bool, isAzureStackCloud bool) string
- func GetDockerConfig(opts map[string]string, overrides []func(*DockerConfig) error) (string, error)
- func GetDockerConfigTestCases() map[string]string
- func GetLatestPatchVersion(majorMinor string, versionsList []string) (version string)
- func GetMasterKubernetesLabels(rg string, deprecated bool) string
- func GetMaxVersion(versions []string, preRelease bool) string
- func GetMinVersion(versions []string, preRelease bool) string
- func GetNSeriesVMCasesForTesting() []struct{ ... }
- func GetOrderedEscapedKeyValsString(config map[string]string) string
- func GetOrderedNewlinedKeyValsStringForCloudInit(config map[string]string) string
- func GetStorageAccountType(sizeName string) (string, error)
- func GetSupportedKubernetesVersion(version string, hasWindows bool, isAzureStackCloud bool) string
- func GetSupportedVersions(orchType string, isUpdate, hasWindows bool, isAzureStackCloud bool) (versions []string, defaultVersion string)
- func GetVNETSubnetIDComponents(vnetSubnetID string) (string, string, string, string, error)
- func GetValidPatchVersion(orchType, orchVer string, isUpdate, hasWindows bool, isAzureStackCloud bool) string
- func GetVersionsBetween(versions []string, versionMin, versionMax string, inclusive, preReleases bool) []string
- func GetVersionsGt(versions []string, version string, inclusive, preReleases bool) []string
- func GetVersionsLt(versions []string, version string, inclusive, preReleases bool) []string
- func HandleValidationErrors(e validator.ValidationErrors) error
- func IP4BroadcastAddress(n *net.IPNet) net.IP
- func IndentString(original string, spaces int) string
- func IsKubernetesVersionGe(actualVersion, version string) bool
- func IsNvidiaEnabledSKU(vmSize string) bool
- func IsSgxEnabledSKU(vmSize string) bool
- func IsSupportedKubernetesVersion(version string, isUpdate, hasWindows bool, isAzureStackCloud bool) bool
- func IsValidMinVersion(orchType, orchRelease, orchVersion, minVersion string) (bool, error)
- func RationalizeReleaseAndVersion(orchType, orchRel, orchVer string, isUpdate, hasWindows bool, ...) (version string)
- func SliceIntIsNonEmpty(s []int) bool
- func ValidateDNSPrefix(dnsName string) error
- func WrapAsARMVariable(s string) string
- func WrapAsParameter(s string) string
- func WrapAsVerbatim(s string) string
- type ContainerdCNIPlugin
- type ContainerdConfig
- type ContainerdPlugin
- type ContainerdRuntime
- type DockerConfig
- type DockerDaemonRuntime
- type IoContainerdGrpcV1Cri
- type LogOpts
- type Plugins
Constants ¶
const ( // MinAgentCount are the minimum number of agents per agent pool MinAgentCount = 1 // MaxAgentCount are the maximum number of agents per agent pool MaxAgentCount = 1000 // MinPort specifies the minimum tcp port to open MinPort = 1 // MaxPort specifies the maximum tcp port to open MaxPort = 65535 // MaxDisks specifies the maximum attached disks to add to the cluster MaxDisks = 4 // MinDiskSizeGB specifies the minimum attached disk size MinDiskSizeGB = 1 // MaxDiskSizeGB specifies the maximum attached disk size MaxDiskSizeGB = 1023 // MinIPAddressCount specifies the minimum number of IP addresses per network interface MinIPAddressCount = 1 // MaxIPAddressCount specifies the maximum number of IP addresses per network interface MaxIPAddressCount = 256 // address relative to the first consecutive Kubernetes static IP DefaultInternalLbStaticIPOffset = 10 // DefaultEnableCSIProxyWindows determines if CSI proxy should be enabled by default for Windows nodes DefaultEnableCSIProxyWindows = false // MaxLoadBalancerOutboundIPs is the maximum number of outbound IPs in a Standard LoadBalancer frontend configuration MaxLoadBalancerOutboundIPs = 16 )
validation values
const ( // AvailabilitySet means that the vms are in an availability set AvailabilitySet = "AvailabilitySet" // VirtualMachineScaleSets means that the vms are in a virtual machine scaleset VirtualMachineScaleSets = "VirtualMachineScaleSets" )
Availability profiles
const ( // StorageAccount means that the nodes use raw storage accounts for their os and attached volumes StorageAccount = "StorageAccount" // ManagedDisks means that the nodes use managed disks for their os and attached volumes ManagedDisks = "ManagedDisks" // Ephemeral means that the node's os disk is ephemeral. This is not compatible with attached volumes. Ephemeral = "Ephemeral" )
storage profiles
const ( // KubernetesDefaultRelease is the default Kubernetes release KubernetesDefaultRelease string = "1.18" // KubernetesDefaultReleaseWindows is the default Kubernetes release for Windows KubernetesDefaultReleaseWindows string = "1.18" // KubernetesDefaultReleaseAzureStack is the default Kubernetes release on Azure Stack KubernetesDefaultReleaseAzureStack string = "1.18" // KubernetesDefaultReleaseWindowsAzureStack is the default Kubernetes release for Windows on Azure Stack KubernetesDefaultReleaseWindowsAzureStack string = "1.18" )
const ( // TillerAddonName is the name of the tiller addon deployment TillerAddonName = "tiller" // ACIConnectorAddonName // Deprecated ACIConnectorAddonName = "aci-connector" // Deprecated // ClusterAutoscalerAddonName is the name of the cluster autoscaler addon deployment ClusterAutoscalerAddonName = "cluster-autoscaler" // BlobfuseFlexVolumeAddonName is the name of the blobfuse flexvolume addon BlobfuseFlexVolumeAddonName = "blobfuse-flexvolume" // SMBFlexVolumeAddonName is the name of the smb flexvolume addon SMBFlexVolumeAddonName = "smb-flexvolume" // KeyVaultFlexVolumeAddonName is the name of the key vault flexvolume addon deployment KeyVaultFlexVolumeAddonName = "keyvault-flexvolume" // DashboardAddonName // Deprecated DashboardAddonName = "kubernetes-dashboard" // Deprecated // DashboardMetricsScraperContainerName is the name of the metrics-scraper container in the kubernetes-dashboard addon DashboardMetricsScraperContainerName = "kubernetes-dashboard-metrics-scraper" // Deprecated // ReschedulerAddonName // Deprecated ReschedulerAddonName = "rescheduler" // Deprecated // ExecHealthZComponentName is the name of the exechealthz component ExecHealthZComponentName = "exechealthz" // MetricsServerAddonName is the name of the kubernetes metrics server addon deployment MetricsServerAddonName = "metrics-server" // AddonResizerComponentName is the name of the kubernetes addon-resizer component AddonResizerComponentName = "addon-resizer" // NVIDIADevicePluginAddonName is the name of the NVIDIA device plugin addon deployment NVIDIADevicePluginAddonName = "nvidia-device-plugin" // ContainerMonitoringAddonName is the name of the kubernetes Container Monitoring addon deployment ContainerMonitoringAddonName = "container-monitoring" // IPMASQAgentAddonName is the name of the ip masq agent addon IPMASQAgentAddonName = "ip-masq-agent" // AzureCNINetworkMonitorAddonName is the name of the Azure CNI networkmonitor addon AzureCNINetworkMonitorAddonName = "azure-cni-networkmonitor" // AzureNetworkPolicyAddonName is the name of the Azure network policy manager addon AzureNetworkPolicyAddonName = "azure-npm-daemonset" // AzureVnetTelemetryContainerName is the name of the deprecated Azure vnet telemetry container in the azure-npm-daemonset addon AzureVnetTelemetryContainerName = "azure-vnet-telemetry-daemonset" // NMIContainerName is the name of the nmi container in the aad-pod-identity addon NMIContainerName = "nmi" // MICContainerName is the name of the mic container in the aad-pod-identity addon MICContainerName = "mic" // CiliumAgentContainerName is the name of the cilium-agent container in the cilium addon CiliumAgentContainerName = "cilium-agent" // CiliumCleanStateContainerName is the name of the clean-cilium-state container in the cilium addon CiliumCleanStateContainerName = "clean-cilium-state" // CiliumOperatorContainerName is the name of the cilium-operator container in the cilium addon CiliumOperatorContainerName = "cilium-operator" // CiliumEtcdOperatorContainerName is the name of the cilium-etcd-operator container in the cilium addon CiliumEtcdOperatorContainerName = "cilium-etcd-operator" // AntreaControllerContainerName is the name of the antrea-controller container in the antrea addon AntreaControllerContainerName = "antrea-controller" // AntreaAgentContainerName is the name of the antrea-agent container in the antrea addon AntreaAgentContainerName = "antrea-agent" // AntreaOVSContainerName is the name of the antrea-ovs container in the antrea addon AntreaOVSContainerName = "antrea-ovs" // AntreaInstallCNIContainerName is the name of the install-cni container in the antrea addon AntreaInstallCNIContainerName = "install-cni" // GatekeeperContainerName is the name of the gatekeeper container in the azure-policy addon GatekeeperContainerName = "gatekeeper" // CloudNodeManagerAddonName is the name of the cloud node manager addon CloudNodeManagerAddonName = "cloud-node-manager" // CalicoAddonName is the name of calico daemonset addon CalicoAddonName = "calico-daemonset" // CalicoTyphaComponentName is the name of calico-typha component CalicoTyphaComponentName = "calico-typha" // CalicoCNIComponentName is the name of calico-cni component CalicoCNIComponentName = "calico-cni" // CalicoNodeComponentName is the name of calico-node component CalicoNodeComponentName = "calico-node" // CalicoPod2DaemonComponentName is the name of calico-pod2daemon component CalicoPod2DaemonComponentName = "calico-pod2daemon" // CalicoClusterAutoscalerComponentName is the name of calico-cluster-proportional-autoscaler component CalicoClusterAutoscalerComponentName = "calico-cluster-proportional-autoscaler" // AADPodIdentityAddonName is the name of the aad-pod-identity addon deployment AADPodIdentityAddonName = "aad-pod-identity" // AzurePolicyAddonName is the name of the Azure Policy addon AzurePolicyAddonName = "azure-policy" // AppGwIngressAddonName appgw addon AppGwIngressAddonName = "appgw-ingress" // AzureDiskCSIDriverAddonName is the name of Azure Disk CSI Driver addon AzureDiskCSIDriverAddonName = "azuredisk-csi-driver" // CSIProvisionerContainerName is the name of the csi-provisioner container in the azuredisk-csi-driver and azurefile-csi-driver addons CSIProvisionerContainerName = "csi-provisioner" // CSIAttacherContainerName is the name of the csi-attacher container in the azuredisk-csi-driver and azurefile-csi-driver addons CSIAttacherContainerName = "csi-attacher" // CSILivenessProbeContainerName is the name of the livenessprobe container in the azuredisk-csi-driver, azurefile-csi-driver and secrets-store-csi-driver addons CSILivenessProbeContainerName = "livenessprobe" // CSILivenessProbeWindowsContainerName is the name of the livenessprobe-windows container in the azuredisk-csi-driver and azurefile-csi-driver addons CSILivenessProbeWindowsContainerName = "livenessprobe-windows" // CSISnapshotterContainerName is the name of the csi-snapshotter container in the azuredisk-csi-driver and azurefile-csi-driver addons CSISnapshotterContainerName = "csi-snapshotter" // CSISnapshotControllerContainerName is the name of the csi-snapshot-controller container CSISnapshotControllerContainerName = "csi-snapshot-controller" // CSIResizerContainerName is the name of the csi-resizer container in the azuredisk-csi-driver addon CSIResizerContainerName = "csi-resizer" // CSINodeDriverRegistrarContainerName is the name of the csi-node-driver-registrar container in the azuredisk-csi-driver, azurefile-csi-driver and secrets-store-csi-driver addons CSINodeDriverRegistrarContainerName = "csi-node-driver-registrar" // CSINodeDriverRegistrarWindowsContainerName is the name of the csi-node-driver-registrar-windows container in the azuredisk-csi-driver and azurefile-csi-driver addons CSINodeDriverRegistrarWindowsContainerName = "csi-node-driver-registrar-windows" // CSIAzureDiskContainerName is the name of the azuredisk-csi container in the azuredisk-csi-driver and azurefile-csi-driver addons CSIAzureDiskContainerName = "azuredisk-csi" // AzureFileCSIDriverAddonName is the name of Azure File CSI Driver addon AzureFileCSIDriverAddonName = "azurefile-csi-driver" // CSIAzureFileContainerName is the name of the azurefile-csi container in the azurefile-csi-driver addon CSIAzureFileContainerName = "azurefile-csi" // AzureStorageClassesAddonName is the name of the azure storage classes addon AzureStorageClassesAddonName = "azure-storage-classes" // Hyperkube is the common "hyperkube" string reference Hyperkube = "hyperkube" // KubeDNSAddonName is the name of the kube-dns-deployment addon KubeDNSAddonName = "kube-dns" // DNSMasqComponentName is the name of the dnsmasq component DNSMasqComponentName = "dnsmasq" // DNSSidecarComponentName is the name of the dnsmasq component DNSSidecarComponentName = "k8s-dns-sidecar" // PauseComponentName is the name of the pause component PauseComponentName = "pause" // CoreDNSAddonName is the name of the coredns addon CoreDNSAddonName = "coredns" // CoreDNSAutoscalerName is the name of the coredns-autoscaler container in the coredns addon CoreDNSAutoscalerName = "coredns-autoscaler" // KubeProxyAddonName is the name of the kube-proxy config addon KubeProxyAddonName = "kube-proxy" // CiliumAddonName is the name of cilium daemonset addon CiliumAddonName = "cilium" // AntreaAddonName is the name of antrea daemonset addon AntreaAddonName = "antrea" // FlannelAddonName is the name of flannel plugin daemonset addon FlannelAddonName = "flannel" // KubeFlannelContainerName is the name of the kube-flannel container in the flannel addon KubeFlannelContainerName = "kube-flannel" // FlannelInstallCNIContainerName is the name of the install-cni container in the flannel addon FlannelInstallCNIContainerName = "install-cni" // KubeRBACProxyContainerName is the name of the kube-rbac-proxy container in the scheduled-maintenance addon KubeRBACProxyContainerName = "kube-rbac-proxy" // ScheduledMaintenanceManagerContainerName is the name of the manager container in the scheduled-maintenance addon ScheduledMaintenanceManagerContainerName = "manager" // AADAdminGroupAddonName is the name of the default admin group RBAC addon AADAdminGroupAddonName = "aad" // AzureCloudProviderAddonName is the name of the azure-cloud-provider addon AzureCloudProviderAddonName = "azure-cloud-provider" // AzureCSIStorageClassesAddonName is the name of Azure CSI storage classes addon AzureCSIStorageClassesAddonName = "azure-csi-storage-classes" // AuditPolicyAddonName is the name of the audit policy addon AuditPolicyAddonName = "audit-policy" // ScheduledMaintenanceAddonName is the name of the scheduled maintenance addon deployment ScheduledMaintenanceAddonName = "scheduled-maintenance" // PodSecurityPolicyAddonName is the name of the PodSecurityPolicy addon PodSecurityPolicyAddonName = "pod-security-policy" // NodeProblemDetectorAddonName is the name of the node problem detector addon NodeProblemDetectorAddonName = "node-problem-detector" // SecretsStoreCSIDriverAddonName is the name of the secrets-store-csi-driver addon SecretsStoreCSIDriverAddonName = "csi-secrets-store" // CSISecretsStoreDriverContainerName is the name of the secrets-store container in the csi-secrets-store addon CSISecretsStoreDriverContainerName = "secrets-store" // CSISecretsStoreProviderAzureContainerName is the name of the provider-azure-installer container in csi-secrets-store addon CSISecretsStoreProviderAzureContainerName = "provider-azure-installer" // ArcAddonName is the name of the arc addon AzureArcOnboardingAddonName = "azure-arc-onboarding" )
Addon name consts
const ( // SchedulerComponentName is the name of the kube-scheduler component SchedulerComponentName = "kube-scheduler" // ControllerManagerComponentName is the name of the kube-controller-manager component ControllerManagerComponentName = "kube-controller-manager" // CloudControllerManagerComponentName is the name of the cloud-controller-manager component CloudControllerManagerComponentName = "cloud-controller-manager" // APIServerComponentName is the name of the kube-apiserver component APIServerComponentName = "kube-apiserver" // AddonManagerComponentName is the name of the kube-addon-manager component AddonManagerComponentName = "kube-addon-manager" // ClusterInitComponentName is the name of the cluster-init component ClusterInitComponentName = "cluster-init" // AzureKMSProviderComponentName is the name of the azure-kms-provider component AzureKMSProviderComponentName = "azure-kms-provider" )
Component name consts
const ( // AzureStackSuffix is appended to kubernetes version on Azure Stack instances AzureStackSuffix = "-azs" // AzureStackPrefix is prepended to windows binary version for Azure Stack instances AzureStackPrefix = "azs-" // AzureStackCaCertLocation is where Azure Stack's CRP drops the stamp CA certificate AzureStackCaCertLocation = "/var/lib/waagent/Certificates.pem" )
const ( KubernetesImageBaseTypeGCR = "gcr" KubernetesImageBaseTypeMCR = "mcr" )
const ( AntreaDefaultTrafficEncapMode = "Encap" AntreaDefaultInstallCniCmd = "install_cni" AntreaInstallCniChainCmd = "install_cni_chaining" AntreaNetworkPolicyOnlyMode = "networkPolicyOnly" )
Antrea Plugin Const
const ( // MasterNodeTaint is the node taint we apply to all master nodes MasterNodeTaint string = "node-role.kubernetes.io/master=true:NoSchedule" // AADPodIdentityTaintKey is the node taint key for AAD Pod Identity-enabled clusters before NMI daemonset is ready AADPodIdentityTaintKey string = "node.kubernetes.io/aad-pod-identity-not-ready" )
Node Taint consts
const (
ContainerDataDirKey = "dataDir"
)
Known container runtime configuration keys
const ( // Kubernetes is the string constant for the Kubernetes orchestrator type Kubernetes string = "Kubernetes" )
the orchestrators supported
const LegacyControlPlaneVMPrefix string = "k8s-master"
const MinCloudProviderQPSToBucketFactor float64 = 0.1
MinCloudProviderQPSToBucketFactor defines the minimum ratio between QPS and Bucket size for cloudprovider rate limiting
const WindowsArtifactAzureStackComponentName = "windowszip-azs"
const WindowsArtifactComponentName = "windowszip"
Variables ¶
var ( // DefaultDockerConfig describes the default configuration of the docker daemon. DefaultDockerConfig = DockerConfig{ LiveRestore: true, LogDriver: "json-file", LogOpts: LogOpts{ MaxSize: "50m", MaxFile: "5", }, } // DefaultContainerdConfig describes the default configuration of the containerd daemon. DefaultContainerdConfig = ContainerdConfig{ Version: 2, OomScore: 0, Plugins: Plugins{ IoContainerdGrpcV1Cri: IoContainerdGrpcV1Cri{ CNI: ContainerdCNIPlugin{}, Containerd: ContainerdPlugin{ DefaultRuntimeName: "runc", Runtimes: map[string]ContainerdRuntime{ "runc": { RuntimeType: "io.containerd.runc.v2", }, "untrusted": { RuntimeType: "io.containerd.runc.v2", }, }, }, }, }, } )
var AllKubernetesSupportedVersions = map[string]bool{}/* 265 elements not displayed */
AllKubernetesSupportedVersions is a hash table of all supported Kubernetes version strings The bool value indicates if creating new clusters with this version is allowed
var AllKubernetesSupportedVersionsAzureStack = map[string]bool{ "1.14.7": false, "1.14.8": false, "1.15.4": false, "1.15.5": false, "1.15.10": false, "1.15.11": false, "1.15.12": false, "1.16.9": false, "1.16.10": false, "1.16.11": false, "1.16.13": false, "1.16.14": false, "1.16.15": false, "1.17.4": false, "1.17.5": false, "1.17.6": false, "1.17.7": false, "1.17.9": false, "1.17.11": false, "1.17.17": false, "1.18.10": false, "1.18.15": false, "1.18.18": true, "1.19.10": true, "1.20.6": true, }
AllKubernetesSupportedVersionsAzureStack is a hash table of all supported Kubernetes version strings on Azure Stack The bool value indicates if creating new clusters with this version is allowed
var AllKubernetesWindowsSupportedVersions = getAllKubernetesWindowsSupportedVersionsMap()
AllKubernetesWindowsSupportedVersions maintain a set of available k8s Windows versions in aks-engine
var AllKubernetesWindowsSupportedVersionsAzureStack = map[string]bool{ "1.15.10": false, "1.15.11": false, "1.15.12": false, "1.16.9": false, "1.16.10": false, "1.16.11": false, "1.16.13": false, "1.16.14": false, "1.16.15": false, "1.17.4": false, "1.17.5": false, "1.17.6": false, "1.17.7": false, "1.17.9": false, "1.17.11": false, "1.17.17": false, "1.18.10": false, "1.18.15": false, "1.18.18": true, "1.19.10": true, "1.20.6": true, }
AllKubernetesWindowsSupportedVersionsAzureStack maintain a set of available k8s Windows versions in aks-engine on Azure Stack
Functions ¶
func CidrFirstIP ¶
CidrFirstIP returns the first IP of the provided subnet.
func CidrStringFirstIP ¶
CidrStringFirstIP returns the first IP of the provided subnet string. Returns an error if the string cannot be parsed.
func ContainerdKubenetOverride ¶ added in v0.50.0
func ContainerdKubenetOverride(config *ContainerdConfig) error
ContainerdKubenetOverride transforms a containerd config to set details required when using kubenet.
func ContainerdSandboxImageOverrider ¶ added in v0.50.0
func ContainerdSandboxImageOverrider(image string) func(*ContainerdConfig) error
ContainerdSandboxImageOverrider produces a function to transform containerd config by setting the SandboxImage.
func DockerNvidiaOverride ¶ added in v0.50.0
func DockerNvidiaOverride(config *DockerConfig) error
DockerNvidiaOverride transforms a docker config to supply nvidia runtime configuration.
func GetAllSupportedKubernetesVersions ¶
GetAllSupportedKubernetesVersions returns a slice of all supported Kubernetes versions
func GetContainerdConfig ¶ added in v0.50.0
func GetContainerdConfig(opts map[string]string, overrides []func(*ContainerdConfig) error) (string, error)
GetContainerdConfig transforms the default containerd config with overrides. Overrides may be nil.
func GetContainerdConfigTestCases ¶ added in v0.50.0
func GetDCSeriesVMCasesForTesting ¶ added in v0.42.0
GetDCSeriesVMCasesForTesting returns a struct w/ VM SKUs and whether or not we expect them to be SGX-enabled
func GetDefaultKubernetesVersion ¶
GetDefaultKubernetesVersion returns the default Kubernetes version, that is the latest patch of the default release
func GetDockerConfig ¶ added in v0.50.0
GetDockerConfig transforms the default docker config with overrides. Overrides may be nil.
func GetDockerConfigTestCases ¶ added in v0.50.0
func GetLatestPatchVersion ¶
GetLatestPatchVersion gets the most recent patch version from a list of semver versions given a major.minor string
func GetMasterKubernetesLabels ¶ added in v0.37.0
GetMasterKubernetesLabels returns a k8s API-compliant labels string. The `kubernetes.io/role` and `node-role.kubernetes.io` labels are disallowed by the kubelet `--node-labels` argument in Kubernetes 1.16 and later.
func GetMaxVersion ¶
GetMaxVersion gets the highest semver version preRelease=true means accept a pre-release version as a max value
func GetMinVersion ¶
GetMinVersion gets the lowest semver version preRelease=true means accept a pre-release version as a min value
func GetNSeriesVMCasesForTesting ¶
GetNSeriesVMCasesForTesting returns a struct w/ VM SKUs and whether or not we expect them to be nvidia-enabled
func GetOrderedEscapedKeyValsString ¶ added in v0.37.0
GetOrderedEscapedKeyValsString returns an ordered string of escaped, quoted key=val
func GetOrderedNewlinedKeyValsStringForCloudInit ¶ added in v0.48.0
GetOrderedNewlinedKeyValsStringForCloudInit returns an ordered string of key = val, separated by newlines
func GetStorageAccountType ¶ added in v0.37.0
GetStorageAccountType returns the managed disk storage tier for a given VM size.
func GetSupportedKubernetesVersion ¶
GetSupportedKubernetesVersion verifies that a passed-in version string is supported, or returns a default version string if not
func GetSupportedVersions ¶
func GetSupportedVersions(orchType string, isUpdate, hasWindows bool, isAzureStackCloud bool) (versions []string, defaultVersion string)
GetSupportedVersions get supported version list for a certain orchestrator
func GetVNETSubnetIDComponents ¶
GetVNETSubnetIDComponents extract subscription, resourcegroup, vnetname, subnetname from the vnetSubnetID
func GetValidPatchVersion ¶
func GetValidPatchVersion(orchType, orchVer string, isUpdate, hasWindows bool, isAzureStackCloud bool) string
GetValidPatchVersion gets the current valid patch version for the minor version of the passed in version
func GetVersionsBetween ¶
func GetVersionsBetween(versions []string, versionMin, versionMax string, inclusive, preReleases bool) []string
GetVersionsBetween returns a list of versions between a min and max inclusive=true means that we test for equality on both bounds preReleases=true means that we include pre-release versions in the list
func GetVersionsGt ¶
GetVersionsGt returns a list of versions greater than a semver string given a list of versions inclusive=true means that we test for equality as well preReleases=true means that we include pre-release versions in the list
func GetVersionsLt ¶
GetVersionsLt returns a list of versions less than than a semver string given a list of versions inclusive=true means that we test for equality as well preReleases=true means that we include pre-release versions in the list
func HandleValidationErrors ¶
func HandleValidationErrors(e validator.ValidationErrors) error
HandleValidationErrors is the helper function to catch validator.ValidationError based on Namespace of the error, and return customized error message.
func IP4BroadcastAddress ¶
IP4BroadcastAddress returns the broadcast address for the given IP subnet.
func IndentString ¶ added in v0.50.0
IndentString pads each line of an original string with N spaces and returns the new value.
func IsKubernetesVersionGe ¶
IsKubernetesVersionGe returns true if actualVersion is greater than or equal to version
func IsNvidiaEnabledSKU ¶
IsNvidiaEnabledSKU determines if an VM SKU has nvidia driver support
func IsSgxEnabledSKU ¶ added in v0.30.0
IsSgxEnabledSKU determines if an VM SKU has SGX driver support
func IsSupportedKubernetesVersion ¶
func IsSupportedKubernetesVersion(version string, isUpdate, hasWindows bool, isAzureStackCloud bool) bool
IsSupportedKubernetesVersion return true if the provided Kubernetes version is supported
func IsValidMinVersion ¶ added in v0.43.0
func RationalizeReleaseAndVersion ¶
func RationalizeReleaseAndVersion(orchType, orchRel, orchVer string, isUpdate, hasWindows bool, isAzureStackCloud bool) (version string)
RationalizeReleaseAndVersion return a version when it can be rationalized from the input, otherwise ""
func SliceIntIsNonEmpty ¶ added in v0.37.0
SliceIntIsNonEmpty is a simple convenience to determine if a []int is non-empty
func ValidateDNSPrefix ¶
ValidateDNSPrefix is a helper function to check that a DNS Prefix is valid
func WrapAsARMVariable ¶ added in v0.37.0
WrapAsARMVariable formats a string for inserting an ARM variable into an ARM expression
func WrapAsParameter ¶ added in v0.37.0
WrapAsParameter formats a string for inserting an ARM parameter into an ARM expression
func WrapAsVerbatim ¶ added in v0.37.0
WrapAsVerbatim formats a string for inserting a literal string into an ARM expression
Types ¶
type ContainerdCNIPlugin ¶ added in v0.50.0
type ContainerdCNIPlugin struct {
ConfTemplate string `toml:"conf_template,omitempty"`
}
type ContainerdConfig ¶ added in v0.50.0
type ContainerdConfig struct { OomScore int `toml:"oom_score,omitempty"` Root string `toml:"root,omitempty"` Version int `toml:"version,omitempty"` Plugins Plugins `toml:"plugins,omitempty"` }
func GetDefaultContainerdConfig ¶ added in v0.50.0
func GetDefaultContainerdConfig() ContainerdConfig
GetDefaultContainerdConfig returns the default containerd config for processing.
type ContainerdPlugin ¶ added in v0.50.0
type ContainerdPlugin struct { DefaultRuntimeName string `toml:"default_runtime_name,omitempty"` Runtimes map[string]ContainerdRuntime `toml:"runtimes,omitempty"` }
type ContainerdRuntime ¶ added in v0.50.0
type ContainerdRuntime struct {
RuntimeType string `toml:"runtime_type,omitempty"`
}
type DockerConfig ¶ added in v0.50.0
type DockerConfig struct { ExecOpts []string `json:"exec-opts,omitempty"` DataRoot string `json:"data-root,omitempty"` LiveRestore bool `json:"live-restore,omitempty"` LogDriver string `json:"log-driver,omitempty"` LogOpts LogOpts `json:"log-opts,omitempty"` DefaultRuntime string `json:"default-runtime,omitempty"` DockerDaemonRuntimes map[string]DockerDaemonRuntime `json:"runtimes,omitempty"` }
func GetDefaultDockerConfig ¶ added in v0.50.0
func GetDefaultDockerConfig() DockerConfig
GetDefaultDockerConfig returns the default docker config for processing.
type DockerDaemonRuntime ¶ added in v0.50.0
type IoContainerdGrpcV1Cri ¶ added in v0.50.0
type IoContainerdGrpcV1Cri struct { SandboxImage string `toml:"sandbox_image,omitempty"` CNI ContainerdCNIPlugin `toml:"cni,omitempty"` Containerd ContainerdPlugin `toml:"containerd,omitempty"` }
type Plugins ¶ added in v0.50.0
type Plugins struct {
IoContainerdGrpcV1Cri IoContainerdGrpcV1Cri `toml:"io.containerd.grpc.v1.cri,omitempty"`
}