Creating and managing deployment scenarios
    • PDF

    Creating and managing deployment scenarios

    • PDF

    Article Summary

    Available in Classic and VPC

    Creating and managing deployment scenarios explains how to create and manage deployment scenarios for each deployment target.

    Note

    To create and manage deployment scenarios, a customer account or sub account with the change/Project permission is required. For permission setting instructions, see Sub Account user guide.

    There are different methods of creating deployment scenarios, depending on the deployment target.

    See the creation method for the deployment scenario's deployment target you want to create.

    Create Server deployment scenario

    The following describes how to create a deployment scenario with Server as the deployment target.

    1. Access NAVER Cloud Platform console.
    2. Click Services > Developer Tools > SourceDeploy in order.
    3. Click a deployment project where you want to create the scenario, and then click a deployment stage with Server as the deployment target.
    4. Click the [Create] button.
    5. When the deployment scenario creation page appears, proceed with the following steps in order.

    1. Basic settings

    Enter the deployment scenario's name and description, and then click the [Next] button.

    2. Set up deployment strategy

    Select the deployment strategy and process, and then click the [Next] button.
    sourcedeploy-use-scenario_strategy_ko

    • Only the basic deployment strategy is provided. Deploy on the deployment server set.
    • Deployment process options available are consecutive deployment and simultaneous deployment.
      • Consecutive deployment: perform a consecutive deployment for the specified deployment server
      • Simultaneous deployment: perform a simultaneous deployment for the specified deployment server

    3. Set up deployment file

    Select the deployment file location and build project, and click the [Next] button.
    sourcedeploy-use-scenario_file_ko

    • The options available for deployment file location are Source Build, Object Storage, and Set later.
      • If you've selected Source build, select a build project. If the last build result is a fail or the build output is not uploaded, then the deployment is not performed.
      • If you’ve selected Object Storage, select a deployment file among the buckets in your Object Storage. Only the deployment file compressed as a .zip file can be deployed.
      • If you've selected Set later, you can set up the deployment file when deploying the scenario.

    4. Set up deployment commands

    sourcedeploy-use-scenario_command_ko

    • You can enter multiple commands, which will be executed in the order they were added.
    • Run before deployment: set up the command to run in the server before the deployment, and click the [Add] button.
      • Account for execution: enter the server account to run the command.
      • Command for execution: enter the command to run on the server.
    • File deployment: set up the path to deploy the file, and click the [Add] button.
      • Source file path: enter the file path to deploy.
      • Deployment path: enter the entire path of the server to deploy.
      • If you've set the deployment file location to Set later in 3. Set up deployment file, or there's no last build output from SourceBuild, Set later or No last build output is displayed in File deployment.
    • Run after deployment: set up the command to run in the server after the deployment, and click the [Add] button.
      • Account for execution: enter the server account to run the command.
      • Command for execution: enter the command to run on the server.
    • Click the [Delete] button to delete the added command.
    • Click Use to select it if you'd like to use the rollback feature in case of failed deployment.
      • If the rollback feature is enabled, then the deployment is automatically rolled back to the previous version when it fails.
      • Rollback is performed by running the last successful deployment of the stage.
      • If the previous deployment file does not exist in Object Storage or there is not a last successful deployment, the rollback fails.

    5. Final confirmation

    Check the information for the deployment scenario configured, and then click the [Create deployment scenario] button.

    Create Auto Scaling deployment scenario

    The following describes how to create a deployment scenario with Auto Scaling as the deployment target.

    1. Access NAVER Cloud Platform console.
    2. Click Services > Developer Tools > SourceDeploy in order.
    3. Click a deployment project where you want to create the scenario, and click a deployment stage with Auto Scaling as the deployment target.
    4. Click the [Create] button.
    5. When the deployment scenario creation page appears, proceed with the following steps in order.

    1. Basic settings

    Enter the deployment scenario's name and description, and then click the [Next] button.

    2. Set up deployment strategy

    Select the deployment strategy and process, and then click the [Next] button.
    sourcedeploy-use-scenario_strategy3_ko

    • The possible deployment strategy options are basic and blue/green.

      Note

      Only the basic option is provided in the Classic environment. The basic and blue/green options are both provided in the VPC environment.

      • Basic: deploy in consecutive order for the servers in the specified Auto Scaling Group
      • Blue/green: copy the specified Auto Scaling Group to create a new Auto Scaling Group, then deploy to the group
        • Once the deployment is successfully completed, the server in the new Auto Scaling Group is connected to the Load Balancer Target Group, and then the traffic is routed to the group. The interruption time due to deployment can be minimized with the blue/green strategy.
    • Deployment process options available are consecutive deployment and simultaneous deployment.

      • Consecutive deployment: perform a consecutive deployment for the specified deployment server
      • Simultaneous deployment: perform a simultaneous deployment for the specified deployment server
    • If you've selected the blue/green deployment strategy, then set up the following:

      • Select a Load Balancer Target Group to connect to the Auto Scaling Group.
        • You can select from a target group connected to the Auto Scaling Group specified as the deployment target.
        • Click the [Check status] button to see the target's health check status.
      • After the blue/green deployment completion, select whether to delete and terminate the existing Auto Scaling Group.
        • Maintain: the existing Auto Scaling Group won't be terminated even after the completion of the blue/green deployment
        • Delete/Return: after the blue/green deployment is completed, the existing Auto Scaling Group will be terminated, and the servers in the Auto Scaling Group will be automatically terminated as well
      • If you've selected to maintain the existing Auto Scaling Group, select how to handle servers in the existing Auto Scaling Group after completing the blue/green deployment.
        • Maintain: after the blue/green deployment is completed, the servers in the existing Auto Scaling Group will not be terminated, but they will be disconnected from the Load Balancer Target Group
        • Return: after the blue/green deployment is completed, the servers in the existing Auto Scaling Group will be automatically terminated
      Note

      If a Cloud Insight monitoring event is set in Auto Scaling Group, the Auto Scaling Group cannot be returned.

    Therefore, if a Cloud Insight monitoring event is set in an existing Auto Scaling Group in the stage of blue/green deployment, the existing Auto Scaling Group cannot be automatically returned after completing the deployment. If the existing Auto Scaling Group is no longer needed, please manually return it from the respective service.

    :::

    3. Set up deployment file

    Select the deployment file location and build project, and click the [Next] button.
    sourcedeploy-use-scenario_file_ko

    • The options available for deployment file location are Source Build, Object Storage, and Set later.
      • If you've selected Source build, select a build project. If the last build result is a fail or the build output is not uploaded, then the deployment is not performed.
      • If you’ve selected Object Storage, select a deployment file among the buckets in your Object Storage. Only the deployment file compressed as a .zip file can be deployed.
      • If you've selected Set later, you can set up the deployment file when deploying the scenario.

    4. Set up deployment commands

    Set the deployment commands, and then click the [Next] button.

    sourcedeploy-use-scenario_command_ko

    • You can enter multiple commands, which will be executed in the order they were added.
    • Run before deployment: set up the command to run in the server before the deployment, and click the [Add] button.
      • Account for execution: enter the server account to run the command.
      • Command for execution: enter the command to run on the server.
    • File deployment: set up the path to deploy the file, and click the [Add] button.
      • Source file path: enter the file path to deploy.
      • Deployment path: enter the entire path of the server to deploy.
      • If you've set the deployment file location to Set later in 3. Set up deployment file, or there's no last build output from SourceBuild, Set later or No last build output is displayed in File deployment.
    • Run after deployment: set up the command to run in the server after the deployment, and click the [Add] button.
      • Account for execution: enter the server account to run the command.
      • Command for execution: enter the command to run on the server.
    • Click the [Delete] button to delete the added command.
    • Click Use to select it if you'd like to use the rollback feature in case of failed deployment.
      • If the rollback feature is enabled, then the deployment is automatically rolled back to the previous version when it fails.
      • Rollback is performed by running the last successful deployment of the stage.
      • If the previous deployment file does not exist in Object Storage or there is not a last successful deployment, the rollback fails.

    5. Final confirmation

    Check the information for the deployment scenario configured, and then click the [Create deployment scenario] button.

    Create Ncloud Kubernetes Service deployment scenario

    The following describes how to create a deployment scenario with Ncloud Kubernetes Service as the deployment target.

    1. Access NAVER Cloud Platform console.
    2. Click Services > Developer Tools > SourceDeploy in order.
    3. Click a deployment project where you want to create the scenario, and select a deployment stage with Ncloud Kubernetes Service as the deployment target.
    4. Click the [Create] button.
    5. When the deployment scenario creation page appears, proceed with the following steps in order.

    1. Basic settings

    Enter the deployment scenario's name and description, and then click the [Next] button.

    2. Manifest settings

    Click the [Next] button after setting the repository and path where the manifest file is.

    sourcedeploy-use-scenario_manifest_ko

    • Select the Manifest File Repository type and then set the details needed.
      • Set the following items when selecting SourceCommit

        • Repository: select the repository with the manifest file
        • Branch: select the branch of the repository with the manifest file
      • When selecting Github Enterprise Server, click the [Login] button and set the following items

        • Enter one of the following authentication information and click the [Github Enterprise Server Login] button
          • OAuth: enter the Github Enterprise Server URL for importing the repository and enter the Client Id and Client Secret of OAuth App created in the relevant server
          • Personal Access Token: enter the Github Enterprise Server URL for importing the repository and the Personal Access Token created on the relevant server
          • Username/Password: enter the Github Enterprise Server URL for importing the repository and the user account information of the relevant server
          • SSH Key: enter the Git Repository URL of SSH protocol format and SSH Private Key and Passphrase for authentication (enter the Passphrase when it is set in SSH Key)
        Note
        • If communication with the Github Enterprise Server is not possible due to firewall settings, etc., you cannot use the relevant storage type.
        • The Github Enterprise Server URL can be entered with IP and Hostname and the environment must be public.
        • SSH Key login, unlike other logins, can access only the repository of the Git repository URL entered.
        • GitHub Enterprise Server official guide
          • OAuth APP creation guide
            • When setting up an Auth app, set the callback URL suitable to platform and Region. Each URL is as follows:
              • KR(Classic) : https://devtools.ncloud.com/ghes/sourcedeploy
              • KR(VPC) : https://devtools.ncloud.com/ghes/vpc/sourcedeploy
              • SGN(VPC) : https://devtools-sg.ncloud.com/ghes/vpc/sourcedeploy
              • JPN(VPC) : https://devtools-jp.ncloud.com/ghes/vpc/sourcedeploy
          • Personal Access Token creation guide
          • SSH key settings guide
        • Owner: select the owner of the repository with the manifest file
        • Repository: select the repository with the manifest file
        • Branch: select the branch of the repository with the manifest file
    • Enter the manifest file's path to deploy, and click the [Add] button.
      • You can delete the added path by clicking the [Delete] button.
    Note
    • To deploy objects to Ncloud Kubernetes Service cluster, you need to create a manifest file, and the manifest file for the deployment must be stored in the SourceCommit repository.

    • Deployment will be performed according to the creation order of the manifest files.

    • You don't have to create a new manifest file for blue/green or canary updates. New objects required for blue/green or canary are deployed automatically in SourceDeploy.

    • Refer to the following example for manifest creation.
      <example> Previously deployed Kubernetes object (kind: deployment, name: sampleapp, namespace: dev)
      sourcedeploy-use-scenario_manifest

      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: sampleapp
        namespace: dev
      spec:
        replicas: 1
        selector:
          matchLabels:
            app: test
        template:
          metadata:
            labels:
              app: test
          spec:
            containers:
              - image: '${registry_endpoint}/nodejs_dockerbuild:latest'
                imagePullPolicy: Always
                name: sampleapp
                ports:
                  - containerPort: 3000
            imagePullSecrets:
              - name: pub
      

    3. Set up deployment strategy

    Select a deployment strategy, and then click the [Next] button.

    sourcedeploy-use-scenario_strategy2_ko

    • Rolling: new objects are deployed if there are no previously deployed objects
      • When you deploy new objects, rather than updating objects, select Rolling.
    • Blue/Green/Canary: the deployment will fail if there are no previously deployed objects
      • You can't deploy new objects with the blue/green or canary strategy.
      • When deploying with the blue/green strategy, a new version (green) of objects are deployed, so the object names are changed. Even if the object names are changed, you can continue to deploy through SourceDeploy without editing the manifest files. However, if an object with the existing name is created with the manual deployment through kubectl apply using the relevant manifest file, you cannot deploy continuously through SourceDeploy because you cannot specify the object to be updated.
    • If you've selected the Canary deployment strategy, see Canary manual analysis settings or Canary automatic analysis settings depending on the analysis method.

    Canary manual analysis settings

    sourcedeploy-use-scenario_canary_ko

    • Number of baselines and canary pods: enter the number of replicas to be applied to applications that are the baseline or canary version.
      • You can set between 1 and 10.
    • Canary analysis method: select Manual.
      • The user manually analyzes the baseline and canary versions of the application to determine whether to approve or cancel the deployment.
    • Time out: enter the maximum time for the user to determine to proceed or cancel a canary deployment.
      • It can range between 1 and 360 minutes.
      • If the set time is exceeded, the deployment will be automatically canceled, and the baseline and canary applications will be closed.

    Canary automatic analysis settings

    sourcedeploy-use-scenario_canary2_ko

    • Number of baselines and canary pods: enter the number of replicas to be applied to applications that are the baseline or canary version.
      • You can set between 1 and 10.
    • Select Canary analysis method as Automatic.
      • The baseline and canary versions of the application are analyzed automatically to determine whether to deploy according to the analysis result.
    • Prometheus Url: enter the Prometheus endpoint to request the Prometheus collection log.
      • To automatically analyze the application, Prometheus must be installed in the Ncloud Kubernetes Service cluster.
      • Set the endpoint as a public IP so SourceDeploy can access it.
        • Set the Prometheus service as load balancer type.
    • Analysis environment variable: enter the variable for distinguishing between baseline and canary when performing Prometheus analysis.
      • The entered value can be used as ${basecanary} in a PromQL statement.
      • Analysis environment variables are specified as ncp_sourcedeploy_canary="baselineenv"/ncp_sourcedeploy_canary="canaryenv" in each pod label of the baseline and canary each, and you can use the value when analyzing the canary.
    • Create a metric to be evaluated, and select it.
      • For more information about creating metrics, see Create metric.
      • If you want to adjust metric settings, select the metric whose settings you want to change, and then click the [Change settings] button. For more information on each item, see Create metric.
      • To delete a metric, select the metric to delete, and then click the [Delete] button.
      • The sum of the weights of all metrics must be 100.
    • Configure analysis settings.
      • Analysis delay time: enter the time to start the analysis after the baseline or canary version application deployment.
        • The analysis begins after the time entered, and the range available is between 0 and 60 minutes.
      • Analysis time: enter the total time during which an analysis will take place.
        • It can range between 10 and 360 minutes.
      • Analysis cycle: enter the time cycle to perform the analysis.
        • The range available is between 1 and 360 minutes, and can't be greater than the analysis time.
      • Metric collection cycle: enter the cycle to sample the collected metric values during analysis.
        • The range available is between 1 and 360 seconds.
    • Analysis success score: enter the analysis score for all metrics during an analysis.
      • You can set between 1 and 100.
      • Deployment is performed only when the score is satisfied for each analysis step.
      • If the score is not satisfied for an analysis step, then analysis stops immediately and the baseline and canary versions of the application will be ended.
      • This is the sum of all metric scores registered.

    Create metric

    If you've selected your deployment strategy as Canary and analysis method as Automatic in 3. Set up deployment strategy, the following describes how to create a metric.

    1. Click the [Create] button under Metric settings.
    2. Enter the metric information in the metric creation popup window.
      sourcedeploy-use-scenario_metric_ko
      • Enter the name of the metric.
      • Select Success criteria.
        • It's the success criteria for the query result of queries registered. They are analyzed as Success or Failure.
        • There can be n query results, and Success/Failure is determined for each query result.
        • The score of the metric registered is calculated with the (successful query results/all query results) weight.
        • Baseline < Canary: successful if the value of the baseline version is greater than that of the canary version (successful if the value of deviation is negative or equal)
        • Baseline > Canary: successful if the value of the canary version is greater than that of the baseline version (successful if the value of deviation is positive or equal)
      • Select Query type.
        • Default: available when you use the label selector only

          • Metric: select the metric set for the Prometheus URL entered when configuring Canary automatic analysis settings.
          • Filter: enter the desired label conditions.
            <example>
            kubernetes_namespace="dev" , ncp_sourcedeploy_canary="${basecanary}"
            
          • Filter's ${basecanary} is provided as a reserved word to compare and analyze the baseline and canary. When you analyze a query with the reserved word, the query is made by substituting it with an analysis environment variable.
            <example> Metric: requests_total
            Filter: ncp_sourcedeploy_canary=${basecanary}
            Canary: canaryenv, Baseline: baselineenv (see Analysis environment variables in Canary automatic analysis settings)
            Baseline version query requests_total{ncp_sourcedeploy_canary="baselineenv"}
            Canary version query requests_total{ncp_sourcedeploy_canary="canaryenv"}
        • PromQL: user must directly enter PromQL in Query to use it.
          <example> success rate of web application requests PromQL

          sum(requests_total{kubernetes_namespace="dev",custom_status="good", ncp_sourcedeploy_canary="${basecanary}"})/sum(requests_total{kubernetes_namespace="dev", ncp_sourcedeploy_canary="${basecanary}"})
          
      • Weight: enter the metric's weight.
        • You can set between 1 and 100.

    4. Final confirmation

    Check the information for the deployment scenario configured, and then click the [Create deployment scenario] button.

    Build CI/CD environment

    Using SourceDeploy, you can build a CI/CD environment for continuous deployment in a Ncloud Kubernetes Service cluster.

    The following describes how to build a CI/CD environment.

    1. Access NAVER Cloud Platform console.
    2. Click the Services > Containers > Container Registry menus, in that order.
    3. Click the [Create registry] button to create a registry.
    4. Click the Services > Developer Tools > SourceBuild menus, in that order.
    5. Click the [Create build project] button to create a build project.
      • For more information about creating build projects, see SourceBuild user guide.
      • Use the docker image build feature to save the Docker image in the build and Container Registry.
        • At the build settings step, click to select Build Docker image, and set Docker image build settings to Enabled in the build command configuration step.
        • Click to select Set as latest with the image tag.
          • As SourceDeploy automatically changes the latest tag to digest form and attempts to deploy it, continuous deployment can be performed normally, even if the image settings aren't changed.
          • You can use it together with image version control and you can always build the latest image.
    6. Click Services > Developer Tools > SourceDeploy in order.
    7. Click the [Create deployment project] button to create a new deployment project with Ncloud Kubernetes Service as the deployment target.
    8. To create a deployment scenario, see Create Ncloud Kubernetes Service deployment scenario.
    9. Click Services > Developer Tools > SourcePipeline in order.
    10. Click the [Create pipeline] button to create a pipeline.
      • For more information about creating pipelines, see SourcePipeline user guide.
        • You can set SourceBuild projects with the Docker image build and SourceDeploy projects with the Ncloud Kubernetes Service deployment to configure as pipeline to build a CI/CD environment.
        • By clicking Set trigger, you can push SourceCommit while deploying new objects to clusters of Docker image and Ncloud Kubernetes Service to operate your service.
    Note

    The deployment image must be stored in the Container Registry to configure continuous deployment to the Ncloud Kubernetes Service cluster with SourceDeploy.

    Create Object Storage deployment scenario

    The following describes how to create a deployment scenario with Object Storage as the deployment target.

    1. Access NAVER Cloud Platform console.
    2. Click Services > Developer Tools > SourceDeploy in order.
    3. Click a deployment project where you want to create the scenario, and click a deployment stage with Object Storage as the deployment target.
    4. Click the [Create] button.
    5. When the deployment scenario creation page appears, proceed with the following steps in order.

    1. Basic settings

    Enter the deployment scenario's name and description, and then click the [Next] button.

    2. Set up deployment file

    Select the deployment file location and build project, and click the [Next] button.
    sourcedeploy-use-scenario_file2_ko

    • The options available for deployment file location are Source Build, Object Storage, and Set later.
      • If you've selected Source build, select a build project. If the last build result is a fail or the build output is not uploaded, then the deployment is not performed.
      • If you’ve selected Object Storage, select a deployment file among the buckets in your Object Storage. Only the deployment file compressed as a .zip file can be deployed.
      • If you've selected Set later, you can set up the deployment file when deploying the scenario.

    3. Set up deployment path

    Set the file's deployment path, and then click the [Next] button.
    sourcedeploy-use-scenario_route_ko

    • Enter source file path and deployment path, and click the [Add] button.
      • You can enter and add multiple paths.
      • Source file path: enter the file path to deploy.
      • Deployment path: enter the path of the bucket to deploy.
    • In the case of locked buckets, files already uploaded will be locked. It will not be correctly deployed if the same file name (deployment path) is entered.
    • If you've set the deployment file location to Set later in 2. Set up deployment file, or there's no last build output from SourceBuild, Set later or No last build output is displayed.
    • Click the [Delete] button to delete the added path.
    • Click Use to select it if you'd like to use the file backup feature in the predetermined deployment path.
      • If the backup feature is enabled, all files in the predetermined deployment path will be backed up.

    4. Final confirmation

    Check the information for the deployment scenario configured, and then click the [Create deployment scenario] button.

    Change deployment scenario settings

    The following describes how to change deployment scenario settings.

    1. Access NAVER Cloud Platform console.
    2. Click Services > Developer Tools > SourceDeploy in order.
    3. Click the deployment project and deployment stage you want to change scenario settings for, in that order.
    4. Select the scenario to change the settings, and then click the [Change settings] button.
    5. Apply the changes in the deployment scenario settings popup window, and then click the [Apply] button.

    Delete deployment scenario

    The following describes how to delete a deployment scenario.

    1. Access NAVER Cloud Platform console.
    2. Click Services > Developer Tools > SourceDeploy in order.
    3. Click the deployment project and deployment stage you want to delete the scenario from.
    4. Select the scenario to delete, and then click the [Delete] button.
    5. Click the [Delete] button in the deployment scenario deletion popup window.
      • The deployment scenario will be deleted.

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.