logo
0
0
WeChat Login

Tencent Cloud Camp Deployment

badge badge

Scenario-based encapsulation of Tencent Cloud Application Management Platform API to implement instance image updates.

Parameter Description

  • secret_id Secret ID
  • secret_key Secret Key
  • action Operation name,
    • ModifyComponentImages: Batch update instance images
    • DeleteInstance: Destroy instance Use with caution
  • instance_url Instance URL, if specified, the following parameters project_id, application_id, instance_id, environment_name will not be used, instead they will be parsed from the URL
  • project_id Project ID
  • application_id Application ID
  • instance_id Instance ID
  • environment_name Environment name
  • result_path If specified, the result will be output as a JSON format string to the specified file

The following parameters are required for ModifyComponentImages

  • container_names Container name array, in the same order as container_images
  • container_images Container image array, in the same order as container_names
  • max_surge Maximum number of Pods allowed to exceed the desired scale in each workload during upgrade, default 0
  • max_unavailable Maximum number of unavailable Pods allowed in each workload during upgrade, default 1
  • in_place_update_flag Whether to update in place, default is true

Examples

Using with Docker

docker run --rm -v $(pwd):$(pwd) -w $(pwd) \
    -e PLUGIN_SECRET_ID="xxx" \
    -e PLUGIN_SECRET_KEY="xxx" \
    -e PLUGIN_ACTION="ModifyComponentImages" \
    -e PLUGIN_PROJECT_ID="prj-xxx" \
    -e PLUGIN_ENVIRONMENT_NAME="development" \
    -e PLUGIN_APPLICATION_ID="app-xxx" \
    -e PLUGIN_INSTANCE_ID="tad-xxx" \
    -e PLUGIN_CONTAINER_NAMES="xxx-container-1,xxx-container-2" \
    -e PLUGIN_CONTAINER_IMAGES="xxx-demo:v2,xxx-demo:t2" \
    tencentcom/tencentyun-camp-deploy

Using with Cloud Native Build

Configure a secret file your_secrets.yaml in the secrets (private repository) with the following content:

# your_secrets.yml
SECRET_ID: xxxx
SECRET_KEY: xxx

Configure .cnb.yml to import environment variables from the above file, with the following content:

# Update example image, without using Instance URL
main:
  push:
    - imports: https://xxx/your_secrets.yml
      stages:
      - name: camp deploy
        image: tencentcom/tencentyun-camp-deploy
        settings:
          secret_id: $SECRET_ID
          secret_key: $SECRET_KEY
          action: ModifyComponentImages
          project_id: prj-xxx
          environment_name: development
          application_id: app-xxx
          instance_id: tad-xxx
          container_names:
            - xxx-container-1
            - xxx-container-2
          container_images: 
            - xxx-demo:v1
            - xxx-demo:t1
# Update example image, using Instance URL
main:
  push:
    - imports: https://xxx/your_secrets.yml
      stages:
      - name: camp deploy
        image: tencentcom/tencentyun-camp-deploy
        settings:
          secret_id: $SECRET_ID
          secret_key: $SECRET_KEY
          action: ModifyComponentImages
          instance_url: https://console.cloud.tencent.com/camp/app/instance/info?appId=app-xxx&projectId=prj-xxx&instanceId=tad-xxx&envName=development
          container_names:
            - xxx-container-1
            - xxx-container-2
          container_images: 
            - xxx-demo:v1
            - xxx-demo:t1
# Destroy example instance, using Instance URL
main:
  push:
    - imports: https://xxx/your_secrets.yml
      stages:
      - name: camp deploy
        image: tencentcom/tencentyun-camp-deploy
        settings:
          secret_id: $SECRET_ID
          secret_key: $SECRET_KEY
          action: DeleteInstance
          instance_url: https://console.cloud.tencent.com/camp/app/instance/info?appId=app-xxx&projectId=prj-xxx&instanceId=tad-xxx&envName=development

About

camp应用管理部署

904.00 KiB
0 forks0 stars1 branches0 TagREADMEMIT license
Language
Markdown47.9%
JavaScript46.7%
License4%
Dockerfile1.2%
Others0.2%