-
Notifications
You must be signed in to change notification settings - Fork 6
/
example-coord.template.yaml
151 lines (145 loc) · 4.33 KB
/
example-coord.template.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
---
apiVersion: v1
kind: ConfigMap
metadata:
name: datamon-fuse-local-config-$SIDECAR_TAG
labels:
app: datamon-coord-fuse-demo
data:
# the buckets configuration (context) for datamon
datamon.yaml: |
config: datamon-config-test-sdjfhga
context: datamon-sidecar-test
---
apiVersion: v1
kind: ConfigMap
metadata:
name: datamon-fuse-params-$SIDECAR_TAG
labels:
app: datamon-coord-fuse-demo
data:
fuse-params.yaml: |
globalOpts:
sleepInsteadOfExit: true
coordPoint: /tmp/coord
# The ones below are no more used (see datamon.yaml above) but kept because of sidecar_param requirements
configBucketName: datamon-config-test-sdjfhga
contextName: datamon-sidecar-test
bundles:
- name: src
srcPath: /tmp/mount
srcRepo: ransom-datamon-test-repo
srcLabel: testlabel
srcBundle: ""
destPath: ""
destRepo: ""
destMessage: ""
destLabel: ""
destBundleID: ""
- name: dest
srcPath: ""
srcRepo: ""
srcLabel: ""
srcBundle: ""
destPath: /tmp/upload
destRepo: ransom-datamon-test-repo
destMessage: result of container coordination demo
destLabel: coordemo
destBundleID: /tmp/bundleid.txt
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: $DEPLOYMENT_NAME
namespace: $NS
spec:
selector:
matchLabels:
app: datamon-coord-fuse-demo
instance: $SIDECAR_TAG
replicas: 1
template:
metadata:
labels:
app: datamon-coord-fuse-demo
instance: $SIDECAR_TAG
spec:
initContainers:
- name: init-application-wrap
image: "gcr.io/onec-co/datamon-wrapper:$SIDECAR_TAG"
imagePullPolicy: "$PULL_POLICY"
command: ["sh", "-c", "cp -a /.scripts/* /scripts"]
volumeMounts:
- mountPath: /scripts
name: application-wrapper
containers:
- name: demo-app
image: "gcr.io/onec-co/datamon-fuse-demo-coord-app:$SIDECAR_TAG"
imagePullPolicy: "$PULL_POLICY"
command: ["/scripts/wrap_application.sh"]
args:
- "-s" # this flag is for debug only: it makes the wrapper sleep forever
- "-c" # specifies the location for coordination messages
- "/tmp/coord"
- "-b" # specifies the coordination type used (fuse|postgres), each type following a specific coordination scheme
- "fuse"
- "--"
- "mock_application.sh"
- "/tmp/mount" # volume where the database is mounted
- "/tmp/upload" # staging area to upload
volumeMounts:
- mountPath: /scripts
name: application-wrapper
- mountPath: /tmp/coord
name: container-coord
- mountPath: /tmp/upload
name: upload-source
- mountPath: /tmp/mount
name: fuse-mountpoint
mountPropagation: "HostToContainer"
- name: datamon-sidecar
image: "gcr.io/onec-co/datamon-fuse-sidecar:$SIDECAR_TAG"
imagePullPolicy: "$PULL_POLICY"
command: ["wrap_datamon.sh"]
args: []
securityContext:
privileged: true
volumeMounts:
- mountPath: /tmp/upload
name: upload-source
- mountPath: /tmp/coord
name: container-coord
- mountPath: /tmp/mount
name: fuse-mountpoint
mountPropagation: "Bidirectional"
- mountPath: /tmp/gac
name: google-application-credentials
- mountPath: /config
name: fuse-params
- mountPath: /home/developer/.datamon2
name: datamon-config
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /tmp/gac/google-application-credentials.json
- name: dm_fuse_params
value: /config/fuse-params.yaml
volumes:
- name: fuse-mountpoint
emptyDir: {}
- name: application-wrapper
emptyDir: {}
- name: container-coord
emptyDir: {}
- name: upload-source
emptyDir: {}
- name: fuse-params
configMap:
name: datamon-fuse-params-$SIDECAR_TAG
defaultMode: 0555
- name: datamon-config
configMap:
name: datamon-fuse-local-config-$SIDECAR_TAG
defaultMode: 0555
- name: google-application-credentials
secret:
secretName: google-application-credentials