defaulting

package
v2.25.2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 24 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DefaultPProfEndpoint                          = ":6600"
	DefaultEtcdVolumeSize                         = "5Gi"
	DefaultAuthClientID                           = "kubermatic"
	DefaultIngressClass                           = "nginx"
	DefaultCABundleConfigMapName                  = "ca-bundle"
	DefaultAPIReplicas                            = 2
	DefaultUIReplicas                             = 2
	DefaultSeedControllerMgrReplicas              = 1
	DefaultMasterControllerMgrReplicas            = 1
	DefaultAPIServerReplicas                      = 2
	DefaultWebhookReplicas                        = 1
	DefaultControllerManagerReplicas              = 1
	DefaultSchedulerReplicas                      = 1
	DefaultExposeStrategy                         = kubermaticv1.ExposeStrategyNodePort
	DefaultVPARecommenderDockerRepository         = "registry.k8s.io/autoscaling/vpa-recommender"
	DefaultVPAUpdaterDockerRepository             = "registry.k8s.io/autoscaling/vpa-updater"
	DefaultVPAAdmissionControllerDockerRepository = "registry.k8s.io/autoscaling/vpa-admission-controller"
	DefaultEnvoyDockerRepository                  = "docker.io/envoyproxy/envoy-distroless"
	DefaultUserClusterScrapeAnnotationPrefix      = "monitoring.kubermatic.io"
	DefaultMaximumParallelReconciles              = 10
	DefaultS3Endpoint                             = "s3.amazonaws.com"

	// 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 (
	// DefaultBackupInterval defines the default interval used to create backups.
	DefaultBackupInterval = "20m"

	// DefaultMeteringStorageSize is the default size for the metering Prometheus PVC.
	DefaultMeteringStorageSize = "100Gi"
	// DefaultMeteringRetentionDays is the default number of days for which the metering Prometheus
	// should keep data.
	DefaultMeteringRetentionDays = 90
)
View Source
const DefaultBackupDeleteContainer = `` /* 621-byte string literal not displayed */
View Source
const DefaultBackupStoreContainer = `` /* 568-byte string literal not displayed */
View Source
const DefaultHelmTimeout = 5 * time.Minute

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

View Source
const DefaultKubernetesAddons = `` /* 1488-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("200m"),
			corev1.ResourceMemory: resource.MustParse("150Mi"),
		},
		Limits: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("1"),
			corev1.ResourceMemory: resource.MustParse("1Gi"),
		},
	}

	DefaultMasterControllerMgrResources = corev1.ResourceRequirements{
		Requests: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("200m"),
			corev1.ResourceMemory: resource.MustParse("128Mi"),
		},
		Limits: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("1"),
			corev1.ResourceMemory: resource.MustParse("400Mi"),
		},
	}

	DefaultSeedControllerMgrResources = corev1.ResourceRequirements{
		Requests: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("200m"),
			corev1.ResourceMemory: resource.MustParse("100Mi"),
		},
		Limits: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("1"),
			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"),
		},
	}

	DefaultVPARecommenderResources = corev1.ResourceRequirements{
		Requests: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("50m"),
			corev1.ResourceMemory: resource.MustParse("512Mi"),
		},
		Limits: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("200m"),
			corev1.ResourceMemory: resource.MustParse("3Gi"),
		},
	}

	DefaultVPAUpdaterResources = corev1.ResourceRequirements{
		Requests: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("50m"),
			corev1.ResourceMemory: resource.MustParse("128Mi"),
		},
		Limits: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("200m"),
			corev1.ResourceMemory: resource.MustParse("512Mi"),
		},
	}

	DefaultVPAAdmissionControllerResources = corev1.ResourceRequirements{
		Requests: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("50m"),
			corev1.ResourceMemory: resource.MustParse("128Mi"),
		},
		Limits: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("200m"),
			corev1.ResourceMemory: resource.MustParse("512Mi"),
		},
	}

	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.28.9"),

		Versions: []semver.Semver{

			newSemver("v1.27.3"),
			newSemver("v1.27.6"),
			newSemver("v1.27.10"),
			newSemver("v1.27.11"),
			newSemver("v1.27.13"),

			newSemver("v1.28.2"),
			newSemver("v1.28.5"),
			newSemver("v1.28.6"),
			newSemver("v1.28.7"),
			newSemver("v1.28.9"),

			newSemver("v1.29.0"),
			newSemver("v1.29.1"),
			newSemver("v1.29.2"),
			newSemver("v1.29.4"),
		},
		Updates: []kubermaticv1.Update{

			{

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

				From: "1.27.*",
				To:   "1.28.*",
			},

			{

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

				From: "1.28.*",
				To:   "1.29.*",
			},

			{

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

			{
				Provider:  string(kubermaticv1.AWSCloudProvider),
				Version:   ">= 1.27.0",
				Condition: kubermaticv1.InTreeCloudProviderCondition,
				Operation: kubermaticv1.CreateOperation,
			},
			{
				Provider:  string(kubermaticv1.AWSCloudProvider),
				Version:   ">= 1.27.0",
				Condition: kubermaticv1.InTreeCloudProviderCondition,
				Operation: kubermaticv1.UpdateOperation,
			},

			{
				Provider:  string(kubermaticv1.OpenstackCloudProvider),
				Version:   ">= 1.26.0",
				Condition: kubermaticv1.InTreeCloudProviderCondition,
				Operation: kubermaticv1.CreateOperation,
			},
			{
				Provider:  string(kubermaticv1.OpenstackCloudProvider),
				Version:   ">= 1.26.0",
				Condition: kubermaticv1.InTreeCloudProviderCondition,
				Operation: kubermaticv1.UpdateOperation,
			},

			{
				Provider:  "",
				Version:   ">= 1.29.0",
				Condition: kubermaticv1.InTreeCloudProviderCondition,
				Operation: kubermaticv1.CreateOperation,
			},
			{
				Provider:  "",
				Version:   ">= 1.29.0",
				Condition: kubermaticv1.InTreeCloudProviderCondition,
				Operation: kubermaticv1.UpdateOperation,
			},
		},
	}

	ExternalClusterDefaultKubernetesVersioning = map[kubermaticv1.ExternalClusterProviderType]kubermaticv1.ExternalClusterProviderVersioningConfiguration{
		kubermaticv1.EKSProviderType: eksProviderVersioningConfiguration,
		kubermaticv1.AKSProviderType: aksProviderVersioningConfiguration,
	}
)

Functions

func DatacenterForClusterSpec added in v2.19.0

func DatacenterForClusterSpec(spec *kubermaticv1.ClusterSpec, seed *kubermaticv1.Seed) (*kubermaticv1.Datacenter, *field.Error)

func DefaultApplicationDefinition added in v2.22.0

func DefaultApplicationDefinition(appInstall *appskubermaticv1.ApplicationDefinition) error

func DefaultApplicationInstallation added in v2.22.0

func DefaultApplicationInstallation(appInstall *appskubermaticv1.ApplicationInstallation) error

func DefaultClusterNetwork added in v2.21.0

func DefaultClusterNetwork(specClusterNetwork kubermaticv1.ClusterNetworkingConfig, provider kubermaticv1.ProviderType, exposeStrategy kubermaticv1.ExposeStrategy) kubermaticv1.ClusterNetworkingConfig

func DefaultClusterSpec added in v2.19.0

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

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

This function assumes that the KubermaticConfiguration has already been defaulted (as the KubermaticConfigurationGetter does that automatically), but the Seed does not yet need to be defaulted (to the values of the KubermaticConfiguration).

func DefaultConfiguration added in v2.22.0

func DefaultDeployOpts added in v2.22.0

func DefaultDeployOpts(deployOpts *appskubermaticv1.DeployOptions)

func DefaultExternalClusterSpec added in v2.21.0

func DefaultExternalClusterSpec(ctx context.Context, spec *kubermaticv1.ExternalClusterSpec) error

DefaultExternalClusterSpec defaults the cluster spec when creating a new external cluster. This function assumes that the KubermaticConfiguration has already been defaulted (as the KubermaticConfigurationGetter does that automatically).

func DefaultOmittedValues added in v2.25.0

func DefaultOmittedValues(spec *appskubermaticv1.ApplicationInstallationSpec)

DefaultOmittedValues defaults the values field to "{}" if it was not explicitly set. Defaulting the field on our end allows users to omit the field in case they are not using it or making use of the newer ValuesBlock field. Without this defaulting, the k8s-apiserver complains that the field cannot be null. This is most likely due to the fact that Values is of type runtime.RawExtension.

func DefaultSeed added in v2.22.0

DefaultSeed fills in missing values in the Seed's spec by copying them from the global defaults in the KubermaticConfiguration (in which some fields might already be deprecated, as we move configuration down into the Seeds). This function assumes that the config has already been defaulted.

func DefaultUserSSHKey added in v2.21.0

func DefaultUserSSHKey(key *kubermaticv1.UserSSHKey, oldKey *kubermaticv1.UserSSHKey) (*kubermaticv1.UserSSHKey, error)

func GetDefaultingClusterTemplate added in v2.19.0

func GetDefaultingClusterTemplate(ctx context.Context, client ctrlruntimeclient.Reader, seed *kubermaticv1.Seed) (*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