Documentation ¶
Index ¶
- Constants
- func ALBActionAnnotationKey(r *v1alpha1.Rollout) string
- func BuildIngressPatch(mode IngressMode, current, desired *Ingress, opts ...PatchOption) ([]byte, bool, error)
- func GetCanaryIngressName(rollout *v1alpha1.Rollout) string
- func GetRolloutIngressKeys(rollout *v1alpha1.Rollout) []string
- func HasRuleWithService(i *Ingress, svc string) bool
- type ALBAction
- type ALBForwardConfig
- type ALBTargetGroup
- type ALBTargetGroupStickinessConfig
- type Ingress
- func (i *Ingress) DeepCopy() *Ingress
- func (i *Ingress) GetAnnotations() map[string]string
- func (i *Ingress) GetClass() string
- func (i *Ingress) GetExtensionsIngress() (*v1beta1.Ingress, error)
- func (i *Ingress) GetLabels() map[string]string
- func (i *Ingress) GetLoadBalancerStatus() corev1.LoadBalancerStatus
- func (i *Ingress) GetName() string
- func (i *Ingress) GetNamespace() string
- func (i *Ingress) GetNetworkingIngress() (*v1.Ingress, error)
- func (i *Ingress) GetObjectMeta() metav1.Object
- func (i *Ingress) Mode() IngressMode
- func (i *Ingress) SetAnnotations(annotations map[string]string)
- type IngressMode
- type IngressWrap
- func (w *IngressWrap) Create(ctx context.Context, namespace string, ingress *Ingress, ...) (*Ingress, error)
- func (w *IngressWrap) Get(ctx context.Context, namespace, name string, opts metav1.GetOptions) (*Ingress, error)
- func (w *IngressWrap) GetCached(namespace, name string) (*Ingress, error)
- func (w *IngressWrap) HasSynced() bool
- func (w *IngressWrap) Informer() cache.SharedIndexInformer
- func (w *IngressWrap) Patch(ctx context.Context, namespace, name string, pt types.PatchType, data []byte, ...) (*Ingress, error)
- func (w *IngressWrap) Update(ctx context.Context, namespace string, ingress *Ingress) (*Ingress, error)
- type ManagedALBActions
- type PatchOption
Constants ¶
const ( // CanaryIngressSuffix is the name suffix all canary ingresses created by the rollouts controller will have CanaryIngressSuffix = "-canary" // ManagedActionsAnnotation holds list of ALB actions that are managed by rollouts ManagedActionsAnnotation = "rollouts.argoproj.io/managed-alb-actions" //ALBIngressAnnotation is the prefix annotation that is used by the ALB Ingress controller to configure an ALB ALBIngressAnnotation = "alb.ingress.kubernetes.io" // ALBActionPrefix the prefix to specific actions within an ALB ingress. ALBActionPrefix = "/actions." )
Variables ¶
This section is empty.
Functions ¶
func ALBActionAnnotationKey ¶
ALBActionAnnotationKey returns the annotation key for a specific action
func BuildIngressPatch ¶ added in v1.2.0
func BuildIngressPatch(mode IngressMode, current, desired *Ingress, opts ...PatchOption) ([]byte, bool, error)
func GetCanaryIngressName ¶
GetCanaryIngressName constructs the name to use for the canary ingress resource from a given Rollout
func GetRolloutIngressKeys ¶
GetRolloutIngressKeys returns ingresses keys (namespace/ingressName) which are referenced by specified rollout
func HasRuleWithService ¶
HasRuleWithService check if an Ingress has a service in one of it's rules
Types ¶
type ALBAction ¶
type ALBAction struct { Type string `json:"Type"` ForwardConfig ALBForwardConfig `json:"ForwardConfig"` }
ALBAction describes an ALB action that configure the behavior of an ALB. This struct is marshaled into a string that is added to the Ingress's annotations.
type ALBForwardConfig ¶
type ALBForwardConfig struct { TargetGroups []ALBTargetGroup `json:"TargetGroups"` TargetGroupStickinessConfig *ALBTargetGroupStickinessConfig `json:"TargetGroupStickinessConfig,omitempty"` }
ALBForwardConfig describes a list of target groups that the ALB should route traffic towards
type ALBTargetGroup ¶
type ALBTargetGroup struct { // the K8s service Name ServiceName string `json:"ServiceName,omitempty"` // the K8s service port ServicePort string `json:"ServicePort,omitempty"` // The weight. The range is 0 to 999. Weight *int64 `json:"Weight,omitempty"` }
ALBTargetGroup holds the weight to send to a specific destination consisting of a K8s service and port or ARN
type ALBTargetGroupStickinessConfig ¶ added in v1.2.0
type ALBTargetGroupStickinessConfig struct { Enabled bool `json:"Enabled"` DurationSeconds int64 `json:"DurationSeconds"` }
ALBTargetGroupStickinessConfig describes settings for the listener to apply to all forwards
type Ingress ¶ added in v1.2.0
type Ingress struct {
// contains filtered or unexported fields
}
Ingress defines an Ingress resource abstraction used to allow Rollouts to work with the newer 'networking' package as well as with the legacy extensions package.
func NewIngress ¶ added in v1.2.0
NewIngress will instantiate and return an Ingress with the given Ingress from networking/v1 package
func NewIngressWithAnnotations ¶ added in v1.2.0
func NewIngressWithAnnotations(mode IngressMode, annotations map[string]string) *Ingress
func NewLegacyIngress ¶ added in v1.2.0
NewLegacyIngress will instantiate and return an Ingress with the given Ingress from extensions/v1beta1 package
func (*Ingress) GetAnnotations ¶ added in v1.2.0
func (*Ingress) GetClass ¶ added in v1.3.0
GetClass returns the ingress class. For backwards compatibility `kubernetes.io/ingress.class` annotation will be used if set, otherwise `spec.ingressClassName` is used.
func (*Ingress) GetExtensionsIngress ¶ added in v1.2.0
func (*Ingress) GetLoadBalancerStatus ¶ added in v1.2.0
func (i *Ingress) GetLoadBalancerStatus() corev1.LoadBalancerStatus
func (*Ingress) GetNamespace ¶ added in v1.2.0
func (*Ingress) GetNetworkingIngress ¶ added in v1.2.0
func (*Ingress) GetObjectMeta ¶ added in v1.2.0
func (*Ingress) Mode ¶ added in v1.2.0
func (i *Ingress) Mode() IngressMode
func (*Ingress) SetAnnotations ¶ added in v1.2.0
type IngressMode ¶ added in v1.2.0
type IngressMode int
const ( IngressModeExtensions IngressMode = iota + 1 // start iota with 1 to avoid having this as default value IngressModeNetworking )
func DetermineIngressMode ¶ added in v1.2.0
func DetermineIngressMode(apiVersion string, d discovery.ServerVersionInterface) (IngressMode, error)
DetermineIngressMode will first attempt to determine the ingress mode by checking the given apiVersion. If it is "extensions/v1beta1" will return IngressModeExtensions. If it is "networking/v1" will return IngressModeNetworking. Otherwise it will check the kubernetes server version to determine the ingress mode.
type IngressWrap ¶ added in v1.2.0
type IngressWrap struct {
// contains filtered or unexported fields
}
IngressWrap wraps the two ingress informers provided by the client-go. This is used to centralize the ingress informer operations to allow Rollouts to interact with both versions.
func NewIngressWrapper ¶ added in v1.2.0
func NewIngressWrapper(mode IngressMode, client kubernetes.Interface, informerFactory informers.SharedInformerFactory) (*IngressWrap, error)
func (*IngressWrap) Create ¶ added in v1.2.0
func (w *IngressWrap) Create(ctx context.Context, namespace string, ingress *Ingress, opts metav1.CreateOptions) (*Ingress, error)
func (*IngressWrap) Get ¶ added in v1.2.0
func (w *IngressWrap) Get(ctx context.Context, namespace, name string, opts metav1.GetOptions) (*Ingress, error)
func (*IngressWrap) GetCached ¶ added in v1.2.0
func (w *IngressWrap) GetCached(namespace, name string) (*Ingress, error)
func (*IngressWrap) HasSynced ¶ added in v1.2.0
func (w *IngressWrap) HasSynced() bool
func (*IngressWrap) Informer ¶ added in v1.2.0
func (w *IngressWrap) Informer() cache.SharedIndexInformer
type ManagedALBActions ¶
ManagedALBActions a mapping of Rollout names to the ALB action that the Rollout manages
func NewManagedALBActions ¶
func NewManagedALBActions(annotation string) (ManagedALBActions, error)
NewManagedALBActions converts a string into a mapping of the rollouts to managed ALB actions
func (ManagedALBActions) String ¶
func (m ManagedALBActions) String() string
String outputs a string of all the managed ALB actions that is stored in the Ingress's annotations
type PatchOption ¶ added in v1.2.0
type PatchOption func(p *patchConfig)
func WithAnnotations ¶ added in v1.2.0
func WithAnnotations() PatchOption
func WithLabels ¶ added in v1.2.0
func WithLabels() PatchOption
func WithSpec ¶ added in v1.2.0
func WithSpec() PatchOption