Skip to content

Commit

Permalink
Add permission to Create/Delete ec2:ResourceTag/kubernetes.io/cluster…
Browse files Browse the repository at this point in the history
…/* volumes so that CSI can Delete KCM-created volumes
  • Loading branch information
wongma7 committed Jun 16, 2021
1 parent 74da18e commit 59a0bb1
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 3 deletions.
28 changes: 26 additions & 2 deletions docs/example-iam-policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,30 @@
}
}
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateVolume"
],
"Resource": "*",
"Condition": {
"StringLike": {
"aws:RequestTag/kubernetes.io/cluster/*": "owned"
}
}
},
{
"Effect": "Allow",
"Action": [
"ec2:DeleteVolume"
],
"Resource": "*",
"Condition": {
"StringLike": {
"ec2:ResourceTag/ebs.csi.aws.com/cluster": "true"
}
}
},
{
"Effect": "Allow",
"Action": [
Expand All @@ -89,7 +113,7 @@
"Resource": "*",
"Condition": {
"StringLike": {
"ec2:ResourceTag/ebs.csi.aws.com/cluster": "true"
"ec2:ResourceTag/kubernetes.io/cluster/*": "owned"
}
}
},
Expand Down Expand Up @@ -118,4 +142,4 @@
}
}
]
}
}
26 changes: 25 additions & 1 deletion hack/kops-patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,30 @@ spec:
}
}
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateVolume"
],
"Resource": "*",
"Condition": {
"StringLike": {
"aws:RequestTag/kubernetes.io/cluster/*": "owned"
}
}
},
{
"Effect": "Allow",
"Action": [
"ec2:DeleteVolume"
],
"Resource": "*",
"Condition": {
"StringLike": {
"ec2:ResourceTag/ebs.csi.aws.com/cluster": "true"
}
}
},
{
"Effect": "Allow",
"Action": [
Expand All @@ -90,7 +114,7 @@ spec:
"Resource": "*",
"Condition": {
"StringLike": {
"ec2:ResourceTag/ebs.csi.aws.com/cluster": "true"
"ec2:ResourceTag/kubernetes.io/cluster/*": "owned"
}
}
},
Expand Down

0 comments on commit 59a0bb1

Please sign in to comment.