forked from ceph/ceph-container
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh.in
executable file
·196 lines (187 loc) · 3.71 KB
/
entrypoint.sh.in
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
#!/bin/bash
set -e
export LC_ALL=C
source variables_entrypoint.sh
source common_functions.sh
source docker_exec.sh
source debug.sh
###########################
# CONFIGURATION GENERATOR #
###########################
# Load in the bootstrapping routines
# based on the data store
case "$KV_TYPE" in
etcd)
# TAG: kv_type_etcd
source /config.kv.etcd.sh
;;
k8s|kubernetes)
# TAG: kv_type_k8s
source /config.k8s.sh
;;
*)
source /config.static.sh
;;
esac
###############
# CEPH_DAEMON #
###############
# Normalize DAEMON to lowercase
CEPH_DAEMON=$(to_lowercase "${CEPH_DAEMON}")
create_mandatory_directories
# If we are given a valid first argument, set the
# CEPH_DAEMON variable from it
case "$CEPH_DAEMON" in
populate_kvstore)
# TAG: populate_kvstore
source populate_kv.sh
populate_kv
;;
mon)
# TAG: mon
source start_mon.sh
start_mon
;;
osd)
# TAG: osd
source start_osd.sh
start_osd
;;
osd_directory)
# TAG: osd_directory
source start_osd.sh
OSD_TYPE="directory"
start_osd
;;
osd_directory_single)
# TAG: osd_directory_single
source start_osd.sh
OSD_TYPE="directory_single"
start_osd
;;
osd_ceph_disk)
# TAG: osd_ceph_disk
source start_osd.sh
OSD_TYPE="disk"
start_osd
;;
osd_ceph_disk_prepare)
# TAG: osd_ceph_disk_prepare
source start_osd.sh
OSD_TYPE="prepare"
start_osd
;;
osd_ceph_disk_activate)
# TAG: osd_ceph_disk_activate
source start_osd.sh
OSD_TYPE="activate"
start_osd
;;
osd_ceph_activate_journal)
# TAG: osd_ceph_activate_journal
source start_osd.sh
OSD_TYPE="activate_journal"
start_osd
;;
osd_ceph_volume_activate)
ami_privileged
# shellcheck disable=SC1091
# TAG: osd_ceph_volume_activate
source osd_volume_activate.sh
osd_volume_activate
;;
mds)
# TAG: mds
source start_mds.sh
start_mds
;;
rgw)
# TAG: rgw
source start_rgw.sh
start_rgw
;;
rgw_user)
# TAG: rgw_user
source start_rgw.sh
create_rgw_user
;;
restapi)
# TAG: restapi
source start_restapi.sh
start_restapi
;;
rbd_mirror)
# TAG: rbd_mirror
source start_rbd_mirror.sh
start_rbd_mirror
;;
nfs)
# TAG: nfs
source start_nfs.sh
start_nfs
;;
zap_device)
# TAG: zap_device
source zap_device.sh
zap_device
;;
mon_health)
# TAG: mon_health
source watch_mon_health.sh
watch_mon_health
;;
mgr)
# TAG: mgr
source start_mgr.sh
start_mgr
;;
disk_introspection)
# TAG: disk_introspection
if [[ "$KV_TYPE" =~ k8s|kubernetes ]]; then
source disk_introspection.sh
else
log "You can not use the disk introspection method outside a Kubernetes environment"
log "Make sure KV_TYPE equals either k8s or kubernetes"
fi
;;
demo)
# TAG: demo
source demo.sh
;;
disk_list)
# TAG: disk_list
source disk_list.sh
start_disk_list
;;
tcmu_runner)
# TAG: tcmu_runner
if is_redhat; then
source start_tcmu_runner.sh
start_tcmu_runner
else
log "ERROR: tcmu_runner scenario is only available on Red Hat systems."
fi
;;
rbd_target_api)
# TAG: rbd_target_api
if is_redhat; then
source start_rbd_target_api.sh
start_rbd_target_api
else
log "ERROR: rbd_target_api scenario is only available on Red Hat systems."
fi
;;
rbd_target_gw)
# TAG: rbd_target_gw
if is_redhat; then
source start_rbd_target_gw.sh
start_rbd_target_gw
else
log "ERROR: rbd_target_gw scenario is only available on Red Hat systems."
fi
;;
*)
invalid_ceph_daemon
;;
esac
exit 0