Skip to content

Initial support for multiple control plane revisions#20798

Merged
istio-testing merged 1 commit intoistio:masterfrom
howardjohn:multi/env-basic
Feb 7, 2020
Merged

Initial support for multiple control plane revisions#20798
istio-testing merged 1 commit intoistio:masterfrom
howardjohn:multi/env-basic

Conversation

@howardjohn
Copy link
Copy Markdown
Member

This is intended to be a minimal change to support backporting to 1.5.
The benefit of backporting to 1.5 is that it will make the old 1.5
control planes behave more correctly once we ship 1.6.

Design doc: https://docs.google.com/document/d/1d1z5PC8wvh9QiR3NesAaPm6w2HnE4-KIfjB7GB-_Wf8/

@howardjohn howardjohn requested review from a team as code owners February 3, 2020 18:02
@googlebot googlebot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Feb 3, 2020
@istio-testing istio-testing added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 3, 2020
@howardjohn howardjohn requested a review from a team as a code owner February 3, 2020 18:14
@howardjohn howardjohn force-pushed the multi/env-basic branch 2 times, most recently from 63de87b to 536c2e2 Compare February 3, 2020 23:18
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

apps/v1 Deployment label selectors are immutable. We'll need a new deployment for every revision bump. This is arguably a good thing for versioning multiple control planes. How will this in 1.5 where we really only support in-place upgrades?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This should be a new deployment. I need to modify this PR to make it so its istiod-{{.revision}}, I forgot that somehow. in 1.5 we could remove this selector I guess?

Am I right in thinking that the 1.5 deployment (matching app: pilot) would match the 1.6 deployment (which has app: pilot as well as a revision label) and things will get weird

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

istiod-{{.revision}} deployment naming to match the istio.io/rev label sounds good.

I think we can remove the selector for 1.5. See my comment below about setting the istio.io/rev directly in the deployment below.

I think you're right. 1.5 pods w/app=pilot would match the 1.6 deployments. If we changed the app label value that shouldn't be a problem though. s/pilot/istiod in 1.6 maybe?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

the only reason I kept it to pilot was to avoid issues where we had tooling selecting app=pilot (eg istioctl). But if we are already selecting on only that, we may not have much choice

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you're right. 1.5 pods w/app=pilot would match the 1.6 deployments.

I had this wrong. The k8s pilot service would match both. The replicasets versions shouldn't get mixed up. That is pretty much how our bookinfo demo is setup today.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Interesting, seems like you can't actually run into the deployment label issue since replicaset adds a pod-hash label.

Let me fix up the names, service selectors, etc

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You might also be able to filter in the k8s list/watch. This would reduce memory usage in the client cache and decrease load on the kube-apiserver.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I really wanted to, but there is no OR support on labels. So we cannot express label is empty OR label is revision123. Unless there is some tricky boolean logic I missed

Copy link
Copy Markdown
Contributor

@ayj ayj Feb 4, 2020

Choose a reason for hiding this comment

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

"label is empty" or "label not set at all"? In the chart above istio.io/revision is only added if the revision value is not empty.

Assuming "label is not set at all", then the "OR" decision is made when the informer is started, i.e. watch all objects vs. only objects with istio.io/rev=.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

"label not set at all". If its not set, it applies to all revisions. This is the "normal" case - all current configs are likely in this category. If we just watch objects with istio.io/rev label then we miss the "global" objects

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The value of istio.io/rev should be .Values.global.revision. You could set the envvar directly in the deployment. That would get around the immutable deployment label selector for 1.5 I think? We could add an annotation to the pod for purely informational purposes, but that would only exist for Istio < 1.6.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think we want it to have a different selector intentionally though, right? otherwise the two are coupled. I need to look into what happens with selectors overlapping on deployments, I don't quite understand.

But I also think we want a label - we might actually want it on every single resource, so we can do kubectl apply --prune -listio.io/rev=foo type things? Otherwise it will be hard to clean up

Copy link
Copy Markdown
Contributor

@ayj ayj Feb 4, 2020

Choose a reason for hiding this comment

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

A revision label on the deployment to match the associated resources is desirable and something I think we can make work in 1.6. IIUC, that requires proper multi-control plane support (e.g. istiod-)?

My understanding of this PR is to make istiod (1.5) forward compatible with 1.6 and honor the istio.io/revision label on resources. It would be great if we could sync the resource revision labels with the deployment revision label but that didn't seem possible for 1.5 and I don't think is strictly required. As a short term solution you could hardwire the REVISION envvar so that config filtering doesn't depend on the deployment's revision label, e.g.

{{- if .Values.global.revision }}
          - name: REVISION
            valueFrom:
              fieldRef:
                fieldPath: {{ Values.global.revision }}
{{- end }}

@istio-testing istio-testing added needs-rebase Indicates a PR needs to be rebased before being merged size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 5, 2020
@istio-testing istio-testing added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR needs to be rebased before being merged size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 5, 2020
Copy link
Copy Markdown
Contributor

@costinm costinm left a comment

Choose a reason for hiding this comment

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

We can add back the revision to names in separate PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It needs a revision as well.

@istio-testing istio-testing merged commit ea5abed into istio:master Feb 7, 2020
@howardjohn
Copy link
Copy Markdown
Member Author

/cherrypick release-1.5

@istio-testing
Copy link
Copy Markdown
Collaborator

@howardjohn: #20798 failed to apply on top of branch "release-1.5":

Using index info to reconstruct a base tree...
M	manifests/global.yaml
M	manifests/istio-control/istio-discovery/templates/deployment.yaml
M	manifests/istio-control/istio-discovery/templates/service.yaml
A	operator/cmd/mesh/testdata/manifest-generate/output/all_on.golden-show-in-gh-pull-request.yaml
A	operator/cmd/mesh/testdata/manifest-generate/output/component_hub_tag.golden.yaml
A	operator/cmd/mesh/testdata/manifest-generate/output/flag_force.golden.yaml
A	operator/cmd/mesh/testdata/manifest-generate/output/flag_output.golden.yaml
A	operator/cmd/mesh/testdata/manifest-generate/output/flag_output_set_profile.golden.yaml
A	operator/cmd/mesh/testdata/manifest-generate/output/flag_output_set_values.golden.yaml
A	operator/cmd/mesh/testdata/manifest-generate/output/flag_override_values.golden.yaml
A	operator/cmd/mesh/testdata/manifest-generate/output/flag_set_values.golden.yaml
A	operator/cmd/mesh/testdata/manifest-generate/output/pilot_default.golden.yaml
A	operator/cmd/mesh/testdata/manifest-generate/output/pilot_k8s_settings.golden.yaml
A	operator/cmd/mesh/testdata/manifest-generate/output/pilot_override_values.golden.yaml
M	operator/cmd/mesh/testdata/profile-dump/output/all_off.yaml
M	operator/data/profiles/default.yaml
A	operator/data/translateConfig/translateConfig-1.6.yaml
M	operator/pkg/apis/istio/v1alpha1/v1alpha1.pb.html
M	operator/pkg/apis/istio/v1alpha1/values_types.pb.go
M	operator/pkg/apis/istio/v1alpha1/values_types.proto
M	operator/pkg/vfs/assets.gen.go
M	pilot/pkg/bootstrap/certcontroller.go
M	pilot/pkg/bootstrap/configcontroller.go
Falling back to patching base and 3-way merge...
Auto-merging pilot/pkg/bootstrap/configcontroller.go
Auto-merging pilot/pkg/bootstrap/certcontroller.go
Auto-merging operator/pkg/vfs/assets.gen.go
CONFLICT (content): Merge conflict in operator/pkg/vfs/assets.gen.go
Auto-merging operator/pkg/apis/istio/v1alpha1/values_types.proto
Auto-merging operator/pkg/apis/istio/v1alpha1/values_types.pb.go
CONFLICT (content): Merge conflict in operator/pkg/apis/istio/v1alpha1/values_types.pb.go
Auto-merging operator/pkg/apis/istio/v1alpha1/v1alpha1.pb.html
Auto-merging operator/data/translateConfig/translateConfig-1.4.yaml
CONFLICT (content): Merge conflict in operator/data/translateConfig/translateConfig-1.4.yaml
Auto-merging operator/data/profiles/default.yaml
Auto-merging operator/cmd/mesh/testdata/profile-dump/output/all_off.yaml
Auto-merging operator/cmd/mesh/testdata/manifest-generate/output/pilot_override_values.yaml
Auto-merging operator/cmd/mesh/testdata/manifest-generate/output/pilot_k8s_settings.yaml
Auto-merging operator/cmd/mesh/testdata/manifest-generate/output/pilot_default.yaml
Auto-merging operator/cmd/mesh/testdata/manifest-generate/output/flag_set_values.yaml
Auto-merging operator/cmd/mesh/testdata/manifest-generate/output/flag_override_values.yaml
Auto-merging operator/cmd/mesh/testdata/manifest-generate/output/flag_output_set_values.yaml
Auto-merging operator/cmd/mesh/testdata/manifest-generate/output/flag_output_set_profile.yaml
Auto-merging operator/cmd/mesh/testdata/manifest-generate/output/flag_output.yaml
Auto-merging operator/cmd/mesh/testdata/manifest-generate/output/flag_force.yaml
Auto-merging operator/cmd/mesh/testdata/manifest-generate/output/component_hub_tag.yaml
Auto-merging operator/cmd/mesh/testdata/manifest-generate/output/all_on.yaml
Auto-merging manifests/istio-control/istio-discovery/templates/service.yaml
Auto-merging manifests/istio-control/istio-discovery/templates/deployment.yaml
Auto-merging manifests/global.yaml
error: Failed to merge in the changes.
Patch failed at 0001 Minimal support for multiple control planes for fwd compatibility

Details

In response to this:

/cherrypick release-1.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

howardjohn added a commit to howardjohn/istio that referenced this pull request Feb 7, 2020
istio-testing pushed a commit that referenced this pull request Feb 7, 2020
#20917)

* Minimal support for multiple control planes for fwd compatibility (#20798)

(cherry picked from commit ea5abed)

* fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants