diff --git a/chart/kubernetes-cronhpa-controller/Chart.yaml b/chart/kubernetes-cronhpa-controller/Chart.yaml index 752ace676..b4332cd17 100644 --- a/chart/kubernetes-cronhpa-controller/Chart.yaml +++ b/chart/kubernetes-cronhpa-controller/Chart.yaml @@ -3,7 +3,7 @@ description: kubernetes-cronhpa-controller is a kubernetes cron horizontal pod a controller using crontab like scheme. You can use CronHorizontalPodAutoscaler with any kind object defined in kubernetes which support scale subresource(such as Deployment and StatefulSet). -version: 1.3.0 +version: 1.3.1 appVersion: "v1beta1" kubeVersion: ">=1.7.0-0" keywords: diff --git a/chart/kubernetes-cronhpa-controller/templates/cleanup_crds.yaml b/chart/kubernetes-cronhpa-controller/templates/cleanup_crds.yaml index 020d94913..2270e58b5 100644 --- a/chart/kubernetes-cronhpa-controller/templates/cleanup_crds.yaml +++ b/chart/kubernetes-cronhpa-controller/templates/cleanup_crds.yaml @@ -22,7 +22,7 @@ spec: {{- end }} containers: - name: kubectl - image: registry.cn-beijing.aliyuncs.com/acs/hyperkube:v1.12.1 + image: {{ .Values.cleanup.image }} imagePullPolicy: IfNotPresent command: - /bin/sh diff --git a/chart/kubernetes-cronhpa-controller/templates/deploy.yaml b/chart/kubernetes-cronhpa-controller/templates/deploy.yaml index 463eaac2e..946b1c7ff 100644 --- a/chart/kubernetes-cronhpa-controller/templates/deploy.yaml +++ b/chart/kubernetes-cronhpa-controller/templates/deploy.yaml @@ -26,6 +26,7 @@ metadata: app: {{ template "fullname" . }} controller-tools.k8s.io: "1.0" spec: + replicas: {{ .Values.controller.replicas }} selector: matchLabels: app: {{ template "fullname" . }} @@ -38,16 +39,34 @@ spec: spec: containers: - image: {{ .Values.controller.image }} + command: + - /bin/sh + - '-c' + - /root/kubernetes-cronhpa-controller --enableLeaderElection=true env: - name: TZ value: {{ .Values.controller.timezone }} imagePullPolicy: Always name: kubernetes-cronhpa-controller resources: - limits: - cpu: 100m - memory: 100Mi - requests: - cpu: 100m - memory: 100Mi - serviceAccount: kubernetes-cronhpa-controller \ No newline at end of file + {{- toYaml .Values.controller.resources | nindent 10 }} + serviceAccount: kubernetes-cronhpa-controller + {{- with .Values.controller.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.controller.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.controller.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + + {{- with .Values.controller.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml . | nindent 8 }} + {{- end }} + + diff --git a/chart/kubernetes-cronhpa-controller/values.yaml b/chart/kubernetes-cronhpa-controller/values.yaml index 9b5dc4bc1..ee02189b9 100644 --- a/chart/kubernetes-cronhpa-controller/values.yaml +++ b/chart/kubernetes-cronhpa-controller/values.yaml @@ -1,5 +1,6 @@ cleanup: cleanupCustomResource: false + image: registry.cn-beijing.aliyuncs.com/acs/hyperkube:v1.12.1 crds: needcreate: true @@ -7,6 +8,38 @@ crds: controller: image: registry.aliyuncs.com/acs/kubernetes-cronhpa-controller:v1.4.1-b8cd52c-aliyun timezone: "Asia/Shanghai" + replicas: 1 + resources: + limits: + cpu: 100m + memory: 100Mi + requests: + cpu: 100m + memory: 100Mi + nodeSelector: {} + # disktype: ssd + affinity: {} + # nodeAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # nodeSelectorTerms: + # - matchExpressions: + # - key: kubernetes.io/e2e-az-name + # operator: In + # values: + # - e2e-az1 + # - e2e-az2 + tolerations: [] + # - key: "example-key" + # operator: "Exists" + # effect: "NoSchedule" + topologySpreadConstraints: [] + # - maxSkew: 1 + # topologyKey: "kubernetes.io/hostname" + # whenUnsatisfiable: ScheduleAnyway + # labelSelector: + # matchLabels: + # app: cronhpa-kubernetes-cronhpa-controller + # controller-tools.k8s.io: "1.0" global: rbac: