Add AIO with k0s

Related-Prod: PRODX-46480
Change-Id: I824d424d524213f56fdfe43dd27710f306e6ecb5
diff --git a/de/heat-templates/scripts/functions.sh b/de/heat-templates/scripts/functions.sh
index 3f838b6..1283894 100644
--- a/de/heat-templates/scripts/functions.sh
+++ b/de/heat-templates/scripts/functions.sh
@@ -359,9 +359,13 @@
 }
 
 function install_k0s {
+    local install_flags="--enable-worker"
+    if [[ "${SINGLE_NODE}" == true ]]; then
+        install_flags="$install_flags  --single"
+    fi
     mkdir -p /etc/k0s
     k0s config create > /etc/k0s/k0s.yaml
-    k0s install controller -c /etc/k0s/k0s.yaml
+    k0s install controller -c /etc/k0s/k0s.yaml $install_flags
     k0s start
 
     sleep 60
@@ -372,8 +376,10 @@
 
     mkdir -p /etc/k0s
     k0s kubeconfig admin > /etc/k0s/admin.conf
-    k0s token create --role=worker > /etc/k0s/worker_token.yaml
-    k0s token create --role=controller > /etc/k0s/controller_token.yaml
+    if [[ "${SINGLE_NODE}" != true ]]; then
+        k0s token create --role=worker > /etc/k0s/worker_token.yaml
+        k0s token create --role=controller > /etc/k0s/controller_token.yaml
+    fi
 
     install_pkgs nginx
     rm -f /etc/nginx/sites-enabled/default