genericmutator

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: Apache-2.0, MIT Imports: 19 Imported by: 72

Documentation

Index

Constants

View Source
const CloudProviderConfigPath = "/var/lib/kubelet/cloudprovider.conf"

Variables

This section is empty.

Functions

func NewMutator

func NewMutator(
	ensurer Ensurer,
	unitSerializer controlplane.UnitSerializer,
	kubeletConfigCodec controlplane.KubeletConfigCodec,
	fciCodec controlplane.FileContentInlineCodec,
	logger logr.Logger,
) extensionswebhook.Mutator

NewMutator creates a new controlplane mutator.

Types

type Ensurer

type Ensurer interface {
	// EnsureKubeAPIServerService ensures that the kube-apiserver service conforms to the provider requirements.
	EnsureKubeAPIServerService(context.Context, EnsurerContext, *corev1.Service) error
	// EnsureKubeAPIServerDeployment ensures that the kube-apiserver deployment conforms to the provider requirements.
	EnsureKubeAPIServerDeployment(context.Context, EnsurerContext, *appsv1.Deployment) error
	// EnsureKubeControllerManagerDeployment ensures that the kube-controller-manager deployment conforms to the provider requirements.
	EnsureKubeControllerManagerDeployment(context.Context, EnsurerContext, *appsv1.Deployment) error
	// EnsureKubeSchedulerDeployment ensures that the kube-scheduler deployment conforms to the provider requirements.
	EnsureKubeSchedulerDeployment(context.Context, EnsurerContext, *appsv1.Deployment) error
	// EnsureETCDStatefulSet ensures that the etcd stateful sets conform to the provider requirements.
	EnsureETCDStatefulSet(context.Context, EnsurerContext, *appsv1.StatefulSet) error
	// EnsureKubeletServiceUnitOptions ensures that the kubelet.service unit options conform to the provider requirements.
	EnsureKubeletServiceUnitOptions(context.Context, EnsurerContext, []*unit.UnitOption) ([]*unit.UnitOption, error)
	// EnsureKubeletConfiguration ensures that the kubelet configuration conforms to the provider requirements.
	EnsureKubeletConfiguration(context.Context, EnsurerContext, *kubeletconfigv1beta1.KubeletConfiguration) error
	// EnsureKubernetesGeneralConfiguration ensures that the kubernetes general configuration conforms to the provider requirements.
	EnsureKubernetesGeneralConfiguration(context.Context, EnsurerContext, *string) error
	// ShouldProvisionKubeletCloudProviderConfig returns true if the cloud provider config file should be added to the kubelet configuration.
	ShouldProvisionKubeletCloudProviderConfig() bool
	// EnsureKubeletCloudProviderConfig ensures that the cloud provider config file content conforms to the provider requirements.
	EnsureKubeletCloudProviderConfig(context.Context, EnsurerContext, *string, string) error
	// EnsureAdditionalUnits ensures additional systemd units
	EnsureAdditionalUnits(context.Context, EnsurerContext, *[]extensionsv1alpha1.Unit) error
	// EnsureAdditionalFile ensures additional systemd files
	EnsureAdditionalFiles(context.Context, EnsurerContext, *[]extensionsv1alpha1.File) error
}

Ensurer ensures that various standard Kubernets controlplane objects conform to the provider requirements. If they don't initially, they are mutated accordingly.

type EnsurerContext

type EnsurerContext interface {
	GetCluster(ctx context.Context) (*extensionscontroller.Cluster, error)
}

EnsurerContext wraps the actual context and cluster object.

func NewEnsurerContext

func NewEnsurerContext(client client.Client, object metav1.Object) EnsurerContext

NewEnsurerContext creates an ensurer context object.

func NewInternalEnsurerContext

func NewInternalEnsurerContext(cluster *extensionscontroller.Cluster) EnsurerContext

NewInternalEnsurerContext creates an ensurer context object.

type NoopEnsurer

type NoopEnsurer struct{}

NoopEnsurer provides no-op implementation of Ensurer. This can be anonymously composed by actual Ensurers for convenience.

func (*NoopEnsurer) EnsureAdditionalFiles

func (e *NoopEnsurer) EnsureAdditionalFiles(ctx context.Context, ectx EnsurerContext, files *[]extensionsv1alpha1.File) error

EnsureAdditionalFiles ensures that additional required system files are added.

func (*NoopEnsurer) EnsureAdditionalUnits

func (e *NoopEnsurer) EnsureAdditionalUnits(ctx context.Context, ectx EnsurerContext, units *[]extensionsv1alpha1.Unit) error

EnsureAdditionalUnits ensures that additional required system units are added.

func (*NoopEnsurer) EnsureETCDStatefulSet

func (e *NoopEnsurer) EnsureETCDStatefulSet(context.Context, EnsurerContext, *appsv1.StatefulSet) error

EnsureETCDStatefulSet ensures that the etcd stateful sets conform to the provider requirements.

func (*NoopEnsurer) EnsureKubeAPIServerDeployment

func (e *NoopEnsurer) EnsureKubeAPIServerDeployment(context.Context, EnsurerContext, *appsv1.Deployment) error

EnsureKubeAPIServerDeployment ensures that the kube-apiserver deployment conforms to the provider requirements.

func (*NoopEnsurer) EnsureKubeAPIServerService

func (e *NoopEnsurer) EnsureKubeAPIServerService(context.Context, EnsurerContext, *corev1.Service) error

EnsureKubeAPIServerService ensures that the kube-apiserver service conforms to the provider requirements.

func (*NoopEnsurer) EnsureKubeControllerManagerDeployment

func (e *NoopEnsurer) EnsureKubeControllerManagerDeployment(context.Context, EnsurerContext, *appsv1.Deployment) error

EnsureKubeControllerManagerDeployment ensures that the kube-controller-manager deployment conforms to the provider requirements.

func (*NoopEnsurer) EnsureKubeSchedulerDeployment

func (e *NoopEnsurer) EnsureKubeSchedulerDeployment(context.Context, EnsurerContext, *appsv1.Deployment) error

EnsureKubeSchedulerDeployment ensures that the kube-scheduler deployment conforms to the provider requirements.

func (*NoopEnsurer) EnsureKubeletCloudProviderConfig

func (e *NoopEnsurer) EnsureKubeletCloudProviderConfig(context.Context, EnsurerContext, *string, string) error

EnsureKubeletCloudProviderConfig ensures that the cloud provider config file conforms to the provider requirements.

func (*NoopEnsurer) EnsureKubeletConfiguration

EnsureKubeletConfiguration ensures that the kubelet configuration conforms to the provider requirements.

func (*NoopEnsurer) EnsureKubeletServiceUnitOptions

func (e *NoopEnsurer) EnsureKubeletServiceUnitOptions(ctx context.Context, ectx EnsurerContext, opts []*unit.UnitOption) ([]*unit.UnitOption, error)

EnsureKubeletServiceUnitOptions ensures that the kubelet.service unit options conform to the provider requirements.

func (*NoopEnsurer) EnsureKubernetesGeneralConfiguration

func (e *NoopEnsurer) EnsureKubernetesGeneralConfiguration(context.Context, EnsurerContext, *string) error

EnsureKubernetesGeneralConfiguration ensures that the kubernetes general configuration conforms to the provider requirements.

func (*NoopEnsurer) ShouldProvisionKubeletCloudProviderConfig

func (e *NoopEnsurer) ShouldProvisionKubeletCloudProviderConfig() bool

ShouldProvisionKubeletCloudProviderConfig returns if the cloud provider config file should be added to the kubelet configuration.

Jump to

Keyboard shortcuts

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