k8s

package
v0.42.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrLabelNotFound      = "k8s.label_not_found"
	ErrAnnotationNotFound = "k8s.annotation_not_found"
	ErrParseLabel         = "k8s.parse_label"
	ErrParseAnnotation    = "k8s.parse_annotation"
	ErrParseQuantity      = "k8s.parse_quantity"
	ErrMissingMetrics     = "k8s.missing_metrics"
	ErrServiceNotFound    = "k8s.service_not_found"
)
View Source
const (
	ReasonEvicted   = "Evicted"
	ReasonOOMKilled = "OOMKilled"
	ReasonCompleted = "Completed"
)

pod termination reasons https://github.com/kubernetes/kube-state-metrics/blob/master/docs/pod-metrics.md

Variables

This section is empty.

Functions

func CPU

func CPU(cpu string) kresource.Quantity

func ConfigMap added in v0.7.0

func ConfigMap(spec *ConfigMapSpec) *kcore.ConfigMap

func ConfigMapMap added in v0.7.0

func ConfigMapMap(configMaps []kcore.ConfigMap) map[string]kcore.ConfigMap

func Deployment

func Deployment(spec *DeploymentSpec) *kapps.Deployment

func DeploymentMap

func DeploymentMap(deployments []kapps.Deployment) map[string]kapps.Deployment

func DeploymentStartTime

func DeploymentStartTime(deployment *kapps.Deployment) *time.Time

func DeploymentStrategiesMatch added in v0.13.0

func DeploymentStrategiesMatch(s1, s2 kapps.DeploymentStrategy) bool

func EmptyDirVolume

func EmptyDirVolume(volumeName string) kcore.Volume

func EmptyDirVolumeMount

func EmptyDirVolumeMount(volumeName string, mountPath string) kcore.VolumeMount

func ErrorAnnotationNotFound added in v0.15.0

func ErrorAnnotationNotFound(annotationName string) error

func ErrorLabelNotFound added in v0.15.0

func ErrorLabelNotFound(labelName string) error

func ErrorMissingMetrics added in v0.33.0

func ErrorMissingMetrics() error

func ErrorParseAnnotation added in v0.15.0

func ErrorParseAnnotation(annotationName string, annotationVal string, desiredType string) error

func ErrorParseLabel added in v0.15.0

func ErrorParseLabel(labelName string, labelVal string, desiredType string) error

func ErrorParseQuantity added in v0.9.0

func ErrorParseQuantity(qtyStr string) error

func ErrorServiceNotFound added in v0.34.0

func ErrorServiceNotFound(serviceName string) error

func ExtractVirtualServiceEndpoints added in v0.13.0

func ExtractVirtualServiceEndpoints(virtualService *istioclientnetworking.VirtualService) strset.Set

func ExtractVirtualServiceGateways added in v0.13.0

func ExtractVirtualServiceGateways(virtualService *istioclientnetworking.VirtualService) strset.Set

func FieldSelectorNotIn

func FieldSelectorNotIn(key string, values []string) string

func GetAnnotation added in v0.14.0

func GetAnnotation(obj kmeta.Object, key string) (string, error)

func GetLabel added in v0.15.0

func GetLabel(obj kmeta.Object, key string) (string, error)

func GetPodConditionOf added in v0.40.0

func GetPodConditionOf(pod *kcore.Pod, podType kcore.PodConditionType) (*bool, *kcore.PodCondition)

func GetPodReadyTime added in v0.7.0

func GetPodReadyTime(pod *kcore.Pod) *time.Time

func HPA added in v0.6.0

func HowManyPodsFitOnNode added in v0.40.0

func HowManyPodsFitOnNode(podSpec kcore.PodSpec, node kcore.Node, cpuReserved resource.Quantity, memoryReserved resource.Quantity) int64

func Ingress

func Ingress(spec *IngressSpec) *kextensions.Ingress

func IngressMap

func IngressMap(ingresses []kextensions.Ingress) map[string]kextensions.Ingress

func IsHPAUpToDate added in v0.7.0

func IsHPAUpToDate(hpa *kautoscaling.HorizontalPodAutoscaler, minReplicas, maxReplicas, targetCPUUtilization, targetMemUtilization int32) bool

func IsPodReady added in v0.7.0

func IsPodReady(pod *kcore.Pod) bool

func IsPodStalled added in v0.40.0

func IsPodStalled(pod *kcore.Pod) bool

func Job

func Job(spec *JobSpec) *kbatch.Job

func JobMap

func JobMap(jobs []kbatch.Job) map[string]kbatch.Job

func LabelExistsSelector added in v0.13.0

func LabelExistsSelector(labelKeys ...string) string

func Mem

func Mem(mem string) kresource.Quantity

func ParseBoolAnnotation added in v0.14.0

func ParseBoolAnnotation(obj kmeta.Object, key string) (bool, error)

func ParseBoolLabel added in v0.15.0

func ParseBoolLabel(obj kmeta.Object, key string) (bool, error)

func ParseDurationAnnotation added in v0.14.0

func ParseDurationAnnotation(obj kmeta.Object, key string) (time.Duration, error)

func ParseDurationLabel added in v0.15.0

func ParseDurationLabel(obj kmeta.Object, key string) (time.Duration, error)

func ParseFloat32Annotation added in v0.14.0

func ParseFloat32Annotation(obj kmeta.Object, key string) (float32, error)

func ParseFloat32Label added in v0.15.0

func ParseFloat32Label(obj kmeta.Object, key string) (float32, error)

func ParseFloat64Annotation added in v0.14.0

func ParseFloat64Annotation(obj kmeta.Object, key string) (float64, error)

func ParseFloat64Label added in v0.15.0

func ParseFloat64Label(obj kmeta.Object, key string) (float64, error)

func ParseInt32Annotation added in v0.14.0

func ParseInt32Annotation(obj kmeta.Object, key string) (int32, error)

func ParseInt32Label added in v0.15.0

func ParseInt32Label(obj kmeta.Object, key string) (int32, error)

func ParseInt64Annotation added in v0.14.0

func ParseInt64Annotation(obj kmeta.Object, key string) (int64, error)

func ParseInt64Label added in v0.15.0

func ParseInt64Label(obj kmeta.Object, key string) (int64, error)

func ParseIntAnnotation added in v0.14.0

func ParseIntAnnotation(obj kmeta.Object, key string) (int, error)

func ParseIntLabel added in v0.15.0

func ParseIntLabel(obj kmeta.Object, key string) (int, error)

func Pod

func Pod(spec *PodSpec) *kcore.Pod

func PodComputesEqual added in v0.13.0

func PodComputesEqual(podSpec1, podSpec2 *kcore.PodSpec) bool

func PodMap

func PodMap(pods []kcore.Pod) map[string]kcore.Pod

func QuantityParser added in v0.11.0

func QuantityParser(v *QuantityValidation) func(string) (interface{}, error)

func QuantityPtr added in v0.11.0

func QuantityPtr(k8sQuantity kresource.Quantity) *kresource.Quantity

func QuantityPtrID added in v0.11.0

func QuantityPtrID(quantity *Quantity) string

func QuantityPtrsEqual added in v0.11.0

func QuantityPtrsEqual(quantity *Quantity, quantity2 *Quantity) bool

func RandomName added in v0.13.0

func RandomName() string

to be safe, k8s sometimes needs all characters to be lower case, and the first to be a letter

func Secret added in v0.21.0

func Secret(spec *SecretSpec) *kcore.Secret

func SecretMap added in v0.21.0

func SecretMap(secrets []kcore.Secret) map[string]kcore.Secret

func Service

func Service(spec *ServiceSpec) *kcore.Service

func ServiceMap

func ServiceMap(services []kcore.Service) map[string]kcore.Service

func ToKiCeil added in v0.37.0

func ToKiCeil(k8sQuantity kresource.Quantity) int64

func ToKiCeilStr added in v0.37.0

func ToKiCeilStr(k8sQuantity kresource.Quantity) string

func ToKiFloor added in v0.37.0

func ToKiFloor(k8sQuantity kresource.Quantity) int64

func ToKiFloorStr added in v0.37.0

func ToKiFloorStr(k8sQuantity kresource.Quantity) string

func ToKiRounded added in v0.37.0

func ToKiRounded(k8sQuantity kresource.Quantity) int64

func ToKiRoundedStr added in v0.37.0

func ToKiRoundedStr(k8sQuantity kresource.Quantity) string

func ToMiCeil added in v0.37.0

func ToMiCeil(k8sQuantity kresource.Quantity) int64

func ToMiCeilStr added in v0.37.0

func ToMiCeilStr(k8sQuantity kresource.Quantity) string

func ToMiFloor added in v0.37.0

func ToMiFloor(k8sQuantity kresource.Quantity) int64

func ToMiFloorStr added in v0.37.0

func ToMiFloorStr(k8sQuantity kresource.Quantity) string

func ToMiRounded added in v0.37.0

func ToMiRounded(k8sQuantity kresource.Quantity) int64

func ToMiRoundedStr added in v0.37.0

func ToMiRoundedStr(k8sQuantity kresource.Quantity) string

func TotalPodCompute added in v0.13.0

func TotalPodCompute(podSpec *kcore.PodSpec) (Quantity, Quantity, int64, int64)

func ValidName

func ValidName(name string) string

ValidName ensures name contains only lower case alphanumeric, '-', or '.'

func ValidNameContainer

func ValidNameContainer(name string) string

ValidNameContainer ensures name contains only lower case alphanumeric or '-', must start with alphabetic, end with alphanumeric

func VirtualService added in v0.8.0

func WasPodOOMKilled added in v0.19.0

func WasPodOOMKilled(pod *kcore.Pod) bool

Types

type Client

type Client struct {
	ctrl.Client
	RestConfig *kclientrest.Config

	Namespace string
	// contains filtered or unexported fields
}

func New

func New(namespace string, inCluster bool, restConfig *kclientrest.Config, scheme *runtime.Scheme) (*Client, error)

func (*Client) ApplyConfigMap added in v0.7.0

func (c *Client) ApplyConfigMap(configMap *kcore.ConfigMap) (*kcore.ConfigMap, error)

func (*Client) ApplyDeployment added in v0.7.0

func (c *Client) ApplyDeployment(deployment *kapps.Deployment) (*kapps.Deployment, error)

func (*Client) ApplyHPA added in v0.7.0

func (*Client) ApplyIngress added in v0.7.0

func (c *Client) ApplyIngress(ingress *kextensions.Ingress) (*kextensions.Ingress, error)

func (*Client) ApplyJob added in v0.7.0

func (c *Client) ApplyJob(job *kbatch.Job) (*kbatch.Job, error)

func (*Client) ApplyPod added in v0.7.0

func (c *Client) ApplyPod(pod *kcore.Pod) (*kcore.Pod, error)

func (*Client) ApplySecret added in v0.21.0

func (c *Client) ApplySecret(secret *kcore.Secret) (*kcore.Secret, error)

func (*Client) ApplyService added in v0.7.0

func (c *Client) ApplyService(service *kcore.Service) (*kcore.Service, error)

func (*Client) ApplyVirtualService added in v0.8.0

func (c *Client) ApplyVirtualService(virtualService *istioclientnetworking.VirtualService) (*istioclientnetworking.VirtualService, error)

func (*Client) ClientSet added in v0.38.0

func (c *Client) ClientSet() *kclientset.Clientset

func (*Client) CreateConfigMap added in v0.7.0

func (c *Client) CreateConfigMap(configMap *kcore.ConfigMap) (*kcore.ConfigMap, error)

func (*Client) CreateDeployment

func (c *Client) CreateDeployment(deployment *kapps.Deployment) (*kapps.Deployment, error)

func (*Client) CreateHPA added in v0.6.0

func (*Client) CreateIngress

func (c *Client) CreateIngress(ingress *kextensions.Ingress) (*kextensions.Ingress, error)

func (*Client) CreateJob

func (c *Client) CreateJob(job *kbatch.Job) (*kbatch.Job, error)

func (*Client) CreatePod

func (c *Client) CreatePod(pod *kcore.Pod) (*kcore.Pod, error)

func (*Client) CreateSecret added in v0.21.0

func (c *Client) CreateSecret(secret *kcore.Secret) (*kcore.Secret, error)

func (*Client) CreateService

func (c *Client) CreateService(service *kcore.Service) (*kcore.Service, error)

func (*Client) CreateVirtualService added in v0.8.0

func (c *Client) CreateVirtualService(virtualService *istioclientnetworking.VirtualService) (*istioclientnetworking.VirtualService, error)

func (*Client) DeleteConfigMap added in v0.7.0

func (c *Client) DeleteConfigMap(name string) (bool, error)

func (*Client) DeleteDeployment

func (c *Client) DeleteDeployment(name string) (bool, error)

func (*Client) DeleteHPA added in v0.6.0

func (c *Client) DeleteHPA(name string) (bool, error)

func (*Client) DeleteIngress

func (c *Client) DeleteIngress(name string) (bool, error)

func (*Client) DeleteJob

func (c *Client) DeleteJob(name string) (bool, error)

func (*Client) DeleteJobs added in v0.19.0

func (c *Client) DeleteJobs(opts *kmeta.ListOptions) (bool, error)

func (*Client) DeletePod

func (c *Client) DeletePod(name string) (bool, error)

func (*Client) DeleteSecret added in v0.21.0

func (c *Client) DeleteSecret(name string) (bool, error)

func (*Client) DeleteService

func (c *Client) DeleteService(name string) (bool, error)

func (*Client) DeleteVirtualService added in v0.8.0

func (c *Client) DeleteVirtualService(name string) (bool, error)

func (*Client) Exec added in v0.14.0

func (c *Client) Exec(podName string, containerName string, command []string) (string, error)

Example of running a shell command: []string{"/bin/bash", "-c", "ps aux | grep my-proc"}

func (*Client) GetConfigMap added in v0.7.0

func (c *Client) GetConfigMap(name string) (*kcore.ConfigMap, error)

func (*Client) GetConfigMapData added in v0.7.0

func (c *Client) GetConfigMapData(name string) (map[string]string, map[string][]byte, error)

func (*Client) GetDeployment

func (c *Client) GetDeployment(name string) (*kapps.Deployment, error)

func (*Client) GetHPA added in v0.6.0

func (*Client) GetIngress

func (c *Client) GetIngress(name string) (*kextensions.Ingress, error)

func (*Client) GetJob

func (c *Client) GetJob(name string) (*kbatch.Job, error)

func (*Client) GetPod

func (c *Client) GetPod(name string) (*kcore.Pod, error)

func (*Client) GetSecret added in v0.21.0

func (c *Client) GetSecret(name string) (*kcore.Secret, error)

func (*Client) GetSecretData added in v0.21.0

func (c *Client) GetSecretData(name string) (map[string][]byte, error)

func (*Client) GetService

func (c *Client) GetService(name string) (*kcore.Service, error)

func (*Client) GetVirtualService added in v0.8.0

func (c *Client) GetVirtualService(name string) (*istioclientnetworking.VirtualService, error)

func (*Client) InternalServiceEndpoint added in v0.34.0

func (c *Client) InternalServiceEndpoint(serviceName string, portNumber int32) string

func (*Client) IsJobRunning added in v0.7.0

func (c *Client) IsJobRunning(name string) (bool, error)

func (*Client) IstioClientSet added in v0.38.0

func (c *Client) IstioClientSet() *istioclient.Clientset

func (*Client) ListConfigMaps added in v0.7.0

func (c *Client) ListConfigMaps(opts *kmeta.ListOptions) ([]kcore.ConfigMap, error)

func (*Client) ListConfigMapsByLabel added in v0.7.0

func (c *Client) ListConfigMapsByLabel(labelKey string, labelValue string) ([]kcore.ConfigMap, error)

func (*Client) ListConfigMapsByLabels added in v0.7.0

func (c *Client) ListConfigMapsByLabels(labels map[string]string) ([]kcore.ConfigMap, error)

func (*Client) ListConfigMapsWithLabelKeys added in v0.13.0

func (c *Client) ListConfigMapsWithLabelKeys(labelKeys ...string) ([]kcore.ConfigMap, error)

func (*Client) ListDeployments

func (c *Client) ListDeployments(opts *kmeta.ListOptions) ([]kapps.Deployment, error)

func (*Client) ListDeploymentsByLabel

func (c *Client) ListDeploymentsByLabel(labelKey string, labelValue string) ([]kapps.Deployment, error)

func (*Client) ListDeploymentsByLabels

func (c *Client) ListDeploymentsByLabels(labels map[string]string) ([]kapps.Deployment, error)

func (*Client) ListDeploymentsWithLabelKeys added in v0.13.0

func (c *Client) ListDeploymentsWithLabelKeys(labelKeys ...string) ([]kapps.Deployment, error)

func (*Client) ListHPAs added in v0.6.0

func (*Client) ListHPAsByLabel added in v0.6.0

func (c *Client) ListHPAsByLabel(labelKey string, labelValue string) ([]kautoscaling.HorizontalPodAutoscaler, error)

func (*Client) ListHPAsByLabels added in v0.6.0

func (c *Client) ListHPAsByLabels(labels map[string]string) ([]kautoscaling.HorizontalPodAutoscaler, error)

func (*Client) ListHPAsWithLabelKeys added in v0.13.0

func (c *Client) ListHPAsWithLabelKeys(labelKeys ...string) ([]kautoscaling.HorizontalPodAutoscaler, error)

func (*Client) ListIngresses

func (c *Client) ListIngresses(opts *kmeta.ListOptions) ([]kextensions.Ingress, error)

func (*Client) ListIngressesByLabel

func (c *Client) ListIngressesByLabel(labelKey string, labelValue string) ([]kextensions.Ingress, error)

func (*Client) ListIngressesByLabels

func (c *Client) ListIngressesByLabels(labels map[string]string) ([]kextensions.Ingress, error)

func (*Client) ListIngressesWithLabelKeys added in v0.13.0

func (c *Client) ListIngressesWithLabelKeys(labelKeys ...string) ([]kextensions.Ingress, error)

func (*Client) ListJobs

func (c *Client) ListJobs(opts *kmeta.ListOptions) ([]kbatch.Job, error)

func (*Client) ListJobsByLabel

func (c *Client) ListJobsByLabel(labelKey string, labelValue string) ([]kbatch.Job, error)

func (*Client) ListJobsByLabels

func (c *Client) ListJobsByLabels(labels map[string]string) ([]kbatch.Job, error)

func (*Client) ListJobsWithLabelKeys added in v0.13.0

func (c *Client) ListJobsWithLabelKeys(labelKeys ...string) ([]kbatch.Job, error)

func (*Client) ListNodes added in v0.8.0

func (c *Client) ListNodes(opts *kmeta.ListOptions) ([]kcore.Node, error)

func (*Client) ListNodesByLabel added in v0.17.0

func (c *Client) ListNodesByLabel(labelKey string, labelValue string) ([]kcore.Node, error)

func (*Client) ListNodesByLabels added in v0.17.0

func (c *Client) ListNodesByLabels(labels map[string]string) ([]kcore.Node, error)

func (*Client) ListNodesWithLabelKeys added in v0.17.0

func (c *Client) ListNodesWithLabelKeys(labelKeys ...string) ([]kcore.Node, error)

func (*Client) ListPods

func (c *Client) ListPods(opts *kmeta.ListOptions) ([]kcore.Pod, error)

func (*Client) ListPodsByLabel

func (c *Client) ListPodsByLabel(labelKey string, labelValue string) ([]kcore.Pod, error)

func (*Client) ListPodsByLabels

func (c *Client) ListPodsByLabels(labels map[string]string) ([]kcore.Pod, error)

func (*Client) ListPodsWithLabelKeys added in v0.13.0

func (c *Client) ListPodsWithLabelKeys(labelKeys ...string) ([]kcore.Pod, error)

func (*Client) ListSecrets added in v0.21.0

func (c *Client) ListSecrets(opts *kmeta.ListOptions) ([]kcore.Secret, error)

func (*Client) ListSecretsByLabel added in v0.21.0

func (c *Client) ListSecretsByLabel(labelKey string, labelValue string) ([]kcore.Secret, error)

func (*Client) ListSecretsByLabels added in v0.21.0

func (c *Client) ListSecretsByLabels(labels map[string]string) ([]kcore.Secret, error)

func (*Client) ListSecretsWithLabelKeys added in v0.21.0

func (c *Client) ListSecretsWithLabelKeys(labelKeys ...string) ([]kcore.Secret, error)

func (*Client) ListServices

func (c *Client) ListServices(opts *kmeta.ListOptions) ([]kcore.Service, error)

func (*Client) ListServicesByLabel

func (c *Client) ListServicesByLabel(labelKey string, labelValue string) ([]kcore.Service, error)

func (*Client) ListServicesByLabels

func (c *Client) ListServicesByLabels(labels map[string]string) ([]kcore.Service, error)

func (*Client) ListServicesWithLabelKeys added in v0.13.0

func (c *Client) ListServicesWithLabelKeys(labelKeys ...string) ([]kcore.Service, error)

func (*Client) ListVirtualServices added in v0.8.0

func (c *Client) ListVirtualServices(opts *kmeta.ListOptions) ([]istioclientnetworking.VirtualService, error)

func (*Client) ListVirtualServicesByLabel added in v0.8.0

func (c *Client) ListVirtualServicesByLabel(labelKey string, labelValue string) ([]istioclientnetworking.VirtualService, error)

func (*Client) ListVirtualServicesByLabels added in v0.8.0

func (c *Client) ListVirtualServicesByLabels(labels map[string]string) ([]istioclientnetworking.VirtualService, error)

func (*Client) ListVirtualServicesWithLabelKeys added in v0.13.0

func (c *Client) ListVirtualServicesWithLabelKeys(labelKeys ...string) ([]istioclientnetworking.VirtualService, error)

func (*Client) UpdateConfigMap added in v0.13.0

func (c *Client) UpdateConfigMap(configMap *kcore.ConfigMap) (*kcore.ConfigMap, error)

func (*Client) UpdateDeployment

func (c *Client) UpdateDeployment(deployment *kapps.Deployment) (*kapps.Deployment, error)

func (*Client) UpdateHPA added in v0.6.0

func (*Client) UpdateIngress added in v0.6.0

func (c *Client) UpdateIngress(ingress *kextensions.Ingress) (*kextensions.Ingress, error)

func (*Client) UpdateJob

func (c *Client) UpdateJob(job *kbatch.Job) (*kbatch.Job, error)

func (*Client) UpdatePod added in v0.6.0

func (c *Client) UpdatePod(pod *kcore.Pod) (*kcore.Pod, error)

func (*Client) UpdateSecret added in v0.21.0

func (c *Client) UpdateSecret(secret *kcore.Secret) (*kcore.Secret, error)

func (*Client) UpdateService added in v0.6.0

func (c *Client) UpdateService(existing, updated *kcore.Service) (*kcore.Service, error)

func (*Client) UpdateVirtualService added in v0.13.0

func (c *Client) UpdateVirtualService(existing, updated *istioclientnetworking.VirtualService) (*istioclientnetworking.VirtualService, error)

func (*Client) VirtualServiceClient added in v0.38.0

func (c *Client) VirtualServiceClient() istionetworkingclient.VirtualServiceInterface

func (*Client) WaitForPodRunning

func (c *Client) WaitForPodRunning(name string, numSeconds int) error

type ConfigMapSpec added in v0.7.0

type ConfigMapSpec struct {
	Name        string
	Data        map[string]string // Data and BinaryData must not have overlapping keys
	BinaryData  map[string][]byte // Data and BinaryData must not have overlapping keys
	Labels      map[string]string
	Annotations map[string]string
}

type DeploymentSpec

type DeploymentSpec struct {
	Name           string
	Replicas       int32
	PodSpec        PodSpec
	MaxSurge       *string // Can be a percentage (e.g. 10%) or an absolute number (e.g. 2)
	MaxUnavailable *string // Can be a percentage (e.g. 10%) or an absolute number (e.g. 2)
	Selector       map[string]string
	Labels         map[string]string
	Annotations    map[string]string
}

type Destination added in v0.19.0

type Destination struct {
	ServiceName string
	Weight      int32
	Port        uint32
	Shadow      bool
	Headers     *istionetworking.Headers
}

type HPASpec added in v0.6.0

type HPASpec struct {
	DeploymentName       string
	MinReplicas          int32
	MaxReplicas          int32
	TargetCPUUtilization int32
	TargetMemUtilization int32
	Labels               map[string]string
	Annotations          map[string]string
}

type IngressSpec

type IngressSpec struct {
	Name         string
	IngressClass string
	ServiceName  string
	ServicePort  int32
	Path         string
	Labels       map[string]string
	Annotations  map[string]string
}

type JobSpec

type JobSpec struct {
	Name         string
	Namespace    string
	PodSpec      PodSpec
	Parallelism  int32
	BackoffLimit int32
	Labels       map[string]string
	Annotations  map[string]string
}

type PodSpec

type PodSpec struct {
	Name        string
	K8sPodSpec  kcore.PodSpec
	Labels      map[string]string
	Annotations map[string]string
}

type PodStatus added in v0.5.0

type PodStatus string
const (
	PodStatusPending      PodStatus = "Pending"
	PodStatusCreating     PodStatus = "Creating"
	PodStatusNotReady     PodStatus = "NotReady"
	PodStatusReady        PodStatus = "Ready"
	PodStatusErrImagePull PodStatus = "ErrImagePull"
	PodStatusTerminating  PodStatus = "Terminating"
	PodStatusFailed       PodStatus = "Failed"
	PodStatusKilled       PodStatus = "Killed"
	PodStatusKilledOOM    PodStatus = "KilledOOM"
	PodStatusStalled      PodStatus = "Stalled"
	PodStatusSucceeded    PodStatus = "Succeeded"
	PodStatusUnknown      PodStatus = "Unknown"
)

func GetPodStatus

func GetPodStatus(pod *kcore.Pod) PodStatus

func PodStatusFromContainerStatuses added in v0.8.0

func PodStatusFromContainerStatuses(containerStatuses []kcore.ContainerStatus) PodStatus

type Quantity added in v0.11.0

type Quantity struct {
	kresource.Quantity
	UserString string
}

func NewMilliQuantity added in v0.16.0

func NewMilliQuantity(milliValue int64) *Quantity

func NewQuantity added in v0.16.0

func NewQuantity(value int64) *Quantity

func NewSummed added in v0.37.0

func NewSummed(quantities ...kresource.Quantity) *Quantity

Returns nil if no quantities are passed in

func WrapQuantity added in v0.17.0

func WrapQuantity(k8sQuantity kresource.Quantity) *Quantity

func (*Quantity) Add added in v0.17.0

func (quantity *Quantity) Add(q2 kresource.Quantity)

func (*Quantity) AddQty added in v0.17.0

func (quantity *Quantity) AddQty(q2 Quantity)

func (*Quantity) DeepCopy added in v0.37.0

func (quantity *Quantity) DeepCopy() Quantity

func (*Quantity) Equal added in v0.11.0

func (quantity *Quantity) Equal(quantity2 Quantity) bool

func (*Quantity) ID added in v0.11.0

func (quantity *Quantity) ID() string

func (Quantity) MarshalBinary added in v0.11.0

func (quantity Quantity) MarshalBinary() ([]byte, error)

func (Quantity) MarshalJSON added in v0.11.0

func (quantity Quantity) MarshalJSON() ([]byte, error)

func (Quantity) MarshalText added in v0.11.0

func (quantity Quantity) MarshalText() ([]byte, error)

func (Quantity) MarshalYAML added in v0.11.0

func (quantity Quantity) MarshalYAML() (interface{}, error)

func (*Quantity) MilliString added in v0.19.0

func (quantity *Quantity) MilliString() string

func (*Quantity) String added in v0.11.0

func (quantity *Quantity) String() string

func (*Quantity) Sub added in v0.17.0

func (quantity *Quantity) Sub(q2 kresource.Quantity)

func (*Quantity) SubQty added in v0.17.0

func (quantity *Quantity) SubQty(q2 Quantity)

func (*Quantity) ToFloat32 added in v0.11.0

func (quantity *Quantity) ToFloat32() float32

func (*Quantity) ToKiCeil added in v0.37.0

func (quantity *Quantity) ToKiCeil() int64

func (*Quantity) ToKiCeilStr added in v0.37.0

func (quantity *Quantity) ToKiCeilStr() string

func (*Quantity) ToKiFloor added in v0.37.0

func (quantity *Quantity) ToKiFloor() int64

func (*Quantity) ToKiFloorStr added in v0.37.0

func (quantity *Quantity) ToKiFloorStr() string

func (*Quantity) ToKiRounded added in v0.37.0

func (quantity *Quantity) ToKiRounded() int64

func (*Quantity) ToKiRoundedStr added in v0.37.0

func (quantity *Quantity) ToKiRoundedStr() string

func (*Quantity) ToMiCeil added in v0.37.0

func (quantity *Quantity) ToMiCeil() int64

func (*Quantity) ToMiCeilStr added in v0.37.0

func (quantity *Quantity) ToMiCeilStr() string

func (*Quantity) ToMiFloor added in v0.37.0

func (quantity *Quantity) ToMiFloor() int64

func (*Quantity) ToMiFloorStr added in v0.37.0

func (quantity *Quantity) ToMiFloorStr() string

func (*Quantity) ToMiRounded added in v0.37.0

func (quantity *Quantity) ToMiRounded() int64

func (*Quantity) ToMiRoundedStr added in v0.37.0

func (quantity *Quantity) ToMiRoundedStr() string

func (*Quantity) UnmarshalBinary added in v0.11.0

func (quantity *Quantity) UnmarshalBinary(data []byte) error

func (*Quantity) UnmarshalJSON added in v0.11.0

func (quantity *Quantity) UnmarshalJSON(data []byte) error

func (*Quantity) UnmarshalText added in v0.11.0

func (quantity *Quantity) UnmarshalText(data []byte) error

func (*Quantity) UnmarshalYAML added in v0.11.0

func (quantity *Quantity) UnmarshalYAML(unmarshal func(interface{}) error) error

type QuantityValidation added in v0.11.0

type QuantityValidation struct {
	GreaterThan          *kresource.Quantity
	GreaterThanOrEqualTo *kresource.Quantity
	LessThan             *kresource.Quantity
	LessThanOrEqualTo    *kresource.Quantity
}

type SecretSpec added in v0.21.0

type SecretSpec struct {
	Name        string
	Data        map[string][]byte
	Labels      map[string]string
	Annotations map[string]string
}

type ServiceSpec

type ServiceSpec struct {
	Name        string
	PortName    string
	Port        int32
	TargetPort  int32
	ServiceType kcore.ServiceType
	Selector    map[string]string
	Labels      map[string]string
	Annotations map[string]string
}

type VirtualServiceSpec added in v0.8.0

type VirtualServiceSpec struct {
	Name         string
	Gateways     []string
	ExactPath    *string // either this or PrefixPath
	PrefixPath   *string // either this or ExactPath
	Destinations []Destination
	Rewrite      *string
	Labels       map[string]string
	Annotations  map[string]string
	Headers      *istionetworking.Headers
	Retries      *int32
}

Jump to

Keyboard shortcuts

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