zoukankan      html  css  js  c++  java
  • k8s弹性伸缩

    cornHPA兼容HPA yaml配置
    apiVersion: apps/v1 kind: Deployment metadata: name: python-django labels: app: nginx spec: replicas: 2 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - command: - sh - start.sh image: 'registry-vpc.cn-beijing.aliyuncs.com/aixuexi-jituan/cunchu:latest' imagePullPolicy: Always name: python-django ports: - containerPort: 80 name: http protocol: TCP resources: limits: cpu: 500m memory: 512Mi requests: cpu: 200m memory: 512Mi --- apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler metadata: annotations: autoscaling.alpha.kubernetes.io/metrics: >- [{"type":"Resource","resource":{"name":"memory","targetAverageUtilization":60}}] name: hpa-sample-test namespace: slide spec: maxReplicas: 12 minReplicas: 2 scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: python-django targetCPUUtilizationPercentage: 50
    ---
    apiVersion: autoscaling.alibabacloud.com/v1beta1
    kind: CronHorizontalPodAutoscaler
    metadata:
      labels:
        controller-tools.k8s.io: "1.0"
      namespace: slide
      name: cronhpa-sample-test
    spec:
       scaleTargetRef:
          apiVersion: autoscaling/v1
          kind: HorizontalPodAutoscaler
          name:  hpa-sample-test
       jobs:
       - name: "scale-start"
         schedule: "0 55 15 * * *"
         targetSize: 4
       - name: "scale-end"
         schedule: "0 0 16 * * *"
         targetSize: 2
  • 相关阅读:
    理财技术+人生感悟(转)
    程序员每天每月每年需要做的事(转)
    数据库常用函数(数字函数)
    数据库之常用函数 (日期函数)
    Qt初级-头文件
    Qt初级-成员函数(二)
    Qt初级-成员函数(一)
    Qt初级-Qt格式(二)
    Qt初级-Qt格式(一)
    Qt初级-Qt继承表
  • 原文地址:https://www.cnblogs.com/liruixin/p/14837355.html
Copyright © 2011-2022 走看看