-
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
support bluegreen release: support workload of deployment and cloneSet #238
Conversation
pkg/controller/batchrelease/control/bluegreenstyle/cloneset/control.go
Outdated
Show resolved
Hide resolved
pkg/controller/batchrelease/control/bluegreenstyle/deployment/control.go
Outdated
Show resolved
Hide resolved
util.InitOriginalSetting(&setting, rc.object) | ||
klog.InfoS("Initialize deployment", "deployment", klog.KObj(rc.object), "setting", util.DumpJSON(&setting)) | ||
|
||
d := rc.object.DeepCopy() |
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.
the obj params of patch field is used to pass the object meta and to store the patched obj, since d is not used anywhere, it is not necessary to deepcopy the object. simply initiate a empty deployment with the namespace/name of obj using GetEmptyObjectWithKey
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.
done
pkg/controller/batchrelease/control/bluegreenstyle/deployment/control.go
Show resolved
Hide resolved
pkg/controller/batchrelease/control/bluegreenstyle/deployment/control.go
Outdated
Show resolved
Hide resolved
pkg/controller/batchrelease/control/bluegreenstyle/deployment/control.go
Outdated
Show resolved
Hide resolved
pkg/controller/batchrelease/control/bluegreenstyle/deployment/control.go
Outdated
Show resolved
Hide resolved
pkg/controller/batchrelease/control/bluegreenstyle/cloneset/control.go
Outdated
Show resolved
Hide resolved
aca5c93
to
ab52d6c
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #238 +/- ##
==========================================
+ Coverage 43.63% 45.00% +1.36%
==========================================
Files 52 60 +8
Lines 5681 6931 +1250
==========================================
+ Hits 2479 3119 +640
- Misses 2778 3279 +501
- Partials 424 533 +109
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
pkg/controller/batchrelease/control/bluegreenstyle/cloneset/control.go
Outdated
Show resolved
Hide resolved
b8bd5b5
to
6fed8e1
Compare
pkg/controller/batchrelease/control/bluegreenstyle/cloneset/control.go
Outdated
Show resolved
Hide resolved
pkg/controller/batchrelease/control/bluegreenstyle/deployment/control.go
Show resolved
Hide resolved
Signed-off-by: yunbo <[email protected]>
Signed-off-by: yunbo <[email protected]>
Signed-off-by: yunbo <[email protected]>
9719408
to
1a4f00e
Compare
Signed-off-by: yunbo <[email protected]>
1a4f00e
to
6885920
Compare
/lgtm |
@@ -148,6 +148,7 @@ type BatchReleaseReconciler struct { | |||
// +kubebuilder:rbac:groups=apps.kruise.io,resources=statefulsets/status,verbs=get;update;patch | |||
// +kubebuilder:rbac:groups=apps.kruise.io,resources=daemonsets,verbs=get;list;watch;update;patch | |||
// +kubebuilder:rbac:groups=apps.kruise.io,resources=daemonsets/status,verbs=get;update;patch | |||
// +kubebuilder:rbac:groups=autoscaling,resources=horizontalpodautoscalers,verbs=get;list;watch;create;update;patch;delete |
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.
verbs=get;list;watch;update;patch
} | ||
|
||
func (rc *realController) Initialize(release *v1beta1.BatchRelease) error { | ||
klog.Info("Initialize cloneset controller") |
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.
remove the log
desired, _ := intstr.GetScaledValueFromIntOrPercent(&ctx.DesiredSurge, int(ctx.Replicas), true) | ||
current, _ := intstr.GetScaledValueFromIntOrPercent(&ctx.CurrentSurge, int(ctx.Replicas), true) | ||
if current >= desired { | ||
klog.Infof("No need to upgrade batch for cloneset %v: because current %d >= desired %d", klog.KObj(rc.object), current, desired) |
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.
infos
return errors.NewRetryError(fmt.Errorf("cloneset %v finalize not done, readyReplicas %d != updatedReadyReplicas %d, current policy %s", | ||
klog.KObj(rc.object), rc.object.Status.ReadyReplicas, rc.object.Status.UpdatedReadyReplicas, release.Spec.ReleasePlan.FinalizingPolicy)) | ||
} | ||
klog.InfoS("Finalize: cloneset bluegreen release: all pods updated and ready") |
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.
add klog.KObj(rc.object).
Signed-off-by: yunbo <[email protected]>
Signed-off-by: yunbo <[email protected]>
Ⅰ. Describe what this PR does
controller/batchrelease
, to support bluegreen style releaseⅡ. Does this pull request fix one issue?
Ⅲ. Special notes for reviews