Documentation ¶
Index ¶
- Constants
- func BaseLabel(additionalLabels map[string]string, name string) map[string]string
- func CreateObject(cli client.Client, obj interface{}) error
- func DeleteObj(cli client.Client, obj client.Object) error
- func DeleteObjByLabel(cli client.Client, obj client.Object, label map[string]string, ...) error
- func DeleteSts(cli client.Client, namespace string, name string) error
- func DeleteStsByLabel(cli client.Client, namespace string, selector map[string]string) error
- func Ensure(cli client.Client, cr *middlewarev1alpha1.MultiCloudMongoDB, ...) error
- func EnsureConfigMapUpdate(cli client.Client, cr *middlewarev1alpha1.MultiCloudMongoDB, ...) error
- func EnsureMongoWithoutSetRef(cli client.Client, obj metav1.Object, found client.Object) error
- func EnsureWithoutSetRef(cli client.Client, obj metav1.Object, found client.Object) error
- func ExecCmd(config *rest.Config, pod *corev1.Pod, containerName string, command string) (string, string, error)
- func GenerateArbiterLabel(additionalLabels map[string]string, serviceName string) map[string]string
- func GenerateArbiterService(name, namespace string, labels, selector map[string]string, headless bool) *corev1.Service
- func GenerateArbiterServicePPLabel(name string) map[string]string
- func GenerateClusterVIPLabel(vip string) map[string]string
- func GenerateClusterVipLabel(additionalLabels map[string]string, name string) map[string]string
- func GenerateConfigMap(name, namespace string, labels map[string]string, hostConf *model.HostConf) *corev1.ConfigMap
- func GenerateConfigMapLabel(additionalLabels map[string]string, name string) map[string]string
- func GenerateConfigMapPPLabel(additionalLabels map[string]string, name string) map[string]string
- func GenerateCustomConfigMapPPLabel(additionalLabels map[string]string, name string) map[string]string
- func GenerateInitLabel(additionalLabels map[string]string, name string) map[string]string
- func GenerateMongo(name, namespace string, labels map[string]string, ...) *middlewarev1alpha1.MongoDB
- func GenerateMongoLabel(additionalLabels map[string]string, name string) map[string]string
- func GenerateService(name, namespace string, labels, selector map[string]string, headless bool) *corev1.Service
- func GenerateServiceLabel(additionalLabels map[string]string, name, serviceName string) map[string]string
- func GenerateServicePPLabel(additionalLabels map[string]string, name string) map[string]string
- func GetConfig() *rest.Config
- func GetConfigMap(cli client.Client, name, namespace string) (*corev1.ConfigMap, error)
- func GetJob(cli client.Client, namespace, name string) (*batchv1.Job, error)
- func GetMongoInstanceByName(cli client.Client, name, namespace string) (*middlewarev1alpha1.MongoDB, error)
- func GetPod(cli client.Client, namespace, name string) (*corev1.Pod, error)
- func GetService(cli client.Client, namespace, name string) (*corev1.Service, error)
- func GetServiceByNodePort(nodePort int32, serviceList []corev1.Service) (*corev1.Service, error)
- func GetSts(cli client.Client, stsName, namespace string) (*appsv1.StatefulSet, error)
- func GetSvc(cli client.Client, namespace, name string) (*corev1.Service, error)
- func IsExistAndDeleted(client client.Client, name, namespace string, found client.Object) error
- func IsExists(client client.Client, obj metav1.Object, found client.Object) (exists bool, err error)
- func IsExistsByName(client client.Client, name, namespace string, found client.Object) (exists bool, err error)
- func IsSubLabel(super, sub map[string]string) bool
- func ListPod(cli client.Client, namespace string, selector map[string]string) ([]corev1.Pod, error)
- func ListService(cli client.Client, namespace string, selector map[string]string) ([]corev1.Service, error)
- func ListSts(cli client.Client, namespace string, selector map[string]string) ([]appsv1.StatefulSet, error)
- func MergeLabels(allLabels ...map[string]string) map[string]string
- func ObjIsExists(client client.Client, found client.Object) (exists bool, err error)
- func ScaleDownCleaner(cli client.Client, schema *runtime.Scheme, serviceList []corev1.Service, ...) error
- func SetRefAndCreateObject(owner metav1.Object, obj interface{}, scheme *runtime.Scheme, ...) error
- func UpdateObject(cli client.Client, obj client.Object) error
- func UpdateObjectStatus(cli client.Client, obj client.Object) error
- func UpsertConfigMapDeleteArbiter(client client.Client, name, namespace string, found client.Object) error
- func UpsertObject(cli client.Client, obj interface{}) error
- func UpsertOpEnsure(cli client.Client, cr *middlewarev1alpha1.MultiCloudMongoDB, ...) error
- func UpsertPPEnsure(cli client.Client, cr *middlewarev1alpha1.MultiCloudMongoDB, ...) error
Constants ¶
View Source
const ( LabelKeyInstance = "app.kubernetes.io/instance" LabelKeyApp = "app" ServicePP = "app.karmada.io/service-pp" ConfigMapPP = "app.karmada.io/configmap-pp" CustomConfigMapPP = "app.karmada.io/custom-configmap-pp" Mongo = "app.fedstate.io/mongo" Arbiter = "app.arbiter.io/instance" Init = "app.mongoinit.io/instance" ClusterVip = "app.mongoclustervip.io/instance" LabelClusterVipInstance = "app.multicloudmongodb.io/vip" )
View Source
const ( DefaultPort = 27017 DefaultServiceName = "mongo" )
Variables ¶
This section is empty.
Functions ¶
func CreateObject ¶
func DeleteObjByLabel ¶
func DeleteStsByLabel ¶
根据labels删除statefulset
func EnsureConfigMapUpdate ¶
func EnsureWithoutSetRef ¶
func GenerateArbiterLabel ¶
func GenerateArbiterService ¶
func GenerateClusterVIPLabel ¶
func GenerateClusterVipLabel ¶
func GenerateConfigMap ¶
func GenerateConfigMapLabel ¶
func GenerateInitLabel ¶
func GenerateMongo ¶
func GenerateMongo(name, namespace string, labels map[string]string, cr *middlewarev1alpha1.MultiCloudMongoDB) *middlewarev1alpha1.MongoDB
func GenerateMongoLabel ¶
func GenerateService ¶
func GenerateServiceLabel ¶
func GenerateServicePPLabel ¶
func GetConfigMap ¶
func GetMongoInstanceByName ¶
func GetService ¶
func GetServiceByNodePort ¶
func IsExistAndDeleted ¶
func IsExistsByName ¶
func ListService ¶
func ListSts ¶
func ListSts(cli client.Client, namespace string, selector map[string]string) ([]appsv1.StatefulSet, error)
根据label获取statefulset
func MergeLabels ¶
MergeLabels merges all the label maps received as argument into a single new label map.
func ObjIsExists ¶
func ScaleDownCleaner ¶
func ScaleDownCleaner(cli client.Client, schema *runtime.Scheme, serviceList []corev1.Service, MultiCloudMongoDB *middlewarev1alpha1.MultiCloudMongoDB, svcPPList *karmadaPolicyv1alpha1.PropagationPolicyList, log *zap.SugaredLogger) error
做缩容用的,需要优化
func SetRefAndCreateObject ¶
func UpsertObject ¶
func UpsertOpEnsure ¶
func UpsertPPEnsure ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.