k8sutil

package
v0.0.0-...-c377703 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2017 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RecommendedConfigPathEnvVar = "KUBECONFIG"
)

Variables

This section is empty.

Functions

func CascadeDeleteOptions

func CascadeDeleteOptions(gracePeriodSeconds int64) *metav1.DeleteOptions

TODO(jlewi): CascadeDeletOptions are part of garbage collection policy. Do we want to use this? See https://kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/

func GetClusterConfig

func GetClusterConfig() (*rest.Config, error)

func IsKubernetesResourceAlreadyExistError

func IsKubernetesResourceAlreadyExistError(err error) bool

func IsKubernetesResourceNotFoundError

func IsKubernetesResourceNotFoundError(err error) bool

func JobListOpt

func JobListOpt(clusterName string) metav1.ListOptions

We are using internal api types for cluster related.

func LabelsForJob

func LabelsForJob(jobName string) map[string]string

func MustNewApiExtensionsClient

func MustNewApiExtensionsClient() apiextensionsclient.Interface

func MustNewKubeClient

func MustNewKubeClient() kubernetes.Interface

Types

type MxJobClient

type MxJobClient interface {
	// Get returns a MxJob
	Get(ns string, name string) (*spec.MxJob, error)

	// Delete a MxJob
	Delete(ns string, name string) (*spec.MxJob, error)

	// List returns a list of MxJobs
	List(ns string) (*spec.MxJobList, error)

	// Create a MxJob
	Create(ns string, j *spec.MxJob) (*spec.MxJob, error)

	// Update a MxJob.
	Update(ns string, j *spec.MxJob) (*spec.MxJob, error)

	// Watch MxJobs.
	Watch(host, ns string, httpClient *http.Client, resourceVersion string) (*http.Response, error)
}

MXJobClient defines an interface for working with MxJob CRDs.

type MxJobRestClient

type MxJobRestClient struct {
	// contains filtered or unexported fields
}

MxJobRestClient uses the Kubernetes rest interface to talk to the CRD.

func NewMxJobClient

func NewMxJobClient() (*MxJobRestClient, error)

func NewMxJobClientExternal

func NewMxJobClientExternal(config *rest.Config) (*MxJobRestClient, error)

New MXJob client for out-of-cluster

func (*MxJobRestClient) Client

func (c *MxJobRestClient) Client() *http.Client

HttpClient returns the http client used.

func (*MxJobRestClient) Create

func (c *MxJobRestClient) Create(ns string, j *spec.MxJob) (*spec.MxJob, error)

func (*MxJobRestClient) Delete

func (c *MxJobRestClient) Delete(ns, name string) (*spec.MxJob, error)

func (*MxJobRestClient) Get

func (c *MxJobRestClient) Get(ns, name string) (*spec.MxJob, error)

func (*MxJobRestClient) List

func (c *MxJobRestClient) List(ns string) (*spec.MxJobList, error)

func (*MxJobRestClient) Update

func (c *MxJobRestClient) Update(ns string, j *spec.MxJob) (*spec.MxJob, error)

func (*MxJobRestClient) Watch

func (c *MxJobRestClient) Watch(host, ns string, httpClient *http.Client, resourceVersion string) (*http.Response, error)

Directories

Path Synopsis
Package election implements leader election of a set of endpoints.
Package election implements leader election of a set of endpoints.
fake provides a fake implementation of MxJobClient suitable for use in testing.
fake provides a fake implementation of MxJobClient suitable for use in testing.

Jump to

Keyboard shortcuts

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