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: docs/getting_started.md
+76-11Lines changed: 76 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,21 +46,11 @@ with the `--env-file` flag. When running as a Systemd service, the environment
46
46
variables are specified in the `/etc/nginx/environment` file. An example of
47
47
the format of the file can be found in the [settings.example](/settings.example)
48
48
file.
49
-
50
-
If you are planning to use docker image on kubernetes cluster, you can use [service account]((https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html)) which can assume a role using [AWS Security Token Service](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html).
51
-
52
-
- Create a new [AWS IAM OIDC Provider](https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html). If you are using AWS EKS Cluster, then the IAM OIDC Provider should already be created as the part of cluster creation. So validate it before you create the new IAM OIDC Provider.
53
-
- Configuring a [Kubernetes service account to assume an IAM role](https://docs.aws.amazon.com/eks/latest/userguide/associate-service-account-role.html)
54
-
-[Annotate the Service Account](https://docs.aws.amazon.com/eks/latest/userguide/cross-account-access.html) using IAM Role create in the above step.
55
-
-[Configure your pods, Deployments, etc to use the Service Account](https://docs.aws.amazon.com/eks/latest/userguide/pod-configuration.html)
56
-
- As soon as the pods/deployments are updated, you will see the couple of Env Variables listed below in the pods.
57
-
`AWS_ROLE_ARN` - Contains IAM Role ARN
58
-
`AWS_WEB_IDENTITY_TOKEN_FILE` - Contains the token which will be used to create temporary credentials using AWS Security Token Service.
59
49
60
50
There are few optional environment variables that can be used.
61
51
62
52
*`HOSTNAME` - (optional) The value will be used for Role Session Name. The default value is nginx-s3-gateway.
63
-
*`STS_ENDPOINT` - (optional) Enter region specific STS Endpoint. The default value is https://sts.amazonaws.com.
53
+
*`STS_ENDPOINT` - (optional) Overrides the STS endpoint to be used in applicable setups. This is not required when running on EKS. See the EKS portion of the guide below for more details.
64
54
65
55
66
56
### Configuring Directory Listing
@@ -278,6 +268,81 @@ modified.
278
268
aws cloudformation delete-stack \
279
269
--stack-name nginx-s3-gateway
280
270
```
271
+
## Running on EKS with IAM roles for service accounts
272
+
273
+
If you are planning to use the container image on an EKS cluster, you can use a [service account]((https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html)) which can assume a role using [AWS Security Token Service](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html).
274
+
275
+
- Create a new [AWS IAM OIDC Provider](https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html). If you are using AWS EKS Cluster, then the IAM OIDC Provider should already be created as the part of cluster creation. So validate it before you create the new IAM OIDC Provider.
276
+
- Configuring a [Kubernetes service account to assume an IAM role](https://docs.aws.amazon.com/eks/latest/userguide/associate-service-account-role.html)
277
+
- [Annotate the Service Account](https://docs.aws.amazon.com/eks/latest/userguide/cross-account-access.html) using IAM Role create in the above step.
278
+
- [Configure your pods, Deployments, etc to use the Service Account](https://docs.aws.amazon.com/eks/latest/userguide/pod-configuration.html)
279
+
- As soon as the pods/deployments are updated, you will see the couple of Env Variables listed below in the pods.
280
+
- `AWS_ROLE_ARN` - Contains IAM Role ARN
281
+
- `AWS_WEB_IDENTITY_TOKEN_FILE` - Contains the token which will be used to create temporary credentials using AWS Security Token Service.
282
+
283
+
The following is a minimal set of resources to deploy:
284
+
```yaml
285
+
apiVersion: v1
286
+
kind: ServiceAccount
287
+
metadata:
288
+
name: nginx-s3-gateway
289
+
annotations:
290
+
eks.amazonaws.com/role-arn: "<role-arn>"
291
+
# See https://docs.aws.amazon.com/eks/latest/userguide/configure-sts-endpoint.html
0 commit comments