Documentation ¶
Index ¶
- Constants
- Variables
- func CleanupClusterResource(client ctrlruntimeclient.Client, obj runtime.Object, name string) error
- func CreateUpdatesYAML(config *operatorv1alpha1.KubermaticVersionsConfiguration) (string, error)
- func CreateVersionsYAML(config *operatorv1alpha1.KubermaticVersionsConfiguration) (string, error)
- func DefaultConfiguration(config *operatorv1alpha1.KubermaticConfiguration, logger *zap.SugaredLogger) (*operatorv1alpha1.KubermaticConfiguration, error)
- func DefaultSeed(seed *kubermaticv1.Seed, logger *zap.SugaredLogger) (*kubermaticv1.Seed, error)
- func DexCASecretCreator(cfg *operatorv1alpha1.KubermaticConfiguration) reconciling.NamedSecretCreatorGetter
- func DockercfgSecretCreator(cfg *operatorv1alpha1.KubermaticConfiguration) reconciling.NamedSecretCreatorGetter
- func ExtraFilesSecretCreator(cfg *operatorv1alpha1.KubermaticConfiguration) reconciling.NamedSecretCreatorGetter
- func NamespaceCreator(cfg *operatorv1alpha1.KubermaticConfiguration) reconciling.NamedNamespaceCreatorGetter
- func OwnershipModifierFactory(owner metav1.Object, scheme *runtime.Scheme) reconciling.ObjectModifier
- func ProxyEnvironmentVars(cfg *operatorv1alpha1.KubermaticConfiguration) []corev1.EnvVar
- func SeedAdmissionServiceCreator(cfg *operatorv1alpha1.KubermaticConfiguration, client ctrlruntimeclient.Client) reconciling.NamedServiceCreatorGetter
- func SeedAdmissionWebhookCreator(cfg *operatorv1alpha1.KubermaticConfiguration, client ctrlruntimeclient.Client) reconciling.NamedValidatingWebhookConfigurationCreatorGetter
- func SeedAdmissionWebhookName(cfg *operatorv1alpha1.KubermaticConfiguration) string
- func StringifyFeatureGates(cfg *operatorv1alpha1.KubermaticConfiguration) string
- func VolumeRevisionLabelsModifierFactory(ctx context.Context, client ctrlruntimeclient.Client) reconciling.ObjectModifier
- func WebhookCABundle(cfg *operatorv1alpha1.KubermaticConfiguration, client ctrlruntimeclient.Client) ([]byte, error)
- func WebhookServingCASecretCreator(cfg *operatorv1alpha1.KubermaticConfiguration) reconciling.NamedSecretCreatorGetter
- func WebhookServingCertSecretCreator(cfg *operatorv1alpha1.KubermaticConfiguration, client ctrlruntimeclient.Client) reconciling.NamedSecretCreatorGetter
Constants ¶
const ( DefaultPProfEndpoint = ":6600" DefaultNodePortRange = "30000-32767" DefaultEtcdVolumeSize = "5Gi" DefaultAuthClientID = "kubermatic" DefaultIngressClass = "nginx" DefaultAPIReplicas = 2 DefaultUIReplicas = 2 DefaultSeedControllerMgrReplicas = 1 DefaultMasterControllerMgrReplicas = 1 DefaultAPIServerReplicas = 2 DefaultExposeStrategy = kubermaticv1.ExposeStrategyNodePort 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" DefaultMaximumParallelReconciles = 10 // 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" )
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" SeedWebhookServiceName = "seed-webhook" ClusterWebhookServiceName = "cluster-webhook" WebhookServingCASecretName = "webhook-ca" WebhookServingCertSecretName = "webhook-cert" IngressName = "kubermatic" MasterControllerManagerDeploymentName = "kubermatic-master-controller-manager" SeedControllerManagerDeploymentName = "kubermatic-seed-controller-manager" CleanupFinalizer = "operator.kubermatic.io/cleanup" // SkipReconcilingAnnotation can be used on Seed resources to make // the operator ignore them and not reconcile the seed components into // the cluster. This should only be used during cluster migrations. SkipReconcilingAnnotation = "operator.kubermatic.io/skip-reconciling" )
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" )
const DefaultBackupCleanupContainer = `` /* 755-byte string literal not displayed */
const DefaultBackupStoreContainer = `` /* 720-byte string literal not displayed */
const DefaultKubernetesAddons = `` /* 1141-byte string literal not displayed */
const (
DefaultNodeportProxyDockerRepository = "quay.io/kubermatic/nodeport-proxy"
)
const DefaultOpenshiftAddons = `` /* 829-byte string literal not displayed */
const DefaultUIConfig = `
{
"share_kubeconfig": false
}`
Variables ¶
var ( DefaultAccessibleAddons = []string{ "cluster-autoscaler", "node-exporter", "gatekeeper", } 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.19.3"), Versions: []*semver.Version{ semver.MustParse("v1.17.9"), semver.MustParse("v1.17.11"), semver.MustParse("v1.17.12"), semver.MustParse("v1.17.13"), semver.MustParse("v1.17.16"), semver.MustParse("v1.18.6"), semver.MustParse("v1.18.8"), semver.MustParse("v1.18.10"), semver.MustParse("v1.18.14"), semver.MustParse("v1.19.0"), semver.MustParse("v1.19.2"), semver.MustParse("v1.19.3"), semver.MustParse("v1.20.2"), }, Updates: []operatorv1alpha1.Update{ { From: "1.15.*", To: "1.16.*", Automatic: pointer.BoolPtr(true), }, { 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), }, { From: "1.18.*", To: "1.19.*", }, { From: "1.19.*", To: "1.19.*", }, { From: "1.19.*", To: "1.20.*", }, { From: "1.20.*", To: "1.20.*", }, }, } // 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.*", }, }, } )
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}) )
Functions ¶
func CleanupClusterResource ¶
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 CreateUpdatesYAML ¶
func CreateUpdatesYAML(config *operatorv1alpha1.KubermaticVersionsConfiguration) (string, error)
func CreateVersionsYAML ¶
func CreateVersionsYAML(config *operatorv1alpha1.KubermaticVersionsConfiguration) (string, error)
func DefaultConfiguration ¶
func DefaultConfiguration(config *operatorv1alpha1.KubermaticConfiguration, logger *zap.SugaredLogger) (*operatorv1alpha1.KubermaticConfiguration, error)
func DefaultSeed ¶
func DefaultSeed(seed *kubermaticv1.Seed, logger *zap.SugaredLogger) (*kubermaticv1.Seed, error)
func DexCASecretCreator ¶
func DexCASecretCreator(cfg *operatorv1alpha1.KubermaticConfiguration) reconciling.NamedSecretCreatorGetter
func DockercfgSecretCreator ¶
func DockercfgSecretCreator(cfg *operatorv1alpha1.KubermaticConfiguration) reconciling.NamedSecretCreatorGetter
func ExtraFilesSecretCreator ¶
func ExtraFilesSecretCreator(cfg *operatorv1alpha1.KubermaticConfiguration) reconciling.NamedSecretCreatorGetter
func NamespaceCreator ¶
func NamespaceCreator(cfg *operatorv1alpha1.KubermaticConfiguration) reconciling.NamedNamespaceCreatorGetter
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 ProxyEnvironmentVars ¶
func ProxyEnvironmentVars(cfg *operatorv1alpha1.KubermaticConfiguration) []corev1.EnvVar
func SeedAdmissionServiceCreator ¶
func SeedAdmissionServiceCreator(cfg *operatorv1alpha1.KubermaticConfiguration, client ctrlruntimeclient.Client) reconciling.NamedServiceCreatorGetter
SeedAdmissionServiceCreator creates the Service for the Seed Admission webhook. This service is created on master and seed clusters, because on masters the original copy of a Seed is validated, and on seed clusters the synced copy is validated (synced by the seed-sync controller).
func SeedAdmissionWebhookCreator ¶
func SeedAdmissionWebhookCreator(cfg *operatorv1alpha1.KubermaticConfiguration, client ctrlruntimeclient.Client) reconciling.NamedValidatingWebhookConfigurationCreatorGetter
func SeedAdmissionWebhookName ¶
func SeedAdmissionWebhookName(cfg *operatorv1alpha1.KubermaticConfiguration) string
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.
func WebhookCABundle ¶ added in v2.16.3
func WebhookCABundle(cfg *operatorv1alpha1.KubermaticConfiguration, client ctrlruntimeclient.Client) ([]byte, error)
func WebhookServingCASecretCreator ¶ added in v2.16.3
func WebhookServingCASecretCreator(cfg *operatorv1alpha1.KubermaticConfiguration) reconciling.NamedSecretCreatorGetter
func WebhookServingCertSecretCreator ¶ added in v2.16.3
func WebhookServingCertSecretCreator(cfg *operatorv1alpha1.KubermaticConfiguration, client ctrlruntimeclient.Client) reconciling.NamedSecretCreatorGetter
Types ¶
This section is empty.