Documentation ¶
Index ¶
- Constants
- func IsValidImageName(image string) bool
- type Controller
- func (c *Controller) BackUpDataRef(clusterOps *clusteroperationv1alpha1.ClusterOperation, ...) (bool, error)
- func (c *Controller) CalSalt(clusterOps *clusteroperationv1alpha1.ClusterOperation) string
- func (c *Controller) CheckClusterDataRef(cluster *clusterv1alpha1.Cluster, ...) error
- func (c *Controller) CheckConfigMapExist(namespace, name string) bool
- func (c *Controller) CheckSecretExist(namespace, name string) bool
- func (c *Controller) CopyConfigMap(clusterOps *clusteroperationv1alpha1.ClusterOperation, ...) (*corev1.ConfigMap, error)
- func (c *Controller) CopySecret(clusterOps *clusteroperationv1alpha1.ClusterOperation, ...) (*corev1.Secret, error)
- func (c *Controller) CreateEntryPointShellConfigMap(clusterOps *clusteroperationv1alpha1.ClusterOperation) (bool, error)
- func (c *Controller) CreateKubeSprayJob(clusterOps *clusteroperationv1alpha1.ClusterOperation) (bool, error)
- func (c *Controller) FetchGlobalInfoManifest() (*manifestv1alpha1.Manifest, error)
- func (c *Controller) FetchGlobalManifestImageTag() string
- func (c *Controller) FetchJobConditionStatusAndCompletionTime(clusterOps *clusteroperationv1alpha1.ClusterOperation) (clusteroperationv1alpha1.OpsStatus, *metav1.Time, error)
- func (c *Controller) GenerateJobName(clusterOps *clusteroperationv1alpha1.ClusterOperation) string
- func (c *Controller) GetKuBeanCluster(clusterOps *clusteroperationv1alpha1.ClusterOperation) (*clusterv1alpha1.Cluster, error)
- func (c *Controller) GetRunningPodFromJob(job *batchv1.Job) (*corev1.Pod, error)
- func (c *Controller) GetServiceAccountName(namespace, labelSelector string) (string, error)
- func (c *Controller) HookCustomAction(clusterOps *clusteroperationv1alpha1.ClusterOperation, job *batchv1.Job) error
- func (c *Controller) NewKubesprayJob(clusterOps *clusteroperationv1alpha1.ClusterOperation, ...) *batchv1.Job
- func (c *Controller) ProcessKubeanOperationImage(oldImage, globalManifestImageTag string) string
- func (c *Controller) Reconcile(ctx context.Context, req controllerruntime.Request) (controllerruntime.Result, error)
- func (c *Controller) Retry(f func() bool) bool
- func (c *Controller) SetOwnerReferences(objectMetaData *metav1.ObjectMeta, ...)
- func (c *Controller) SetupWithManager(mgr controllerruntime.Manager) error
- func (c *Controller) Start(ctx context.Context) error
- func (c *Controller) TrySuspendPod(clusterOps *clusteroperationv1alpha1.ClusterOperation) (bool, error)
- func (c *Controller) UpdateClusterOpsStatusDigest(clusterOps *clusteroperationv1alpha1.ClusterOperation) (bool, error)
- func (c *Controller) UpdateOperationOwnReferenceForCluster(operation *clusteroperationv1alpha1.ClusterOperation, ...) (bool, error)
- func (c *Controller) UpdateOwnReferenceToClusterOps(clusterOps *clusteroperationv1alpha1.ClusterOperation) error
- func (c *Controller) UpdateStatusForLabel(ops *clusteroperationv1alpha1.ClusterOperation) error
- func (c *Controller) UpdateStatusHasModified(clusterOps *clusteroperationv1alpha1.ClusterOperation) (bool, error)
- func (c *Controller) UpdateStatusLoop(clusterOps *clusteroperationv1alpha1.ClusterOperation, ...) (bool, error)
Constants ¶
View Source
const ( RequeueAfter = time.Second * 3 LoopForJobStatus = time.Second * 5 RetryInterval = time.Millisecond * 300 RetryCount = 5 ServiceAccount = "kubean.io/kubean-operator=sa" SprayJobPodName = "kubean" JobActorPodAnnoKey = "kubean.io/actor" )
View Source
const BaseSlat = "kubean"
Variables ¶
This section is empty.
Functions ¶
func IsValidImageName ¶ added in v0.1.1
Types ¶
type Controller ¶
type Controller struct { Client client.Client ClientSet kubernetes.Interface KubeanClusterSet clusterClientSet.Interface KubeanClusterOpsSet clusterOperationClientSet.Interface InfoManifestClientSet manifestClientSet.Interface }
func (*Controller) BackUpDataRef ¶
func (c *Controller) BackUpDataRef(clusterOps *clusteroperationv1alpha1.ClusterOperation, cluster *clusterv1alpha1.Cluster) (bool, error)
BackUpDataRef perform the backup of configRef and secretRef and return (needRequeue,error).
func (*Controller) CalSalt ¶
func (c *Controller) CalSalt(clusterOps *clusteroperationv1alpha1.ClusterOperation) string
func (*Controller) CheckClusterDataRef ¶ added in v0.3.0
func (c *Controller) CheckClusterDataRef(cluster *clusterv1alpha1.Cluster, clusterOPS *clusteroperationv1alpha1.ClusterOperation) error
func (*Controller) CheckConfigMapExist ¶ added in v0.3.0
func (c *Controller) CheckConfigMapExist(namespace, name string) bool
func (*Controller) CheckSecretExist ¶ added in v0.3.0
func (c *Controller) CheckSecretExist(namespace, name string) bool
func (*Controller) CopyConfigMap ¶
func (c *Controller) CopyConfigMap(clusterOps *clusteroperationv1alpha1.ClusterOperation, oldConfigMapRef *apis.ConfigMapRef, newName, newNamespace string) (*corev1.ConfigMap, error)
func (*Controller) CopySecret ¶
func (c *Controller) CopySecret(clusterOps *clusteroperationv1alpha1.ClusterOperation, oldSecretRef *apis.SecretRef, newName, newNamespace string) (*corev1.Secret, error)
func (*Controller) CreateEntryPointShellConfigMap ¶
func (c *Controller) CreateEntryPointShellConfigMap(clusterOps *clusteroperationv1alpha1.ClusterOperation) (bool, error)
CreateEntryPointShellConfigMap create configMap to store entrypoint.sh.
func (*Controller) CreateKubeSprayJob ¶
func (c *Controller) CreateKubeSprayJob(clusterOps *clusteroperationv1alpha1.ClusterOperation) (bool, error)
func (*Controller) FetchGlobalInfoManifest ¶ added in v0.4.1
func (c *Controller) FetchGlobalInfoManifest() (*manifestv1alpha1.Manifest, error)
func (*Controller) FetchGlobalManifestImageTag ¶ added in v0.4.1
func (c *Controller) FetchGlobalManifestImageTag() string
func (*Controller) FetchJobConditionStatusAndCompletionTime ¶ added in v0.6.5
func (c *Controller) FetchJobConditionStatusAndCompletionTime(clusterOps *clusteroperationv1alpha1.ClusterOperation) (clusteroperationv1alpha1.OpsStatus, *metav1.Time, error)
func (*Controller) GenerateJobName ¶ added in v0.2.1
func (c *Controller) GenerateJobName(clusterOps *clusteroperationv1alpha1.ClusterOperation) string
func (*Controller) GetKuBeanCluster ¶
func (c *Controller) GetKuBeanCluster(clusterOps *clusteroperationv1alpha1.ClusterOperation) (*clusterv1alpha1.Cluster, error)
GetKuBeanCluster fetch the cluster which clusterOps belongs to.
func (*Controller) GetRunningPodFromJob ¶ added in v0.8.2
func (*Controller) GetServiceAccountName ¶ added in v0.4.2
func (c *Controller) GetServiceAccountName(namespace, labelSelector string) (string, error)
GetServiceAccountName get serviceaccount name on kubean namespace by labelSelector.
func (*Controller) HookCustomAction ¶ added in v0.4.5
func (c *Controller) HookCustomAction(clusterOps *clusteroperationv1alpha1.ClusterOperation, job *batchv1.Job) error
HookCustomAction inject custom actions to spray job.
func (*Controller) NewKubesprayJob ¶
func (c *Controller) NewKubesprayJob(clusterOps *clusteroperationv1alpha1.ClusterOperation, serviceAccountName string) *batchv1.Job
func (*Controller) ProcessKubeanOperationImage ¶ added in v0.4.1
func (c *Controller) ProcessKubeanOperationImage(oldImage, globalManifestImageTag string) string
func (*Controller) Reconcile ¶
func (c *Controller) Reconcile(ctx context.Context, req controllerruntime.Request) (controllerruntime.Result, error)
func (*Controller) Retry ¶ added in v0.3.4
func (c *Controller) Retry(f func() bool) bool
func (*Controller) SetOwnerReferences ¶
func (c *Controller) SetOwnerReferences(objectMetaData *metav1.ObjectMeta, clusterOps *clusteroperationv1alpha1.ClusterOperation)
func (*Controller) SetupWithManager ¶
func (c *Controller) SetupWithManager(mgr controllerruntime.Manager) error
func (*Controller) TrySuspendPod ¶ added in v0.8.2
func (c *Controller) TrySuspendPod(clusterOps *clusteroperationv1alpha1.ClusterOperation) (bool, error)
func (*Controller) UpdateClusterOpsStatusDigest ¶
func (c *Controller) UpdateClusterOpsStatusDigest(clusterOps *clusteroperationv1alpha1.ClusterOperation) (bool, error)
func (*Controller) UpdateOperationOwnReferenceForCluster ¶ added in v0.7.4
func (c *Controller) UpdateOperationOwnReferenceForCluster(operation *clusteroperationv1alpha1.ClusterOperation, cluster *clusterv1alpha1.Cluster) (bool, error)
func (*Controller) UpdateOwnReferenceToClusterOps ¶ added in v0.8.2
func (c *Controller) UpdateOwnReferenceToClusterOps(clusterOps *clusteroperationv1alpha1.ClusterOperation) error
func (*Controller) UpdateStatusForLabel ¶ added in v0.9.0
func (c *Controller) UpdateStatusForLabel(ops *clusteroperationv1alpha1.ClusterOperation) error
func (*Controller) UpdateStatusHasModified ¶
func (c *Controller) UpdateStatusHasModified(clusterOps *clusteroperationv1alpha1.ClusterOperation) (bool, error)
func (*Controller) UpdateStatusLoop ¶
func (c *Controller) UpdateStatusLoop(clusterOps *clusteroperationv1alpha1.ClusterOperation, fetchJobStatus func(*clusteroperationv1alpha1.ClusterOperation) (clusteroperationv1alpha1.OpsStatus, *metav1.Time, error)) (bool, error)
Click to show internal directories.
Click to hide internal directories.