-
Notifications
You must be signed in to change notification settings - Fork 0
/
promotion.yaml
95 lines (94 loc) · 2.5 KB
/
promotion.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
apiVersion: apps/v1
kind: Deployment
metadata:
name: promotion
spec:
selector:
matchLabels:
app: promotion
replicas: 1
template:
metadata:
labels:
app: promotion
spec:
initContainers:
- name: wait-for-postgres
image: busybox
env:
- name: KONG_PG_HOST
value: postgres
- name: KONG_PG_PORT
value: "5432"
command: [ "/bin/sh", "-c", "until nc -zv $KONG_PG_HOST $KONG_PG_PORT -w1; do echo 'waiting for db'; sleep 1; done" ]
- name: setup-network
image: istio/proxy_init:1.0.4
# TODO: This should be `-b *` and not `-b 8080`, the former results
# in DB connection failure in Kong.
args: [ "-p", "8000", "-u", "1337", "-m", "REDIRECT", "-i", "*", "-b", "8091"]
securityContext:
capabilities:
add:
- NET_ADMIN
containers:
- name: promotion
image: mashape/kong-mesh-demo:promotion
- name: kong
image: mashape/kong-enterprise:mesh
securityContext:
capabilities:
add:
- NET_RAW
env:
- name: KONG_LOG_LEVEL
value: debug
- name: KONG_ORIGINS
value: "http://shop:8090=http://127.0.0.1:8090"
- name: KONG_STREAM_LISTEN
value: "0.0.0.0:7000 transparent"
- name: KONG_PROXY_LISTEN
value: "0.0.0.0:8000, 0.0.0.0:8443 ssl"
- name: KONG_ADMIN_LISTEN
value: "off"
- name: KONG_PG_PASSWORD
value: kong
- name: KONG_PG_HOST
value: postgres
- name: KONG_PROXY_ACCESS_LOG
value: "/dev/stdout"
- name: KONG_ADMIN_ACCESS_LOG
value: "/dev/stdout"
- name: KONG_PROXY_ERROR_LOG
value: "/dev/stderr"
- name: KONG_ADMIN_ERROR_LOG
value: "/dev/stderr"
ports:
- name: kongstream
containerPort: 7000
protocol: TCP
- name: kongproxy
containerPort: 8000
protocol: TCP
- name: kongproxyssl
containerPort: 8443
protocol: TCP
- name: kongadmin
containerPort: 8001
protocol: TCP
- name: kongadminssl
containerPort: 8443
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: promotion
spec:
type: NodePort
ports:
- name: promotion
port: 8090
targetPort: 8090
protocol: TCP
selector:
app: promotion