statefulset

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(mgr manager.Manager) error

Add creates a new StatefulSet Controller and adds it to the Manager. The Manager will set fields on the Controller and Start it when the Manager is Started.

func ApplyRevision

func ApplyRevision(set *ketiv1.StatefulSet, revision *ketiv1.ControllerRevision) (*ketiv1.StatefulSet, error)

ApplyRevision returns a new StatefulSet constructed by restoring the state in revision to set. If the returned error is nil, the returned StatefulSet is valid.

func Match

func Match(ss *ketiv1.StatefulSet, history *ketiv1.ControllerRevision) (bool, error)

Match check if the given StatefulSet's template matches the template stored in the given history.

Types

type ReconcileStatefulSet

type ReconcileStatefulSet struct {
	KetiClient migration.MigrationV1Interface
	KubeClient kubeclient.Interface
	// contains filtered or unexported fields
}

ReconcileStatefulSet reconciles a StatefulSet object

func (*ReconcileStatefulSet) Reconcile

func (r *ReconcileStatefulSet) Reconcile(request reconcile.Request) (reconcile.Result, error)

Reconcile reads that state of the cluster for a StatefulSet object and makes changes based on the state read and what is in the StatefulSet.Spec TODO(user): Modify this Reconcile function to implement your Controller logic. This example creates a Pod as an example Note: The Controller will requeue the Request to be processed again if the returned error is non-nil or Result.Requeue is true, otherwise upon completion it will remove the work from the queue.

type StatefulPodControlInterface

type StatefulPodControlInterface interface {
	// CreateStatefulPod create a Pod in a StatefulSet. Any PVCs necessary for the Pod are created prior to creating
	// the Pod. If the returned error is nil the Pod and its PVCs have been created.
	CreateStatefulPod(set *ketiv1.StatefulSet, pod *ketiv1.Pod) error
	// UpdateStatefulPod Updates a Pod in a StatefulSet. If the Pod already has the correct identity and stable
	// storage this method is a no-op. If the Pod must be mutated to conform to the Set, it is mutated and updated.
	// pod is an in-out parameter, and any updates made to the pod are reflected as mutations to this parameter. If
	// the create is successful, the returned error is nil.
	UpdateStatefulPod(set *ketiv1.StatefulSet, pod *ketiv1.Pod) error
	// DeleteStatefulPod deletes a Pod in a StatefulSet. The pods PVCs are not deleted. If the delete is successful,
	// the returned error is nil.
	DeleteStatefulPod(set *ketiv1.StatefulSet, pod *ketiv1.Pod) error
}

StatefulPodControlInterface defines the interface that StatefulSetController uses to create, update, and delete Pods, and to update the Status of a StatefulSet. It follows the design paradigms used for PodControl, but its implementation provides for PVC creation, ordered Pod creation, ordered Pod termination, and Pod identity enforcement. Like controller.PodControlInterface, it is implemented as an interface to provide for testing fakes.

type StatefulSetControlInterface

type StatefulSetControlInterface interface {
	// UpdateStatefulSet implements the control logic for Pod creation, update, and deletion, and
	// persistent volume creation, update, and deletion.
	// If an implementation returns a non-nil error, the invocation will be retried using a rate-limited strategy.
	// Implementors should sink any errors that they do not wish to trigger a retry, and they may feel free to
	// exit exceptionally at any point provided they wish the update to be re-run at a later point in time.
	UpdateStatefulSet(set *ketiv1.StatefulSet, pods []*ketiv1.Pod) error
	// ListRevisions returns a array of the ControllerRevisions that represent the revisions of set. If the returned
	// error is nil, the returns slice of ControllerRevisions is valid.
	ListRevisions(set *ketiv1.StatefulSet) ([]*ketiv1.ControllerRevision, error)
	// AdoptOrphanRevisions adopts any orphaned ControllerRevisions that match set's Selector. If all adoptions are
	// successful the returned error is nil.
	AdoptOrphanRevisions(set *ketiv1.StatefulSet, revisions []*ketiv1.ControllerRevision) error
}

StatefulSetControl implements the control logic for updating StatefulSets and their children Pods. It is implemented as an interface to allow for extensions that provide different semantics. Currently, there is only one implementation.

func NewDefaultStatefulSetControl

func NewDefaultStatefulSetControl(
	podControl StatefulPodControlInterface,
	statusUpdater StatefulSetStatusUpdaterInterface,
	controllerHistory history.Interface,
	recorder record.EventRecorder) StatefulSetControlInterface

NewDefaultStatefulSetControl returns a new instance of the default implementation StatefulSetControlInterface that implements the documented semantics for StatefulSets. podControl is the PodControlInterface used to create, update, and delete Pods and to create PersistentVolumeClaims. statusUpdater is the StatefulSetStatusUpdaterInterface used to update the status of StatefulSets. You should use an instance returned from NewRealStatefulPodControl() for any scenario other than testing.

type StatefulSetStatusUpdaterInterface

type StatefulSetStatusUpdaterInterface interface {
	// UpdateStatefulSetStatus sets the set's Status to status. Implementations are required to retry on conflicts,
	// but fail on other errors. If the returned error is nil set's Status has been successfully set to status.
	UpdateStatefulSetStatus(set *ketiv1.StatefulSet, status *ketiv1.StatefulSetStatus) error
}

StatefulSetStatusUpdaterInterface is an interface used to update the StatefulSetStatus associated with a StatefulSet. For any use other than testing, clients should create an instance using NewRealStatefulSetStatusUpdater.

func NewRealStatefulSetStatusUpdater

func NewRealStatefulSetStatusUpdater(
	client migration.MigrationV1Interface,
	setLister lister.StatefulSetLister) StatefulSetStatusUpdaterInterface

NewRealStatefulSetStatusUpdater returns a StatefulSetStatusUpdaterInterface that updates the Status of a StatefulSet, using the supplied client and setLister.

Jump to

Keyboard shortcuts

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