-
Notifications
You must be signed in to change notification settings - Fork 81
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
Availability set deprecation #1025
Conversation
/test |
Testrun: e2e-xn69g +---------------------+---------------------------+-----------+----------+ | NAME | STEP | PHASE | DURATION | +---------------------+---------------------------+-----------+----------+ | infrastructure-test | infra-flow-test | Succeeded | 21m14s | | infrastructure-test | infra-flow-migration-test | Succeeded | 26m21s | | bastion-test | bastion-test | Succeeded | 9m4s | | infrastructure-test | infrastructure-test | Succeeded | 23m8s | +---------------------+---------------------------+-----------+----------+ |
if err := fctx.client.Get(ctx, k8sclient.ObjectKey{ | ||
Namespace: fctx.infra.Namespace, | ||
Name: azure.CloudControllerManagerName, | ||
}, deployment); k8sclient.IgnoreNotFound(err) != nil { | ||
return err | ||
} else if k8sclient.IgnoreNotFound(err) != nil { | ||
return nil | ||
} |
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.
if err := fctx.client.Get(ctx, k8sclient.ObjectKey{ | |
Namespace: fctx.infra.Namespace, | |
Name: azure.CloudControllerManagerName, | |
}, deployment); k8sclient.IgnoreNotFound(err) != nil { | |
return err | |
} else if k8sclient.IgnoreNotFound(err) != nil { | |
return nil | |
} | |
if err := fctx.client.Get(ctx, k8sclient.ObjectKey{ | |
Namespace: fctx.infra.Namespace, | |
Name: azure.CloudControllerManagerName, | |
}, deployment); k8sclient.IgnoreNotFound(err) != nil { | |
return err | |
} |
Not sure if this is the right one to keep
dbc9ae3
to
ba7a8a1
Compare
@@ -171,7 +177,16 @@ func (fctx *FlowContext) EnsureAvailabilitySet(ctx context.Context) error { | |||
return nil | |||
} | |||
|
|||
avset, err := fctx.ensureAvailabilitySet(ctx, log, *avsetCfg) | |||
// complete AS migration. | |||
if v := fctx.whiteboard.GetChild("migration").GetChild(KindAvailabilitySet.String()).Get("complete"); v != nil && *v == "true" { |
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.
Nit: I think it would be nice we define such keys as "migration" and "complete" somewhere as constants.
// return early if the migration has already been complete | ||
if v := fctx.whiteboard.GetChild("migration").GetChild(KindAvailabilitySet.String()).Get("complete"); v != nil && *v == "true" { | ||
return nil | ||
} | ||
// return early if the cluster does not have AS. | ||
if fctx.whiteboard.GetChild(ChildKeyIDs).Get(KindAvailabilitySet.String()) == nil { | ||
return nil | ||
} | ||
|
||
// IF VMOs are not needed, or the migration is already done, return early. | ||
if !helper.HasShootVmoMigrationAnnotation(fctx.cluster.Shoot.GetAnnotations()) { | ||
return nil | ||
} |
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.
Nit: Aren't these all dependencies for the migration task - maybe we could put them into a separate function and use this function as task dependency.
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.
These checks as a group are used in one place. The separate function will just be giving a name to preflight checks but I can oblige
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.
Rethinking your question:
-
Do you mean as a
shared.DoIf
?
It's a question of when are the dependencies of a task evaluated (at build or at runtime) and AFAIK they are on build time. At that point you may not have theKindAvailabilitySet
in the state for example. -
Do you mean as a
shared.Dependency
?
I am actually not sure if this will block a child Task in the graph from being executed. I would need to test the scemantics. It may either mark the skipped parent as completed (so the childen are always executed), or it may really prune the tree (what you suggested I believe). But I need to check first.
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.
Based on https://github.com/gardener/gardener/blob/84184385dbb9616c2c838e4f24487cae2be75da0/pkg/utils/flow/flow.go#L303 I think it marks the skipped nodes as completed
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.
Valid arguments.
I think I was a bit too quick here and didn't think it through completely.
Let's leave it as is.
} | ||
|
||
// IsVmoRequiredForInfrastructure determines if VMO is required. | ||
func (ia *InfrastructureAdapter) IsVmoRequiredForInfrastructure() bool { |
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.
I don't see where this function is used?
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.
old artifact - thank you
if lb.Properties == nil || len(lb.Properties.FrontendIPConfigurations) == 0 { | ||
return nil | ||
} |
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.
duplicated check
} | ||
log.Info("Deleting load balancer", "Name", fctx.infra.Namespace) | ||
if err := loadbalancerClient.Delete(ctx, fctx.adapter.ResourceGroupName(), fctx.adapter.TechnicalName()); err != nil { | ||
return err | ||
} | ||
log.Info("Deleting internal load balancer", "Name", fctx.infra.Namespace) | ||
if err := loadbalancerClient.Delete(ctx, fctx.adapter.ResourceGroupName(), fmt.Sprintf("%s-internal", fctx.adapter.TechnicalName())); err != nil { | ||
return err | ||
} |
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.
} | |
log.Info("Deleting load balancer", "Name", fctx.infra.Namespace) | |
if err := loadbalancerClient.Delete(ctx, fctx.adapter.ResourceGroupName(), fctx.adapter.TechnicalName()); err != nil { | |
return err | |
} | |
log.Info("Deleting internal load balancer", "Name", fctx.infra.Namespace) | |
if err := loadbalancerClient.Delete(ctx, fctx.adapter.ResourceGroupName(), fmt.Sprintf("%s-internal", fctx.adapter.TechnicalName())); err != nil { | |
return err | |
} | |
} | |
loadbalancerName := fctx.adapter.TechnicalName() | |
log.Info("Deleting load balancer", "Name", loadbalancerName) | |
if err := loadbalancerClient.Delete(ctx, fctx.adapter.ResourceGroupName(), loadbalancerName); err != nil { | |
return err | |
} | |
loadbalancerName = fmt.Sprintf("%s-internal", fctx.adapter.TechnicalName()) | |
log.Info("Deleting internal load balancer", "Name", loadbalancerName ) | |
if err := loadbalancerClient.Delete(ctx, fctx.adapter.ResourceGroupName(), loadbalancerName ); err != nil { | |
return err | |
} |
deployment.Spec.Replicas = ptr.To(int32(0)) | ||
// Apply the patch on the "scale" subresource | ||
if err := c.SubResource("scale").Patch(ctx, deployment, patch); err != nil { | ||
return fmt.Errorf("failed to patch deployment %s with replicas: %w", key.String(), err) |
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.
return fmt.Errorf("failed to patch deployment %s with replicas: %w", key.String(), err) | |
return fmt.Errorf("failed to patch deployment %s with replicas: %w", key, err) |
should not be needed
if ia.config.Zoned { | ||
return false | ||
} | ||
// If the infrastructureStatus already exists that mean the Infrastucture is already created. |
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.
// If the infrastructureStatus already exists that mean the Infrastucture is already created. | |
// If the infrastructureStatus already exists that means the Infrastucture is already created. |
/test |
Testrun: e2e-f5mbk +---------------------+---------------------------+-----------+----------+ | NAME | STEP | PHASE | DURATION | +---------------------+---------------------------+-----------+----------+ | infrastructure-test | infrastructure-test | Succeeded | 22m44s | | infrastructure-test | infra-flow-test | Succeeded | 20m5s | | infrastructure-test | infra-flow-migration-test | Succeeded | 25m4s | | bastion-test | bastion-test | Succeeded | 9m30s | +---------------------+---------------------------+-----------+----------+ |
How to categorize this PR?
/area control-plane
/kind enhancement
/platform azure
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Release note: