-
Notifications
You must be signed in to change notification settings - Fork 18
/
example-app.yaml
55 lines (55 loc) · 1.43 KB
/
example-app.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
apiVersion: apps/v1
kind: Deployment
metadata:
name: aws-iam-example
labels:
application: aws-iam-example
version: latest
spec:
replicas: 1
selector:
matchLabels:
application: aws-iam-example
template:
metadata:
labels:
application: aws-iam-example
version: latest
spec:
containers:
- name: aws-iam-example
image: alpine:latest
command: ["sh", "-c"]
env:
# must be set for the AWS SDK/AWS CLI to find the credentials file.
- name: AWS_SHARED_CREDENTIALS_FILE
value: /meta/aws-iam/credentials.process
- name: S3_BUCKET
value: <my-bucket>
args:
- |
apk add -U bash python py-pip py-setuptools ca-certificates;
pip --no-cache-dir install awscli;
while true; do aws s3 ls "s3://${S3_BUCKET}"; sleep 120; done
volumeMounts:
- name: aws-iam-credentials
mountPath: /meta/aws-iam
readOnly: true
resources:
limits:
cpu: 100m
memory: 512Mi
requests:
cpu: 100m
memory: 512Mi
volumes:
- name: aws-iam-credentials
secret:
secretName: my-app-iam-role # name of the AWSIAMRole resource
---
apiVersion: zalando.org/v1
kind: AWSIAMRole
metadata:
name: my-app-iam-role
spec:
roleReference: <my-iam-role-name> # AWS IAM role name or full ARN