v1

package
v1.1.23 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// AddToScheme applies all the stored functions to the scheme. A non-nil error
	// indicates that one function failed and the attempt was abandoned.
	AddToScheme = schemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: zalando.GroupName, Version: "v1"}

SchemeGroupVersion is the group version used to register these objects.

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group-qualified GroupResource.

Types

type ActualTraffic added in v1.1.0

type ActualTraffic struct {
	StackName   string             `json:"stackName"`
	ServiceName string             `json:"serviceName"`
	ServicePort intstr.IntOrString `json:"servicePort"`
	Weight      float64            `json:"weight"`
}

Traffic is the actual traffic setting on services for this stackset, controllers interested in current traffic decision should read this.

type Autoscaler

type Autoscaler struct {
	// minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down.
	// It defaults to 1 pod.
	// +optional
	MinReplicas *int32 `json:"minReplicas,omitempty"`
	// maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.
	// It cannot be less that minReplicas.
	MaxReplicas int32 `json:"maxReplicas"`

	Metrics []AutoscalerMetrics `json:"metrics"`
}

Autoscaler is the autoscaling definition for a stack +k8s:deepcopy-gen=true

func (*Autoscaler) DeepCopy

func (in *Autoscaler) DeepCopy() *Autoscaler

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Autoscaler.

func (*Autoscaler) DeepCopyInto

func (in *Autoscaler) DeepCopyInto(out *Autoscaler)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AutoscalerMetrics

type AutoscalerMetrics struct {
	Type               string             `json:"type"`
	Average            *resource.Quantity `json:"average,omitempty"`
	Endpoint           *MetricsEndpoint   `json:"endpoint,omitempty"`
	AverageUtilization *int32             `json:"averageUtilization,omitempty"`
	Queue              *MetricsQueue      `json:"queue,omitempty"`
}

AutoscalerMetrics is the type of metric to be be used for autoscaling +k8s:deepcopy-gen=true

func (*AutoscalerMetrics) DeepCopy

func (in *AutoscalerMetrics) DeepCopy() *AutoscalerMetrics

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalerMetrics.

func (*AutoscalerMetrics) DeepCopyInto

func (in *AutoscalerMetrics) DeepCopyInto(out *AutoscalerMetrics)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DesiredTraffic added in v1.1.0

type DesiredTraffic struct {
	StackName string  `json:"stackName"`
	Weight    float64 `json:"weight"`
}

DesiredTraffic is the desired traffic setting to direct traffic to a stack. This is meant to use by clients to orchestrate traffic switching.

type HorizontalPodAutoscaler

type HorizontalPodAutoscaler struct {
	metav1.ObjectMeta `json:"metadata,omitempty"`
	// minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down.
	// It defaults to 1 pod.
	// +optional
	MinReplicas *int32 `json:"minReplicas,omitempty"`
	// maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.
	// It cannot be less that minReplicas.
	MaxReplicas int32 `json:"maxReplicas"`
	// metrics contains the specifications for which to use to calculate the
	// desired replica count (the maximum replica count across all metrics will
	// be used).  The desired replica count is calculated multiplying the
	// ratio between the target value and the current value by the current
	// number of pods.  Ergo, metrics used must decrease as the pod count is
	// increased, and vice-versa.  See the individual metric source types for
	// more information about how each type of metric must respond.
	// +optional
	Metrics []autoscaling.MetricSpec `json:"metrics,omitempty"`
}

HorizontalPodAutoscaler is the Autoscaling configuration of a Stack. If defined an HPA will be created for the Stack. +k8s:deepcopy-gen=true

func (*HorizontalPodAutoscaler) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HorizontalPodAutoscaler.

func (*HorizontalPodAutoscaler) DeepCopyInto

func (in *HorizontalPodAutoscaler) DeepCopyInto(out *HorizontalPodAutoscaler)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MetricsEndpoint

type MetricsEndpoint struct {
	Port int32  `json:"port"`
	Path string `json:"path"`
	Key  string `json:"key"`
	Name string `json:"name"`
}

MetricsEndpoint specified the endpoint where the custom endpoint where the metrics can be queried +k8s:deepcopy-gen=true

func (*MetricsEndpoint) DeepCopy

func (in *MetricsEndpoint) DeepCopy() *MetricsEndpoint

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsEndpoint.

func (*MetricsEndpoint) DeepCopyInto

func (in *MetricsEndpoint) DeepCopyInto(out *MetricsEndpoint)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MetricsQueue

type MetricsQueue struct {
	Name   string `json:"name"`
	Region string `json:"region"`
}

MetricsQueue specifies the SQS queue whose length should be used for scaling +k8s:deepcopy-gen=true

func (*MetricsQueue) DeepCopy

func (in *MetricsQueue) DeepCopy() *MetricsQueue

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsQueue.

func (*MetricsQueue) DeepCopyInto

func (in *MetricsQueue) DeepCopyInto(out *MetricsQueue)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PrescalingStatus

type PrescalingStatus struct {
	// Active indicates if prescaling is current active
	// +optional
	Active bool `json:"active"`
	// Replicas is the number of replicas required for prescaling
	// +optional
	Replicas int32 `json:"replicas,omitempty"`
	// DesiredTrafficWeight is the desired traffic weight that the stack was prescaled for
	// +optional
	DesiredTrafficWeight float64 `json:"desiredTrafficWeight,omitempty"`
	// LastTrafficIncrease is the timestamp when the traffic was last increased on the stack
	// +optional
	LastTrafficIncrease *metav1.Time `json:"lastTrafficIncrease,omitempty"`
}

Prescaling hold prescaling information +k8s:deepcopy-gen=true

func (*PrescalingStatus) DeepCopy

func (in *PrescalingStatus) DeepCopy() *PrescalingStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrescalingStatus.

func (*PrescalingStatus) DeepCopyInto

func (in *PrescalingStatus) DeepCopyInto(out *PrescalingStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Stack

type Stack struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   StackSpec   `json:"spec"`
	Status StackStatus `json:"status"`
}

Stack defines one version of an application. It is possible to switch traffic between multiple versions of an application. +k8s:deepcopy-gen=true

func (*Stack) DeepCopy

func (in *Stack) DeepCopy() *Stack

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Stack.

func (*Stack) DeepCopyInto

func (in *Stack) DeepCopyInto(out *Stack)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Stack) DeepCopyObject

func (in *Stack) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type StackLifecycle

type StackLifecycle struct {
	// ScaledownTTLSeconds is the ttl in seconds for when Stacks of a
	// StackSet should be scaled down to 0 replicas in case they are not
	// getting traffic.
	// Defaults to 300 seconds.
	// +optional
	ScaledownTTLSeconds *int64 `json:"scaledownTTLSeconds,omitempty"`
	// Limit defines the maximum number of Stacks to keep around. If the
	// number of Stacks exceeds the limit then the oldest stacks which are
	// not getting traffic are deleted.
	Limit *int32 `json:"limit,omitempty"`
}

StackLifecycle defines lifecycle of the Stacks of a StackSet. +k8s:deepcopy-gen=true

func (*StackLifecycle) DeepCopy

func (in *StackLifecycle) DeepCopy() *StackLifecycle

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackLifecycle.

func (*StackLifecycle) DeepCopyInto

func (in *StackLifecycle) DeepCopyInto(out *StackLifecycle)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StackList

type StackList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []Stack `json:"items"`
}

StackList is a list of Stacks. +k8s:deepcopy-gen=true

func (*StackList) DeepCopy

func (in *StackList) DeepCopy() *StackList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackList.

func (*StackList) DeepCopyInto

func (in *StackList) DeepCopyInto(out *StackList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*StackList) DeepCopyObject

func (in *StackList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type StackServiceSpec

type StackServiceSpec struct {
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// The list of ports that are exposed by this service.
	// More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies
	// +patchMergeKey=port
	// +patchStrategy=merge
	Ports []v1.ServicePort `json:"ports,omitempty" patchStrategy:"merge" patchMergeKey:"port"`
}

StackServiceSpec makes it possible to customize the service generated for a stack. +k8s:deepcopy-gen=true

func (*StackServiceSpec) DeepCopy

func (in *StackServiceSpec) DeepCopy() *StackServiceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackServiceSpec.

func (*StackServiceSpec) DeepCopyInto

func (in *StackServiceSpec) DeepCopyInto(out *StackServiceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StackSet

type StackSet struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   StackSetSpec   `json:"spec"`
	Status StackSetStatus `json:"status"`
}

StackSet describes an application resource. +k8s:deepcopy-gen=true

func (*StackSet) DeepCopy

func (in *StackSet) DeepCopy() *StackSet

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackSet.

func (*StackSet) DeepCopyInto

func (in *StackSet) DeepCopyInto(out *StackSet)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*StackSet) DeepCopyObject

func (in *StackSet) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type StackSetExternalIngressSpec added in v1.1.0

type StackSetExternalIngressSpec struct {
	BackendPort intstr.IntOrString `json:"backendPort"`
}

StackSetExternalIngressSpec defines the required service backendport for ingress managed outside of stackset.

type StackSetIngressSpec

type StackSetIngressSpec struct {
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Hosts             []string           `json:"hosts"`
	BackendPort       intstr.IntOrString `json:"backendPort"`
	Path              string             `json:"path"`
}

StackSetIngressSpec is the ingress defintion of an StackSet. This includes ingress annotations and a list of hostnames. +k8s:deepcopy-gen=true

func (*StackSetIngressSpec) DeepCopy

func (in *StackSetIngressSpec) DeepCopy() *StackSetIngressSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackSetIngressSpec.

func (*StackSetIngressSpec) DeepCopyInto

func (in *StackSetIngressSpec) DeepCopyInto(out *StackSetIngressSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StackSetList

type StackSetList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []StackSet `json:"items"`
}

StackSetList is a list of StackSets. +k8s:deepcopy-gen=true

func (*StackSetList) DeepCopy

func (in *StackSetList) DeepCopy() *StackSetList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackSetList.

func (*StackSetList) DeepCopyInto

func (in *StackSetList) DeepCopyInto(out *StackSetList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*StackSetList) DeepCopyObject

func (in *StackSetList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type StackSetSpec

type StackSetSpec struct {
	// Ingress is the information we need to create ingress and
	// service. Ingress is optional, because other controller
	// might create ingress objects, but stackset owns the traffic
	// switch. In this case we would only have a Traffic, but no
	// ingress.
	Ingress *StackSetIngressSpec `json:"ingress,omitempty"`
	// ExternalIngress is used to specify the backend port to
	// generate the services for the stacks.
	ExternalIngress *StackSetExternalIngressSpec `json:"externalIngress,omitempty"`
	// StackLifecycle defines the cleanup rules for old stacks.
	StackLifecycle StackLifecycle `json:"stackLifecycle"`
	// StackTemplate container for resources to be created that
	// belong to one stack.
	StackTemplate StackTemplate `json:"stackTemplate"`
	// Traffic is the mapping from a stackset to stack with
	// weights. It defines the desired traffic. Clients that
	// orchestrate traffic switching should write this part.
	Traffic []*DesiredTraffic `json:"traffic,omitempty"`
}

StackSetSpec is the spec part of the StackSet. +k8s:deepcopy-gen=true

func (*StackSetSpec) DeepCopy

func (in *StackSetSpec) DeepCopy() *StackSetSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackSetSpec.

func (*StackSetSpec) DeepCopyInto

func (in *StackSetSpec) DeepCopyInto(out *StackSetSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StackSetStatus

type StackSetStatus struct {
	// Stacks is the number of stacks managed by the StackSet.
	// +optional
	Stacks int32 `json:"stacks"`
	// ReadyStacks is the number of stacks managed by the StackSet which
	// are considered ready. a Stack is considered ready if:
	// replicas == readyReplicas == updatedReplicas.
	// +optional
	ReadyStacks int32 `json:"readyStacks"`
	// StacksWithTraffic is the number of stacks managed by the StackSet
	// which are getting traffic.
	// +optional
	StacksWithTraffic int32 `json:"stacksWithTraffic"`
	// ObservedStackVersion is the version of Stack generated from the current StackSet definition.
	// TODO: add a more detailed comment
	// +optional
	ObservedStackVersion string `json:"observedStackVersion,omitempty"`
	// Traffic is the actual traffic setting on services for this stackset
	// +optional
	Traffic []*ActualTraffic `json:"traffic,omitempty"`
}

StackSetStatus is the status section of the StackSet resource. +k8s:deepcopy-gen=true

func (*StackSetStatus) DeepCopy

func (in *StackSetStatus) DeepCopy() *StackSetStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackSetStatus.

func (*StackSetStatus) DeepCopyInto

func (in *StackSetStatus) DeepCopyInto(out *StackSetStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StackSpec

type StackSpec struct {
	// Number of desired pods. This is a pointer to distinguish between explicit
	// zero and not specified. Defaults to 1.
	// +optional
	Replicas                *int32                   `json:"replicas,omitempty"`
	HorizontalPodAutoscaler *HorizontalPodAutoscaler `json:"horizontalPodAutoscaler,omitempty"`
	// Service can be used to configure a custom service, if not
	// set stackset-controller will generate a service based on
	// container port and ingress backendport.
	Service *StackServiceSpec `json:"service,omitempty"`
	// PodTemplate describes the pods that will be created.
	PodTemplate v1.PodTemplateSpec `json:"podTemplate"`

	Autoscaler *Autoscaler `json:"autoscaler,omitempty"`

	// Strategy describe the rollout strategy for the underlying deployment
	Strategy *appsv1.DeploymentStrategy `json:"strategy,omitempty"`
}

StackSpec is the spec part of the Stack. +k8s:deepcopy-gen=true

func (*StackSpec) DeepCopy

func (in *StackSpec) DeepCopy() *StackSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackSpec.

func (*StackSpec) DeepCopyInto

func (in *StackSpec) DeepCopyInto(out *StackSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StackSpecTemplate

type StackSpecTemplate struct {
	StackSpec
	Version string `json:"version"`
}

StackSpecTemplate is the spec part of the Stack. +k8s:deepcopy-gen=true

func (*StackSpecTemplate) DeepCopy

func (in *StackSpecTemplate) DeepCopy() *StackSpecTemplate

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackSpecTemplate.

func (*StackSpecTemplate) DeepCopyInto

func (in *StackSpecTemplate) DeepCopyInto(out *StackSpecTemplate)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StackStatus

type StackStatus struct {
	// ActualTrafficWeight is the actual amount of traffic currently
	// routed to the stack.
	// TODO: should we be using floats in the API?
	// +optional
	ActualTrafficWeight float64 `json:"actualTrafficWeight"`
	// DesiredTrafficWeight is desired amount of traffic to be routed to
	// the stack.
	// +optional
	DesiredTrafficWeight float64 `json:"desiredTrafficWeight"`
	// Replicas is the number of replicas in the Deployment managed by the
	// stack.
	// +optional
	Replicas int32 `json:"replicas"`
	// ReadyReplicas is the number of ready replicas in the Deployment
	// managed by the stack.
	// +optional
	ReadyReplicas int32 `json:"readyReplicas"`
	// UpdatedReplicas is the number of updated replicas in the Deployment
	// managed by the stack.
	// +optional
	UpdatedReplicas int32 `json:"updatedReplicas"`
	// DesiredReplicas is the number of desired replicas in the Deployment
	// +optional
	DesiredReplicas int32 `json:"desiredReplicas"`
	// Prescaling current prescaling information
	// +optional
	Prescaling PrescalingStatus `json:"prescalingStatus"`
	// NoTrafficSince is the timestamp defining the last time the stack was
	// observed getting traffic.
	NoTrafficSince *metav1.Time `json:"noTrafficSince,omitempty"`
	// LabelSelector is the label selector used to find all pods managed by
	// a stack.
	LabelSelector string `json:"labelSelector,omitempty"`
}

StackStatus is the status part of the Stack. +k8s:deepcopy-gen=true

func (*StackStatus) DeepCopy

func (in *StackStatus) DeepCopy() *StackStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackStatus.

func (*StackStatus) DeepCopyInto

func (in *StackStatus) DeepCopyInto(out *StackStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StackTemplate

type StackTemplate struct {
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              StackSpecTemplate `json:"spec"`
}

StackTemplate defines the template used for the Stack created from a StackSet definition. +k8s:deepcopy-gen=true

func (*StackTemplate) DeepCopy

func (in *StackTemplate) DeepCopy() *StackTemplate

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackTemplate.

func (*StackTemplate) DeepCopyInto

func (in *StackTemplate) DeepCopyInto(out *StackTemplate)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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