common

package
v2.14.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPProfEndpoint                          = ":6600"
	DefaultNodePortRange                          = "30000-32767"
	DefaultEtcdVolumeSize                         = "5Gi"
	DefaultAuthClientID                           = "kubermatic"
	DefaultIngressClass                           = "nginx"
	DefaultAPIReplicas                            = 2
	DefaultUIReplicas                             = 2
	DefaultSeedControllerMgrReplicas              = 1
	DefaultMasterControllerMgrReplicas            = 1
	DefaultAPIServerReplicas                      = 2
	DefaultExposeStrategy                         = operatorv1alpha1.NodePortStrategy
	DefaultVPARecommenderDockerRepository         = "gcr.io/google_containers/vpa-recommender"
	DefaultVPAUpdaterDockerRepository             = "gcr.io/google_containers/vpa-updater"
	DefaultVPAAdmissionControllerDockerRepository = "gcr.io/google_containers/vpa-admission-controller"
	DefaultEnvoyDockerRepository                  = "docker.io/envoyproxy/envoy-alpine"

	// 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 (
	// NameLabel is the label containing the application's name.
	NameLabel = "app.kubernetes.io/name"

	// VersionLabel is the label containing the application's version.
	VersionLabel = "app.kubernetes.io/version"

	// VersionsFileName is the name of the YAML file containing the enabled and
	// default Kubernetes and Openshift versions.
	VersionsFileName = "versions.yaml"

	// UpdatesFileName is the name of the YAML file containing the configured
	// cluster upgrade rules.
	UpdatesFileName = "updates.yaml"

	// OpenshiftAddonsFileName is the name of the openshift addons manifest file
	// in the master files.
	OpenshiftAddonsFileName = "openshift-addons.yaml"

	// KubernetesAddonsFileName is the name of the kubernetes addons manifest file
	// in the master files.
	KubernetesAddonsFileName = "kubernetes-addons.yaml"

	DockercfgSecretName              = "dockercfg"
	DexCASecretName                  = "dex-ca"
	ExtraFilesSecretName             = "extra-files"
	SeedWebhookServingCASecretName   = "seed-webhook-ca"
	SeedWebhookServingCertSecretName = "seed-webhook-cert"

	IngressName                           = "kubermatic"
	MasterControllerManagerDeploymentName = "kubermatic-master-controller-manager"
	SeedControllerManagerDeploymentName   = "kubermatic-seed-controller-manager"

	CleanupFinalizer = "operator.kubermatic.io/cleanup"
)
View Source
const (
	// OperatorName is used as the value for ManagedBy labels to establish
	// a weak ownership to reconciled resources.
	OperatorName = "kubermatic-operator"

	// ManagedByLabel is the label used to identify the resources
	// created by this controller.
	ManagedByLabel = "app.kubernetes.io/managed-by"
)
View Source
const DefaultBackupCleanupContainer = `` /* 755-byte string literal not displayed */
View Source
const DefaultBackupStoreContainer = `` /* 720-byte string literal not displayed */
View Source
const DefaultKubernetesAddons = `` /* 1411-byte string literal not displayed */
View Source
const (
	DefaultNodeportProxyDockerRepository = "quay.io/kubermatic/nodeport-proxy"
)
View Source
const DefaultOpenshiftAddons = `` /* 829-byte string literal not displayed */
View Source
const DefaultUIConfig = `
{
  "share_kubeconfig": false
}`

Variables

View Source
var (
	DefaultAccessibleAddons = []string{
		"node-exporter",
	}

	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("512Mi"),
		},
		Limits: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("250m"),
			corev1.ResourceMemory: resource.MustParse("1Gi"),
		},
	}

	DefaultMasterControllerMgrResources = corev1.ResourceRequirements{
		Requests: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("50m"),
			corev1.ResourceMemory: resource.MustParse("128Mi"),
		},
		Limits: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("100m"),
			corev1.ResourceMemory: resource.MustParse("256Mi"),
		},
	}

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

	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("32Mi"),
		},
		Limits: corev1.ResourceList{
			corev1.ResourceCPU:    resource.MustParse("200m"),
			corev1.ResourceMemory: resource.MustParse("128Mi"),
		},
	}

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

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

	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 = operatorv1alpha1.KubermaticVersioningConfiguration{
		Default: semver.MustParse("v1.17.9"),
		Versions: []*semver.Version{

			semver.MustParse("v1.15.5"),
			semver.MustParse("v1.15.6"),
			semver.MustParse("v1.15.7"),
			semver.MustParse("v1.15.9"),
			semver.MustParse("v1.15.10"),
			semver.MustParse("v1.15.11"),

			semver.MustParse("v1.16.13"),

			semver.MustParse("v1.17.9"),

			semver.MustParse("v1.18.6"),
		},
		Updates: []operatorv1alpha1.Update{

			{

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

				From:      "<= 1.14.7, >= 1.14.0",
				To:        "1.14.8",
				Automatic: pointer.BoolPtr(true),
			},
			{

				From: "1.14.*",
				To:   "1.15.*",
			},

			{

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

				From:      "<= 1.15.4, >= 1.15.0",
				To:        "1.15.5",
				Automatic: pointer.BoolPtr(true),
			},
			{

				From:      "1.15.8",
				To:        "1.15.9",
				Automatic: pointer.BoolPtr(true),
			},
			{

				From: "1.15.*",
				To:   "1.16.*",
			},

			{

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

				From:      "<= 1.16.12, >= 1.16.0",
				To:        "1.16.13",
				Automatic: pointer.BoolPtr(true),
			},
			{

				From: "1.16.*",
				To:   "1.17.*",
			},

			{

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

				From:      "<= 1.17.8, >= 1.17.0",
				To:        "1.17.9",
				Automatic: pointer.BoolPtr(true),
			},
			{

				From: "1.17.*",
				To:   "1.18.*",
			},

			{

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

				From:      "<= 1.18.5, >= 1.18.0",
				To:        "1.18.6",
				Automatic: pointer.BoolPtr(true),
			},
		},
	}

	// DefaultOpenshiftVersioning contains the supported versions for openshift clusters. The OpenShift 4
	// minor release is: Kubernetes minor - 12, since we only support openshift v4.1.9 and v4.1.18 only
	// only cri-o 1.13.x is installed to the provisioned machines.
	DefaultOpenshiftVersioning = operatorv1alpha1.KubermaticVersioningConfiguration{
		Default: semver.MustParse("v4.1.18"),
		Versions: []*semver.Version{

			semver.MustParse("v4.1.9"),

			semver.MustParse("v4.1.18"),
		},
		Updates: []operatorv1alpha1.Update{

			{

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

				From: "4.1.*",
				To:   "2.2.*",
			},
		},
	}
)
View Source
var (
	// ManagedByOperatorPredicate is a predicate that matches all resources created by
	// the Kubermatic Operator, based on the ManagedBy label.
	ManagedByOperatorPredicate = predicate.Factory(func(m metav1.Object, _ runtime.Object) bool {
		for _, ref := range m.GetOwnerReferences() {
			if isKubermaticConfiguration(ref) || isSeed(ref) {
				return true
			}
		}

		return false
	})

	// ManagedByOperatorSelector is a label selector that matches all resources created by
	// the Kubermatic Operator.
	ManagedByOperatorSelector, _ = labels.NewRequirement(ManagedByLabel, selection.Equals, []string{OperatorName})
)
View Source
var KUBERMATICDOCKERTAG string

KUBERMATICDOCKERTAG is a magic variable containing the tag / git commit hash of the kubermatic Docker image to deploy. It gets fed by the Makefile as an ldflag.

View Source
var UIDOCKERTAG string

UIDOCKERTAG is a magic variable containing the tag / git commit hash of the dashboard-v2 Docker image to deploy. It gets fed by the Makefile as an ldflag.

Functions

func CleanupClusterResource

func CleanupClusterResource(client ctrlruntimeclient.Client, obj runtime.Object, name string) error

CleanupClusterResource attempts to find a cluster-wide resource and deletes it if it was found. If no resource with the given name exists, nil is returned.

func DefaultSeed

func DefaultSeed(seed *kubermaticv1.Seed, logger *zap.SugaredLogger) (*kubermaticv1.Seed, error)

func OwnershipModifierFactory

func OwnershipModifierFactory(owner metav1.Object, scheme *runtime.Scheme) reconciling.ObjectModifier

OwnershipModifierFactory is generating a new ObjectModifier that wraps an ObjectCreator and takes care of applying the ownership and other labels for all managed objects.

func StringifyFeatureGates

func StringifyFeatureGates(cfg *operatorv1alpha1.KubermaticConfiguration) string

StringifyFeatureGates takes a set of enabled features and returns a comma-separated key=value list like "featureA=true,featureB=true,...".

func VolumeRevisionLabelsModifierFactory

func VolumeRevisionLabelsModifierFactory(ctx context.Context, client ctrlruntimeclient.Client) reconciling.ObjectModifier

VolumeRevisionLabelsModifierFactory scans volume mounts for pod templates for ConfigMaps and Secrets and will then put new labels for these mounts onto the pod template, causing restarts when the volumes changed.

Types

type Versions

type Versions struct {
	Kubermatic        string
	UI                string
	VPA               string
	Envoy             string
	KubermaticEdition edition.Type
}

func NewDefaultVersions

func NewDefaultVersions() Versions

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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