Documentation ¶
Index ¶
- Constants
- func GetMappingGVR() schema.GroupVersionResource
- func GetMappingService(obj *unstructured.Unstructured) string
- func GetMappingWeight(obj *unstructured.Unstructured) int64
- func NewDynamicClient(di dynamic.Interface, namespace string) dynamic.ResourceInterface
- type ClientInterface
- type Reconciler
- func (r *Reconciler) RemoveManagedRoutes() error
- func (r *Reconciler) SetHeaderRoute(headerRouting *v1alpha1.SetHeaderRoute) error
- func (r *Reconciler) SetMirrorRoute(setMirrorRoute *v1alpha1.SetMirrorRoute) error
- func (r *Reconciler) SetWeight(desiredWeight int32, additionalDestinations ...v1alpha1.WeightDestination) error
- func (r *Reconciler) Type() string
- func (r *Reconciler) UpdateHash(canaryHash, stableHash string, ...) error
- func (r *Reconciler) VerifyWeight(desiredWeight int32, additionalDestinations ...v1alpha1.WeightDestination) (*bool, error)
Constants ¶
const ( Type = "Ambassador" AmbassadorMappingNotFound = "AmbassadorMappingNotFound" AmbassadorMappingConfigError = "AmbassadorMappingConfigError" CanaryMappingCleanupError = "CanaryMappingCleanupError" CanaryMappingCreationError = "CanaryMappingCreationError" CanaryMappingUpdateError = "CanaryMappingUpdateError" CanaryMappingWeightUpdate = "CanaryMappingWeightUpdate" )
Type defines the ambassador traffic routing type.
Variables ¶
This section is empty.
Functions ¶
func GetMappingGVR ¶
func GetMappingGVR() schema.GroupVersionResource
GetMappingGVR will return the Ambassador Mapping GVR to be used. The logic is based on the ambassadorAPIVersion variable that is set with a default value. The default value can be changed by invoking the SetAPIVersion function.
func GetMappingService ¶
func GetMappingService(obj *unstructured.Unstructured) string
func GetMappingWeight ¶
func GetMappingWeight(obj *unstructured.Unstructured) int64
func NewDynamicClient ¶
func NewDynamicClient(di dynamic.Interface, namespace string) dynamic.ResourceInterface
NewDynamicClient will initialize a real kubernetes dynamic client to interact with Ambassador CRDs
Types ¶
type ClientInterface ¶
type ClientInterface interface { Get(ctx context.Context, name string, options metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error) Create(ctx context.Context, obj *unstructured.Unstructured, options metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error) Update(ctx context.Context, obj *unstructured.Unstructured, options metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error) Delete(ctx context.Context, name string, options metav1.DeleteOptions, subresources ...string) error }
ClientInterface defines a subset of k8s client operations having only the required ones.
type Reconciler ¶
type Reconciler struct { Rollout *v1alpha1.Rollout Client ClientInterface Recorder record.EventRecorder Log *logrus.Entry }
Reconciler implements a TrafficRoutingReconciler for Ambassador.
func NewReconciler ¶
func NewReconciler(r *v1alpha1.Rollout, c ClientInterface, rec record.EventRecorder) *Reconciler
NewReconciler will build and return an ambassador Reconciler
func (*Reconciler) RemoveManagedRoutes ¶ added in v1.3.0
func (r *Reconciler) RemoveManagedRoutes() error
func (*Reconciler) SetHeaderRoute ¶ added in v1.3.0
func (r *Reconciler) SetHeaderRoute(headerRouting *v1alpha1.SetHeaderRoute) error
func (*Reconciler) SetMirrorRoute ¶ added in v1.3.0
func (r *Reconciler) SetMirrorRoute(setMirrorRoute *v1alpha1.SetMirrorRoute) error
func (*Reconciler) SetWeight ¶
func (r *Reconciler) SetWeight(desiredWeight int32, additionalDestinations ...v1alpha1.WeightDestination) error
SetWeight will configure a canary ambassador mapping with the given desiredWeight. The canary ambassador mapping is dynamically created cloning the mapping provided in the ambassador configuration in the traffic routing section of the rollout. If the canary ambassador mapping is already present, it will be updated to the given desiredWeight.
func (*Reconciler) Type ¶
func (r *Reconciler) Type() string
func (*Reconciler) UpdateHash ¶
func (r *Reconciler) UpdateHash(canaryHash, stableHash string, additionalDestinations ...v1alpha1.WeightDestination) error
UpdateHash informs a traffic routing reconciler about new canary/stable pod hashes
func (*Reconciler) VerifyWeight ¶
func (r *Reconciler) VerifyWeight(desiredWeight int32, additionalDestinations ...v1alpha1.WeightDestination) (*bool, error)