Files
bash_mng_scripts/create-lxd-microk8s.sh

22 lines
585 B
Bash
Executable File

#!/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