-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy-gcsbc.yaml
64 lines (62 loc) · 1.33 KB
/
deploy-gcsbc.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
apiVersion: v1
kind: Service
metadata:
name: asset
labels:
app: asset
spec:
type: ClusterIP
ports:
- port: 8080
targetPort: 8080
selector:
app: asset
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: asset
name: asset
spec:
replicas: 1
selector:
matchLabels:
app: asset
template:
metadata:
labels:
app: asset
spec:
nodeSelector:
cloud.google.com/gke-nodepool: work-pool
containers:
- image: "gcr.io/homin-dev/gcsbc:latest"
# args: ["-f", "asset" "/bucket/"]
name: asset
ports:
- containerPort: 8080
env:
- name: BUCKET_NAME
value: homin-dev_asset
volumeMounts:
- name: sa-key
subPath: gcsbc-key.json
mountPath: "/sa-key.json"
readOnly: true
securityContext:
privileged: true
capabilities:
add:
- SYS_ADMIN
lifecycle:
postStart:
exec:
command: ["/bin/sh", "-c", "gcsfuse --implicit-dirs --key-file=/sa-key.json ${BUCKET_NAME} /bucket"]
preStop:
exec:
command: ["/bin/sh", "-c", "fusermount -u ${BUCKET_NAME}"]
volumes:
- name: sa-key
secret:
secretName: sa-key