k8s

package
v0.0.0-...-4c0bbbd Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIExtClient

func APIExtClient() (apiextensionsclient.Interface, error)

APIExtClient creates a new k8s api extensions client

func CanUseAPIExtV1

func CanUseAPIExtV1() bool

CanUseAPIExtV1 returns true if we can use k8s apiextension/v1 else false

func CanUseAPIExtV1Beta1

func CanUseAPIExtV1Beta1() bool

CanUseAPIExtV1 returns true if we can use k8s apiextension/v1beta1 else false

func CreateConfig

func CreateConfig(apiServerURL, kubeCfgPath string) (*rest.Config, error)

CreateConfig creates a rest.Config for connecting to k8s api-server.

The precedence of the configuration selection is the following: 1. kubeCfgPath 2. apiServerURL (https if specified) 3. rest.InClusterConfig().

func CreateNewDeployment

func CreateNewDeployment(k8sClient kubernetes.Interface, namespace string,
	svc *appsv1.Deployment) error

CreateNewDeployment creates a new Kubernetes Deployment for the provided Deployment object.

func CreateNewService

func CreateNewService(k8sClient kubernetes.Interface, namespace string, svc *corev1.Service) error

CreateNewService creates a new Kubernetes service for the provided service object.

func CreateNewStatefulSet

func CreateNewStatefulSet(k8sClient kubernetes.Interface, namespace string,
	svc *appsv1.StatefulSet) error

CreateNewStatefulSet creates a new Kubernetes StatefulSet for the provided StatefulSet object.

func DeleteDeployment

func DeleteDeployment(k8sClient kubernetes.Interface, namespace string,
	svc *appsv1.Deployment) error

DeleteDeployment deletes a kubernetes Deployment from the cluster.

func DeleteService

func DeleteService(k8sClient kubernetes.Interface, namespace string, svc *corev1.Service) error

DeleteService deletes a kubernetes service from the cluster.

func DeleteStatefulSet

func DeleteStatefulSet(k8sClient kubernetes.Interface, namespace string,
	svc *appsv1.StatefulSet) error

DeleteStatefulSet deletes a kubernetes StatefulSet from the cluster.

func UpdateDeployment

func UpdateDeployment(k8sClient kubernetes.Interface, namespace string,
	svc *appsv1.Deployment) (*appsv1.Deployment, error)

UpdateDeployment updates the Deployment in the kubernetes cluster.

func UpdateService

func UpdateService(k8sClient kubernetes.Interface, namespace string,
	svc *corev1.Service) (*corev1.Service, error)

UpdateService updates the service in the kubernetes cluster.

func UpdateStatefulSet

func UpdateStatefulSet(k8sClient kubernetes.Interface, namespace string,
	svc *appsv1.StatefulSet) (*appsv1.StatefulSet, error)

UpdateStatefulSet updates the StatefulSet in the kubernetes cluster.

func UpdateVersion

func UpdateVersion(client kubernetes.Interface) error

Update retrieves the version of the Kubernetes apiserver. This function must be called after connectivity to the apiserver has been established.

func Version

func Version() go_version.Version

Version returns the version of the Kubernetes apiserver

func WaitForCRD

func WaitForCRD(crdName string) error

WaitForCRD waits for a kubernetes custom resource definition to be ready.

Types

type ClientK8s

type ClientK8s struct {
	// kubernetes.Interface is the object through which interactions with
	// Kubernetes are performed.
	kubernetes.Interface
}

ClientK8s is a wrapper around kubernetes.Interface.

func Client

func Client() (*ClientK8s, error)

Client creates a new k8s client

type DgraphClientK8s

type DgraphClientK8s struct {
	versioned.Interface
}

DgraphClientK8s is a wrapper around clientset.Interface for dgraph operator kubernetes client.

func DgraphClient

func DgraphClient() (*DgraphClientK8s, error)

DgraphClient creates a new k8s api extensions client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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