create k8s container
This commit is contained in:
21
create-lxd-microk8s.sh
Executable file
21
create-lxd-microk8s.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
# Basic shell script to backup required LXD parts ##
|
||||
## Backup and restore LXD config ##
|
||||
## Today's date ##
|
||||
|
||||
if [[ $1 == '' ]]; then
|
||||
echo "use $0 container-name"
|
||||
exit
|
||||
fi
|
||||
echo $(date) "Starting create LXD microk8s container $1..."
|
||||
|
||||
echo $(date) "Creating LXD container $1..."
|
||||
lxc launch -p default -p microk8s ubuntu:22.04 $1
|
||||
|
||||
sleep 15
|
||||
|
||||
echo $(date) "Installing microk8s..."
|
||||
lxc exec $1 -- sudo snap install microk8s --classic
|
||||
|
||||
echo $(date) "Creating an rc.local file to perform the profile loading..."
|
||||
lxc file push --mode 775 lxd-microk8s/rc-local $1/etc/rc.local
|
||||
Reference in New Issue
Block a user