You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/configuration/acme/dns01/route53.md
+129-4Lines changed: 129 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -188,11 +188,18 @@ Note that, as mentioned above, the pod is using `arn:aws:iam::XXXXXXXXXXX:role/c
188
188
189
189
While [`kiam`](https://github.com/uswitch/kiam) / [`kube2iam`](https://github.com/jtblin/kube2iam) work directly with cert-manager, some special attention is needed for using the [IAM Roles for Service Accounts](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html) feature available on EKS.
190
190
191
-
### OIDC provider
191
+
This feature uses Kubernetes `ServiceAccount` tokens to authenticate with AWS using the [API_AssumeRoleWithWebIdentity](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html).
192
192
193
-
First follow the AWS documentation [Enabling IAM roles for service accounts on your cluster](https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html) to ensure that the OIDC provider for the EKS cluster is enabled. The OIDC information is needed to create the trust relationship for the cert-manager role below.
193
+
> **Note**: For using IRSA with cert-manager you must first enable the feature for your cluster. You can do this by
194
+
> following the [official documentation(https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html).
194
195
195
-
### IAM role trust policy
196
+
Because `ServiceAccount` tokens are used to authenticate there are two modes of operation, you can either use cert-manager's own `ServiceAccount` to authenticate or you can reference your own `ServiceAccount` within your `Issuer`/`ClusterIssuer` config. Each option is described below.
197
+
198
+
### Using the cert-manager ServiceAccount
199
+
200
+
In this configuration an IAM role is mapped to the cert-manager `ServiceAccount` allowing it to authenticate with AWS. The IAM role you map to the `ServiceAccount` will need permissions on any and all Route53 zones cert-manager will be using.
201
+
202
+
#### IAM role trust policy
196
203
197
204
The cert-manager role needs the following trust relationship attached to the role in order to use the IRSA method. Replace the following:
198
205
@@ -224,7 +231,7 @@ The cert-manager role needs the following trust relationship attached to the rol
224
231
225
232
**Note:** If you're following the Cross Account example above, this trust policy is attached to the cert-manager role in Account X with ARN `arn:aws:iam::XXXXXXXXXXX:role/cert-manager`. The permissions policy is the same as above.
226
233
227
-
### Service annotation
234
+
#### Service annotation
228
235
229
236
Annotate the `ServiceAccount` created by cert-manager:
230
237
@@ -257,3 +264,121 @@ securityContext:
257
264
```
258
265
259
266
**Note:** If you're following the Cross Account example above, modify the `ClusterIssuer` in the same way as above with the role from Account Y.
267
+
268
+
### Referencing your own ServiceAccount within Issuer/ClusterIssuer config
269
+
270
+
In this configuration you can reference your own `ServiceAccounts` within your `Issuer`/`ClusterIssuer` and cert-manager will issue itself temporary credentials using these `ServiceAccounts`. Because each issuer can reference a different `ServiceAccount` you can lock down permissions much more, with each `ServiceAccount` mapped to an IAM role that only has permission on the zones it needs for that particular issuer.
271
+
272
+
273
+
#### Creating a ServiceAccount
274
+
275
+
In order to reference a `ServiceAccount` it must first exist. Unlike normal IRSA the `eks.amazonaws.com/role-arn` annotation is not required, however you may wish to set it as a reference.
276
+
277
+
```yaml
278
+
apiVersion: v1
279
+
kind: ServiceAccount
280
+
metadata:
281
+
name: <service-account-name>
282
+
annotation:
283
+
eks.amazonaws.com/role-arn: <iam-role-arn>
284
+
```
285
+
286
+
#### IAM role trust policy
287
+
288
+
For every `ServiceAccount` you want to use for AWS authentication you must first set up a trust policy. Replace the following:
289
+
290
+
- `<aws-account-id>`with the AWS account ID of the EKS cluster.
291
+
- `<aws-region>`with the region where the EKS cluster is located.
292
+
- `<eks-hash>` with the hash in the EKS API URL; this will be a random 32 character hex string (example: `45DABD88EEE3A227AF0FA468BE4EF0B5`)
293
+
- `<namespace>`with the namespace of the `ServiceAccount` object.
294
+
- `<service-account-name>`with the name of the `ServiceAccount` object.
**Note:** If you're following the Cross Account example above, this trust policy is attached to the cert-manager role in Account X with ARN `arn:aws:iam::XXXXXXXXXXX:role/cert-manager`. The permissions policy is the same as above.
317
+
318
+
#### RBAC
319
+
320
+
In order to allow cert-manager to issue a token using your `ServiceAccount` you must deploy some RBAC to the cluster. Replace the following:
321
+
322
+
- `<service-account-name>`name of the `ServiceAccount` object.
323
+
- `<service-account-namespace>`namespace of the `ServiceAccount` object.
324
+
- `<cert-manager-service-account-name>`name of cert-managers `ServiceAccount` object, as created during cert-manager installation.
325
+
- `<cert-manager-namespace>`namespace that cert-manager is deployed into.
0 commit comments