-
Notifications
You must be signed in to change notification settings - Fork 0
/
roulette-deployment.yaml
203 lines (203 loc) · 4.97 KB
/
roulette-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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
apiVersion: v1
kind: Service
metadata:
name: roulette-mongodb
labels:
name: roulette-mongodb
spec:
ports:
- port: 27017
targetPort: 27017
clusterIP: None
selector:
role: roulette-mongodb
---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: roulette-mongodb
spec:
serviceName: "roulette-mongodb"
updateStrategy:
type: RollingUpdate
replicas: 3
template:
metadata:
labels:
role: "roulette-mongodb"
environment: development
spec:
terminationGracePeriodSeconds: 10
containers:
- name: roulette-mongodb
image: mongo
command:
- mongod
- "--replSet"
- rs0
- "--smallfiles"
- "--noprealloc"
- "--bind_ip_all"
ports:
- containerPort: 27017
name: mongo
protocol: TCP
volumeMounts:
- name: mongo-persistent-storage
mountPath: /data/db
- name: proposal-mongo-sidecar
image: austbot/mongo-k8s-sidecar
env:
- name: KUBERNETES_MONGO_SERVICE_NAME
value: "roulette-mongodb"
- name: MONGO_SIDECAR_POD_LABELS
value: "role=roulette-mongodb,environment=development"
volumeClaimTemplates:
- metadata:
name: mongo-persistent-storage
#annotations:
# volume.beta.kubernetes.io/storage-class: aws-efs
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 8Gi
---
apiVersion: v1
kind: ConfigMap
metadata:
name: roulette-config
namespace: default
data:
api-diagram.json: |
[
{
"name": "/configuration/ingress",
"type": "put",
"function": "org.augugrumi.roulette.routes.DefaultIngressPutRoute"
},
{
"name": "/configuration/egress",
"type": "put",
"function": "org.augugrumi.roulette.routes.DefaultEgressPutRoute"
},
{
"name": "/routes/:spi",
"type": "post",
"function": "org.augugrumi.roulette.routes.RouteAdderRoute"
},
{
"name": "/routes/:spi",
"type": "get",
"function": "org.augugrumi.roulette.routes.RouteGetterRoute"
},
{
"name": "/routes/:spi/:si",
"type": "get",
"function": "org.augugrumi.roulette.routes.VnfNameGetterRoute"
},
{
"name": "/routes/:spi",
"type": "delete",
"function": "org.augugrumi.roulette.routes.RouteDeleterRoute"
},
{
"name": "/routes/:spi",
"type": "put",
"function": "org.augugrumi.roulette.routes.RouteUpdaterRoute"
},
{
"name": "/endpoints/",
"type": "put",
"function": "org.augugrumi.roulette.routes.EndpointPutRoute"
},
{
"name": "/endpoints/ingress/:ipSrc/:ipDst/:portSrc/:portDst/:idSfc/:protocol",
"type": "put",
"function": "org.augugrumi.roulette.routes.EndpointEgressUpdateRoute"
},
{
"name": "/endpoints/egress/:ipSrc/:ipDst/:portSrc/:portDst/:idSfc/:protocol",
"type": "put",
"function": "org.augugrumi.roulette.routes.EndpointIngressUpdateRoute"
},
{
"name": "/endpoints/ingress/:ipSrc/:ipDst/:portSrc/:portDst/:idSfc/:protocol",
"type": "get",
"function": "org.augugrumi.roulette.routes.EndpointIngressGetRoute"
},
{
"name": "/endpoints/egress/:ipSrc/:ipDst/:portSrc/:portDst/:idSfc/:protocol",
"type": "get",
"function": "org.augugrumi.roulette.routes.EndpointEgressGetRoute"
},
{
"name": "/endpoints/:_id",
"type": "get",
"function": "org.augugrumi.roulette.routes.EndpointGetRoute"
},
{
"name": "/endpoints/:_id",
"type": "delete",
"function": "org.augugrumi.roulette.routes.EndpointDeleteRoute"
}
]
db-definition.json: |
{
"port": 27017,
"address": "roulette-mongodb",
"username": "augugrumi",
"password": "ubuntu"
}
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: roulette
namespace: default
labels:
k8s-app: roulette
spec:
replicas: 1
selector:
matchLabels:
k8s-app: roulette
template:
metadata:
labels:
k8s-app: roulette
name: roulette
spec:
containers:
- name: roulette
image: augugrumi/roulette
imagePullPolicy: Always
ports:
- name: http
containerPort: 80
volumeMounts:
- name: roulette-config
mountPath: /config
env:
- name: ROULETTE_API_CONFIG
value: /config/api-diagram.json
- name: ROULETTE_DATABASE_JSON_CONFIG
value: /config/db-definition.json
volumes:
- name: roulette-config
configMap:
name: roulette-config
---
kind: Service
apiVersion: v1
metadata:
name: roulette-service
namespace: default
spec:
selector:
k8s-app: roulette
ports:
- protocol: TCP
port: 80
name: web
type: NodePort