diff --git a/p3/scripts/argo-install.sh b/p3/scripts/argo-install.sh index 9f3ac29..253af71 100755 --- a/p3/scripts/argo-install.sh +++ b/p3/scripts/argo-install.sh @@ -7,13 +7,13 @@ kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/late kubectl patch deployment metrics-server -n kube-system --type='json' \ -p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--kubelet-insecure-tls"}]' -echo '> Waiting for metrics-server to be ready...' -kubectl wait --for=condition=available deployment/metrics-server -n kube-system --timeout=300s +echo '> metrics-server is starting (this takes around ~3 minutes)...' +kubectl wait --for=condition=available deployment/metrics-server -n kube-system --timeout=500s kubectl create namespace argocd kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml -echo "> ArgoCD is starting (this takes around ~5 minutes)..." +echo "> ArgoCD is starting (this takes around ~6 minutes)..." sleep 10 echo '> Starting watch...' sleep 5 @@ -44,7 +44,7 @@ echo '> App is starting (this takes around ~30 seconds)...' kubectl wait --namespace dev \ --for=condition=ready pod \ - --selector=app.kubernetes.io/name=app-deployment \ + --selector=app=app-p3 \ --timeout=300s echo 'App imported in ArgoCD' sleep 10 @@ -63,3 +63,5 @@ echo Username: admin echo -n "Password: " kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d echo "===============================" + +kubectl port-forward svc/argocd-server -n argocd 8080:443 diff --git a/vm/configuration.nix b/vm/configuration.nix index 3adeb79..ffeb5a6 100644 --- a/vm/configuration.nix +++ b/vm/configuration.nix @@ -26,6 +26,15 @@ script = '' mkdir -p /iot /run/wrappers/bin/mount -t 9p -o trans=virtio,version=9p2000.L host0 /iot + + rm -rf /home/user/iot /root/iot + + mkdir /home/user/iot -p + cp -r /iot/p* /iot/bonus /home/user/iot/ + chown -R user:user /home/user/iot + + mkdir /root/iot -p + cp -r /iot/p* /iot/bonus /rot/iot/ ''; wantedBy = [ "multi-user.target" ]; @@ -47,19 +56,8 @@ }; services = { - k3s = { - enable = true; - }; + k3s.enable = true; getty.autologinUser = "root"; - openssh = { - enable = true; - ports = [ 22 ]; - settings = { - PermitRootLogin = "yes"; - PasswordAuthentication = true; - AllowUsers = null; - }; - }; xserver = { enable = true; xkb = { @@ -81,15 +79,19 @@ enable = true; enable32Bit = true; }; - virtualisation.docker.enable = true; + + virtualisation = { + virtualbox.host.enable = true; + docker.enable = true; + }; boot.kernelParams = [ "kvm.enable_virt_at_load=0" ]; programs = { zsh = { - autosuggestions.enable = true; - syntaxHighlighting.enable = true; enable = true; enableBashCompletion = true; + autosuggestions.enable = true; + syntaxHighlighting.enable = true; shellAliases = (import ./aliases.nix); }; }; diff --git a/vm/flake.nix b/vm/flake.nix index 09c863b..227fd8a 100644 --- a/vm/flake.nix +++ b/vm/flake.nix @@ -84,7 +84,6 @@ -m 4G \ -smp 1 \ -cpu host \ - -netdev user,id=net0,hostfwd=tcp::2222-:22 \ -virtfs local,path=$(${pkgs.coreutils}/bin/pwd)/..,mount_tag=host0,security_model=mapped-xattr,id=host0 ''; in