mirror of https://github.com/kubernetes/kops.git
Merge pull request #1620 from ese/autoscaler
Provide iam policy for autoscaler addon
This commit is contained in:
commit
1924f9af25
|
@ -14,6 +14,8 @@ spec:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
k8s-app: cluster-autoscaler
|
k8s-app: cluster-autoscaler
|
||||||
|
annotations:
|
||||||
|
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"dedicated", "value":"master"}]'
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: cluster-autoscaler
|
- name: cluster-autoscaler
|
||||||
|
@ -40,3 +42,5 @@ spec:
|
||||||
- name: ssl-certs
|
- name: ssl-certs
|
||||||
hostPath:
|
hostPath:
|
||||||
path: {{SSL_CERT_PATH}}
|
path: {{SSL_CERT_PATH}}
|
||||||
|
nodeSelector:
|
||||||
|
kubernetes.io/role: master
|
||||||
|
|
|
@ -140,6 +140,17 @@ func (b *IAMPolicyBuilder) BuildAWSIAMPolicy() (*IAMPolicy, error) {
|
||||||
Resource: []string{"*"},
|
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
|
// Restrict the KMS permissions to only the keys that are being used
|
||||||
kmsKeyIDs := sets.NewString()
|
kmsKeyIDs := sets.NewString()
|
||||||
for _, e := range b.Cluster.Spec.EtcdClusters {
|
for _, e := range b.Cluster.Spec.EtcdClusters {
|
||||||
|
|
Loading…
Reference in New Issue