This is an automated email from the ASF dual-hosted git repository.

msciabarra pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/openserverless.git

commit 8a176d29e1985f399225355aced0f94d432b81ff
Author: Michele Sciabarra <[email protected]>
AuthorDate: Sat Jul 6 10:35:24 2024 +0200

    add direnv
---
 README.md       |  8 +++++---
 cloud-init.yaml | 13 ++++++++-----
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md
index 3f77359..499f5a2 100644
--- a/README.md
+++ b/README.md
@@ -30,13 +30,15 @@ The method we use to setup a VM in Linux and Mac is using 
[multipass](https://mu
 
 -  Otherwise follow [those instructions](https://multipass.run/install)
 
-Once you have `multipass` type
+Once you have `multipass` type the following 
 
 ```
-multipass launch -nopenserverless -c4 -d20g -m8g --cloud-init cloud-init.yaml
+multipass launch -nopenserverless -c4 -d20g -m8g --cloud-init 
https://raw.githubusercontent.com/nuvolaris/openserverless/main/cloud-init.yaml
+multipass exec "openserverless" -- sudo cloud-init status --wait
 ```
 
-Once you have finished,  ensure you have backed up all your files. Then use 
+#### Removal
+If you do now want to keep the vm anymore,   ensure you have backed up all 
your files. Then use the following commands to cleanup:
 
 ```
 multipass delete openserverless
diff --git a/cloud-init.yaml b/cloud-init.yaml
index 9e2c67f..9fbe9e3 100644
--- a/cloud-init.yaml
+++ b/cloud-init.yaml
@@ -4,9 +4,12 @@ apt_update: true
 apt_upgrade: true
 
 runcmd:
- - >
-   curl -sfL https://get.k3s.io | sh -
- - >
-   curl -L https://nixos.org/nix/install 
-   | sudo -u "$(getent passwd 1000 | awk -F: '{print $1}')"  sh -s -- --daemon
+ - curl -sfL https://get.k3s.io | sh -
+-  curl -sfL https://direnv.net/install.sh | bash
+ - |
+   USR= "$(getent passwd 1000 | awk -F: '{print $1}')"
+   mkdir -p "/home/$USR/.kube"
+   cp /etc/rancher/k3s/k3s.yaml "/home/$USR/.kube/config"
+   chown -Rvf $USR "/home/$USR/.kube"
+   curl -L https://nixos.org/nix/install | sudo -u $USR  sh -s -- --daemon
  
\ No newline at end of file

Reply via email to