Documentation ¶
Index ¶
- Constants
- func CCMMigrationCompleted(cluster *kubermaticv1.Cluster) bool
- func ClusterCloudProviderName(spec kubermaticv1.CloudSpec) (string, error)
- func ClusterReconcileWrapper(ctx context.Context, client ctrlruntimeclient.Client, workerName string, ...) (*reconcile.Result, error)
- func ClusterReconciliationSuccessful(cluster *kubermaticv1.Cluster, versions kubermatic.Versions, ...) (missingConditions []kubermaticv1.ClusterConditionType, success bool)
- func DatacenterCloudProviderName(spec *kubermaticv1.DatacenterSpec) (string, error)
- func EnsureProjectServiceAccountPrefix(str string) string
- func ExternalClusterCloudProviderName(spec kubermaticv1.ExternalClusterCloudSpec) (string, error)
- func GetHealthStatus(status kubermaticv1.HealthStatus, cluster *kubermaticv1.Cluster, ...) kubermaticv1.HealthStatus
- func GetProviderList(p *kubermaticv1.Preset) []kubermaticv1.ProviderType
- func GetProviderPreset(p *kubermaticv1.Preset, providerType kubermaticv1.ProviderType) *kubermaticv1.ProviderPreset
- func GetUserOwnedProjects(ctx context.Context, client ctrlruntimeclient.Client, userName string) ([]kubermaticv1.Project, error)
- func HasClusters(ctx context.Context, client ctrlruntimeclient.Client, projectID string) (bool, error)
- func HasExternalClusters(ctx context.Context, client ctrlruntimeclient.Client, projectID string) (bool, error)
- func HasProvider(p *kubermaticv1.Preset, providerType kubermaticv1.ProviderType) (bool, reflect.Value)
- func IsClusterInitialized(cluster *kubermaticv1.Cluster, versions kubermatic.Versions) bool
- func IsProjectServiceAccount(nameOrEmail string) bool
- func IsProviderEnabled(p *kubermaticv1.Preset, provider kubermaticv1.ProviderType) bool
- func NeedCCMMigration(cluster *kubermaticv1.Cluster) bool
- func OverrideProvider(p *kubermaticv1.Preset, providerType kubermaticv1.ProviderType, ...) *kubermaticv1.Preset
- func RemoveProjectServiceAccountPrefix(str string) string
- func RemoveProvider(p *kubermaticv1.Preset, providerType kubermaticv1.ProviderType) *kubermaticv1.Preset
- func SetClusterCondition(c *kubermaticv1.Cluster, v kubermatic.Versions, ...)
- func SetProviderEnabled(p *kubermaticv1.Preset, providerType kubermaticv1.ProviderType, enabled bool)
- func SetSeedCondition(seed *kubermaticv1.Seed, conditionType kubermaticv1.SeedConditionType, ...)
- func UpdateClusterStatus(ctx context.Context, client ctrlruntimeclient.Client, ...) error
- func UpdateKubermaticConfigurationStatus(ctx context.Context, client ctrlruntimeclient.Client, ...) error
- func UpdateResourceQuotaStatus(ctx context.Context, client ctrlruntimeclient.Client, ...) error
- func UpdateSeedStatus(ctx context.Context, client ctrlruntimeclient.Client, seed *kubermaticv1.Seed, ...) error
- func Validate(p *kubermaticv1.Preset, providerType kubermaticv1.ProviderType) error
- type ClusterPatchFunc
- type KubermaticConfigurationPatchFunc
- type ResourceQuotaPatchFunc
- type SeedPatchFunc
Constants ¶
const (
UserServiceAccountPrefix = "serviceaccount-"
)
Variables ¶
This section is empty.
Functions ¶
func CCMMigrationCompleted ¶
func CCMMigrationCompleted(cluster *kubermaticv1.Cluster) bool
func ClusterCloudProviderName ¶ added in v2.22.0
func ClusterCloudProviderName(spec kubermaticv1.CloudSpec) (string, error)
ClusterCloudProviderName returns the provider name for the given CloudSpec.
func ClusterReconcileWrapper ¶
func ClusterReconcileWrapper( ctx context.Context, client ctrlruntimeclient.Client, workerName string, cluster *kubermaticv1.Cluster, versions kubermatic.Versions, conditionType kubermaticv1.ClusterConditionType, reconcile func() (*reconcile.Result, error), ) (*reconcile.Result, error)
ClusterReconcileWrapper is a wrapper that should be used around any cluster reconciliaton. It:
- Checks if the cluster is paused
- Checks if the worker-name matches
- Sets the ReconcileSuccess condition for the controller by fetching the current Cluster object and patching its status.
func ClusterReconciliationSuccessful ¶
func ClusterReconciliationSuccessful(cluster *kubermaticv1.Cluster, versions kubermatic.Versions, ignoreKubermaticVersion bool) (missingConditions []kubermaticv1.ClusterConditionType, success bool)
ClusterReconciliationSuccessful checks if cluster has all conditions that are required for it to be healthy. ignoreKubermaticVersion should only be set in tests.
func DatacenterCloudProviderName ¶ added in v2.22.0
func DatacenterCloudProviderName(spec *kubermaticv1.DatacenterSpec) (string, error)
DatacenterCloudProviderName returns the provider name for the given Datacenter.
func EnsureProjectServiceAccountPrefix ¶ added in v2.21.0
EnsureProjectServiceAccountPrefix adds "serviceaccount-" prefix to a SA's ID, for example given "7d4b5695vb" it returns "serviceaccount-7d4b5695vb".
func ExternalClusterCloudProviderName ¶ added in v2.22.0
func ExternalClusterCloudProviderName(spec kubermaticv1.ExternalClusterCloudSpec) (string, error)
ExternalClusterCloudProviderName returns the provider name for the given ExternalClusterCloudSpec.
func GetHealthStatus ¶
func GetHealthStatus(status kubermaticv1.HealthStatus, cluster *kubermaticv1.Cluster, versions kubermatic.Versions) kubermaticv1.HealthStatus
We assume that the cluster is still provisioning if it was not initialized fully at least once.
func GetProviderList ¶
func GetProviderList(p *kubermaticv1.Preset) []kubermaticv1.ProviderType
func GetProviderPreset ¶
func GetProviderPreset(p *kubermaticv1.Preset, providerType kubermaticv1.ProviderType) *kubermaticv1.ProviderPreset
func GetUserOwnedProjects ¶ added in v2.22.0
func GetUserOwnedProjects(ctx context.Context, client ctrlruntimeclient.Client, userName string) ([]kubermaticv1.Project, error)
func HasClusters ¶ added in v2.22.0
func HasExternalClusters ¶ added in v2.22.0
func HasProvider ¶
func HasProvider(p *kubermaticv1.Preset, providerType kubermaticv1.ProviderType) (bool, reflect.Value)
func IsClusterInitialized ¶
func IsClusterInitialized(cluster *kubermaticv1.Cluster, versions kubermatic.Versions) bool
func IsProjectServiceAccount ¶ added in v2.21.0
IsProjectServiceAccount determines whether the given email address or user object name belongs to a project service account. For a service account, they must have the UserServiceAccountPrefix.
func IsProviderEnabled ¶
func IsProviderEnabled(p *kubermaticv1.Preset, provider kubermaticv1.ProviderType) bool
func NeedCCMMigration ¶
func NeedCCMMigration(cluster *kubermaticv1.Cluster) bool
func OverrideProvider ¶
func OverrideProvider(p *kubermaticv1.Preset, providerType kubermaticv1.ProviderType, newPreset *kubermaticv1.Preset) *kubermaticv1.Preset
func RemoveProjectServiceAccountPrefix ¶ added in v2.21.0
RemoveProjectServiceAccountPrefix removes "serviceaccount-" from a SA's ID, for example given "serviceaccount-7d4b5695vb" it returns "7d4b5695vb".
func RemoveProvider ¶
func RemoveProvider(p *kubermaticv1.Preset, providerType kubermaticv1.ProviderType) *kubermaticv1.Preset
func SetClusterCondition ¶
func SetClusterCondition( c *kubermaticv1.Cluster, v kubermatic.Versions, conditionType kubermaticv1.ClusterConditionType, status corev1.ConditionStatus, reason string, message string, )
SetClusterCondition sets a condition on the given cluster using the provided type, status, reason and message. It also adds the Kubermatic version and timestamps.
func SetProviderEnabled ¶
func SetProviderEnabled(p *kubermaticv1.Preset, providerType kubermaticv1.ProviderType, enabled bool)
func SetSeedCondition ¶ added in v2.21.0
func SetSeedCondition(seed *kubermaticv1.Seed, conditionType kubermaticv1.SeedConditionType, status corev1.ConditionStatus, reason string, message string)
SetSeedCondition sets a condition on the given seed using the provided type, status, reason and message.
func UpdateClusterStatus ¶ added in v2.20.0
func UpdateClusterStatus(ctx context.Context, client ctrlruntimeclient.Client, cluster *kubermaticv1.Cluster, patch ClusterPatchFunc) error
UpdateClusterStatus will attempt to patch the cluster status of the given cluster.
func UpdateKubermaticConfigurationStatus ¶ added in v2.21.0
func UpdateKubermaticConfigurationStatus(ctx context.Context, client ctrlruntimeclient.Client, kc *kubermaticv1.KubermaticConfiguration, patch KubermaticConfigurationPatchFunc, ) error
func UpdateResourceQuotaStatus ¶ added in v2.21.0
func UpdateResourceQuotaStatus(ctx context.Context, client ctrlruntimeclient.Client, resourceQuota *kubermaticv1.ResourceQuota, patch ResourceQuotaPatchFunc) error
UpdateResourceQuotaStatus will attempt to patch the resource quota status of the given resource quota.
func UpdateSeedStatus ¶ added in v2.21.0
func UpdateSeedStatus(ctx context.Context, client ctrlruntimeclient.Client, seed *kubermaticv1.Seed, patch SeedPatchFunc) error
func Validate ¶
func Validate(p *kubermaticv1.Preset, providerType kubermaticv1.ProviderType) error
Types ¶
type ClusterPatchFunc ¶ added in v2.20.0
type ClusterPatchFunc func(cluster *kubermaticv1.Cluster)
type KubermaticConfigurationPatchFunc ¶ added in v2.21.0
type KubermaticConfigurationPatchFunc func(kc *kubermaticv1.KubermaticConfiguration)
type ResourceQuotaPatchFunc ¶ added in v2.21.0
type ResourceQuotaPatchFunc func(resourceQuota *kubermaticv1.ResourceQuota)
type SeedPatchFunc ¶ added in v2.21.0
type SeedPatchFunc func(seed *kubermaticv1.Seed)