Skip to content

update autoscaling version to v2beta2 #37872

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

Merged
merged 7 commits into from
May 6, 2022
Merged

Conversation

richardwxn
Copy link
Contributor

@richardwxn richardwxn commented Mar 10, 2022

need to wait for #istio/api#2273 to get in first

address #32005

@richardwxn richardwxn requested review from a team as code owners March 10, 2022 23:34
@istio-policy-bot
Copy link

😊 Welcome @richardwxn! This is either your first contribution to the Istio istio repo, or it's been
awhile since you've been here.

You can learn more about the Istio working groups, code of conduct, and contributing guidelines
by referring to Contributing to Istio.

Thanks for contributing!

Courtesy of your friendly welcome wagon.

@istio-testing istio-testing added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 10, 2022
Copy link
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

Nice! what happens if someone has an overlay?

@howardjohn
Copy link
Member

@richardwxn the failures look like they are real

@richardwxn
Copy link
Contributor Author

@richardwxn the failures look like they are real

Yep I think we need to check in the istio/api changes first, otherwise it cannot recognize the updated schema, which is the reason why the tests are failing

@richardwxn
Copy link
Contributor Author

richardwxn commented Mar 15, 2022

Nice! what happens if someone has an overlay?

for helm it should just work since the original values. settings just mapped to a different k8s field.

A bit trickier for k8s overlay cases, since some fields are just removed in the v2beta2/v2 schema, two ideas:

  1. check for k8s version, if older than xxx pick the old template otherwise pick the new template
  2. check for deprecated fields, if using any deprecated fields pick the old template
    but either way we need to keep two copies: both v2beta1 and v2, switched in the chart by an internal flag

@howardjohn @ostromart lmk if that makes sense to you

@howardjohn
Copy link
Member

2 seems slightly better since (1) would still be a breaking change to IOP when a user upgrades their underlying K8s cluster. With 2 they just need to move before they upgrade to 1.25 which removes the old API

@richardwxn
Copy link
Contributor Author

@howardjohn PTAL?

@@ -279,6 +279,9 @@ global:
# Setting this port to a non-zero value enables STS server.
servicePort: 0

# whether to use autoscaling/v2 template for HPA settings
autoscalingv2API: true
Copy link
Member

Choose a reason for hiding this comment

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

Is a user expected to configure this? It would be nice to auto-detect based on their Kubernetes version.

See manifests/charts/gateway/templates/deployment.yaml ip_unprivileged_port_start for an example doing this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is for internal usage, i.e. we check the existence of deprecated fields usages from user's IOP and set this autoscalingv2API to false, then render the v2beta1 template instead

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a comment to the Helm description saying it's for internal usage? Users look to our Helm values as an API

@istio-testing istio-testing added the needs-rebase Indicates a PR needs to be rebased before being merged label Apr 11, 2022
@istio-testing istio-testing removed the needs-rebase Indicates a PR needs to be rebased before being merged label Apr 14, 2022
@@ -279,6 +279,9 @@ global:
# Setting this port to a non-zero value enables STS server.
servicePort: 0

# whether to use autoscaling/v2 template for HPA settings
autoscalingv2API: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a comment to the Helm description saying it's for internal usage? Users look to our Helm values as an API

@@ -193,6 +209,7 @@ func (h *HelmReconciler) GetPrunedResources(revision string, includeClusterResou
labels[IstioComponentLabelStr] = componentName
}
selector := klabels.Set(labels).AsSelectorPreValidated()
h.modifyPruneResourcesBasedOnK8SVersion()
Copy link
Contributor

Choose a reason for hiding this comment

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

+1, think we'd have to change this in a few places though?

@richardwxn richardwxn requested a review from a team as a code owner May 6, 2022 18:47
@istio-testing istio-testing removed the needs-rebase Indicates a PR needs to be rebased before being merged label May 6, 2022
@richardwxn richardwxn requested a review from Monkeyanator May 6, 2022 20:54
@istio-testing istio-testing merged commit c3d3d13 into istio:master May 6, 2022
@istio-testing
Copy link
Collaborator

In response to a cherrypick label: #37872 failed to apply on top of branch "release-1.14":

Applying: update autoscaling version to v2beta2
Applying: integrate with api repo changes
.git/rebase-apply/patch:2579: trailing whitespace.
          - object: 
.git/rebase-apply/patch:2588: trailing whitespace.
          - resource: 
.git/rebase-apply/patch:2599: trailing whitespace.
          - pods: 
warning: 3 lines add whitespace errors.
Using index info to reconstruct a base tree...
M	go.mod
M	go.sum
M	manifests/charts/istio-control/istio-discovery/files/gen-istio.yaml
M	operator/pkg/apis/istio/v1alpha1/values_types.pb.go
Falling back to patching base and 3-way merge...
Auto-merging operator/pkg/apis/istio/v1alpha1/values_types.pb.go
Auto-merging manifests/charts/istio-control/istio-discovery/files/gen-istio.yaml
Auto-merging go.sum
Auto-merging go.mod
Applying: address comments
Using index info to reconstruct a base tree...
M	go.sum
M	operator/cmd/mesh/testdata/manifest-generate/output/all_on.golden-show-in-gh-pull-request.yaml
M	operator/cmd/mesh/testdata/manifest-generate/output/pilot_default.golden.yaml
M	operator/cmd/mesh/testdata/manifest-generate/output/sidecar_template.golden.yaml
Falling back to patching base and 3-way merge...
Auto-merging operator/cmd/mesh/testdata/manifest-generate/output/sidecar_template.golden.yaml
Auto-merging operator/cmd/mesh/testdata/manifest-generate/output/pilot_default.golden.yaml
Auto-merging operator/cmd/mesh/testdata/manifest-generate/output/all_on.golden-show-in-gh-pull-request.yaml
Auto-merging go.sum
Applying: update helm gateway
Applying: address comments, fix boolean condition
warning: Cannot merge binary files: operator/cmd/mesh/testdata/manifest-generate/data-snapshot.tar.gz (HEAD vs. address comments, fix boolean condition)
Using index info to reconstruct a base tree...
M	go.mod
M	go.sum
M	operator/cmd/mesh/testdata/manifest-generate/data-snapshot.tar.gz
M	operator/pkg/apis/istio/v1alpha1/values_types.pb.go
Falling back to patching base and 3-way merge...
Auto-merging operator/pkg/apis/istio/v1alpha1/values_types.pb.go
Auto-merging operator/cmd/mesh/testdata/manifest-generate/data-snapshot.tar.gz
CONFLICT (content): Merge conflict in operator/cmd/mesh/testdata/manifest-generate/data-snapshot.tar.gz
Auto-merging go.sum
CONFLICT (content): Merge conflict in go.sum
Auto-merging go.mod
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0005 address comments, fix boolean condition
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: new issue created for failed cherrypick: #38779

GregHanson pushed a commit to GregHanson/istio that referenced this pull request May 13, 2022
* update autoscaling version to v2beta2

* integrate with api repo changes

* address comments

* update helm gateway

* address comments, fix boolean condition

* modify pruning based on k8s version

* fix comments
GregHanson pushed a commit to GregHanson/istio that referenced this pull request May 13, 2022
* update autoscaling version to v2beta2

* integrate with api repo changes

* address comments

* update helm gateway

* address comments, fix boolean condition

* modify pruning based on k8s version

* fix comments
istio-testing pushed a commit that referenced this pull request May 13, 2022
* operator: update golden files (#38714)

Currently operator tests use a snapshot of the manifests for tests to
avoid churn. Update these to meet current state of the world.

All changes are autogenerated

* update autoscaling version to v2beta2 (#37872)

* update autoscaling version to v2beta2

* integrate with api repo changes

* address comments

* update helm gateway

* address comments, fix boolean condition

* modify pruning based on k8s version

* fix comments

* bump pdb version to policy/v1 (#38814)

* add v1 pdb

* release note

* Remove common-protos (#38546)

* Remove common-protos

* Make gen

Co-authored-by: John Howard <howardjohn@google.com>
Co-authored-by: Xinnan Wen <iamwen@google.com>
Co-authored-by: Zhonghu Xu <xuzhonghu@huawei.com>
arka-pramanik-hpe added a commit to arka-pramanik-hpe/cray-istio that referenced this pull request Jun 3, 2024
arka-pramanik-hpe added a commit to arka-pramanik-hpe/cray-istio that referenced this pull request Jun 14, 2024
arka-pramanik-hpe added a commit to arka-pramanik-hpe/cray-istio that referenced this pull request Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants