Documentation ¶
Index ¶
- Constants
- func CheckAPIHealthz(client rest.Interface) bool
- func CheckDaemonset(client kubernetes.Interface, namespace string, name string) (bool, error)
- func CheckDeployment(client kubernetes.Interface, namespace string, name string) (bool, error)
- func CheckStatefulSet(client kubernetes.Interface, namespace string, name string) (bool, error)
- func CreateOrRetainConfigMap(client clientset.Interface, cm *v1.ConfigMap, configMapName string) error
- func CreateOrUpdateClusterRole(client clientset.Interface, clusterRole *rbac.ClusterRole) error
- func CreateOrUpdateClusterRoleBinding(client clientset.Interface, clusterRoleBinding *rbac.ClusterRoleBinding) error
- func CreateOrUpdateConfigMap(client clientset.Interface, cm *v1.ConfigMap) error
- func CreateOrUpdateConfigMapFromFile(client clientset.Interface, cm *v1.ConfigMap, pattern string) error
- func CreateOrUpdateCronJob(client clientset.Interface, cronjob *batchv1beta1.CronJob) error
- func CreateOrUpdateDaemonSet(client clientset.Interface, ds *apps.DaemonSet) error
- func CreateOrUpdateDeployment(client clientset.Interface, deploy *apps.Deployment) error
- func CreateOrUpdateDeploymentExtensionsV1beta1(client clientset.Interface, deploy *extensionsv1beta1.Deployment) error
- func CreateOrUpdateEndpoints(client clientset.Interface, ep *v1.Endpoints) error
- func CreateOrUpdateIngress(client clientset.Interface, ing *extensionsv1beta1.Ingress) error
- func CreateOrUpdateJob(client clientset.Interface, job *batchv1.Job) error
- func CreateOrUpdateNamespace(client clientset.Interface, ns *v1.Namespace) error
- func CreateOrUpdateRole(client clientset.Interface, role *rbac.Role) error
- func CreateOrUpdateRoleBinding(client clientset.Interface, roleBinding *rbac.RoleBinding) error
- func CreateOrUpdateSecret(client clientset.Interface, secret *v1.Secret) error
- func CreateOrUpdateService(client clientset.Interface, svc *v1.Service) error
- func CreateOrUpdateServiceAccount(client clientset.Interface, sa *v1.ServiceAccount) error
- func CreateOrUpdateStatefulSet(client clientset.Interface, sts *apps.StatefulSet) error
- func CreateResourceWithDir(client kubernetes.Interface, pattern string, option interface{}) error
- func CreateResourceWithFile(client kubernetes.Interface, filename string, option interface{}) error
- func DeleteClusterRoleBinding(client clientset.Interface, crbName string) error
- func DeleteDaemonSetForeground(client clientset.Interface, namespace, name string) error
- func DeleteDeployment(client clientset.Interface, namespace string, deployName string, ...) error
- func DeleteDeploymentForeground(client clientset.Interface, namespace, name string) error
- func DeleteReplicaSetApp(client clientset.Interface, options metav1.ListOptions) error
- func DeleteService(client clientset.Interface, namespace string, svcName string) error
- func DeleteServiceAccounts(client clientset.Interface, namespace string, svcAccountName string) error
- func GetClientset(masterEndpoint string, token string, caCert []byte) (*kubernetes.Clientset, error)
- func GetClusterRoleBinding(client clientset.Interface, name string) (*rbac.ClusterRoleBinding, error)
- func GetPlatformClientset(masterEndpoint string, token string, caCert []byte) (tkeclientset.Interface, error)
- func GetService(client clientset.Interface, namespace string, name string) (*v1.Service, error)
- func GetServiceAccount(client clientset.Interface, namespace string, name string) (*v1.ServiceAccount, error)
- func IsPodReady(pod *corev1.Pod) bool
- func PatchNode(client clientset.Interface, nodeName string, patchFn func(*v1.Node)) error
- func PatchNodeOnce(client clientset.Interface, nodeName string, patchFn func(*v1.Node)) func() (bool, error)
Constants ¶
const ( // APICallRetryInterval defines how long should wait before retrying a failed API operation APICallRetryInterval = 500 * time.Millisecond // PatchNodeTimeout specifies how long should wait for applying the label and taint on the master before timing out PatchNodeTimeout = 2 * time.Minute // UpdateNodeTimeout specifies how long should wait for updating node with the initial remote configuration of kubelet before timing out UpdateNodeTimeout = 2 * time.Minute // LabelHostname specifies the lable in node. LabelHostname = "kubernetes.io/hostname" )
Variables ¶
This section is empty.
Functions ¶
func CheckAPIHealthz ¶
CheckAPIHealthz check healthz
func CheckDaemonset ¶
CheckDaemonset check daemonset current replicas is equal to desired and all pods are running
func CheckDeployment ¶
CheckDeployment check Deployment current replicas is equal to desired and all pods are running
func CheckStatefulSet ¶
CheckStatefulSet check StatefulSet current replicas is equal to desired and all pods are running
func CreateOrRetainConfigMap ¶
func CreateOrRetainConfigMap(client clientset.Interface, cm *v1.ConfigMap, configMapName string) error
CreateOrRetainConfigMap creates a ConfigMap if the target resource doesn't exist. If the resource exists already, this function will retain the resource instead.
func CreateOrUpdateClusterRole ¶
func CreateOrUpdateClusterRole(client clientset.Interface, clusterRole *rbac.ClusterRole) error
CreateOrUpdateClusterRole creates a ClusterRole if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateOrUpdateClusterRoleBinding ¶
func CreateOrUpdateClusterRoleBinding(client clientset.Interface, clusterRoleBinding *rbac.ClusterRoleBinding) error
CreateOrUpdateClusterRoleBinding creates a ClusterRoleBinding if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateOrUpdateConfigMap ¶
CreateOrUpdateConfigMap creates a ConfigMap if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateOrUpdateConfigMapFromFile ¶
func CreateOrUpdateConfigMapFromFile(client clientset.Interface, cm *v1.ConfigMap, pattern string) error
CreateOrUpdateConfigMapFromFile like kubectl create configmap --from-file
func CreateOrUpdateCronJob ¶
func CreateOrUpdateCronJob(client clientset.Interface, cronjob *batchv1beta1.CronJob) error
CreateOrUpdateCronJob creates a Job if the target resource doesn't exist. If the resource exists already, this function will update
func CreateOrUpdateDaemonSet ¶
CreateOrUpdateDaemonSet creates a DaemonSet if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateOrUpdateDeployment ¶
func CreateOrUpdateDeployment(client clientset.Interface, deploy *apps.Deployment) error
CreateOrUpdateDeployment creates a Deployment if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateOrUpdateDeploymentExtensionsV1beta1 ¶
func CreateOrUpdateDeploymentExtensionsV1beta1(client clientset.Interface, deploy *extensionsv1beta1.Deployment) error
CreateOrUpdateDeploymentExtensionsV1beta1 creates a ExtensionsV1beta1 Deployment if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateOrUpdateEndpoints ¶
CreateOrUpdateEndpoints creates a Endpoints if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateOrUpdateIngress ¶
func CreateOrUpdateIngress(client clientset.Interface, ing *extensionsv1beta1.Ingress) error
CreateOrUpdateIngress creates a Ingress if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateOrUpdateJob ¶
CreateOrUpdateJob creates a Job if the target resource doesn't exist. If the resource exists already, this function will update
func CreateOrUpdateNamespace ¶
CreateOrUpdateNamespace creates a namespace if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateOrUpdateRole ¶
CreateOrUpdateRole creates a Role if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateOrUpdateRoleBinding ¶
func CreateOrUpdateRoleBinding(client clientset.Interface, roleBinding *rbac.RoleBinding) error
CreateOrUpdateRoleBinding creates a RoleBinding if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateOrUpdateSecret ¶
CreateOrUpdateSecret creates a Secret if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateOrUpdateService ¶
CreateOrUpdateService creates a service if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateOrUpdateServiceAccount ¶
func CreateOrUpdateServiceAccount(client clientset.Interface, sa *v1.ServiceAccount) error
CreateOrUpdateServiceAccount creates a ServiceAccount if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateOrUpdateStatefulSet ¶
func CreateOrUpdateStatefulSet(client clientset.Interface, sts *apps.StatefulSet) error
CreateOrUpdateStatefulSet creates a statefulSet if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateResourceWithDir ¶
func CreateResourceWithDir(client kubernetes.Interface, pattern string, option interface{}) error
CreateResourceWithDir create k8s resource with dir
func CreateResourceWithFile ¶
func CreateResourceWithFile(client kubernetes.Interface, filename string, option interface{}) error
CreateResourceWithFile create k8s resource with file
func DeleteClusterRoleBinding ¶
DeleteClusterRoleBinding delete a clusterrolebinding
func DeleteDaemonSetForeground ¶
DeleteDaemonSetForeground deletes the specified DaemonSet in foreground mode; i.e. it blocks until/makes sure all the managed Pods are deleted
func DeleteDeployment ¶
func DeleteDeploymentForeground ¶
DeleteDeploymentForeground deletes the specified Deployment in foreground mode; i.e. it blocks until/makes sure all the managed Pods are deleted
func DeleteReplicaSetApp ¶
func DeleteReplicaSetApp(client clientset.Interface, options metav1.ListOptions) error
DeleteReplicaSetApp delete the replicaset and pod additionally for deployment app with extension group
func DeleteService ¶
DeleteService delete a service
func DeleteServiceAccounts ¶
func DeleteServiceAccounts(client clientset.Interface, namespace string, svcAccountName string) error
DeleteServiceAccounts delete a serviceAccount
func GetClientset ¶
func GetClientset(masterEndpoint string, token string, caCert []byte) (*kubernetes.Clientset, error)
GetClientset return clientset
func GetClusterRoleBinding ¶
func GetClusterRoleBinding(client clientset.Interface, name string) (*rbac.ClusterRoleBinding, error)
GetClusterRoleBinding get a cluster role binding.
func GetPlatformClientset ¶
func GetPlatformClientset(masterEndpoint string, token string, caCert []byte) (tkeclientset.Interface, error)
GetPlatformClientset return clientset
func GetService ¶
GetService get a service.
func GetServiceAccount ¶
func GetServiceAccount(client clientset.Interface, namespace string, name string) (*v1.ServiceAccount, error)
GetServiceAccount get a service.
func IsPodReady ¶
IsPodReady returns true if a pod is ready; false otherwise.
func PatchNode ¶
PatchNode tries to patch a node using patchFn for the actual mutating logic. Retries are provided by the wait package.
func PatchNodeOnce ¶
func PatchNodeOnce(client clientset.Interface, nodeName string, patchFn func(*v1.Node)) func() (bool, error)
PatchNodeOnce executes patchFn on the node object found by the node name. This is a condition function meant to be used with wait.Poll. false, nil implies it is safe to try again, an error indicates no more tries should be made and true indicates success.
Types ¶
This section is empty.