tencent cloud

Tencent Kubernetes Engine

Release Notes and Announcements
Release Notes
Announcements
Release Notes
Product Introduction
Overview
Strengths
Architecture
Scenarios
Features
Concepts
Native Kubernetes Terms
Common High-Risk Operations
Regions and Availability Zones
Service Regions and Service Providers
Open Source Components
Purchase Guide
Purchase Instructions
Purchase a TKE General Cluster
Purchasing Native Nodes
Purchasing a Super Node
Getting Started
Beginner’s Guide
Quickly Creating a Standard Cluster
Examples
Container Application Deployment Check List
Cluster Configuration
General Cluster Overview
Cluster Management
Network Management
Storage Management
Node Management
GPU Resource Management
Remote Terminals
Application Configuration
Workload Management
Service and Configuration Management
Component and Application Management
Auto Scaling
Container Login Methods
Observability Configuration
Ops Observability
Cost Insights and Optimization
Scheduler Configuration
Scheduling Component Overview
Resource Utilization Optimization Scheduling
Business Priority Assurance Scheduling
QoS Awareness Scheduling
Security and Stability
TKE Security Group Settings
Identity Authentication and Authorization
Application Security
Multi-cluster Management
Planned Upgrade
Backup Center
Cloud Native Service Guide
Cloud Service for etcd
TMP
TKE Serverless Cluster Guide
TKE Registered Cluster Guide
Use Cases
Cluster
Serverless Cluster
Scheduling
Security
Service Deployment
Network
Release
Logs
Monitoring
OPS
Terraform
DevOps
Auto Scaling
Containerization
Microservice
Cost Management
Hybrid Cloud
AI
Troubleshooting
Disk Full
High Workload
Memory Fragmentation
Cluster DNS Troubleshooting
Cluster kube-proxy Troubleshooting
Cluster API Server Inaccessibility Troubleshooting
Service and Ingress Inaccessibility Troubleshooting
Common Service & Ingress Errors and Solutions
Engel Ingres appears in Connechtin Reverside
CLB Ingress Creation Error
Troubleshooting for Pod Network Inaccessibility
Pod Status Exception and Handling
Authorizing Tencent Cloud OPS Team for Troubleshooting
CLB Loopback
API Documentation
History
Introduction
API Category
Making API Requests
Elastic Cluster APIs
Resource Reserved Coupon APIs
Cluster APIs
Third-party Node APIs
Relevant APIs for Addon
Network APIs
Node APIs
Node Pool APIs
TKE Edge Cluster APIs
Cloud Native Monitoring APIs
Scaling group APIs
Super Node APIs
Other APIs
Data Types
Error Codes
TKE API 2022-05-01
FAQs
TKE General Cluster
TKE Serverless Cluster
About OPS
Hidden Danger Handling
About Services
Image Repositories
About Remote Terminals
Event FAQs
Resource Management
Service Agreement
TKE Service Level Agreement
TKE Serverless Service Level Agreement
Contact Us
Glossary

HPC

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2024-02-01 10:16:40

Overview

Add-on description

HorizontalPodCronscaler (HPC) is an add-on to modify the number of replicas of K8S workload. Used in conjunction with HPC CRD resources, it can support scheduled actions in seconds.

Add-on features

Configures "Pod Range" (when the associated object is HPA) or "Desired Number of Pods" (when the associated object is Deployment or StatefulSet).
Sets an “Exceptional Time”. The smallest granularity of the setting is Day. Multiple exceptional times are allowed.
Specifies whether the scheduled task runs only once.

Kubernetes objects deployed in a cluster

Deploying HPC Add-on in a cluster will deploy the following Kubernetes objects in the cluster:
Kubernetes Object
Type
Required Resources
Namespaces
horizontalpodcronscalers.autoscaling.cloud.tencent.com
CustomResourceDefinition
-
-
hpc-leader-election-role
Role
-
kube-system
hpc-leader-election-rolebinding
RoleBinding
-
kube-system
hpc-manager-role
ClusterRole
-
-
hpc-manager-rolebinding
ClusterRoleBinding
-
-
cronhpa-controller-manager-metrics-service
Service
-
kube-system
hpc-manager
ServiceAccount
-
kube-system
tke-hpc-controller
Deployment
100mCPU, 100Mi/pod
kube-system

Limits

Environment requirements

Note:
If you create a cluster of version 1.12.4 or later, you can use the cluster directly without any parameter changes.
This add-on is supported only by Kubernetes 1.12 or later versions.
The launch parameters of kube-apiserver must be set as follows: --feature-gates=CustomResourceSubresources=true.

Node Requirements

The HPC add-on follows the timezone of the associated server. Please make sure that the /etc/localtime file exists in the node.
By default, two HPC Pods are installed on different nodes. Therefore at least two nodes are required.

Requirement on resource to be controlled

When you create an HPC resource, please make sure that the workload (K8S resource) to be controlled exists in the cluster.

Component Permission Description

Permission Description

The permission of this component is the minimal dependency required for the current feature to operate.

Permission Scenarios

Feature
Involved Object
Involved Operation Permission
Monitoring changes of horizontalpodcronscalers
horizontalpodcronscalers
create/delete/get/list/patch/watch
The replicas of deployments/statefulsets that required modification
deployments/statefulsets
get/list/patch/watch
Modifying the minReplicas/maxReplicas of horizontalpodautoscalers
horizontalpodautoscalers
get/list/patch/watc
Synchronizing the events of HPC scheduled task execution
events
create/patch

Permission Definition

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: hpc-manager-role
rules:
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- apps
resources:
- deployments
verbs:
- get
- list
- patch
- watch
- apiGroups:
- apps
resources:
- statefulsets
verbs:
- get
- list
- patch
- watch
- apiGroups:
- autoscaling
resources:
- horizontalpodautoscalers
verbs:
- get
- list
- patch
- watch
- apiGroups:
- autoscaling.cloud.tencent.com
resources:
- horizontalpodcronscalers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- autoscaling.cloud.tencent.com
resources:
- horizontalpodcronscalers/status
verbs:
- get
- patch
- update
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
resourceNames:
- horizontalpodcronscalers.autoscaling.cloud.tencent.com
verbs:
- get
- list
- delete
- watch

Directions

Installing HPC

1. Log in to the TKE console and select Cluster in the left sidebar.
2. On the “Cluster Management page, click the ID of the target cluster to go to the cluster details page.
3. In the left sidebar, click Add-on Management to go to the Add-on List page.
4. On the "Add-on List" page, click Create, On the "Create Add-on" page that appears, select HPC.
5. Click Done.

Examples

Creating a scheduled task resource that associated with Deployment

The example is as follows:
apiVersion: autoscaling.cloud.tencent.com/v1
kind: HorizontalPodCronscaler
metadata:
name: hpc-deployment
namespace: default
spec:
scaleTarget:
apiVersion: apps/v1
kind: Deployment
name: nginx-deployment
namespace: default
crons:
- name: "scale-down"
excludeDates:
- "* * * 15 11 *"
- "* * * * * 5"
schedule: "30 */1 * * * *"
targetSize: 1
- name: "scale-up"
excludeDates:
- "* * * 15 11 *"
- "* * * * * 5"
schedule: "0 */1 * * * *"
targetSize: 3


Creating a scheduled task resource that associated with StatefulSet

The example is as follows:
apiVersion: autoscaling.cloud.tencent.com/v1
kind: HorizontalPodCronscaler
metadata:
name: hpc-statefulset
namespace: default
spec:
scaleTarget:
apiVersion: apps/v1
kind: Statefulset
name: nginx-statefulset
namespace: default
crons:
- name: "scale-down"
excludeDates:
- "* * * 15 11 *"
schedule: "0 */2 * * * *"
targetSize: 1
- name: "scale-up"
excludeDates:
- "* * * 15 11 *"
schedule: "30 */2 * * * *"
targetSize: 4


Creating a scheduled task resource that associated with HPA

The example is as follows:
apiVersion: autoscaling.cloud.tencent.com/v1
kind: HorizontalPodCronscaler
metadata:
labels:
controller-tools.k8s.io: "1.0"
name: hpc-hpa
spec:
scaleTarget:
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
name: nginx-hpa
namespace: default
crons:
- name: "scale-up"
schedule: "30 */1 * * * *"
minSize: 2
maxSize: 6
- name: "scale-down"
schedule: "0 */1 * * * *"
minSize: 1
maxSize: 5


Scheduled duration settings

Field Name
Required
Value Range
Allowed Special Characters
Seconds
Yes
0 - 59
* / , -
Minutes
Yes
0 - 59
* / , -
Hours
Yes
0 - 23
* / , -
Day of month
Yes
1 - 31
* / , - ?
Month
Yes
1 - 12 or JAN - DEC
* / , -
Day of week
Yes
0 - 6 or SUN - SAT
* / , - ?

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan