Documentation ¶
Index ¶
- Variables
- func ApplyConfigMap(ctx context.Context, k8sClient client.Client, configmap *corev1.ConfigMap) error
- func ApplyDeployment(ctx context.Context, k8sClient client.Client, deploy *appv1.Deployment) error
- func ApplyService(ctx context.Context, k8sClient client.Client, expectSvc *corev1.Service, ...) error
- func ApplyStatefulSet(ctx context.Context, k8sClient client.Client, expect *appv1.StatefulSet, ...) error
- func CheckVolumes(volumes []corev1.Volume, mounts []corev1.VolumeMount) error
- func CreateClientObject(ctx context.Context, k8sClient client.Client, object client.Object) error
- func DeleteAutoscaler(ctx context.Context, k8sClient client.Client, namespace, name string) error
- func DeleteConfigMap(ctx context.Context, k8sClient client.Client, namespace, name string) error
- func DeleteDeployment(ctx context.Context, k8sClient client.Client, namespace, name string) error
- func DeleteService(ctx context.Context, k8sClient client.Client, namespace, name string) error
- func DeleteStatefulset(ctx context.Context, k8sClient client.Client, namespace, name string) error
- func GetConfigMap(ctx context.Context, k8scient client.Client, namespace, name string) (*corev1.ConfigMap, error)
- func GetEnvVarValue(ctx context.Context, k8sClient client.Client, namespace string, ...) (string, error)
- func GetKubernetesVersion() error
- func GetValueFromConfigmap(ctx context.Context, k8sClient client.Client, namespace string, name string, ...) (string, error)
- func GetValueFromSecret(ctx context.Context, k8sClient client.Client, namespace string, name string, ...) (string, error)
- func PodIsReady(status *corev1.PodStatus) bool
- func UpdateClientObject(ctx context.Context, k8sClient client.Client, object client.Object) error
- type ServiceEqual
- type StatefulSetEqual
Constants ¶
This section is empty.
Variables ¶
var ( KUBE_MAJOR_VERSION string KUBE_MINOR_VERSION string )
Functions ¶
func ApplyConfigMap ¶ added in v1.8.0
func ApplyDeployment ¶ added in v1.8.0
func ApplyService ¶
func ApplyStatefulSet ¶
func ApplyStatefulSet(ctx context.Context, k8sClient client.Client, expect *appv1.StatefulSet, enableScaleTo1 bool, equal StatefulSetEqual) error
ApplyStatefulSet when the object is not exist, create object. if exist and statefulset have been updated, patch the statefulset.
func CheckVolumes ¶ added in v1.9.1
func CheckVolumes(volumes []corev1.Volume, mounts []corev1.VolumeMount) error
func CreateClientObject ¶
func DeleteAutoscaler ¶
func DeleteConfigMap ¶ added in v1.8.0
DeleteConfigMap delete configmap.
func DeleteDeployment ¶ added in v1.8.0
DeleteDeployment delete deployment.
func DeleteService ¶
DeleteService delete service.
func DeleteStatefulset ¶
DeleteStatefulset delete statefulset.
func GetConfigMap ¶
func GetConfigMap(ctx context.Context, k8scient client.Client, namespace, name string) (*corev1.ConfigMap, error)
GetConfigMap get the configmap name=name, namespace=namespace.
func GetEnvVarValue ¶ added in v1.9.0
func GetEnvVarValue(ctx context.Context, k8sClient client.Client, namespace string, envVar corev1.EnvVar) (string, error)
GetEnvVarValue returns the value of an environment variable. It handles both Value and ValueFrom cases. It assumes that the environment variable exists and is valid.
func GetKubernetesVersion ¶ added in v1.8.1
func GetKubernetesVersion() error
GetKubernetesVersion get kubernetes version. It should not be executed concurrently. The global variable KUBE_MAJOR_VERSION and KUBE_MINOR_VERSION will be set.
func GetValueFromConfigmap ¶ added in v1.9.0
func GetValueFromConfigmap(ctx context.Context, k8sClient client.Client, namespace string, name string, key string) (string, error)
GetValueFromConfigmap returns the runtime value of a key in a configmap. It assumes that the configmap and the key exist and are valid.
func GetValueFromSecret ¶ added in v1.9.0
func GetValueFromSecret(ctx context.Context, k8sClient client.Client, namespace string, name string, key string) (string, error)
GetValueFromSecret returns the value of a key in a secret. It assumes that the secret and the key exist and are valid.
func PodIsReady ¶
Types ¶
type ServiceEqual ¶
ServiceEqual judges two services equal or not in some fields. developer can custom the function.
type StatefulSetEqual ¶
type StatefulSetEqual func(expect *appv1.StatefulSet, actual *appv1.StatefulSet) bool
StatefulSetEqual judges two statefulset equal or not in some fields. developer can custom the function.