mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-06 06:46:26 +01:00
64 lines
1.7 KiB
Plaintext
64 lines
1.7 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * applications/deployments/deployment-strategies.adoc
|
|
|
|
[id="deployments-creating-rolling-deployment_{context}"]
|
|
= Creating a Rolling deployment
|
|
|
|
Rolling deployments are the default type in {product-title}. You can create a
|
|
Rolling deployment using the CLI.
|
|
|
|
.Procedure
|
|
|
|
. Create an application based on the example deployment images found in
|
|
link:https://hub.docker.com/r/openshift/deployment-example/[DockerHub]:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc new-app openshift/deployment-example
|
|
----
|
|
|
|
. If you have the router installed, make the application available via a route (or
|
|
use the service IP directly)
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc expose svc/deployment-example
|
|
----
|
|
|
|
. Browse to the application at `deployment-example.<project>.<router_domain>` to
|
|
verify you see the `v1` image.
|
|
|
|
. Scale the DeploymentConfig up to three replicas:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc scale dc/deployment-example --replicas=3
|
|
----
|
|
|
|
. Trigger a new deployment automatically by tagging a new version of the example
|
|
as the `latest` tag:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc tag deployment-example:v2 deployment-example:latest
|
|
----
|
|
|
|
. In your browser, refresh the page until you see the `v2` image.
|
|
|
|
. When using the CLI, the following command shows how many pods are on version 1
|
|
and how many are on version 2. In the web console, the pods are progressively
|
|
added to v2 and removed from v1:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc describe dc deployment-example
|
|
----
|
|
|
|
During the deployment process, the new ReplicationController is incrementally
|
|
scaled up. After the new pods are marked as `ready` (by passing their readiness
|
|
check), the deployment process continues.
|
|
|
|
If the pods do not become ready, the process aborts, and the DeploymentConfig
|
|
rolls back to its previous version.
|