-
Notifications
You must be signed in to change notification settings - Fork 0
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
add upgradePolicy api #9
add upgradePolicy api #9
Conversation
@@ -114,6 +116,11 @@ func CreateControllerContext(cfg *config.Config, rootClientBuilder controller.Cl | |||
return ControllerContext{}, err | |||
} | |||
|
|||
region := os.Getenv("REGION") | |||
if region == "" { | |||
return ControllerContext{}, fmt.Errorf("Please set env REGION") |
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.
这里会导致不通用的吧
@@ -161,7 +161,10 @@ func (c *Controller) needsUpdate(old *applicationv1.App, new *applicationv1.App) | |||
new.Status.Phase == applicationv1.AppPhaseInstallFailed || | |||
new.Status.Phase == applicationv1.AppPhaseUpgradFailed || | |||
new.Status.Phase == applicationv1.AppPhaseSucceeded || | |||
new.Status.Phase == applicationv1.AppPhaseTerminating { | |||
new.Status.Phase == applicationv1.AppPhaseTerminating || | |||
// ds升级,通过添加注解触发再次进入app处理状态 |
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.
上次讨论没有注解了的,现在还有吗?
} | ||
|
||
// List selects resources in the storage which match to the selector. 'options' can be nil. | ||
func (r *REST) List(ctx context.Context, options *metainternal.ListOptions) (runtime.Object, error) { |
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.
如果这里资源是租户隔离的,还需要重写watch,不然走watch会越权
2b1a9f1
into
GaoXiaodong:feature/tke-app-upgrade
What type of PR is this?
kind feature
What this PR does / why we need it:
对于app管理的组件,如果是daemonset类型,提供daemonset组件分批次更新能力。
Special notes for your reviewer:
1、app对象的spec中,添加upgradepolicy字段,用于选择升级策略
2、app对象的status中,扩展phase,添加UpgradingDaemonset、UpgradingDaemonsetFailed
1、新增全局的upgradepolicy对象:描述升级策略
2、新增namespace级别的upgradejob对象,用于具体的ds升级处理
1、app-controller中,添加对于upgradepolicy字段的处理,如果配置了升级策略则会创建upgradejob对象并进入到UpgradingDaemonset阶段;UpgradingDaemonset、UpgradingDaemonsetFailed中等待upgradejob升级完成
2、新增upgradejob-controller,用于处理upgradejob,控制目标集群中daemonset的升级。处理结束后会更新app对象的注解,触发app再进入UpgradingDaemonset进行处理
整体方案如下: