-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change v1beta1 apis #183
Closed
Closed
Change v1beta1 apis #183
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,51 +38,21 @@ const ( | |
// Only when RolloutIDLabel is set, RolloutBatchIDLabel will be patched. | ||
// Users can use RolloutIDLabel and RolloutBatchIDLabel to select the pods that are upgraded in some certain batch and release. | ||
RolloutBatchIDLabel = "rollouts.kruise.io/rollout-batch-id" | ||
|
||
// RollbackInBatchAnnotation is set to rollout annotations. | ||
// RollbackInBatchAnnotation allow use disable quick rollback, and will roll back in batch style. | ||
RollbackInBatchAnnotation = "rollouts.kruise.io/rollback-in-batch" | ||
|
||
// RolloutStyleAnnotation define the rolling behavior for Deployment. | ||
// must be "partition" or "canary": | ||
// * "partition" means rolling in batches just like CloneSet, and will NOT create any extra Workload; | ||
// * "canary" means rolling in canary way, and will create a canary Workload. | ||
// Currently, only Deployment support both "partition" and "canary" rolling styles. | ||
// For other workload types, they only support "partition" styles. | ||
// Defaults to "canary" to Deployment. | ||
// Defaults to "partition" to the others. | ||
RolloutStyleAnnotation = "rollouts.kruise.io/rolling-style" | ||
|
||
// TrafficRoutingAnnotation is the TrafficRouting Name, and it is the Rollout's TrafficRouting. | ||
// The Rollout release will trigger the TrafficRouting release. For example: | ||
// A microservice consists of three applications, and the invocation relationship is as follows: a -> b -> c, | ||
// and application(a, b, c)'s gateway is trafficRouting. Any application(a, b or b) release will trigger TrafficRouting release. | ||
TrafficRoutingAnnotation = "rollouts.kruise.io/trafficrouting" | ||
) | ||
|
||
// RolloutSpec defines the desired state of Rollout | ||
type RolloutSpec struct { | ||
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster | ||
// Important: Run "make" to regenerate code after modifying this file | ||
// ObjectRef indicates workload | ||
ObjectRef ObjectRef `json:"objectRef"` | ||
// WorkloadRef contains enough information to let you identify a workload for Rollout | ||
// Batch release of the bypass | ||
WorkloadRef *WorkloadRef `json:"workloadRef"` | ||
// rollout strategy | ||
Strategy RolloutStrategy `json:"strategy"` | ||
// DeprecatedRolloutID is the deprecated field. | ||
// It is recommended that configure RolloutId in workload.annotations[rollouts.kruise.io/rollout-id]. | ||
// RolloutID should be changed before each workload revision publication. | ||
// It is to distinguish consecutive multiple workload publications and rollout progress. | ||
DeprecatedRolloutID string `json:"rolloutID,omitempty"` | ||
// if a rollout disabled, then the rollout would not watch changes of workload | ||
//+kubebuilder:validation:Optional | ||
//+kubebuilder:default=false | ||
Disabled bool `json:"disabled"` | ||
} | ||
|
||
type ObjectRef struct { | ||
// WorkloadRef contains enough information to let you identify a workload for Rollout | ||
// Batch release of the bypass | ||
WorkloadRef *WorkloadRef `json:"workloadRef,omitempty"` | ||
Disabled bool `json:"disabled,omitempty"` | ||
} | ||
|
||
// WorkloadRef holds a references to the Kubernetes object | ||
|
@@ -100,46 +70,124 @@ type RolloutStrategy struct { | |
// Paused indicates that the Rollout is paused. | ||
// Default value is false | ||
Paused bool `json:"paused,omitempty"` | ||
// +optional | ||
// Canary is Canary Release or A/B Testing Release | ||
// (Scenario 1) A/B Testing, header[user-agent] of request http will be routing to canary version. | ||
// canary: | ||
// replicas: 1 | ||
// matches: | ||
// - headers: | ||
// - name: user-agent | ||
// type: Exact | ||
// value: pc | ||
// trafficRoutings: | ||
// - service: service-demo | ||
// ingress: | ||
// classType: nginx | ||
// name: ingress-demo | ||
// (Scenario 2) canary release, 10 percent of request http will be routing to canary version. | ||
// canary: | ||
// replicas: 1 | ||
// weight: 10 | ||
// trafficRoutings: | ||
// - service: service-demo | ||
// ingress: | ||
// classType: nginx | ||
// name: ingress-demo | ||
// Traffic Graying, include canary release, A/B Testing release | ||
Canary *CanaryStrategy `json:"canary,omitempty"` | ||
} | ||
|
||
// CanaryStrategy defines parameters for a Replica Based Canary | ||
type CanaryStrategy struct { | ||
// Steps define the order of phases to execute release in batches(20%, 40%, 60%, 80%, 100%) | ||
// Batches is batch release capacity, | ||
// (Scenario 1) Users can only instance replicas: | ||
// batches: | ||
// steps: | ||
// - replicas: 1 # batches 0 | ||
// - replicas: 2 # batches 1 | ||
// - replicas: 5 # batches 2 | ||
// (Scenario 2) Users can a/b testing combined with batch release: | ||
// batches: | ||
// steps: | ||
// - replicas: 1 | ||
// matches: | ||
// - headers: | ||
// - name: user-agent | ||
// type: Exact | ||
// value: pc | ||
// - replicas: 20% | ||
// - replicas: 40% | ||
// - replicas: 80% | ||
// - replicas: 100% | ||
// trafficRoutings: | ||
// - service: service-demo | ||
// ingress: | ||
// classType: nginx | ||
// name: ingress-demo | ||
// (Scenario 3) Users can traffic weight combined with batch release: | ||
// batches: | ||
// steps: | ||
// - replicas: 1 | ||
// weight: 10 | ||
// - replicas: 20% | ||
// - replicas: 40% | ||
// - replicas: 80% | ||
// - replicas: 100% | ||
// trafficRoutings: | ||
// - service: service-demo | ||
// ingress: | ||
// classType: nginx | ||
// name: ingress-demo | ||
// Not that these replicas should be a non-decreasing sequence. | ||
// +optional | ||
Steps []CanaryStep `json:"steps,omitempty"` | ||
// TrafficRoutings hosts all the supported service meshes supported to enable more fine-grained traffic routing | ||
// and current only support one TrafficRouting | ||
TrafficRoutings []v1alpha1.TrafficRoutingRef `json:"trafficRoutings,omitempty"` | ||
Batches *BatchStrategy `json:"batches,omitempty"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. batches -> Batch ? |
||
// FailureThreshold indicates how many failed pods can be tolerated in all upgraded pods. | ||
// Only when FailureThreshold are satisfied, Rollout can enter ready state. | ||
// If FailureThreshold is nil, Rollout will use the MaxUnavailable of workload as its | ||
// FailureThreshold. | ||
// Defaults to nil. | ||
FailureThreshold *intstr.IntOrString `json:"failureThreshold,omitempty"` | ||
// PatchPodTemplateMetadata indicates patch configuration(e.g. labels, annotations) to the canary deployment podTemplateSpec.metadata | ||
// only support for canary deployment | ||
// +optional | ||
PatchPodTemplateMetadata *PatchPodTemplateMetadata `json:"patchPodTemplateMetadata,omitempty"` | ||
} | ||
|
||
type PatchPodTemplateMetadata struct { | ||
// annotations | ||
Annotations map[string]string `json:"annotations,omitempty"` | ||
// labels | ||
Labels map[string]string `json:"labels,omitempty"` | ||
type BatchStrategy struct { | ||
BatchStep []BatchStep `json:"steps"` | ||
// TrafficRoutings hosts all the supported service meshes supported to enable more fine-grained traffic routing | ||
// and current only support one TrafficRouting | ||
TrafficRoutings []v1alpha1.TrafficRoutingRef `json:"trafficRoutings"` | ||
} | ||
|
||
type BatchStep struct { | ||
v1alpha1.TrafficRoutingStrategy `json:",inline"` | ||
// Replicas is the number of expected canary pods in this batch | ||
// it can be an absolute number (ex: 5) or a percentage of total pods. | ||
Replicas *intstr.IntOrString `json:"replicas"` | ||
// Pause defines a pause stage for a rollout, manual or auto | ||
// +optional | ||
Pause RolloutPause `json:"pause,omitempty"` | ||
} | ||
|
||
// CanaryStep defines a step of a canary workload. | ||
type CanaryStep struct { | ||
// CanaryStrategy defines parameters for a Replica Based Canary | ||
type CanaryStrategy struct { | ||
v1alpha1.TrafficRoutingStrategy `json:",inline"` | ||
// Replicas is the number of expected canary pods in this batch | ||
// it can be an absolute number (ex: 5) or a percentage of total pods. | ||
Replicas *intstr.IntOrString `json:"replicas,omitempty"` | ||
// Pause defines a pause stage for a rollout, manual or auto | ||
// +optional | ||
Pause RolloutPause `json:"pause,omitempty"` | ||
// TrafficRoutings hosts all the supported service meshes supported to enable more fine-grained traffic routing | ||
// and current only support one TrafficRouting | ||
TrafficRoutings []v1alpha1.TrafficRoutingRef `json:"trafficRoutings"` | ||
veophi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// End-to-end progressive delivery capacity for microservice application, | ||
// TrafficRoutingRef is Type TrafficRouting's Name | ||
TrafficRoutingRef string `json:"trafficRoutingRef,omitempty"` | ||
// PatchPodTemplateMetadata indicates patch configuration(e.g. labels, annotations) to the canary deployment podTemplateSpec.metadata | ||
// only support for canary deployment | ||
// +optional | ||
PatchPodTemplateMetadata *PatchPodTemplateMetadata `json:"patchPodTemplateMetadata,omitempty"` | ||
} | ||
|
||
type PatchPodTemplateMetadata struct { | ||
// annotations | ||
Annotations map[string]string `json:"annotations,omitempty"` | ||
// labels | ||
Labels map[string]string `json:"labels,omitempty"` | ||
} | ||
|
||
type HttpRouteMatch struct { | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this label removed?