tencent cloud

Feedback

Stage Types

Last updated: 2024-01-03 11:50:30
    This document describes the stage types of deployment pipelines in CODING Continuous Deployment (CODING-CD).

    Prerequisites

    You must activate the CODING DevOps service for your Tencent Cloud account before you can use CODING Project Management (CODING-PM).

    Open Project

    1. Log in to the CODING Console and click Use Now to go to CODING.
    2. On the Workspace homepage, click
    
    on the left to go to the CODING-CD Console.

    General Types

    When you edit a deployment pipeline, you can select a stage type for each step.
    
    
    

    Prerequisite check

    Check such prerequisites as the cluster size or status of a specific stage before executing the next step.

    Custom variables

    Add custom variables (i.e. key/value pairs), which can be referenced by downstream stages.
    
    
    

    Manual confirmation

    Wait for manual confirmation before executing the next step. To facilitate manual confirmation, you can add instructions, or offer input options to users for selection. These input options determine the execution behaviors in the downstream stage. For example, the prerequisite check can be used to ensure that a stage will be executed only when specific conditions are met.

    Deployment pipeline

    Execute other deployment pipelines as sub-pipelines. You can execute the deployment pipeline of this application, as well as the pipelines of other applications that you have access to. You can select whether to wait for the execution results of the sub-pipelines before the stage execution ends. If you select to wait, the final execution status of the sub-pipelines is deemed as the status of this stage. Otherwise, when the execution of the sub-pipelines starts, the status of this stage will be flagged as "successful".
    Description of configuration options:
    Field
    Required?
    Description
    Application
    Yes
    Lists all the applications that you have access to
    Deployment Pipeline
    Yes
    Lists all the deployment pipelines under the application
    Wait for execution result
    No
    If you select to wait, the final execution status of the sub-pipelines is deemed as the status of this stage. Otherwise, when the execution of the sub-pipelines starts, the status of this stage will be flagged as "successful".
    
    
    

    Wait

    Wait for a certain period of time before resuming execution. During the pipeline execution, you can manually reduce the waiting time or directly skip waiting. The waiting time can be an expression.
    
    
    

    Webhook

    Calling external system APIs can be a stage in a deployment pipeline.
    To call a specified webhook, the target URL and HTTP method can be used together with a custom header and the payload in JSON format. By default, if calling a webhook returns 2XX or 3XX, the stage execution has succeeded; if it returns 4XX or 5XX, the execution has failed. The final status of the webhook's URL and payload will be displayed in the pipeline execution details.
    Pipeline expressions can be used in the URL field and payload. When the stage execution is complete, the payload content will be included in the Webhook object of the stage context, so that the payload can be referenced in the subsequent pipeline expressions. For example, you can use the following expression to obtain the final status of the webhook execution:
    ${#stage("My Webhook Stage")["context"]["webhook"]["statusCode"]}
    
    
    
    

    Disable Cluster

    If you disable a cluster, the cluster keeps running but cannot process traffic. If needed, you can specify a certain number of service groups to keep them running, and disable the remaining ones.
    Description of configuration options:
    Select Kubernetes for Cloud Service (Provider)
    Field
    Required?
    Description
    Cloud Service
    Yes
    Cloud service type. Kubernetes and Tencent Cloud are supported.
    Cloud Account
    Yes
    Cloud account that manages resource objects
    Namespaces
    Yes
    Namespaces where the service groups belong
    Clusters
    Yes
    Clusters where the service groups belong
    Disable Options
    Yes
    Specifies the rules for disabling options
    Select Kubernetes for Cloud Service (Provider)
    Field
    Required?
    Description
    Cloud Service
    Yes
    Cloud service type. Kubernetes and Tencent Cloud are supported.
    Cloud Account
    Yes
    Cloud account that manages resource objects
    Namespaces
    Yes
    Namespaces where the service groups belong
    Clusters
    Yes
    Clusters where the service groups belong
    Disable Options
    Yes
    Specifies the rules for disabling options
    Health Check
    Yes
    Only refers to the health check that Tencent Cloud provides when you perform this task

    Cluster Scale-Down

    You can select whether to scale down active service groups (i.e. those operating normally). In addition, you can specify a certain number of service groups to maintain their size, and scale down the remaining ones.
    Select Kubernetes for Cloud Service (Provider)
    Field
    Required?
    Description
    Cloud Service
    Yes
    Cloud service type. Kubernetes and Tencent Cloud are supported.
    Cloud Account
    Yes
    Cloud account that manages resource objects
    Namespaces
    Yes
    Namespaces where the service groups belong
    Clusters
    Yes
    Clusters where the service groups belong
    Scale-Down Options
    Yes
    Specifies scale-down options
    Select Tencent Cloud for Cloud Service (Provider)
    Field
    Required?
    Description
    Cloud Service
    Yes
    Cloud service type. Kubernetes and Tencent Cloud are supported.
    Cloud Account
    Yes
    Cloud account that manages resource objects
    Regions
    Yes
    Regions where the service groups belong
    Clusters
    Yes
    Clusters where the service groups belong
    Health Check
    Yes
    Only refers to the health check that Tencent Cloud provides when you perform this task
    

    Enable Service Group

    If you enable a service group that has been disabled, it will process request traffic again. The configuration of the load balancer determines the routing rules between old and new service groups. When a service group is enabled, the scaling strategy is also enabled.
    Description of configuration options:
    Select Kubernetes for Cloud Service (Provider)
    Field
    Required?
    Description
    Cloud Service
    Yes
    Cloud service type. Kubernetes and Tencent Cloud are supported.
    Cloud Account
    Yes
    Cloud account that manages resource objects
    Namespaces
    Yes
    Namespaces where the service groups belong
    Clusters
    Yes
    Clusters where the service groups belong
    Target Service Groups
    Yes
    Specifies matching rules for service groups
    Select Tencent Cloud for Cloud Service (Provider)
    Field
    Required?
    Description
    Cloud Service
    Yes
    Cloud service type. Kubernetes and Tencent Cloud are supported.
    Cloud Account
    Yes
    Cloud account that manages resource objects
    Regions
    Yes
    Regions where the service groups belong
    Clusters
    Yes
    Clusters where the service groups belong
    Target Service Groups
    Yes
    Specifies matching rules for service groups
    Health Check
    Yes
    Only refers to the health check that Tencent Cloud provides when you perform this task

    Disable Service Group

    If you disable a service group, the service group keeps running but cannot process traffic. In addition, any scaling operations on the disabled service groups will be disabled. By disabling service groups, you can easily switch traffic between old and new service groups. Before a stage is initiated, you must specify the newest, oldest, or newer service groups to be disabled.
    Note:
    For configuration options, refer to Enable Service Group.

    Destroy Service Group

    You can destroy the service groups and relevant resources of a specified cluster. Before a stage is initiated, you must specify the newest, oldest, or newer service groups to be destroyed.
    Description of configuration options:
    Select Kubernetes for Cloud Service (Provider)
    Field
    Required?
    Description
    Cloud Service
    Yes
    Cloud service type. Kubernetes and Tencent Cloud are supported.
    Cloud Account
    Yes
    Cloud account that manages resource objects
    Namespaces
    Yes
    Namespaces where the service groups belong
    Clusters
    Yes
    Clusters where the service groups belong
    Target Service Groups
    Yes
    Specifies matching rules for service groups
    Select Tencent Cloud for Cloud Service (Provider)
    Field
    Required?
    Description
    Cloud Service
    Yes
    Cloud service type. Kubernetes and Tencent Cloud are supported.
    Cloud Account
    Yes
    Cloud account that manages resource objects
    Regions
    Yes
    Regions where the service groups belong
    Clusters
    Yes
    Clusters where the service groups belong
    Target Service Groups
    Yes
    Specifies matching rules for service groups

    Adjust Service Group Size

    Adjusts the size of a service group in proportion to its current size or by a specified amount. The supported adjustment strategies are as follows:
    Scale-up: Increases the size of the target service group
    Scale-down: Decreases the size of the target service group
    Scale up to the relatively largest size: Scales up the target service group to match the size of the largest service group in the current cluster
    Adjust to a specific size: Adjusts the size of the target service group to a specific value

    Tencent Cloud Type

    Bake

    Bakes cloud server images from the specified software package. Baking refers to the process of creating cloud server images. The CODING-CD Console abstracts the Baker stage by using HashiCorp's Packer, and offers a default Packer template and basic cloud server images to help you get started.
    Note that the bake process will be skipped if Spinnaker does not detect any new bake operation. The console generates a unique key for each bake operation according to the parameters of the Bake stage (the base OS, versioned software package, and so on). Any changes to the software package or the parameters will trigger a new bake operation. If you need to change the default behaviors and rebake images every time the deployment pipeline is executed, select Rebake in the stage configuration. For more information, see Packer by HashiCorp.

    Deploy

    Deploys the images baked in advance according to the specified deployment strategies. CODING-CD offers partly built-in deployment strategies such as red/black (blue/green) deployment and Highlander deployment. You can also adopt non-invasive deployment methods for the existing service groups, or create custom deployment strategies.

    Roll Back Cluster

    Rolls back the instances of one or more regions in a cluster.
    Description of configuration options:
    Field
    Required?
    Description
    Cloud Account
    Yes
    Tencent Cloud Account
    Regions
    Yes
    Regions where the clusters belong
    Clusters
    Yes
    Specifies the clusters to be rolled back
    Health Check
    Yes
    Only refers to the health check that Tencent Cloud provides when you perform this task

    Clone Service Group

    Clones all the fields of the existing service group to a new service group (by using images, containers, and so on). When you create a new service group, you can overwrite any field of the cloned service group.

    Shrink Cluster

    Retains a certain number of the newest or largest service groups, and deletes the remaining ones. You can select whether to delete active service groups (i.e. those operating normally) that do not meet the specified conditions.

    Modify Scaling Process

    Pauses or resumes scaling operations.

    Kubernetes Type

    Bake (Manifest)

    Bakes the resource list by using such template renderers as Helm.

    Deploy (Manifest)

    Includes two major steps:
    Specifies the manifest to be deployed
    Specifies the artifacts to be overwritten in the manifest (such as Docker image)
    Configure manifest
    You can specify a manifest in the following two ways:
    Static: Specify it directly in the deployment pipeline
    Dynamic: Use the bound artifact during execution
    Either way, select the Deploy (Manifest) stage in advance.
    Configure static manifest
    If you know the manifest that corresponds to the resources to be deployed beforehand (even though you do not know the artifact version), you can directly provide the plaintext content of the manifest in the configuration of the Deploy (Manifest) stage.
    Note:
    When you select the Text type, you can directly edit the YAML file content in the text field.
    If a JSON-defined deployment pipeline is used, the corresponding content will be as follows:
    {
    "name": "Deploy my manifest", // human-readable name
    "type": "deployManifest", // tells orchestration engine what to run
    "account": "nudge", // account (k8s cluster) to deploy to
    "cloudProvider": "kubernetes",
    "source": "text",
    "manifest": {
    // manifest contents go here
    }
    }
    Configure dynamic manifest
    If artifacts are not stored in the pipeline repository, or multiple artifacts need to be deployed at a stage, you can configure the manifest by binding artifacts. CODING-CD artifacts allow you to reference any remote deployable resources. The artifacts referenced at the Deploy (Manifest) stage must be the text files that contain the manifest definition, which may exist in GitHub repositories or GCS. For more information, see Deployment Pipeline Settings.
    If you have declared expected artifacts at the upstream stages, you can reference them at the Deploy (Manifest) stage:
    Note:
    After you select Artifact for the Manifest Source field, you can deploy the artifacts offered by upstream stages. Make sure that your cloud account has permission to download artifacts.
    Upstream stages may match multiple artifacts. For example, if you configure the regular expression .*\\yml to use all yml files as artifacts, then all matching yml files will be deployed when the Deploy (Manifest) stage is executed.
    Overwrite artifacts
    Normally, when you deploy and update Kubernetes resources, most of the changes involve a flag in the Docker image or ConfigMap. Therefore, CODING-CD provides excellent adaptability to these resource type changes.
    Docker image
    Kubernetes ConfigMap
    Kubernetes Secret
    If these resource objects exist at an upstream stage of a deployment pipeline, CODING-CD will try to automatically inject them into the manifest file being deployed.
    For example: The pipeline execution is triggered by the Docker image registry trigger that carries the image gcr.io/my-project/my-image, whose digest value is sha256:c81e41ef5e.... In the pipeline, you configure a deployment stage with the following manifest content:
    # ... rest of manifest
    containers:
    - name: my-container
    image: gcr.io/my-project/my-image
    # rest of manifest ...
    Because the pipeline is triggered by changes in the content of the Docker image, the pipeline orchestration engine will distribute the Docker image artifact along with the manifest at the deployment stage to the Clouddriver component for processing. The content of the manifest that is eventually deployed will be as follows:
    # ... rest of manifest
    containers:
    - name: my-container
    image: gcr.io/my-project/my-image@:sha256:c81e41ef5e...
    # rest of manifest ...
    To ensure that proper artifacts are obtained at the deployment stage, you can forcibly bind all the required artifacts to the stage. If the binding fails, the stage will fail to boot. The following configuration indicates that the Docker image gcr.io/my-project/my-image must be bound to the manifest. Otherwise, the stage execution will fail:

    Enable (Manifest)

    Enables Kubernetes objects.
    Description of configuration options:
    Select Statically Specify Target for Selector
    Field
    Required?
    Description
    Cloud Account
    Yes
    Cloud account that manages resource objects
    Namespace
    Yes
    Namespace where the resource objects belong
    Selector
    Yes
    Statically specifies the target resources to be deleted by name
    Kind
    Yes
    Resource object type
    Name
    Yes
    Resource object name (such as ReplicaSet resources nginx-deployment-5dfd77bbf9)
    Select Dynamically Select Target for Selector
    Field
    Required?
    Description
    Cloud Account
    Yes
    Cloud account that manages resource objects
    Namespace
    Yes
    Namespace where the resource objects belong
    Selector
    Yes
    Statically specifies the target resources to be deleted by name
    Kind
    Yes
    Resource object type
    Clusters
    Yes
    Resource object name (such as ReplicaSet resources nginx-deployment-5dfd77bbf9)
    Target
    Yes
    Selects matching rules for resource objects

    Delete (Manifest)

    Deletes the Kubernetes objects that are created through the resource list.
    Description of configuration options:
    Select Statically Specify Target for Selector
    Field
    Required?
    Description
    Cloud Account
    Yes
    Cloud account that manages resource objects
    Namespace
    Yes
    Namespace where the resource objects belong
    Selector
    Yes
    Statically specifies the target resources to be deleted by name
    Kind
    Yes
    Resource object type
    Name
    Yes
    Resource object name (such as ReplicaSet resources nginx-deployment-5dfd77bbf9)
    Select Dynamically Select Target for Selector
    Field
    Required?
    Description
    Cloud Account
    Yes
    Cloud account that manages resource objects
    Namespace
    Yes
    Namespace where the resource objects belong
    Selector
    Yes
    Dynamically selects resource objects by cluster and target field
    Kind
    Yes
    Resource object type
    Cluster
    Yes
    Cluster where the resource objects belong
    Target
    Yes
    Selects matching rules for resource objects
    Select Match Target by Tag for Selector
    Field
    Required?
    Description
    Cloud Account
    Yes
    Cloud account that manages resource objects
    Namespace
    Yes
    Namespace where the resource objects belong
    Selector
    Yes
    Matches resource objects according to the specified tag rules
    Kind
    Yes
    Resource object type
    Labels
    Yes
    Matches all the resource objects of the specified types if no rules are set
    Description of setting options:
    Field
    Required?
    Description
    Delete Cascade
    No
    If this field is checked, all the resource objects managed by this resource object (for example, all the pods managed by a ReplicaSet) will be deleted. If this field is not checked, orphan resources may be generated.
    Grace Period
    No
    (Optional) Specifies a termination time for the resource object, which will overwrite the time set in the manifest.
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support