-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployment.yaml
56 lines (56 loc) · 1.98 KB
/
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
kind: Service
apiVersion: v1
metadata:
name: build-trigger
spec:
selector:
app: build-trigger
ports:
- protocol: TCP
port: 80
# Note that a Service can map an incoming port to any targetPort.
# By default the targetPort will be set to the same value as the port field.
# Perhaps more interesting is that targetPort can be a string,
# referring to the name of a port in the backend Pods.
# The actual port number assigned to that name can be different in each backend Pod.
# This offers a lot of flexibility for deploying and evolving your Services.
# For example, you can change the port number that pods expose in the next
# version of your backend software, without breaking clients.
targetPort: 80
# NodePort: Exposes the service on each Node’s IP at a static port (the NodePort).
# A ClusterIP service, to which the NodePort service will route, is automatically created.
# You’ll be able to contact the NodePort service,
# from outside the cluster, by requesting <NodeIP>:<NodePort>.
# nodePort: 30062
# type: NodePort
type: LoadBalancer
---
apiVersion: apps/v1beta1 # for versions before 1.6.0 use extensions/v1beta1
kind: Deployment
metadata:
name: build-trigger-deployment
spec:
replicas: 3
template:
metadata:
labels:
app: build-trigger
spec:
containers:
- name: thingy
image: gcr.io/agosto-k8s-demo/github-agosto-calvinbehling-cloud-trigger:2f78472fdb1167a8af969695831e5c0697a1b477
ports:
- containerPort: 80
imagePullPolicy: IfNotPresent
command:
- bash
- '-c'
- |
COUNTER=0
echo 'start'
while true; do
{ echo -e 'HTTP/1.1 200 OK\r\n'; cat /index.html; } | nc -l 8080
nc -l 80 < /index.html
printf 'serviced %d\n' "$COUNTER"
COUNTER=$(($COUNTER + 1))
done