Skip to content
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

skipper: enable manual canary deployment #6592

Merged
merged 1 commit into from
Dec 6, 2023
Merged

Conversation

AlexanderYastrebov
Copy link
Member

@AlexanderYastrebov AlexanderYastrebov commented Nov 29, 2023

The change introduces parameterized skipper-ingress deployment template.
This template is used to define main and canary deployments.
A single replica canary deployment is enabled by a new skipper_ingress_canary_enabled config item.
When canary deployment is enabled number of main HPA min replicas is reduced by one.

To deploy a canary version update $canary_internal_version and set skipper_ingress_canary_enabled.
After checking that canary behaves as expected set $internal_version equal to $canary_internal_version.

I.e. in the cluster where canary is enabled there is always one canary
instance whose version is either above or equal to the main deployment version.

All config items are accessed through .Cluster.ConfigItems for clarity.

architectural New features and architectural changes, e.g. framework changes, migrations, rollout of new services.

@RomanZavodskikh
Copy link
Member

👍

@AlexanderYastrebov AlexanderYastrebov force-pushed the skipper/canary branch 3 times, most recently from 36de8dc to 115bf04 Compare December 1, 2023 14:00
@AlexanderYastrebov AlexanderYastrebov added the architectural New features and architectural changes, e.g. framework changes, migrations, rollout of new services. label Dec 1, 2023
The change introduces parameterized `skipper-ingress` deployment template.
This template is used to define `main` and `canary` deployments.
A single replica `canary` deployment is enabled by a new `skipper_ingress_canary_enabled` config item.
When `canary` deployment is enabled number of `main` HPA min replicas is reduced by one.

To deploy a canary version update `$canary_internal_version` and set `skipper_ingress_canary_enabled`.
After checking that canary behaves as expected set `$internal_version` equal to `$canary_internal_version`.

I.e. in the cluster where canary is enabled there is always one canary
instance whose version is either above or equal to the main deployment version.

All config items are accessed through `.Cluster.ConfigItems` for clarity.

Signed-off-by: Alexander Yastrebov <[email protected]>
{{ end }}
resources:
{{ if and (eq .Cluster.ConfigItems.enable_dedicate_nodepool_skipper "true") (eq .Cluster.ConfigItems.skipper_ingress_binpack "true") }}
{{ $cpu_requests := sumQuantities .Cluster.ConfigItems.skipper_ingress_cpu (printf "-%s" .Cluster.ConfigItems.teapot_admission_controller_daemonset_reserved_cpu) (printf "-%s" .Cluster.ConfigItems.kubelet_system_reserved_cpu) (printf "-%s" .Cluster.ConfigItems.kubelet_kube_reserved_cpu) }}
{{ $cpu_requests := sumQuantities .Cluster.ConfigItems.skipper_ingress_cpu (printf "-%s" .Cluster.ConfigItems.teapot_admission_controller_daemonset_reserved_cpu) (printf "-%s" .Cluster.ConfigItems.kubelet_system_reserved_cpu) (printf "-%s" .Cluster.ConfigItems.kubelet_kube_reserved_cpu) }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I wasn't aware of that. So we can actually just set the configuration item to the resource of the node and this calculates the resources that can be used by skipper-ingress.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only with skipper_ingress_binpack=true but this didn't work 100% so not enabled in most clusters yet. I was hoping to look into this with Karpenter as there seem to be a miscalculation with Cluster Autoscaler when I investigated it months ago.

@szuecs
Copy link
Member

szuecs commented Dec 5, 2023

👍

1 similar comment
@katyanna
Copy link
Member

katyanna commented Dec 6, 2023

👍

@AlexanderYastrebov AlexanderYastrebov merged commit 6e9eea7 into dev Dec 6, 2023
10 checks passed
@AlexanderYastrebov AlexanderYastrebov deleted the skipper/canary branch December 6, 2023 12:03
AlexanderYastrebov added a commit that referenced this pull request Dec 8, 2023
As we decided to not have a config item for canary version value
it also does not make sense to have an item for canary args.

This change uses template variable for canary args to keep
canary version and args close together.

Followup on #6592

Signed-off-by: Alexander Yastrebov <[email protected]>
AlexanderYastrebov added a commit that referenced this pull request Dec 11, 2023
As we decided to not have a config item for canary version value
it also does not make sense to have an item for canary args.

This change uses template variable for canary args to keep
canary version and args close together.

Followup on #6592

Signed-off-by: Alexander Yastrebov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architectural New features and architectural changes, e.g. framework changes, migrations, rollout of new services. merged/alpha merged/beta merged/stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants