Merge pull request #1620 from ese/autoscaler

Provide iam policy for autoscaler addon
This commit is contained in:
Justin Santa Barbara 2017-01-30 22:01:05 -05:00 committed by GitHub
commit 1924f9af25
2 changed files with 15 additions and 0 deletions

View File

@ -14,6 +14,8 @@ spec:
metadata:
labels:
k8s-app: cluster-autoscaler
annotations:
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"dedicated", "value":"master"}]'
spec:
containers:
- name: cluster-autoscaler
@ -40,3 +42,5 @@ spec:
- name: ssl-certs
hostPath:
path: {{SSL_CERT_PATH}}
nodeSelector:
kubernetes.io/role: master

View File

@ -140,6 +140,17 @@ func (b *IAMPolicyBuilder) BuildAWSIAMPolicy() (*IAMPolicy, error) {
Resource: []string{"*"},
})
p.Statement = append(p.Statement, &IAMStatement{
Effect: IAMStatementEffectAllow,
Action: []string{
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeAutoScalingInstances",
"autoscaling:SetDesiredCapacity",
"autoscaling:TerminateInstanceInAutoScalingGroup",
},
Resource: []string{"*"},
})
// Restrict the KMS permissions to only the keys that are being used
kmsKeyIDs := sets.NewString()
for _, e := range b.Cluster.Spec.EtcdClusters {