-
Notifications
You must be signed in to change notification settings - Fork 0
/
kubernetes-deployment.yaml
71 lines (68 loc) · 1.73 KB
/
kubernetes-deployment.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
## README:
# You must set these enviroment variables:
# - SERVER_STATIC_IP: Server static IP for the Loa Balancer
# - MAX_REVIEWS_PAGE: Max reviews to parse per webpage
# - AWS_ASSOCIATE_TAG: Amazon associate tag
# - AWS_ACCESS_KEY_ID: AWS access key
# - AWS_SECRET_KEY: AWS secret key
#
# Then run:
# $ envsubst < deployment.yaml | kubectl apply -f -
##
#### Deployment
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: how-it-does
spec:
replicas: 1
selector:
matchLabels:
app: how-it-does
template:
metadata:
labels:
app: how-it-does
spec:
containers:
- name: frontend
image: gcr.io/how-it-does/frontend:latest
imagePullPolicy: Always
ports:
- name: http
containerPort: 80
- name: backend
image: gcr.io/how-it-does/backend:latest
imagePullPolicy: Always
ports:
- name: http
containerPort: 8080
env: # NOTE: See Readme on file header
- name: AWS_ACCESS_KEY_ID
value: "$AWS_ACCESS_KEY_ID"
- name: AWS_SECRET_KEY
value: "$AWS_SECRET_KEY"
- name: AWS_ASSOCIATE_TAG
value: "$AWS_ASSOCIATE_TAG"
- name: MAX_REVIEWS_PAGE
value: "$MAX_REVIEWS_PAGE"
---
#### Load Balancer to expose app
apiVersion: v1
kind: Service
metadata:
name: how-it-does
spec:
type: LoadBalancer
loadBalancerIP: "$SERVER_STATIC_IP"
selector:
app: how-it-does
ports:
- protocol: TCP
port: 80
targetPort: 80
name: http-frontend
- protocol: TCP
port: 8080
targetPort: 8080
name: http-backend