• About Us
  • Privacy & Policy
HowTo's
  • Home
  • Commands
  • Linux
  • SCM
  • Git
  • Database
  • MySQL
  • Kubernetes
  • Docker
No Result
View All Result
  • Home
  • Commands
  • Linux
  • SCM
  • Git
  • Database
  • MySQL
  • Kubernetes
  • Docker
No Result
View All Result
HowTo's
No Result
View All Result
Home Kubernetes

Manage Resource Rollouts with kubectl rollout

June 26, 2024
in Kubernetes, Kubernetes Commands Examples, Kubernetes Commands Tutorial, Kubernetes Tutorial
A A
0
11
SHARES
100
VIEWS
Share on FacebookShare on Twitter

The kubectl rollout command is used to manage resource rollouts in Kubernetes clusters. Resource rollouts typically involve updating, reverting, or inspecting the status of resources like deployments, daemonsets, and statefulsets within your Kubernetes environment.

Here are several examples demonstrating how to use kubectl rollout with different resource types:

1. Updating a Deployment:
To update a deployment named `myapp`, you can use the following command:

kubectl rollout restart deployment/myapp

This command restarts the pods of the deployment `myapp`, triggering a new rollout.

Verification: You can verify the rollout by checking the deployment’s revision history:

kubectl rollout history deployment/myapp

2. Inspecting Rollout Status:
Check the status of a rollout to monitor its progress:

kubectl rollout status deployment/myapp

This command shows whether the deployment is progressing as expected or if there are any issues.

3. Rolling Back a Deployment:
Roll back a deployment to a previous revision:

kubectl rollout undo deployment/myapp

This reverts the deployment `myapp` to the previous stable state.

Verification: Confirm the rollback by inspecting the deployment’s revision history.

4. Managing StatefulSets:
Perform a rolling update on a StatefulSet named `mysql`:

kubectl rollout restart statefulset/mysql

This command initiates a rolling update across the pods of the StatefulSet `mysql`.

5. Handling DaemonSets:
Restart all pods managed by a DaemonSet named `fluentd`:

kubectl rollout restart daemonset/fluentd

This command restarts all instances of the DaemonSet `fluentd`.

6. Viewing Rollout History:
List the revision history of a deployment:

kubectl rollout history deployment/myapp

This shows all revisions of the deployment `myapp`, including the current and previous versions.

7. Pausing and Resuming Rollouts:
Pause a deployment to prevent further updates:

kubectl rollout pause deployment/myapp

To resume the rollout, use:

kubectl rollout resume deployment/myapp

Pausing allows for investigation or manual intervention before continuing the rollout.

8. Force Rollout:
Forcefully roll out an update to a deployment:

kubectl rollout restart deployment/myapp --force

This command forcefully restarts all pods of the deployment `myapp`.

9. Monitoring Rollout Progress:
Watch the status of a rollout in real-time:

kubectl rollout status deployment/myapp --watch

This continuously monitors the deployment `myapp` until the rollout completes or encounters an error.

10. Editing Rollout Configuration:
Edit the configuration of a deployment and trigger a rollout:

kubectl set image deployment/myapp nginx=nginx:1.19

This updates the image of the `nginx` container in the deployment `myapp` to version `1.19`.

Verification: Check the rollout status or history to ensure the new image is applied successfully.

Also check similar articles.

Efficiently Delete Kubernetes Resources with kubectl delete
Comprehensive Guide to kubectl get Command
Understanding Kubernetes Resources with kubectl explain
Setting Features on Kubernetes Objects using kubectl set
Running Docker Images on Kubernetes with kubectl run

Tags: KubernetesKubernetes Commands ExamplesKubernetes Commands TutorialKubernetes Tutorial
Previous Post

Efficiently Delete Kubernetes Resources with kubectl delete

Next Post

Scaling Kubernetes Deployments with kubectl scale

Related You may like!

howto

Interacting with Kubernetes Plugins using kubectl plugin

June 26, 2024
howto

Configuring kubectl and kubeconfig Files

June 26, 2024

Exploring Kubernetes API Versions with kubectl api-versions

June 26, 2024

Understanding Kubernetes API Resources with kubectl api-resources

June 26, 2024

Generating Shell Completion Code with kubectl completion

June 26, 2024

Managing Kubernetes Annotations with kubectl annotate

June 26, 2024
Next Post
howto

Scaling Kubernetes Deployments with kubectl scale

howto

Implement Auto-Scaling in Kubernetes with kubectl autoscale

howto

Managing Kubernetes Certificates with kubectl certificate

Discussion about this post

Latest Updated

howto

How to Use -iname for Case-Insensitive Filename Searches in find

August 21, 2024
howto

Search for Files with Case-Insensitive Pattern Matching Using -ilname in find

August 21, 2024
howto

Find Files by Group Name with -group in find Command

August 21, 2024
howto

Locate Files by Group ID Using -gid in find Command

August 21, 2024
howto

How to Search for Filesystems with -fstype in find Command

August 21, 2024

Trending in Week

  • howto

    Using BTRFS Subvolume for User Home Directory in Linux

    22 shares
    Share 9 Tweet 6
  • Downloading Docker Images from a Registry

    13 shares
    Share 5 Tweet 3
  • Configuring SSL Connection Mode in mysqldump

    17 shares
    Share 7 Tweet 4
  • Omit Tablespace Information in mysqldump Output

    13 shares
    Share 5 Tweet 3
  • Setting MySQL Dump Compatibility Mode

    18 shares
    Share 7 Tweet 5
  • Setting Network Buffer Length in mysqldump

    13 shares
    Share 5 Tweet 3
  • Logging out from Docker Registries

    13 shares
    Share 5 Tweet 3
  • Scheduling Nodes in Kubernetes with kubectl uncordon

    12 shares
    Share 5 Tweet 3
  • Managing Default User Creation Settings in Linux

    15 shares
    Share 6 Tweet 4
  • Using Extended INSERT Syntax in mysqldump

    12 shares
    Share 5 Tweet 3
  • About Us
  • Privacy & Policy

© 2024 All Rights Reserved. Howto.swebtools.com.

No Result
View All Result

© 2024 All Rights Reserved. Howto.swebtools.com.