Kubernetes 对象名称 | 类型 | 默认占用资源 | 所属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/pod、100Mi/pod | kube-system |
--feature-gates=CustomResourceSubresources=true
/etc/localtime
文件。功能 | 涉及对象 | 涉及操作权限 |
监听 horizontalpodcronscalers 的变动 | horizontalpodcronscalers | create/delete/get/list/patch/watch |
需要修改 deployments/statefulsets 的 replicas | deployments/statefulsets | get/list/patch/watch |
修改 horizontalpodautoscalers 的 minReplicas/maxReplicas | horizontalpodautoscalers | get/list/patch/watc |
同步 HPC 定时任务执行的 events | events | create/patch |
apiVersion: rbac.authorization.k8s.io/v1kind: ClusterRolemetadata:creationTimestamp: nullname: hpc-manager-rolerules:- apiGroups:- ""resources:- eventsverbs:- create- patch- apiGroups:- appsresources:- deploymentsverbs:- get- list- patch- watch- apiGroups:- appsresources:- statefulsetsverbs:- get- list- patch- watch- apiGroups:- autoscalingresources:- horizontalpodautoscalersverbs:- get- list- patch- watch- apiGroups:- autoscaling.cloud.tencent.comresources:- horizontalpodcronscalersverbs:- create- delete- get- list- patch- update- watch- apiGroups:- autoscaling.cloud.tencent.comresources:- horizontalpodcronscalers/statusverbs:- get- patch- update- apiGroups:- apiextensions.k8s.ioresources:- customresourcedefinitionsresourceNames:- horizontalpodcronscalers.autoscaling.cloud.tencent.comverbs:- get- list- delete- watch
apiVersion: autoscaling.cloud.tencent.com/v1kind: HorizontalPodCronscalermetadata:name: hpc-deploymentnamespace: defaultspec:scaleTarget:apiVersion: apps/v1kind: Deploymentname: nginx-deploymentnamespace: defaultcrons:- name: "scale-down"excludeDates:- "* * * 15 11 *"- "* * * * * 5"schedule: "30 */1 * * * *"targetSize: 1- name: "scale-up"excludeDates:- "* * * 15 11 *"- "* * * * * 5"schedule: "0 */1 * * * *"targetSize: 3
apiVersion: autoscaling.cloud.tencent.com/v1kind: HorizontalPodCronscalermetadata:name: hpc-statefulsetnamespace: defaultspec:scaleTarget:apiVersion: apps/v1kind: Statefulsetname: nginx-statefulsetnamespace: defaultcrons:- name: "scale-down"excludeDates:- "* * * 15 11 *"schedule: "0 */2 * * * *"targetSize: 1- name: "scale-up"excludeDates:- "* * * 15 11 *"schedule: "30 */2 * * * *"targetSize: 4
apiVersion: autoscaling.cloud.tencent.com/v1kind: HorizontalPodCronscalermetadata:labels:controller-tools.k8s.io: "1.0"name: hpc-hpaspec:scaleTarget:apiVersion: autoscaling/v1kind: HorizontalPodAutoscalername: nginx-hpanamespace: defaultcrons:- name: "scale-up"schedule: "30 */1 * * * *"minSize: 2maxSize: 6- name: "scale-down"schedule: "0 */1 * * * *"minSize: 1maxSize: 5
字段名称 | 是否必选 | 允许值范围 | 允许的特殊字符 |
Seconds | 是 | 0 - 59 | * / , - |
Minutes | 是 | 0 - 59 | * / , - |
Hours | 是 | 0 - 23 | * / , - |
Day of month | 是 | 1 - 31 | * / , - ? |
Month | 是 | 1 - 12 或 JAN - DEC | * / , - |
Day of week | 是 | 0 - 6 或 SUN - SAT | * / , - ? |
本页内容是否解决了您的问题?