-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cluster-autoscaler: initial commit (#496)
- Loading branch information
1 parent
01ec810
commit 8bbdb54
Showing
18 changed files
with
1,238 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
description: Scales worker nodes within autoscaling groups. | ||
icon: https://github.com/kubernetes/kubernetes/blob/master/logo/logo.png | ||
name: cluster-autoscaler | ||
version: 7.1.0 | ||
appVersion: 1.17.1 | ||
home: https://github.com/kubernetes/autoscaler | ||
sources: | ||
- https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler | ||
- https://github.com/spotinst/kubernetes-autoscaler/tree/master/cluster-autoscaler | ||
maintainers: | ||
- name: mhrabovcin | ||
email: [email protected] | ||
engine: gotpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
approvers: | ||
- yurrriq | ||
reviewers: | ||
- yurrriq |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{{- if or .Values.autoDiscovery.clusterName .Values.autoscalingGroups -}} | ||
|
||
To verify that cluster-autoscaler has started, run: | ||
|
||
kubectl --namespace={{ .Release.Namespace }} get pods -l "app={{ template "cluster-autoscaler.name" . }},release={{ .Release.Name }}" | ||
|
||
{{- else -}} | ||
|
||
############################################################################## | ||
#### ERROR: You must specify values for either #### | ||
#### autoDiscovery.clusterName or autoscalingGroups[] #### | ||
############################################################################## | ||
|
||
The deployment and pod will not be created and the installation is not functional | ||
See README: | ||
open https://github.com/kubernetes/charts/tree/master/stable/cluster-autoscaler | ||
|
||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "cluster-autoscaler.name" -}} | ||
{{- default (printf "%s-%s" .Values.cloudProvider .Chart.Name) .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
*/}} | ||
{{- define "cluster-autoscaler.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default (printf "%s-%s" .Values.cloudProvider .Chart.Name) .Values.nameOverride -}} | ||
{{- if ne $name .Release.Name -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s" $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "cluster-autoscaler.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Return instance and name labels. | ||
*/}} | ||
{{- define "cluster-autoscaler.instance-name" -}} | ||
app.kubernetes.io/instance: {{ .Release.Name | quote }} | ||
app.kubernetes.io/name: {{ include "cluster-autoscaler.name" . | quote }} | ||
{{- end -}} | ||
|
||
|
||
{{/* | ||
Return labels, including instance and name. | ||
*/}} | ||
{{- define "cluster-autoscaler.labels" -}} | ||
{{ include "cluster-autoscaler.instance-name" . }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service | quote }} | ||
helm.sh/chart: {{ include "cluster-autoscaler.chart" . | quote }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Return the appropriate apiVersion for deployment. | ||
*/}} | ||
{{- define "deployment.apiVersion" -}} | ||
{{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }} | ||
{{- if semverCompare "<1.9-0" $kubeTargetVersion -}} | ||
{{- print "apps/v1beta2" -}} | ||
{{- else -}} | ||
{{- print "apps/v1" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Return the appropriate apiVersion for podsecuritypolicy. | ||
*/}} | ||
{{- define "podsecuritypolicy.apiVersion" -}} | ||
{{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }} | ||
{{- if semverCompare "<1.10-0" $kubeTargetVersion -}} | ||
{{- print "extensions/v1beta1" -}} | ||
{{- else -}} | ||
{{- print "policy/v1beta1" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Return the service account name used by the pod. | ||
*/}} | ||
{{- define "serviceaccount.name" -}} | ||
{{- if and .Values.rbac.create .Values.rbac.serviceAccount.create -}} | ||
{{ include "cluster-autoscaler.fullname" . }} | ||
{{- else -}} | ||
{{ .Values.rbac.serviceAccount.name }} | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
{{- if .Values.rbac.create -}} | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: ClusterRole | ||
metadata: | ||
labels: | ||
{{ include "cluster-autoscaler.labels" . | indent 4 }} | ||
name: {{ template "cluster-autoscaler.fullname" . }} | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- events | ||
- endpoints | ||
verbs: | ||
- create | ||
- patch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods/eviction | ||
verbs: | ||
- create | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods/status | ||
verbs: | ||
- update | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- endpoints | ||
resourceNames: | ||
- cluster-autoscaler | ||
verbs: | ||
- get | ||
- update | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- nodes | ||
verbs: | ||
- watch | ||
- list | ||
- get | ||
- update | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
- services | ||
- replicationcontrollers | ||
- persistentvolumeclaims | ||
- persistentvolumes | ||
verbs: | ||
- watch | ||
- list | ||
- get | ||
- apiGroups: | ||
- batch | ||
resources: | ||
- jobs | ||
- cronjobs | ||
verbs: | ||
- watch | ||
- list | ||
- get | ||
- apiGroups: | ||
- batch | ||
- extensions | ||
resources: | ||
- jobs | ||
verbs: | ||
- get | ||
- list | ||
- patch | ||
- watch | ||
- apiGroups: | ||
- extensions | ||
resources: | ||
- replicasets | ||
- daemonsets | ||
verbs: | ||
- watch | ||
- list | ||
- get | ||
- apiGroups: | ||
- policy | ||
resources: | ||
- poddisruptionbudgets | ||
verbs: | ||
- watch | ||
- list | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- daemonsets | ||
- replicasets | ||
- statefulsets | ||
verbs: | ||
- watch | ||
- list | ||
- get | ||
- apiGroups: | ||
- storage.k8s.io | ||
resources: | ||
- storageclasses | ||
- csinodes | ||
verbs: | ||
- watch | ||
- list | ||
- get | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- coordination.k8s.io | ||
resources: | ||
- leases | ||
verbs: | ||
- create | ||
- apiGroups: | ||
- coordination.k8s.io | ||
resourceNames: | ||
- cluster-autoscaler | ||
resources: | ||
- leases | ||
verbs: | ||
- get | ||
- update | ||
{{- if .Values.rbac.pspEnabled }} | ||
- apiGroups: | ||
- extensions | ||
resources: | ||
- podsecuritypolicies | ||
resourceNames: | ||
- {{ template "cluster-autoscaler.fullname" . }} | ||
verbs: | ||
- use | ||
{{- end -}} | ||
|
||
{{- end -}} |
16 changes: 16 additions & 0 deletions
16
stable/cluster-autoscaler/templates/clusterrolebinding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{{- if .Values.rbac.create -}} | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
labels: | ||
{{ include "cluster-autoscaler.labels" . | indent 4 }} | ||
name: {{ template "cluster-autoscaler.fullname" . }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: {{ template "cluster-autoscaler.fullname" . }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ template "serviceaccount.name" . }} | ||
namespace: {{ .Release.Namespace }} | ||
{{- end -}} |
Oops, something went wrong.