defaulting

package
v3.0.0-...-d6c4d9c Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultEtcdClusterSize = 3
	MinEtcdClusterSize     = 3
	MaxEtcdClusterSize     = 9

	// DefaultNodeAccessNetwork is the default CIDR used for the VPNs
	// transit network through which we route the ControlPlane -> Node/Pod traffic.
	DefaultNodeAccessNetwork = "10.254.0.0/16"
)
View Source
const (
	DefaultPProfEndpoint                       = ":6600"
	DefaultEtcdVolumeSize                      = "5Gi"
	DefaultAuthClientID                        = "kubermatic"
	DefaultIngressClass                        = "nginx"
	DefaultCABundleConfigMapName               = "ca-bundle"
	DefaultAPIReplicas                         = 2
	DefaultUIReplicas                          = 2
	DefaultSeedControllerManagerReplicas       = 1
	DefaultWebhookReplicas                     = 1
	DefaultKubernetesApiserverReplicas         = 2
	DefaultKubernetesControllerManagerReplicas = 1
	DefaultKubernetesSchedulerReplicas         = 1
	DefaultExposeStrategy                      = kubermaticv1.ExposeStrategyNodePort
	DefaultEnvoyDockerRepository               = "docker.io/envoyproxy/envoy-alpine"
	DefaultUserClusterScrapeAnnotationPrefix   = "monitoring.kubermatic.io"
	DefaultMaximumParallelReconciles           = 10
	DefaultS3Endpoint                          = "s3.amazonaws.com"
	DefaultSSHPort                             = 22
	DefaultKubeletPort                         = 10250

	// DefaultCloudProviderReconciliationInterval is the time in between deep cloud provider reconciliations
	// in case the user did not configure a special interval for the given datacenter.
	DefaultCloudProviderReconciliationInterval = 6 * time.Hour

	// DefaultNoProxy is a set of domains/networks that should never be
	// routed through a proxy. All user-supplied values are appended to
	// this constant.
	DefaultNoProxy = "127.0.0.1/8,localhost,.local,.local.,kubernetes,.default,.svc"
)
View Source
const (
	DefaultNodeportProxyDockerRepository = "quay.io/kubermatic/nodeport-proxy"

	// DefaultKubermaticImage defines the default Docker repository containing the Kubermatic API image.
	DefaultKubermaticImage = "quay.io/kubermatic/kubermatic"

	// DefaultEtcdLauncherImage defines the default Docker repository containing the etcd launcher image.
	DefaultEtcdLauncherImage = "quay.io/kubermatic/etcd-launcher"

	// DefaultDNATControllerImage defines the default Docker repository containing the DNAT controller image.
	DefaultDNATControllerImage = "quay.io/kubermatic/kubeletdnat-controller"

	// DefaultDashboardAddonImage defines the default Docker repository containing the dashboard image.
	DefaultDashboardImage = "quay.io/kubermatic/dashboard"

	// DefaultKubernetesAddonImage defines the default Docker repository containing the Kubernetes addons.
	DefaultKubernetesAddonImage = "quay.io/kubermatic/addons"

	// DefaultNetworkInterfaceManagerImage defines the default Docker repository containing the network interface manager image.
	DefaultNetworkInterfaceManagerImage = "quay.io/kubermatic/network-interface-manager"

	// DefaultSystemApplicationsHelmRepository defines the default OCI repository containing the Helm charts of system Applications, such as CNI.
	DefaultSystemApplicationsHelmRepository = "quay.io/kubermatic/helm-charts"
)
View Source
const DefaultHelmTimeout = 5 * time.Minute

DefaultHelmTimeout is the default time to wait for any individual Kubernetes operation.

View Source
const DefaultKubernetesAddons = `` /* 1631-byte string literal not displayed */

Variables

View Source
var (
	DefaultAccessibleAddons = []string{
		"cluster-autoscaler",
		"node-exporter",
		"kube-state-metrics",
		"multus",
		"hubble",
		"metallb",
	}

	DefaultUIResources = corev1.ResourceRequirements{
		Requests: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("100m"),
			corev1.ResourceMemory: resource.MustParse("64Mi"),
		},
		Limits: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("250m"),
			corev1.ResourceMemory: resource.MustParse("128Mi"),
		},
	}

	DefaultAPIResources = corev1.ResourceRequirements{
		Requests: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("100m"),
			corev1.ResourceMemory: resource.MustParse("150Mi"),
		},
		Limits: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("250m"),
			corev1.ResourceMemory: resource.MustParse("1Gi"),
		},
	}

	DefaultSeedControllerManagerResources = corev1.ResourceRequirements{
		Requests: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("200m"),
			corev1.ResourceMemory: resource.MustParse("100Mi"),
		},
		Limits: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("500m"),
			corev1.ResourceMemory: resource.MustParse("1Gi"),
		},
	}

	DefaultWebhookResources = corev1.ResourceRequirements{
		Requests: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("50m"),
			corev1.ResourceMemory: resource.MustParse("64Mi"),
		},
		Limits: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("250m"),
			corev1.ResourceMemory: resource.MustParse("256Mi"),
		},
	}

	DefaultNodeportProxyEnvoyResources = corev1.ResourceRequirements{
		Requests: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("50m"),
			corev1.ResourceMemory: resource.MustParse("32Mi"),
		},
		Limits: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("1"),
			corev1.ResourceMemory: resource.MustParse("128Mi"),
		},
	}

	DefaultNodeportProxyEnvoyManagerResources = corev1.ResourceRequirements{
		Requests: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("50m"),
			corev1.ResourceMemory: resource.MustParse("32Mi"),
		},
		Limits: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("150m"),
			corev1.ResourceMemory: resource.MustParse("48Mi"),
		},
	}

	DefaultNodeportProxyUpdaterResources = corev1.ResourceRequirements{
		Requests: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("50m"),
			corev1.ResourceMemory: resource.MustParse("32Mi"),
		},
		Limits: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("150m"),
			corev1.ResourceMemory: resource.MustParse("32Mi"),
		},
	}

	DefaultNodeportProxyServiceAnnotations = map[string]string{

		"service.beta.kubernetes.io/aws-load-balancer-type": "nlb",

		"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout": "3600",
	}

	DefaultKubernetesVersioning = kubermaticv1.KubermaticVersioningConfiguration{
		Default: semver.NewSemverOrDie("v1.25.9"),

		Versions: []semver.Semver{

			newSemver("v1.24.3"),
			newSemver("v1.24.6"),
			newSemver("v1.24.8"),
			newSemver("v1.24.9"),
			newSemver("v1.24.10"),
			newSemver("v1.24.13"),

			newSemver("v1.25.2"),
			newSemver("v1.25.4"),
			newSemver("v1.25.5"),
			newSemver("v1.25.6"),
			newSemver("v1.25.9"),

			newSemver("v1.26.1"),
			newSemver("v1.26.4"),
		},
		Updates: []kubermaticv1.Update{

			{

				From:      "1.23.*",
				To:        "1.24.10",
				Automatic: pointer.Bool(true),
			},

			{

				From: "1.24.*",
				To:   "1.24.*",
			},
			{

				From:      ">= 1.24.0, < 1.24.8",
				To:        "1.24.8",
				Automatic: pointer.Bool(true),
			},
			{

				From: "1.24.*",
				To:   "1.25.*",
			},

			{

				From: "1.25.*",
				To:   "1.25.*",
			},
			{

				From:      ">= 1.25.0, < 1.25.4",
				To:        "1.25.4",
				Automatic: pointer.Bool(true),
			},
			{

				From: "1.25.*",
				To:   "1.26.*",
			},

			{

				From: "1.26.*",
				To:   "1.26.*",
			},
		},
		ProviderIncompatibilities: []kubermaticv1.Incompatibility{

			{
				Provider:  kubermaticv1.CloudProviderAWS,
				Version:   "< 1.24.0",
				Condition: kubermaticv1.ConditionExternalCloudProvider,
				Operation: kubermaticv1.OperationSupport,
			},
			{
				Provider:  kubermaticv1.CloudProviderAWS,
				Version:   "< 1.24.0",
				Condition: kubermaticv1.ConditionExternalCloudProvider,
				Operation: kubermaticv1.OperationCreate,
			},
			{
				Provider:  kubermaticv1.CloudProviderAWS,
				Version:   "< 1.24.0",
				Condition: kubermaticv1.ConditionExternalCloudProvider,
				Operation: kubermaticv1.OperationUpdate,
			},

			{
				Provider:  kubermaticv1.CloudProviderOpenStack,
				Version:   ">= 1.26.0",
				Condition: kubermaticv1.ConditionInTreeCloudProvider,
				Operation: kubermaticv1.OperationCreate,
			},
			{
				Provider:  kubermaticv1.CloudProviderOpenStack,
				Version:   ">= 1.26.0",
				Condition: kubermaticv1.ConditionInTreeCloudProvider,
				Operation: kubermaticv1.OperationUpdate,
			},

			{
				Provider:  kubermaticv1.CloudProviderVSphere,
				Version:   ">= 1.25.0",
				Condition: kubermaticv1.ConditionInTreeCloudProvider,
				Operation: kubermaticv1.OperationCreate,
			},
			{
				Provider:  kubermaticv1.CloudProviderVSphere,
				Version:   ">= 1.25.0",
				Condition: kubermaticv1.ConditionInTreeCloudProvider,
				Operation: kubermaticv1.OperationUpdate,
			},
		},
	}

	ExternalClusterDefaultKubernetesVersioning = map[kubermaticv1.ExternalClusterProvider]kubermaticv1.ExternalClusterProviderVersioningConfiguration{
		kubermaticv1.ExternalClusterProviderEKS: eksProviderVersioningConfiguration,
		kubermaticv1.ExternalClusterProviderAKS: aksProviderVersioningConfiguration,
	}
)
View Source
var (
	// DefaultClusterComponentSettings are default values that are applied to new clusters
	// upon creation. This is the last source of default values, other mechanisms like the
	// default cluster templates are used earlier.
	DefaultClusterComponentSettings = kubermaticv1.ComponentSettings{
		Apiserver: kubermaticv1.APIServerSettings{
			NodePortRange: resources.DefaultNodePortRange,
			DeploymentSettings: kubermaticv1.DeploymentSettings{
				Replicas: pointer.Int32(DefaultKubernetesApiserverReplicas),
			},
		},
		ControllerManager: kubermaticv1.ControllerSettings{
			DeploymentSettings: kubermaticv1.DeploymentSettings{
				Replicas: pointer.Int32(DefaultKubernetesControllerManagerReplicas),
			},
		},
		Scheduler: kubermaticv1.ControllerSettings{
			DeploymentSettings: kubermaticv1.DeploymentSettings{
				Replicas: pointer.Int32(DefaultKubernetesSchedulerReplicas),
			},
		},
		Etcd: kubermaticv1.EtcdStatefulSetSettings{
			ClusterSize: pointer.Int32(DefaultEtcdClusterSize),
			DiskSize:    mustParseQuantity(DefaultEtcdVolumeSize),
		},
	}
)

Functions

func DatacenterForClusterSpec

func DatacenterForClusterSpec(ctx context.Context, spec *kubermaticv1.ClusterSpec, datacenterGetter provider.DatacenterGetter) (*kubermaticv1.Datacenter, *field.Error)

func DefaultApplicationDefinition

func DefaultApplicationDefinition(appInstall *appskubermaticv1.ApplicationDefinition) error

func DefaultApplicationInstallation

func DefaultApplicationInstallation(appInstall *appskubermaticv1.ApplicationInstallation) error

func DefaultClusterSpec

func DefaultClusterSpec(ctx context.Context, spec *kubermaticv1.ClusterSpec, template *kubermaticv1.ClusterTemplate, config *kubermaticv1.KubermaticConfiguration, datacenterGetter provider.DatacenterGetter, cloudProvider provider.CloudProvider) error

DefaultClusterSpec defaults the cluster spec when creating a new cluster. Defaults are taken from, in order:

  1. ClusterTemplate (if given)
  2. KubermaticConfiguration's spec.userCluster
  3. Constants in pkg/controller/operator/defaults

This function assumes that the KubermaticConfiguration has already been defaulted (as the KubermaticConfigurationGetter does that automatically).

func DefaultDeployOpts

func DefaultDeployOpts(deployOpts *appskubermaticv1.DeployOptions)

func GetDefaultingClusterTemplate

func GetDefaultingClusterTemplate(ctx context.Context, client ctrlruntimeclient.Reader, config *kubermaticv1.KubermaticConfiguration) (*kubermaticv1.ClusterTemplate, error)

GetDefaultingClusterTemplate returns the ClusterTemplate that is referenced by the Seed. Note that this can return nil if no template is configured yet (this is not considered an error).

Types

This section is empty.

Jump to

Keyboard shortcuts

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