K8s deployment

The concept:
    Deployment provides a simpler mechanism for updating the RC and the Pod, K8S version 1.2 implementation, Deployment main responsibility is to ensure that the same number of pod and health, 90% of the RC function exactly the same, can be seen as a new generation the RC.
Function:
    Deployment integrated on-line deployment, rolling upgrades, create a copy, pause on the line task, the task back online, roll back to a previous version (success / stable) Deployment of other functions, in a way, no one can achieve Deployment on the line of duty.
    All RC function: Deployment RC inherits all the features.
    Events and status View: You can view detailed upgrade Deployment of the progress and status.
    Rollback: find problems when upgrading pod mirroring or parameters may be used to roll back rollback stable version or a specified version.
    Version History: Deployment of each operation, can be preserved, given the subsequent rollback may be used.
    Pause and Start: For each upgrade, you can pause at any time and start.
    A variety of upgrade options: Recreate-- delete all existing pod, re-create new; when RollingUpdate-- rolling upgrade, and gradually replace the strategy, and rolling upgrades, support more additional parameters, such as setting the maximum number of unavailable pod The minimum update interval, and so on.

Usage scenarios:
    Use Deployment to start (on-line / deploy) a Pod or RS
    checks whether the successful execution of a Deployment
    Update Deployment to re-create the appropriate Pods (for example, requires the use of a new Image)
    If an existing Deployment unstable, then back rolled an early version of stable Deployment
    pause or resume a Deployment
commonly used commands:
    create
    using the sub-command create, create Deployment
    kubectl the create -f the Test-dpm.yaml --record
    note --record parameter, use this parameter to create a follow-up record operation objects, easy to manage and issue retrospective
    view deployment status
    kubectl rolloutstatus deployment / lykops-dpm
    kubectl DESCRIBE deployment / lykops-dpm
    upgrade
    kubectl set image deployment / lykops-dpm lykops-dpm = app: v1
    or use the subcommand edit, edit spec .replicas / spec.template.spec.container.image field to complete the deployment of scalable capacity and rolling upgrade (which is much faster than the sub-command rolling-update rate)
    is tentatively scheduled upgrade
    kubectl rolloutpause deployment / lykops-dpm
    continue to upgrade
    kubectl rolloutresume deployment / lykops-dpm
    rollback
    kubectl rolloutundo deployment / lykops-dpm
    View deployments version
    kubectl rollouthistory deployments
    roll back to the specified version
    kubectl rolloutundo deployment / lykops-dpm --to -revision = 2

Guess you like

Origin blog.csdn.net/qq_42409788/article/details/88575646