logo
0
0
Login

Example of Updating TKE Workload Images

badge badge badge

This example demonstrates how to update images for Deployment and StatefulSet workloads in Tencent Cloud Container Service using Cloud Native Build.

Prerequisites

  • Using Tencent Cloud Container Service (TKE) cluster with existing Deployment or StatefulSet resources
  • Target images to be updated
  • Tencent Cloud secret_id and secret_key with proper cluster access permissions. Setup guide: doc/access.md
  • Using Tencent Cloud TKE Image Update Plugin

Parameter Description

  • secret_id Secret ID, details in doc/access.md
  • secret_key Secret Key
  • region Cluster region, format like: ap-nanjing. Details in doc/regions.md
  • cluster_id Cluster ID, format like: cls-m9miwj4u
  • namespace Namespace of the workload, e.g. default
  • workload_kind Workload type. Supports deployment, statefulset
  • workload_name Workload name
  • container_names Container names, separate multiple with commas
  • container_images New container images to update, separate multiple with commas

Execution Results

  • With correct permissions and parameters, the plugin will exit successfully if image update succeeds, otherwise fails. Similar to kubectl set image behavior.
  • After updating images, it will monitor pod rollout status for 10 minutes and print logs for pipeline visibility. This step doesn't affect plugin exit status. Final rollout results can be checked in cluster details.
  • Mechanism: Similar to kubectl set image. This plugin won't verify if target images exist or are valid. It directly updates the image field in workload yaml and lets K8s handle subsequent steps like pod rollout asynchronously.

Quick Usage Example

# Example image update configuration main: push: - stages: - name: Update image using TKE plugin image: tencentcom/deploy-to-tke settings: secret_id: AKID***MpL4 secret_key: mRH1***wu0C region: ap-*** cluster_id: cls-*** namespace: default workload_kind: deployment workload_name: my-***-deployment container_names: container-***-1 container_images: nginx-***:v1

Additional Information

About

更新 TKE 镜像的 showcase