forked from rcurrie/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (38 loc) · 1.14 KB
/
Makefile
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
DOCKERHUB_ACCOUNT ?= "robcurrie"
build:
# Build customer docker image
docker build -f Dockerfile -t $(USER)-ubuntu .
debug:
docker run -it --rm \
-v `pwd`:/app \
--user=`id -u`:`id -g` \
--entrypoint /bin/bash \
$(USER)-ubuntu
push:
# Push our containers to dockerhub for running in k8s
docker tag $(USER)-ubuntu $(DOCKERHUB_ACCOUNT)/ubuntu
docker push $(DOCKERHUB_ACCOUNT)/ubuntu
update-secrets:
# Update secrets from our AWS file so we can access S3 in k8s
kubectl delete secrets/$(USER)-aws-credentials
kubectl create secret generic $(USER)-aws-credentials --from-file=../.aws/credentials
run-job:
kubectl create -f job.yml
delete-job:
kubectl delete job/magic-job
create-pod:
# Create a pod
envsubst < pod.yml | kubectl create -f -
kubectl wait --for=condition=Ready pod/$(USER)-pod --timeout=5m
list-pods:
# List all pods
kubectl get pods
delete-pod:
# Delete a pod
kubectl delete pod/$(USER)-pod
shell-pod:
# Open a shell on the pod
kubectl exec -it $(USER)-pod /bin/bash
aws-ls:
# Sample command to access AWS on pod/job
aws --profile $AWS_PROFILE --endpoint $AWS_S3_ENDPOINT s3 ls s3://braingeneers/archive/derived/