Created
April 30, 2020 15:00
-
-
Save electrofelix/b450c4d694aa3d73424638a0c7e56007 to your computer and use it in GitHub Desktop.
tilt ci never exits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: dynamodb-local | |
labels: | |
app: dynamodb-local | |
spec: | |
selector: | |
matchLabels: | |
app: dynamodb-local | |
template: | |
metadata: | |
labels: | |
app: dynamodb-local | |
spec: | |
terminationGracePeriodSeconds: 30 | |
nodeSelector: | |
kubernetes.io/os: linux | |
containers: | |
- name: dynamodb-local | |
image: amazon/dynamodb-local:1.12.0 | |
imagePullPolicy: IfNotPresent | |
args: | |
- -XX:+UseContainerSupport | |
- -jar | |
- DynamoDBLocal.jar | |
- -sharedDb | |
- -dbPath | |
- /data | |
env: | |
- name: POD_NAME | |
valueFrom: | |
fieldRef: | |
fieldPath: metadata.name | |
- name: POD_NAMESPACE | |
valueFrom: | |
fieldRef: | |
fieldPath: metadata.namespace | |
volumeMounts: | |
- name: dynamodb-dbpath | |
mountPath: /data | |
ports: | |
- containerPort: 8000 | |
resources: | |
limits: | |
memory: 300Mi | |
requests: | |
memory: 150Mi | |
volumes: | |
- name: dynamodb-dbpath | |
emptyDir: {} | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: dynamodb-local | |
labels: | |
app: dynamodb-local | |
spec: | |
ports: | |
- name: http | |
protocol: TCP | |
port: 8000 | |
targetPort: 8000 | |
selector: | |
app: dynamodb-local | |
--- | |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: dynamodb-create-table-script | |
labels: | |
app: dynamodb-local | |
data: | |
bootstrap.sh: |- | |
#! /bin/sh | |
DYN_URL="http://dynamodb-local:8000" | |
aws --endpoint-url $DYN_URL dynamodb list-tables --region us-west-2 | grep -q "example" && exit 0 | |
aws --endpoint-url $DYN_URL dynamodb create-table \ | |
--table-name example \ | |
--region us-west-2 \ | |
--attribute-definitions AttributeName=ID,AttributeType=S AttributeName=skey,AttributeType=S \ | |
--key-schema AttributeName=ID,KeyType=HASH AttributeName=skey,KeyType=RANGE \ | |
--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 | |
exit 0 | |
--- | |
apiVersion: batch/v1 | |
kind: Job | |
metadata: | |
name: dynamodb-create-table | |
labels: | |
app: dynamodb-local | |
spec: | |
template: | |
metadata: | |
labels: | |
app: dynamodb-local | |
spec: | |
restartPolicy: Never | |
containers: | |
- name: bootstrap-tables | |
image: amazon/aws-cli:2.0.10 | |
imagePullPolicy: IfNotPresent | |
command: ["sh"] | |
args: ["/tmp/bootstrap.sh"] | |
env: | |
- name: AWS_ACCESS_KEY_ID | |
value: bogus | |
- name: AWS_SECRET_ACCESS_KEY | |
value: bogus | |
volumeMounts: | |
- name: bootstrap-script | |
mountPath: /tmp | |
volumes: | |
- name: bootstrap-script | |
configMap: | |
name: dynamodb-create-table-script |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
k8s_yaml('dynamodb.yaml') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment