Documentation ¶
Index ¶
- Constants
- func GetHttpRoutesI(obj *unstructured.Unstructured) ([]any, error)
- func GetTcpRoutesI(obj *unstructured.Unstructured) ([]any, error)
- func GetTlsRoutesI(obj *unstructured.Unstructured) ([]any, error)
- func UnmarshalJson(input []byte, result any) (map[string]any, error)
- func ValidateHTTPRoutes(r *v1alpha1.Rollout, routeNames []string, httpRoutes []VirtualServiceHTTPRoute) error
- func ValidateTcpRoutes(r *v1alpha1.Rollout, vsvcTCPRoutes []v1alpha1.TCPRoute, ...) error
- func ValidateTlsRoutes(r *v1alpha1.Rollout, vsvcTLSRoutes []v1alpha1.TLSRoute, ...) error
- type DestinationRule
- type DestinationRuleSpec
- type IstioController
- func (c *IstioController) EnqueueDestinationRule(obj any)
- func (c *IstioController) EnqueueRolloutFromIstioVirtualService(vsvc any)
- func (c *IstioController) GetReferencedVirtualServices(ro *v1alpha1.Rollout) (*[]unstructured.Unstructured, error)
- func (c *IstioController) Run(ctx context.Context)
- func (c *IstioController) ShutDownWithDrain()
- type IstioControllerConfig
- type L4MatchAttributes
- type Percent
- type Port
- 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)
- type RouteMatch
- type Subset
- type TLSMatchAttributes
- type VirtualService
- type VirtualServiceDestination
- type VirtualServiceHTTPRoute
- type VirtualServiceRouteDestination
- type VirtualServiceSpec
- type VirtualServiceTCPRoute
- type VirtualServiceTLSRoute
Constants ¶
const Http = "http"
const SpecHttpNotFound = "spec.http not found"
const Tcp = "tcp"
const Tls = "tls"
const Type = "Istio"
Variables ¶
This section is empty.
Functions ¶
func GetHttpRoutesI ¶
func GetHttpRoutesI(obj *unstructured.Unstructured) ([]any, error)
func GetTcpRoutesI ¶
func GetTcpRoutesI(obj *unstructured.Unstructured) ([]any, error)
func GetTlsRoutesI ¶
func GetTlsRoutesI(obj *unstructured.Unstructured) ([]any, error)
func ValidateHTTPRoutes ¶
func ValidateHTTPRoutes(r *v1alpha1.Rollout, routeNames []string, httpRoutes []VirtualServiceHTTPRoute) error
ValidateHTTPRoutes ensures that all the routes in the rollout exist
func ValidateTcpRoutes ¶
func ValidateTcpRoutes(r *v1alpha1.Rollout, vsvcTCPRoutes []v1alpha1.TCPRoute, tcpRoutes []VirtualServiceTCPRoute) error
ValidateTcpRoutes ensures that all the routes in the rollout exist and they only have two destinations
func ValidateTlsRoutes ¶
func ValidateTlsRoutes(r *v1alpha1.Rollout, vsvcTLSRoutes []v1alpha1.TLSRoute, tlsRoutes []VirtualServiceTLSRoute) error
ValidateTlsRoutes ensures that all the routes in the rollout exist and they only have two destinations
Types ¶
type DestinationRule ¶
type DestinationRule struct { metav1.ObjectMeta `json:"metadata,omitempty"` Spec DestinationRuleSpec `json:"spec,omitempty"` }
DestinationRule is an Istio DestinationRule containing only the fields which we care about
type DestinationRuleSpec ¶
type IstioController ¶
type IstioController struct { IstioControllerConfig VirtualServiceLister dynamiclister.Lister DestinationRuleLister dynamiclister.Lister // contains filtered or unexported fields }
func NewIstioController ¶
func NewIstioController(cfg IstioControllerConfig) *IstioController
func (*IstioController) EnqueueDestinationRule ¶
func (c *IstioController) EnqueueDestinationRule(obj any)
EnqueueDestinationRule examines a VirtualService, finds the Rollout referencing that VirtualService, and enqueues the corresponding Rollout for reconciliation
func (*IstioController) EnqueueRolloutFromIstioVirtualService ¶
func (c *IstioController) EnqueueRolloutFromIstioVirtualService(vsvc any)
EnqueueRolloutFromIstioVirtualService examines a VirtualService, finds the Rollout referencing that VirtualService, and enqueues the corresponding Rollout for reconciliation
func (*IstioController) GetReferencedVirtualServices ¶
func (c *IstioController) GetReferencedVirtualServices(ro *v1alpha1.Rollout) (*[]unstructured.Unstructured, error)
func (*IstioController) Run ¶
func (c *IstioController) Run(ctx context.Context)
Run starts the Istio informers. If Istio is not installed, will periodically check for presence of Istio, then start informers once detected. This allows Argo Rollouts to be installed in any order during cluster bootstrapping.
func (*IstioController) ShutDownWithDrain ¶
func (c *IstioController) ShutDownWithDrain()
type IstioControllerConfig ¶
type IstioControllerConfig struct { ArgoprojClientSet roclientset.Interface DynamicClientSet dynamic.Interface EnqueueRollout func(ro any) RolloutsInformer informers.RolloutInformer VirtualServiceInformer cache.SharedIndexInformer DestinationRuleInformer cache.SharedIndexInformer }
type L4MatchAttributes ¶
type L4MatchAttributes struct { DestinationSubnets []string `json:"destinationSubnets,omitempty"` Port int64 `json:"port,omitempty"` SourceLabels map[string]string `json:"sourceLabels,omitempty"` Gateways []string `json:"gateways,omitempty"` SourceNamespace string `json:"sourceNamespace,omitempty"` }
L4MatchAttributes is the route matcher for a TCP route in a VirtualService
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
Reconciler holds required fields to reconcile Istio resources
func NewReconciler ¶
func NewReconciler(r *v1alpha1.Rollout, client dynamic.Interface, recorder record.EventRecorder, virtualServiceLister, destinationRuleLister dynamiclister.Lister, replicaSets []*appsv1.ReplicaSet) *Reconciler
NewReconciler returns a reconciler struct that brings the Virtual Service into the desired state
func (*Reconciler) RemoveManagedRoutes ¶
func (r *Reconciler) RemoveManagedRoutes() error
RemoveManagedRoutes this removes all the routes in all the istio virtual services rollouts is managing by getting two slices from the splitManagedRoutesAndNonManagedRoutes function and setting the Istio Virtual Service routes to just the ones not managed by rollouts
func (*Reconciler) SetHeaderRoute ¶
func (r *Reconciler) SetHeaderRoute(headerRouting *v1alpha1.SetHeaderRoute) error
func (*Reconciler) SetMirrorRoute ¶
func (r *Reconciler) SetMirrorRoute(setMirrorRoute *v1alpha1.SetMirrorRoute) error
func (*Reconciler) SetWeight ¶
func (r *Reconciler) SetWeight(desiredWeight int32, additionalDestinations ...v1alpha1.WeightDestination) error
SetWeight modifies Istio resources to reach desired state
func (*Reconciler) Type ¶
func (r *Reconciler) Type() string
Type indicates this reconciler is an Istio reconciler
func (*Reconciler) UpdateHash ¶
func (r *Reconciler) UpdateHash(canaryHash, stableHash string, additionalDestinations ...v1alpha1.WeightDestination) error
func (*Reconciler) VerifyWeight ¶
func (r *Reconciler) VerifyWeight(desiredWeight int32, additionalDestinations ...v1alpha1.WeightDestination) (*bool, error)
type RouteMatch ¶
type RouteMatch struct { // Method What http methods should be mirrored // +optional Method *v1alpha1.StringMatch `json:"method,omitempty" protobuf:"bytes,1,opt,name=method"` // Uri What url paths should be mirrored // +optional Uri *v1alpha1.StringMatch `json:"uri,omitempty" protobuf:"bytes,2,opt,name=uri"` // Headers What request with matching headers should be mirrored // +optional Headers map[string]v1alpha1.StringMatch `json:"headers,omitempty" protobuf:"bytes,3,opt,name=headers"` }
type TLSMatchAttributes ¶
type TLSMatchAttributes struct { SNI []string `json:"sniHosts,omitempty"` DestinationSubnets []string `json:"destinationSubnets,omitempty"` Port int64 `json:"port,omitempty"` SourceLabels map[string]string `json:"sourceLabels,omitempty"` Gateways []string `json:"gateways,omitempty"` SourceNamespace string `json:"sourceNamespace,omitempty"` }
TLSMatchAttributes is the route matcher for a TLS route in a VirtualService
type VirtualService ¶
type VirtualService struct { metav1.ObjectMeta `json:"metadata,omitempty"` Spec VirtualServiceSpec `json:"spec,omitempty"` }
VirtualService is an Istio VirtualService containing only the fields which we care about
type VirtualServiceDestination ¶
type VirtualServiceDestination struct { Host string `json:"host,omitempty"` Subset string `json:"subset,omitempty"` Port *Port `json:"port,omitempty"` }
Destination fields within the VirtualServiceDestination struct of the Virtual Service that the controller modifies
type VirtualServiceHTTPRoute ¶
type VirtualServiceHTTPRoute struct { Name string `json:"name,omitempty"` Match []RouteMatch `json:"match,omitempty"` Route []VirtualServiceRouteDestination `json:"route,omitempty"` Mirror *VirtualServiceDestination `json:"mirror,omitempty"` MirrorPercentage *Percent `json:"mirrorPercentage,omitempty"` }
VirtualServiceHTTPRoute is a HTTP route in a VirtualService
func GetHttpRoutes ¶
func GetHttpRoutes(httpRoutesI []any) ([]VirtualServiceHTTPRoute, error)
type VirtualServiceRouteDestination ¶
type VirtualServiceRouteDestination struct { // Destination holds the destination struct of the virtual service Destination VirtualServiceDestination `json:"destination,omitempty"` // Weight holds the destination struct of the virtual service Weight int64 `json:"weight,omitempty"` }
VirtualServiceRouteDestination is a destination within { VirtualServiceHTTPRoute, VirtualServiceTLSRoute }
type VirtualServiceSpec ¶
type VirtualServiceSpec struct { HTTP []VirtualServiceHTTPRoute `json:"http,omitempty"` TLS []VirtualServiceTLSRoute `json:"tls,omitempty"` TCP []VirtualServiceTCPRoute `json:"tcp,omitempty"` }
type VirtualServiceTCPRoute ¶
type VirtualServiceTCPRoute struct { Match []L4MatchAttributes `json:"match,omitempty"` Route []VirtualServiceRouteDestination `json:"route,omitempty"` }
VirtualServiceTCPRoute is a TLS route in a VirtualService
func GetTcpRoutes ¶
func GetTcpRoutes(obj *unstructured.Unstructured, tcpRoutesI []any) ([]VirtualServiceTCPRoute, error)
type VirtualServiceTLSRoute ¶
type VirtualServiceTLSRoute struct { Match []TLSMatchAttributes `json:"match,omitempty"` Route []VirtualServiceRouteDestination `json:"route,omitempty"` }
VirtualServiceTLSRoute is a TLS route in a VirtualService
func GetTlsRoutes ¶
func GetTlsRoutes(obj *unstructured.Unstructured, tlsRoutesI []any) ([]VirtualServiceTLSRoute, error)