create k8s container
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
logs/rsync-backup.log
|
||||
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
|
||||
4
lxd-microk8s/rc-local
Normal file
4
lxd-microk8s/rc-local
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
apparmor_parser --replace /var/lib/snapd/apparmor/profiles/snap.microk8s.*
|
||||
exit 0
|
||||
Reference in New Issue
Block a user