forked from patnaikshekhar/AKSNodeInstaller
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrunOnHost.sh
31 lines (21 loc) · 850 Bytes
/
runOnHost.sh
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
#!/bin/bash
# Copy installation script to host
cp /tmp/install.sh /host
# Copy cleanup script to host
cp /tmp/cleanup.sh /host
# Copy wait script to the host
cp /wait.sh /host
# Copy install files to the host
cp -R /files /host/files
# Give executable priv to wait script
/usr/bin/nsenter -m/proc/1/ns/mnt -- chmod u+x /tmp/install/wait.sh
# Give execute priv to script
/usr/bin/nsenter -m/proc/1/ns/mnt -- chmod u+x /tmp/install/install.sh
# Give execute priv to cleanup script
/usr/bin/nsenter -m/proc/1/ns/mnt -- chmod u+x /tmp/install/cleanup.sh
# Wait for Node updates to complete
/usr/bin/nsenter -m/proc/1/ns/mnt /tmp/install/wait.sh
# If the /tmp folder is mounted on the host then it can run the script
/usr/bin/nsenter -m/proc/1/ns/mnt /tmp/install/install.sh
# Sleep so that the Pod in the DaemonSet does not exit
sleep infinity