Câu hỏi phỏng vấn Kubernetes
Câu hỏi

How to rollbac...

Câu trả lời

To rollback a Deployment in Kubernetes, you can use the kubectl rollout command. Here is a step-by-step guide on how to perform a rollback:

Step-by-Step Guide to Rollback a Deployment

  1. List Deployments:
    First, list all the Deployments in your cluster to identify the one you want to rollback:

    bash Copy
    kubectl get deployments

    This command will display the status of all Deployments in your cluster.

  2. Check Revision History:
    Obtain the revision history of the specific Deployment you want to rollback. Replace <deployment_name> with the name of your Deployment:

    bash Copy
    kubectl rollout history deployment/<deployment_name>

    This command will show the revision history, including the change causes for each revision.

  3. Rollback to a Specific Revision:
    To rollback to a specific revision, use the following command. Replace <revision_number> with the desired revision number:

    bash Copy
    kubectl rollout undo deployment/<deployment_name> --to-revision=<revision_number>

    This command will rollback the Deployment to the specified revision.

  4. Verify Rollback:
    After performing the rollback, verify that it was successful by checking the status of the Deployment:

    bash Copy
    kubectl rollout status deployment/<deployment_name>

    If the rollback was successful, you should see a message indicating a successful rollout.

  5. Check Deployment Details:
    Optionally, you can describe the Deployment to get more details about its current state:

    bash Copy
    kubectl describe deployment/<deployment_name>

Example

Here is an example of roll...

senior

senior

Gợi ý câu hỏi phỏng vấn

middle

When to use StatefulSet?

junior

What is a Pod?

middle

What happens when a master fails? What happens when a worker fails?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào