-
Notifications
You must be signed in to change notification settings - Fork 1.8k
OSSM-8958: Cluster-wide migration using istio injection label #89324
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
// Module included in the following assemblies: | ||
// | ||
// * service-mesh-docs-main/migrating/cluster-wide/ossm-migrating-cluster-wide-assembly.adoc | ||
|
||
:_mod-docs-content-type: PROCEDURE | ||
[id="ossm-migrating-a-cluster-wide-deployment-using-the-istio-injection-label_{context}"] | ||
rh-tokeefe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
= Migrating a cluster-wide deployment by using the istio injection label | ||
|
||
You can perform a canary upgrade with the gradual migration of data plane namespaces for a cluster-wide deployment by using the `istio-injection=enabled` label and the `default` revision tag. | ||
|
||
You must re-label all of the data plane namespaces. However, it is safe to restart any of the workloads at any point during the migration process. | ||
|
||
The `bookinfo` application is used as an example for the `Istio` resource. For more information about configuration differences between the {SMProduct} 2 `ServiceMeshControlPlane` resource and the {SMProduct} 3 `Istio` resource, see "ServiceMeshControlPlane resource to Istio resource fields mapping". | ||
|
||
.Prerequisites | ||
|
||
* You have deployed {ocp-product-title} 4.14 or later. | ||
* You are logged in to the {ocp-product-title} web console as a user with the `cluster-admin` role. | ||
* You have completed the premigration checklists. | ||
* You have the {SMProduct} {SMv2Version} Operator installed. | ||
* You have the {SMProduct} 3 Operator installed. | ||
* You have created an `IstioCNI` resource. | ||
* You have installed the `istioctl` tool. | ||
* You are running a cluster-wide Service Mesh control plane resource. | ||
* You have installed the `bookinfo` application. | ||
|
||
.Procedure | ||
|
||
. Identify the namespaces that contain a 2.6 control plane by running the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ oc get smcp -A | ||
---- | ||
+ | ||
.Example output | ||
[source,terminal] | ||
---- | ||
NAMESPACE NAME READY STATUS PROFILES VERSION AGE | ||
istio-system install-istio-system 6/6 ComponentsReady ["default"] 2.6.6 115m | ||
---- | ||
|
||
. Create a YAML file named `ossm-3.yaml`. This procedure creates the {istio} resource for the 3.0 installation in the same namespace as the `ServiceMeshControlPlane` resource for the 2.6 installation. | ||
+ | ||
[NOTE] | ||
rh-tokeefe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
==== | ||
In the following example configuration, the {istio} control plane has access to all namespaces on the cluster. If you want to limit the namespaces the control plan has access to, you must define discovery selectors. You must match all the data plane namespaces that you plan to migrate from version 2.6. | ||
==== | ||
+ | ||
.Example `Istio` resource | ||
[source,yaml,subs="attributes,verbatim"] | ||
---- | ||
apiVersion: sailoperator.io/v1 | ||
kind: Istio | ||
metadata: | ||
name: ossm-3 # <1> | ||
spec: | ||
updateStrategy: | ||
type: RevisionBased | ||
namespace: istio-system # <2> | ||
version: v1.24.3 | ||
values: | ||
meshConfig: | ||
extensionProviders: # <3> | ||
- name: prometheus | ||
prometheus: {} | ||
- name: otel | ||
opentelemetry: | ||
port: 4317 | ||
service: otel-collector.opentelemetrycollector-3.svc.cluster.local | ||
---- | ||
<1> The `name`, `updateStrategy` and `version` fields specify how the `IstioRevision` resource name is created. For more information, see "Identifying the revision name". | ||
<2> The 3.0 and 2.6 control planes must run in the same namespace. | ||
<3> Optional: If you are migrating metrics and tracing, update the `extensionProviders` fields according to your tracing and metrics configurations. | ||
+ | ||
[NOTE] | ||
rh-tokeefe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
==== | ||
To prevent the {SMProduct} 3.0 control plane from injecting proxies in the namespaces that have the `istio-injection=enabled` label applied and are still managed by {SMProduct} 2.6 control plane, do not use use the `default` name for the {istio} resource, and do not create the `default` revision tag in the following steps. You create the `default` revision tag later in this procedure. | ||
==== | ||
|
||
. Apply the YAML file by running the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ oc apply -f ossm-3.yaml | ||
---- | ||
|
||
.Verification | ||
|
||
. Verify that the new `istiod` resource uses the existing root certificate by running the following command: | ||
+ | ||
agantony marked this conversation as resolved.
Show resolved
Hide resolved
|
||
[source,terminal] | ||
---- | ||
$ oc logs deployments/istiod-ossm-3-v1-24-3 -n istio-system | grep 'Load signing key and cert from existing secret' | ||
---- | ||
+ | ||
.Example output | ||
[source,terminal] | ||
---- | ||
2024-12-18T08:13:53.788959Z info pkica Load signing key and cert from existing secret istio-system/istio-ca-secret | ||
---- |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,113 @@ | ||||||||||||||||||||
// Module included in the following assemblies: | ||||||||||||||||||||
// | ||||||||||||||||||||
// * service-mesh-docs-main/migrating/cluster-wide/ossm-migrating-cluster-wide-assembly.adoc | ||||||||||||||||||||
|
||||||||||||||||||||
:_mod-docs-content-type: PROCEDURE | ||||||||||||||||||||
[id="ossm-migrating-workloads-using-the-istio-injection-label_{context}"] | ||||||||||||||||||||
= Migrating workloads by using the istio injection label | ||||||||||||||||||||
|
||||||||||||||||||||
Now you can migrate your workloads from the {SMProduct} 2.6 control plane to the {SMproduct} 3.0 control plane. | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Does "Now you can..." mean "After migrating a cluster-wide deployment"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This task is still part of the migration process - the migration process is not separate from this task. We already have published topics that phrase it this way, so I think it makes sense to keep the same language here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you can write a better description using the guidelines: |
||||||||||||||||||||
|
||||||||||||||||||||
[NOTE] | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will leave as Note; same as similar comment. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We used the same description in a few related tasks. I will discuss with the team after the release. We don't have time to update this across all the docs before the release. |
||||||||||||||||||||
==== | ||||||||||||||||||||
You can migrate workloads and gateways separately, and in any order. For more information, see "Migrating gateways". | ||||||||||||||||||||
==== | ||||||||||||||||||||
|
||||||||||||||||||||
.Procedure | ||||||||||||||||||||
|
||||||||||||||||||||
. Find the current `IstioRevision` resource for your {SMProduct} 3.0 control plane by running the following command: | ||||||||||||||||||||
+ | ||||||||||||||||||||
[source,terminal] | ||||||||||||||||||||
---- | ||||||||||||||||||||
$ oc get istios | ||||||||||||||||||||
---- | ||||||||||||||||||||
+ | ||||||||||||||||||||
.Example output | ||||||||||||||||||||
+ | ||||||||||||||||||||
[source,terminal] | ||||||||||||||||||||
---- | ||||||||||||||||||||
NAME REVISIONS READY IN USE ACTIVE REVISION STATUS VERSION AGE | ||||||||||||||||||||
ossm-3 1 1 0 ossm-3-v1-24-3 Healthy v1.24.3 30s | ||||||||||||||||||||
---- | ||||||||||||||||||||
|
||||||||||||||||||||
. Copy the `ACTIVE REVISION` value to use as your `istio.io/rev` label in the next step. | ||||||||||||||||||||
+ | ||||||||||||||||||||
[NOTE] | ||||||||||||||||||||
==== | ||||||||||||||||||||
The naming format of your revisions depends on which upgrade strategy you choose for your `Istio` instance. | ||||||||||||||||||||
==== | ||||||||||||||||||||
|
||||||||||||||||||||
. Update the injection labels on the data plane namespace by running the following command: | ||||||||||||||||||||
+ | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We use the same language in multiple documents. I would prefer to maintain the consistency across the docs. |
||||||||||||||||||||
[source,terminal] | ||||||||||||||||||||
---- | ||||||||||||||||||||
$ oc label ns bookinfo istio.io/rev=ossm-3-v1-24-3 maistra.io/ignore-namespace="true" istio-injection- --overwrite=true | ||||||||||||||||||||
---- | ||||||||||||||||||||
+ | ||||||||||||||||||||
The `oc label` command performs the following actions: | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, @agantony I don't understand this comment. There are a set of four related procedures, and they all use this language. I would prefer to keep this as is, unless absolutely necessary to make the change. We have a release deadline this coming Monday, and I have to merge this PR. Then, I can rebase to pull in these changes and continue to work on the additional related PRs. |
||||||||||||||||||||
|
||||||||||||||||||||
.. Removes the `istio-injection` label: This label prevents the 3.0 control plane from injecting the proxy. The `istio-injection` label takes precedence over the `istio.io/rev` label. You must temporarily remove the `istio-injection=enabled` because you cannot create the default `IstioRevisionTag` tag yet. Leaving the `istio-injection=enabled` label applied would prevent the 3.0 control plane from performing proxy injection. | ||||||||||||||||||||
|
||||||||||||||||||||
.. Adds the `istio.io/rev=ossm-3-v1-24-3` label: This label ensures that any newly created or restarted pods in the namespace connect to the {SMProduct} 3.0 proxy. | ||||||||||||||||||||
|
||||||||||||||||||||
.. Adds the `maistra.io/ignore-namespace: "true"` label: This label disables sidecar injection for {SMProduct} 2.6 proxies in the namespace. With the label applied, {SMProduct} 2.6 stops injecting proxies in this namespace, and any new proxies are injected by {SMProduct} 3.0. Without this label, the {SMProduct} 2.6 injection webhook tries to inject the pod and the injected sidecar proxy refuses to start since it will has both the {SMProduct} 2.6 and the {SMProduct} 3.0 Container Network Interface(CNI) annotations. | ||||||||||||||||||||
Comment on lines
+49
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would prefer to keep as is for now because of the set of related procedures. Will discuss with team after the Monday release. |
||||||||||||||||||||
+ | ||||||||||||||||||||
[NOTE] | ||||||||||||||||||||
==== | ||||||||||||||||||||
After you apply the `maistra.io/ignore-namespace` label, any new pod that gets created in the namespace connects to the {SMProduct} 3.0 proxy. Workloads can still communicate with each other regardless of which control plane they are connected to. | ||||||||||||||||||||
==== | ||||||||||||||||||||
|
||||||||||||||||||||
. Restart the workloads by using one of the following options: | ||||||||||||||||||||
rh-tokeefe marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||
+ | ||||||||||||||||||||
.. To restart all the workloads at the same time so that the new pods are injected with the {SMProduct} 3.0 proxy, run the following command: | ||||||||||||||||||||
+ | ||||||||||||||||||||
.Example command for `bookinfo` application | ||||||||||||||||||||
[source,terminal] | ||||||||||||||||||||
---- | ||||||||||||||||||||
$ oc rollout restart deployments -n bookinfo | ||||||||||||||||||||
---- | ||||||||||||||||||||
|
||||||||||||||||||||
.. To restart each workload individually, run the following command for each workload: | ||||||||||||||||||||
rh-tokeefe marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||
+ | ||||||||||||||||||||
.Example command for `bookinfo` application | ||||||||||||||||||||
[source,terminal] | ||||||||||||||||||||
---- | ||||||||||||||||||||
$ oc rollout restart deployments productpage-v1 -n bookinfo | ||||||||||||||||||||
---- | ||||||||||||||||||||
|
||||||||||||||||||||
. Wait for the `productpage` application to restart by running the following command: | ||||||||||||||||||||
+ | ||||||||||||||||||||
[source,terminal] | ||||||||||||||||||||
---- | ||||||||||||||||||||
$ oc rollout status deployment productpage-v1 -n bookinfo | ||||||||||||||||||||
---- | ||||||||||||||||||||
|
||||||||||||||||||||
.Verification | ||||||||||||||||||||
|
||||||||||||||||||||
. Verify that the the new control plane manages the expected workloads by running the following command: | ||||||||||||||||||||
+ | ||||||||||||||||||||
[source,terminal] | ||||||||||||||||||||
---- | ||||||||||||||||||||
$ istioctl ps -n bookinfo | ||||||||||||||||||||
---- | ||||||||||||||||||||
+ | ||||||||||||||||||||
.Example output: | ||||||||||||||||||||
[source,terminal] | ||||||||||||||||||||
---- | ||||||||||||||||||||
NAME CLUSTER CDS LDS EDS RDS ECDS ISTIOD VERSION | ||||||||||||||||||||
details-v1-7f46897b-d497c.bookinfo Kubernetes SYNCED SYNCED SYNCED SYNCED NOT SENT istiod-install-istio-system-866b57d668-6lpcr 1.20.8 | ||||||||||||||||||||
productpage-v1-74bfbd4d65-vsxqm.bookinfo Kubernetes SYNCED (4s) SYNCED (4s) SYNCED (3s) SYNCED (4s) IGNORED istiod-ossm-3-v1-24-3-797bb4d78f-xpchx 1.24.3 | ||||||||||||||||||||
ratings-v1-559b64556-c5ppg.bookinfo Kubernetes SYNCED SYNCED SYNCED SYNCED NOT SENT istiod-install-istio-system-866b57d668-6lpcr 1.20.8 | ||||||||||||||||||||
reviews-v1-847fb7c54d-qxt5d.bookinfo Kubernetes SYNCED SYNCED SYNCED SYNCED NOT SENT istiod-install-istio-system-866b57d668-6lpcr 1.20.8 | ||||||||||||||||||||
reviews-v2-5c7ff5b77b-8jbhd.bookinfo Kubernetes SYNCED SYNCED SYNCED SYNCED NOT SENT istiod-install-istio-system-866b57d668-6lpcr 1.20.8 | ||||||||||||||||||||
reviews-v3-5c5d764c9b-rrx8w.bookinfo Kubernetes SYNCED SYNCED SYNCED SYNCED NOT SENT istiod-install-istio-system-866b57d668-6lpcr 1.20.8 | ||||||||||||||||||||
---- | ||||||||||||||||||||
+ | ||||||||||||||||||||
The output shows that the `productpage-v1` deployment is the only deployment that has been restarted and was injected with the 3.0 proxy. Even if there are different versions of the proxies, communication between the services still works. | ||||||||||||||||||||
|
||||||||||||||||||||
. If the 2.6 installation contains additional namespaces, migrate the next namespace now. | ||||||||||||||||||||
rh-tokeefe marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||
+ | ||||||||||||||||||||
[NOTE] | ||||||||||||||||||||
rh-tokeefe marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||
==== | ||||||||||||||||||||
Remove the `maistra.io/ignore-namespace="true"` label only after the 2.6 control plane has been uninstalled. | ||||||||||||||||||||
==== |
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.
Do not use the Next steps section to provide detailed instructions to documentation users.
https://github.com/openshift/openshift-docs/blob/main/contributing_to_docs/doc_guidelines.adoc#lead-in-link-sentence-style-for-the-link-attribute:~:text=Provide%20links%20to%20resources%20that%20contain%20instructions%20that%20might%20be%20useful%20to%20the%20user%20after%20they%20complete%20a%20module%20or%20assembly.%20Do%20not%20use%20the%20Next%20steps%20section%20to%20provide%20detailed%20instructions%20to%20documentation%20users.
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.
You can add the textual information at the end of the module.
https://www.ibm.com/docs/en/ibm-style?topic=format-procedures#ending-the-procedure
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 think I should discuss this with the team after the release. We've done this in a few places, and some of the tasks are already merged.