Skip to content

Commit

Permalink
Unification test (#229)
Browse files Browse the repository at this point in the history
* Temporary jenkins file to deploy only in qal

* Only Build in new jenkins - testing

* boilerplate code for traffic config crd

* envoy filter creation code

* WIP - refactored to separate Traffic Controller and Remote controllers

* adding code for decoupled logic

* removed commented code, added functionality for remote worker manager

* changing workerMgrMap from normal map to sync.Map to handle concurrent access

* test checkin

* Bootstrap changes

* add dependency, rollout & service controllers

* add dependency, rollout & service controllers

* service entry not needed for admiral-unification

* implemented decideEnvoyFilter logic

* passing stopCh to processItem to propogate os.exit signal

* added new function to get allkeys of a cache map and improved envoy filter creation

* Branch name correction in jenkins

* Branch name correction in jenkins (#183)

* change to us west2

* Ratelimiting filter logic (#184)

* Branch name correction in jenkins

* change to us west2

* Change default traffic config namespace

* Ratelimiting filter logic (#185)

* Branch name correction in jenkins

* change to us west2

* Change default traffic config namespace

* do not proceed with vs geberation in case of rollout

* Ratelimiting filter logic (#186)

* Branch name correction in jenkins

* change to us west2

* Change default traffic config namespace

* do not proceed with vs geberation in case of rollout

* adding debug statements to identify GetKey() cache panic

* reverting back the envoyfilter namespace to admiral-sync

* Handle remote cluster unavailability (#191)

* Ratelimiting filter logic (#192)

* Handle remote cluster unavailability

* remove unwanted space before api version

* adding new fields to traffic config crd

* completed envoy filter operations

* updated error handling for processItem function

* fixing crd not registered issue

* added workload labels i.e. deployment/rollout labels to envoyfilter

* updating traffic config CRD to add timeout for edgeservice spec and handling nil cache panic

* Ignore updates in passive mode (#197)

* Merge heliograph changes (#198)

* Ignore updates in passive mode

* merge heliograph changes(temporary)

* Ratelimiting filter logic (#199)

* Ignore updates in passive mode

* merge heliograph changes(temporary)

* Update heliograph from admiral-deployment, not from jenkins

* Temporary hack to override heliograph tag (#200)

* Ignore updates in passive mode

* merge heliograph changes(temporary)

* Update heliograph from admiral-deployment, not from jenkins

* temporary hack to override heliograph tag

* undo heliograph changes in jenkins

* undo heliograph changes in jenkins (#201)

* undo heliograph changes in jenkins (#201)

* change envoy filter namespace & move vs creation to a different file

* change envoy filter namespace & move vs creation to a different file (#203)

* undo heliograph changes in jenkins

* change envoy filter namespace & move vs creation to a different file

* fixing context

* vs deletion

* logging improvement, deletion (#205)

* undo heliograph changes in jenkins

* change envoy filter namespace & move vs creation to a different file

* vs deletion

* asseralias to be in lowercase

* debugging labels issue (#207)

* no need of retries in vs

* Deploy label debugging (#209)

* debugging labels issue

* handling map update

* adding code changes to correct envoy filters and logging struct (#210)

* Envofilter formatting (#211)

* adding code changes to correct envoy filters and logging struct

* updating service now image

* Envofilter formatting (#212)

* adding code changes to correct envoy filters and logging struct

* updating service now image

* envoyfilter namespace changed from admiral-sync to istio-system

* changing envoy filter namespace from admiral-sync to istio-system (#213)

* Ns change (#214)

* changing envoy filter namespace from admiral-sync to istio-system

* fixing envoyfilter issue for name and struct

* vs env delete fix

* handling traffic config isDisbaled annotation, also handling update and delete (#217)

* cname identity map pupulation fix

* position gervice entry selector only for admiral

* altering traffic config persona code flow in service entry

* altering traffic config persona code flow in service entry (#221)

* making strings as const in common for resue

* Unification test (#222)

* altering traffic config persona code flow in service entry

* making strings as const in common for resue

* adding adaptive concurrency filter

* altering traffic config persona code flow in service entry

* remove cluster from map upon deletion

* debug traces

* review comments

* null check for virtual service

* worker manager pointer corrected

* add traffic config object for all clusters the asset is in

* envoy filter env crud fix

* admiral-unification in qal east

* handling empty workloadenvselector lable case (#228)

* Delete registry.go_backup

Not needed

* Delete types.go_backup

* Delete virtualservice.go_backup

* Delete envoyfilter-operations.go_backup

* merge conflict for pull req 229

Co-authored-by: Rajendra Gosavi <[email protected]>
  • Loading branch information
2 people authored and GitHub Enterprise committed Feb 27, 2023
1 parent 0019002 commit bf0aafe
Show file tree
Hide file tree
Showing 34 changed files with 3,235 additions and 140 deletions.
462 changes: 462 additions & 0 deletions Jenkinsfile.uni

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions admiral/cmd/admiral/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ func GetRootCmd(args []string) *cobra.Command {
"If Routing Policy feature needs to be enabled")
rootCmd.PersistentFlags().StringArrayVar(&params.ExcludedIdentityList, "excluded_identity_list", []string{},
"List of identities which should be excluded from getting processed")
rootCmd.PersistentFlags().StringVar(&params.TrafficConfigNamespace, "traffic-config-namespace", "admiral", "namespace where Heliograph will create traffic config object.")
rootCmd.PersistentFlags().BoolVar(&params.TrafficConfigPersona, "traffic_config_persona", false, "Admiral Bootstrapped to generate Throttling & Routing Configurations")
return rootCmd
}

Expand Down
2 changes: 2 additions & 0 deletions admiral/pkg/apis/admiral/v1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&GlobalTrafficPolicyList{},
&RoutingPolicy{},
&RoutingPolicyList{},
&TrafficConfig{},
&TrafficConfigList{},
)

// register the type in the scheme
Expand Down
122 changes: 119 additions & 3 deletions admiral/pkg/apis/admiral/v1/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
//generic cdr object to wrap the dependency api
// generic cdr object to wrap the dependency api
type Dependency struct {
meta_v1.TypeMeta `json:",inline"`
meta_v1.ObjectMeta `json:"metadata"`
Expand All @@ -30,7 +30,7 @@ type DependencyList struct {
Items []Dependency `json:"items"`
}

//generic cdr object to wrap the GlobalTrafficPolicy api
// generic cdr object to wrap the GlobalTrafficPolicy api
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type GlobalTrafficPolicy struct {
Expand All @@ -56,7 +56,7 @@ type GlobalTrafficPolicyList struct {
Items []GlobalTrafficPolicy `json:"items"`
}

//generic cdr object to wrap the GlobalTrafficPolicy api
// generic cdr object to wrap the GlobalTrafficPolicy api
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type RoutingPolicy struct {
Expand All @@ -81,3 +81,119 @@ type RoutingPolicyList struct {

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

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// TrafficConfig is the Schema for the TrafficConfigs API
type TrafficConfig struct {
meta_v1.TypeMeta `json:",inline"`
meta_v1.ObjectMeta `json:"metadata,omitempty"`

Spec TrafficConfigSpec `json:"spec,omitempty"`
Status TrafficConfigStatus `json:"status,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// TrafficConfigList contains a list of TrafficConfig
type TrafficConfigList struct {
meta_v1.TypeMeta `json:",inline"`
meta_v1.ListMeta `json:"metadata,omitempty"`
Items []TrafficConfig `json:"items"`
}

// QuotaGroupSpec defines the desired state of QuotaGroup specified by the user
type TrafficConfigSpec struct {
WorkloadEnv []string `json:"workloadEnvs"`
EdgeService *EdgeService `json:"edgeService"`
QuotaGroup *QuotaGroup `json:"quotaGroup"`
}

type EdgeService struct {
DynamicRouting []*DynamicRouting `json:"dynamicRouting"`
Filters []*Filter `json:"filters"`
Routes []*Route `json:"routes"`
}

type QuotaGroup struct {
TotalQuotaGroup []*TotalQuotaGroup `json:"totalQuotaGroups"`
AppQuotaGroups []*AppQuotaGroup `json:"appQuotaGroups,omitempty"`
}

type Route struct {
Name string `json:"name"`
Inbound string `json:"inbound"`
Outbound string `json:"outbound"`
FilterSelector string `json:"filterSelector"`
WorkloadEnvSelectors []string `json:"workloadEnvSelectors"`
Timeout int `json:"timeout"`
}

type Filter struct {
Name string `json:"name"`
Retries Retry `json:"retries"`
Options []string `json:"options"`
}

type Retry struct {
Attempts int `json:"attempts"`
PerTryTimeout string `json:"perTryTimeout"`
}

type DynamicRouting struct {
Name string `json:"name"`
Url string `json:"url"`
CacheKeyAlgorithm string `json:"cacheKeyAlgorithm"`
TtlSec int `json:"ttlSec"`
Local bool `json:"local"`
}

type TotalQuotaGroup struct {
Name string `json:"name"`
Description string `json:"description"`
Quotas *[]Quota `json:"quotas"`
WorkloadEnvSelectors []string `json:"workloadEnvSelectors"`
RegionLevelLimit bool `json:"regionLevelLimit"`
CPULimit *int `json:"cpuLimit,omitempty"`
MemoryLimit *int `json:"memoryLimit,omitempty"`
PodLevelThreshold *int `json:"podLevelThreshold"`
FailureModeBehaviour string `json:"failureModeBehaviour"`
AdaptiveConcurrency *AdaptiveConcurrency `json:"adaptiveConcurrency,omitempty"`
}
type AppQuotaGroup struct {
Name string `json:"name"`
Description string `json:"description"`
Quotas *[]Quota `json:"quotas"`
AssociatedApps []string `json:"associatedApps"`
WorkloadEnvSelectors []string `json:"workloadEnvSelectors"`
}

type AdaptiveConcurrency struct {
LatencyThreshold string `json:"latencyThreshold"`
SkippedURLs []string `json:"skippedURLs"`
SampleAggregatePercentile int `json:"sampleAggregatePercentile"`
ConcurrencyUpdateInterval string `json:"concurrencyUpdateInterval"`
MinRTTCalInterval string `json:"minRTTCalInterval"`
MinRTTCalJitter int `json:"minRTTCalJitter"`
MinRTTCalRequestCount int `json:"minRTTCalRequestCount"`
MinRTTCalMinConcurrency int `json:"minRTTCalMinConcurrency"`
Enabled bool `json:"enabled"`
}

type Quota struct {
Name string `json:"name"`
TimePeriod string `json:"timePeriod"`
MaxAmount int `json:"maxAmount"`
KeyType string `json:"keyType"`
Algorithm string `json:"algorithm"`
Behaviour string `json:"behaviour"`
Rule string `json:"rule"`
Methods []string `json:"methods,omitempty"`
}

// TrafficConfigStatus defines the observed state of TrafficConfig
type TrafficConfigStatus struct {
Message string `json:"message"`
LastAppliedConfigVersion string `json:"lastAppliedConfigVersion"`
LastUpdateTime meta_v1.Time `json:"lastUpdateTime"`
Status bool `json:"status"`
}
Loading

0 comments on commit bf0aafe

Please sign in to comment.