kubernetes

package
v0.0.0-...-9d0dce2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// label keys
	LabelPrefix            = "j2."
	LabelJobName           = LabelPrefix + "job.name"
	LabelTaskGroupName     = LabelPrefix + "taskgroup.name"
	LabelTaskGroupFullName = LabelPrefix + "taskgroup.fullname"
	LabelPodName           = LabelPrefix + "pod.name"
)
View Source
const (
	// environment variable names
	EnvVarPodIP     = "J2_POD_IP"
	EnvVarPodName   = "J2_POD_NAME"
	EnvVarNodeName  = "J2_NODE_NAME"
	EnvVarNamespace = "J2_NAMESPACE"

	// Secret related
	EnvVarClusterID    = "CLUSTER_ID"
	EnvVarVaultAddress = "VAULT_ADDR"
	EnvVarVaultCACert  = "VAULT_CACERT"
	EnvVarVaultCAPath  = "VAULT_CAPATH"
)
View Source
const (
	// Well known secret names
	SecretClusterInfo = "j2-cluster-info"
	SecretVaultInfo   = "j2-vault-info"
)
View Source
const (
	// Docker registry secret field names
	DockerRegistrySecretDataFieldDockerConfigJSON = ".dockerconfigjson"
	DockerRegistrySecretTypeDockerConfigJSON      = "kubernetes.io/dockerconfigjson"
)
View Source
const (
	// Load-balancer names
	LoadBalancerDNS = "lb-lb-srv.base"
)

Variables

This section is empty.

Functions

func FromInt

func FromInt(i int32) intstr.IntOrString

func FromString

func FromString(s string) intstr.IntOrString

func ResourceName

func ResourceName(fullName string) string

ResourceName replaces all characters in the given name that are not valid for K8S resource names.

Types

type DaemonSet

type DaemonSet struct {
	k8s.DaemonSet
}

DaemonSet is a wrapper for a kubernetes v1beta1.DaemonSet that implements scheduler.UnitData.

func (*DaemonSet) Content

func (ds *DaemonSet) Content() string

Content returns a JSON representation of the resource.

func (*DaemonSet) Destroy

func (ds *DaemonSet) Destroy(cs k8s.Client, events chan string) error

Destroy deletes the daemonset from the cluster.

func (*DaemonSet) GetCurrent

func (ds *DaemonSet) GetCurrent(cs k8s.Client) (interface{}, error)

GetCurrent loads the current version of the object on the cluster

func (*DaemonSet) IsEqual

func (ds *DaemonSet) IsEqual(other interface{}) ([]string, bool, error)

IsEqual returns true of all values configured in myself are the same in the other object.

func (*DaemonSet) IsValidState

func (ds *DaemonSet) IsValidState(cs k8s.Client) (bool, string, error)

IsValidState returns true if the current state of the resource on the cluster is OK.

func (*DaemonSet) Name

func (ds *DaemonSet) Name() string

Name returns a name of the resource

func (*DaemonSet) Namespace

func (ds *DaemonSet) Namespace() string

Namespace returns the namespace the resource should be added to.

func (*DaemonSet) ObjectMeta

func (ds *DaemonSet) ObjectMeta() *k8s.ObjectMeta

ObjectMeta returns the ObjectMeta of the resource.

func (*DaemonSet) Start

func (ds *DaemonSet) Start(cs k8s.Client, events chan string) error

Start creates/updates the daemonSet

type Deployment

type Deployment struct {
	k8s.Deployment
}

Deployment is a wrapper for a kubernetes v1beta1.Deployment that implements scheduler.UnitData.

func (*Deployment) Content

func (ds *Deployment) Content() string

Content returns a JSON representation of the resource.

func (*Deployment) Destroy

func (ds *Deployment) Destroy(cs k8s.Client, events chan string) error

Destroy deletes the deployment from the cluster.

func (*Deployment) GetCurrent

func (ds *Deployment) GetCurrent(cs k8s.Client) (interface{}, error)

GetCurrent loads the current version of the object on the cluster

func (*Deployment) IsEqual

func (ds *Deployment) IsEqual(other interface{}) ([]string, bool, error)

IsEqual returns true of all values configured in myself are the same in the other object.

func (*Deployment) IsValidState

func (ds *Deployment) IsValidState(cs k8s.Client) (bool, string, error)

IsValidState returns true if the current state of the resource on the cluster is OK.

func (*Deployment) Name

func (ds *Deployment) Name() string

Name returns a name of the resource

func (*Deployment) Namespace

func (ds *Deployment) Namespace() string

Namespace returns the namespace the resource should be added to.

func (*Deployment) ObjectMeta

func (ds *Deployment) ObjectMeta() *k8s.ObjectMeta

ObjectMeta returns the ObjectMeta of the resource.

func (*Deployment) Start

func (ds *Deployment) Start(cs k8s.Client, events chan string) error

Start creates/updates the deployment

type Ingress

type Ingress struct {
	k8s.Ingress
}

Ingress is a wrapper for a kubernetes v1beta1.Ingress that implements scheduler.UnitData.

func (*Ingress) Content

func (ds *Ingress) Content() string

Content returns a JSON representation of the resource.

func (*Ingress) Destroy

func (ds *Ingress) Destroy(cs k8s.Client, events chan string) error

Destroy deletes the ingress from the cluster.

func (*Ingress) GetCurrent

func (ds *Ingress) GetCurrent(cs k8s.Client) (interface{}, error)

GetCurrent loads the current version of the object on the cluster

func (*Ingress) IsEqual

func (ds *Ingress) IsEqual(other interface{}) ([]string, bool, error)

IsEqual returns true of all values configured in myself are the same in the other object.

func (*Ingress) IsValidState

func (ds *Ingress) IsValidState(cs k8s.Client) (bool, string, error)

IsValidState returns true if the current state of the resource on the cluster is OK.

func (*Ingress) Name

func (ds *Ingress) Name() string

Name returns a name of the resource

func (*Ingress) Namespace

func (ds *Ingress) Namespace() string

Namespace returns the namespace the resource should be added to.

func (*Ingress) ObjectMeta

func (ds *Ingress) ObjectMeta() *k8s.ObjectMeta

ObjectMeta returns the ObjectMeta of the resource.

func (*Ingress) Start

func (ds *Ingress) Start(cs k8s.Client, events chan string) error

Start creates/updates the ingress

type Job

type Job struct {
	k8s.Job
}

Job is a wrapper for a kubernetes batch.Job that implements scheduler.UnitData.

func (*Job) Content

func (ds *Job) Content() string

Content returns a JSON representation of the resource.

func (*Job) Destroy

func (ds *Job) Destroy(cs k8s.Client, events chan string) error

Destroy deletes the job from the cluster.

func (*Job) GetCurrent

func (ds *Job) GetCurrent(cs k8s.Client) (interface{}, error)

GetCurrent loads the current version of the object on the cluster

func (*Job) IsEqual

func (ds *Job) IsEqual(other interface{}) ([]string, bool, error)

IsEqual returns true of all values configured in myself are the same in the other object.

func (*Job) IsValidState

func (ds *Job) IsValidState(cs k8s.Client) (bool, string, error)

IsValidState returns true if the current state of the resource on the cluster is OK.

func (*Job) Name

func (ds *Job) Name() string

Name returns a name of the resource

func (*Job) Namespace

func (ds *Job) Namespace() string

Namespace returns the namespace the resource should be added to.

func (*Job) ObjectMeta

func (ds *Job) ObjectMeta() *k8s.ObjectMeta

ObjectMeta returns the ObjectMeta of the resource.

func (*Job) Start

func (ds *Job) Start(cs k8s.Client, events chan string) error

Start creates/updates the job

type Secret

type Secret struct {
	k8s.Secret
}

Secret is a wrapper for a kubernetes v1.Secret that implements scheduler.UnitData.

func (*Secret) Content

func (ds *Secret) Content() string

Content returns a JSON representation of the resource.

func (*Secret) Destroy

func (ds *Secret) Destroy(cs k8s.Client, events chan string) error

Destroy deletes the service from the cluster.

func (*Secret) GetCurrent

func (ds *Secret) GetCurrent(cs k8s.Client) (interface{}, error)

GetCurrent loads the current version of the object on the cluster

func (*Secret) IsEqual

func (ds *Secret) IsEqual(other interface{}) ([]string, bool, error)

IsEqual returns true of all values configured in myself are the same in the other object.

func (*Secret) IsValidState

func (ds *Secret) IsValidState(cs k8s.Client) (bool, string, error)

IsValidState returns true if the current state of the resource on the cluster is OK.

func (*Secret) Name

func (ds *Secret) Name() string

Name returns a name of the resource

func (*Secret) Namespace

func (ds *Secret) Namespace() string

Namespace returns the namespace the resource should be added to.

func (*Secret) ObjectMeta

func (ds *Secret) ObjectMeta() *k8s.ObjectMeta

ObjectMeta returns the ObjectMeta of the resource.

func (*Secret) Start

func (ds *Secret) Start(cs k8s.Client, events chan string) error

Start creates/updates the secret

type Service

type Service struct {
	k8s.Service
}

Service is a wrapper for a kubernetes v1.Service that implements scheduler.UnitData.

func (*Service) Content

func (ds *Service) Content() string

Content returns a JSON representation of the resource.

func (*Service) Destroy

func (ds *Service) Destroy(cs k8s.Client, events chan string) error

Destroy deletes the service from the cluster.

func (*Service) GetCurrent

func (ds *Service) GetCurrent(cs k8s.Client) (interface{}, error)

GetCurrent loads the current version of the object on the cluster

func (*Service) IsEqual

func (ds *Service) IsEqual(other interface{}) ([]string, bool, error)

IsEqual returns true of all values configured in myself are the same in the other object.

func (*Service) IsValidState

func (ds *Service) IsValidState(cs k8s.Client) (bool, string, error)

IsValidState returns true if the current state of the resource on the cluster is OK.

func (*Service) Name

func (ds *Service) Name() string

Name returns a name of the resource

func (*Service) Namespace

func (ds *Service) Namespace() string

Namespace returns the namespace the resource should be added to.

func (*Service) ObjectMeta

func (ds *Service) ObjectMeta() *k8s.ObjectMeta

ObjectMeta returns the ObjectMeta of the resource.

func (*Service) Start

func (ds *Service) Start(cs k8s.Client, events chan string) error

Start creates/updates the service

Jump to

Keyboard shortcuts

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