Add iscsi installtion daemonset yaml file
Add iscsi installation yaml file to provide a convenient way to install iscsi on every host. Longhorn #1741 Signed-off-by: Bo Tao <bo.tao@rancher.com>
This commit is contained in:
parent
1389981637
commit
6c34cef1ef
31
deploy/iscsi/longhorn-iscsi-installation.yaml
Normal file
31
deploy/iscsi/longhorn-iscsi-installation.yaml
Normal file
@ -0,0 +1,31 @@
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: longhorn-iscsi-installation
|
||||
labels:
|
||||
app: longhorn-iscsi-installation
|
||||
annotations:
|
||||
command: &cmd OS=$(grep "ID_LIKE" /etc/os-release | cut -d '=' -f 2); if [[ $OS == *"debian"* ]]; then apt-get update -qy && apt-get install -qy open-iscsi && sudo systemctl enable iscsid && sudo systemctl start iscsid; else yum install iscsi-initiator-utils -y && sudo systemctl enable iscsid && sudo systemctl start iscsid; fi && if [ $? -eq 0 ]; then echo "iscsi install successfully"; else echo "iscsi install failed error code " $?; fi
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: longhorn-iscsi-installation
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: longhorn-iscsi-installation
|
||||
spec:
|
||||
hostNetwork: true
|
||||
containers:
|
||||
- name: iscsi-installation
|
||||
command:
|
||||
- nsenter
|
||||
- --mount=/proc/1/ns/mnt
|
||||
- --
|
||||
- sh
|
||||
- -c
|
||||
- *cmd
|
||||
image: alpine:3.7
|
||||
securityContext:
|
||||
privileged: true
|
||||
hostPID: true
|
Loading…
Reference in New Issue
Block a user