controller

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PodStatusSuccess = "Successful"
	PodStatusRunning = "Running"
	PodStatusFailed  = "Failure"

	Upgrade = "upgrade"
)

Variables

This section is empty.

Functions

func GetClientSet

func GetClientSet() *kubernetes.Clientset

GetClientSet 获取一个 clientSet

func UpgradePodByImages

func UpgradePodByImages(ctx context.Context, pod *corev1.Pod, image []string, clientSet *kubernetes.Clientset) error

UpgradePodByImages 更新 Pod 的镜像

Types

type UpGradeReconciler

type UpGradeReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

UpGradeReconciler reconciles a UpGrade object

func (*UpGradeReconciler) Reconcile

func (r *UpGradeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the UpGrade object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.17.2/pkg/reconcile

func (*UpGradeReconciler) SetupWithManager

func (r *UpGradeReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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