-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathservice-with-lifecycle.yaml
46 lines (46 loc) · 1.06 KB
/
service-with-lifecycle.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
apiVersion: v1
kind: Pod
metadata:
name: myservice-pod
annotations:
podDirector: "director1"
podEnvironment: "dev"
podDC: "-dc1"
podWeight: "1"
vaasUser: "admin"
vaasKey: "admin_api_key"
vaasUrl: "http://localhost:80"
spec:
containers:
- name: myservice-with-hooks-container
image: python:2
command: ["python", "-m", "SimpleHTTPServer", "8080"]
env:
- name: KUBERNETES_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: KUBERNETES_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
ports:
- containerPort: 8080
volumeMounts:
- name: hooks
mountPath: /hooks
lifecycle:
postStart:
exec:
command: ["/bin/sh", "-c", "/hooks/vaas-hook --debug register"]
preStop:
exec:
command: ["/bin/sh", "-c", "/hooks/vaas-hook --debug deregister"]
- name: vaas-dev-container
image: allegro/vaas
ports:
- containerPort: 80
volumes:
- name: hooks
hostPath:
path: /hooks