workload

package
v2.2.13+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: Apache-2.0 Imports: 24 Imported by: 450

Documentation

Index

Constants

View Source
const (
	AppVersion                         = "apps/v1beta2"
	BatchBetaVersion                   = "batch/v1beta1"
	BatchVersion                       = "batch/v1"
	WorkloadAnnotation                 = "field.cattle.io/targetWorkloadIds"
	PortsAnnotation                    = "field.cattle.io/ports"
	ClusterIPServiceType               = "ClusterIP"
	DeploymentType                     = "deployment"
	ReplicationControllerType          = "replicationcontroller"
	ReplicaSetType                     = "replicaset"
	DaemonSetType                      = "daemonset"
	StatefulSetType                    = "statefulset"
	JobType                            = "job"
	CronJobType                        = "cronjob"
	WorkloadAnnotatioNoop              = "workload.cattle.io/targetWorkloadIdNoop"
	WorkloaAnnotationdPortBasedService = "workload.cattle.io/workloadPortBased"
)

Variables

View Source
var WorkloadKinds = map[string]bool{
	"Deployment":            true,
	"ReplicationController": true,
	"ReplicaSet":            true,
	"DaemonSet":             true,
	"StatefulSet":           true,
	"Job":                   true,
	"CronJob":               true,
}

Functions

func ArePortsEqual

func ArePortsEqual(one []corev1.ServicePort, two []corev1.ServicePort) bool

func IDAnnotationToString

func IDAnnotationToString(workloadID string) (string, error)

func Register

func Register(ctx context.Context, workload *config.UserOnlyContext)

Types

type CommonController

type CommonController struct {
	DeploymentLister            v1beta2.DeploymentLister
	ReplicationControllerLister v1.ReplicationControllerLister
	ReplicaSetLister            v1beta2.ReplicaSetLister
	DaemonSetLister             v1beta2.DaemonSetLister
	StatefulSetLister           v1beta2.StatefulSetLister
	JobLister                   batchv1.JobLister
	CronJobLister               v1beta1.CronJobLister
	Deployments                 v1beta2.DeploymentInterface
	ReplicationControllers      v1.ReplicationControllerInterface
	ReplicaSets                 v1beta2.ReplicaSetInterface
	DaemonSets                  v1beta2.DaemonSetInterface
	StatefulSets                v1beta2.StatefulSetInterface
	Jobs                        batchv1.JobInterface
	CronJobs                    v1beta1.CronJobInterface
	Sync                        func(key string, w *Workload) error
}

func NewWorkloadController

func NewWorkloadController(ctx context.Context, workload *config.UserOnlyContext, f func(key string, w *Workload) error) CommonController

func (CommonController) EnqueueAllWorkloads

func (c CommonController) EnqueueAllWorkloads(namespace string) error

func (CommonController) EnqueueWorkload

func (c CommonController) EnqueueWorkload(w *Workload)

func (CommonController) GetAllWorkloads

func (c CommonController) GetAllWorkloads(namespace string) ([]*Workload, error)

func (CommonController) GetByWorkloadID

func (c CommonController) GetByWorkloadID(key string) (*Workload, error)

func (CommonController) GetByWorkloadIDRetryAPIIfNotFound

func (c CommonController) GetByWorkloadIDRetryAPIIfNotFound(key string) (*Workload, error)

func (CommonController) GetWorkloadsMatchingLabels

func (c CommonController) GetWorkloadsMatchingLabels(namespace string, targetLabels map[string]string) ([]*Workload, error)

func (CommonController) GetWorkloadsMatchingSelector

func (c CommonController) GetWorkloadsMatchingSelector(namespace string, selectorLabels map[string]string) ([]*Workload, error)

func (CommonController) UpdateWorkload

func (c CommonController) UpdateWorkload(w *Workload, annotations map[string]string) error

type ContainerPort

type ContainerPort struct {
	Kind          string `json:"kind,omitempty"`
	SourcePort    int    `json:"sourcePort,omitempty"`
	DNSName       string `json:"dnsName,omitempty"`
	Name          string `json:"name,omitempty"`
	Protocol      string `json:"protocol,omitempty"`
	ContainerPort int32  `json:"containerPort,omitempty"`
}

type Controller

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

func (*Controller) CreateService

func (c *Controller) CreateService(key string, w *Workload) error

func (*Controller) CreateServiceForWorkload

func (c *Controller) CreateServiceForWorkload(workload *Workload) error

type Service

type Service struct {
	Type         corev1.ServiceType
	ClusterIP    string
	ServicePorts []corev1.ServicePort
	Name         string
}

type Status

type Status struct {
	Replicas          int32
	AvailableReplicas int32
	Conditions        []map[string]interface{}
}

type Workload

type Workload struct {
	Name            string
	Namespace       string
	UUID            types.UID
	SelectorLabels  map[string]string
	Annotations     map[string]string
	TemplateSpec    *corev1.PodTemplateSpec
	Kind            string
	APIVersion      string
	OwnerReferences []metav1.OwnerReference
	Labels          map[string]string
	Key             string
	Status          *Status
}

Jump to

Keyboard shortcuts

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