diff --git a/p3/confs/argocd-app.yml b/p3/confs/argocd-app.yml index a9a23c2..9716a20 100644 --- a/p3/confs/argocd-app.yml +++ b/p3/confs/argocd-app.yml @@ -12,9 +12,10 @@ spec: destination: server: https://kubernetes.default.svc namespace: dev + name: '' syncPolicy: automated: prune: true selfHeal: true syncOptions: - - CreateNamespace=true \ No newline at end of file + - CreateNamespace=true diff --git a/p3/scripts/argo-install.sh b/p3/scripts/argo-install.sh index 76fc5f9..52a1b4d 100755 --- a/p3/scripts/argo-install.sh +++ b/p3/scripts/argo-install.sh @@ -1,33 +1,42 @@ #!/usr/bin/env sh k3d cluster create inception-of-things + +# Setup a metrics-server to prevent dumb errors +# kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml +# kubectl patch deployment metrics-server -n kube-system --type='json' \ +# -p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--kubelet-insecure-tls"}]' + kubectl create namespace argocd kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml -echo ArgoCD is starting... +echo ">" +echo "> ArgoCD is starting (this takes around ~4 minutes)..." +echo ">" kubectl wait --namespace argocd \ --for=condition=ready pod \ --selector=app.kubernetes.io/name=argocd-server \ - --timeout=300s \ - 1>/dev/null 2>/dev/null + --timeout=600s -kubectl port-forward svc/argocd-server -n argocd 8080:443 1>/dev/null 2>/dev/null & echo 'ArgoCD is running' - +sleep 10 SCRIPT_PATH="$(realpath "${BASH_SOURCE[0]}")" SCRIPT_DIR="$(dirname "$SCRIPT_PATH")" kubectl create namespace dev kubectl apply -n argocd -f "$SCRIPT_DIR/../confs/argocd-app.yml" -echo 'App is starting...' +echo '>' +echo '> App is starting (this takes around ~30 seconds)...' +echo '>' kubectl wait --namespace dev \ --for=condition=ready pod \ --selector=app.kubernetes.io/name=app-deployment \ --timeout=300s echo 'App imported in ArgoCD' +sleep 10 TRAEFIK_IP=$(kubectl get service -n kube-system traefik -o jsonpath='{.status.loadBalancer.ingress[0].ip}') echo Traefik ip is : $TRAEFIK_IP @@ -40,6 +49,6 @@ echo echo "=== Login into ArgoCD with: ===" echo Username: admin -ADMIN_PASS=$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d) -echo Password: \'$ADMIN_PASS\' +echo -n "Password: " +kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d echo "===============================" diff --git a/vm/flake.nix b/vm/flake.nix index 1b6ca88..09c863b 100644 --- a/vm/flake.nix +++ b/vm/flake.nix @@ -63,8 +63,8 @@ set -x source ${selfPkgs.vm}/bin/run-${hostname}-vm \ -enable-kvm \ - -m 4G \ - -smp 1 \ + -m 6G \ + -smp 2 \ -cpu host \ -virtfs local,path=$(${pkgs.coreutils}/bin/pwd)/..,mount_tag=host0,security_model=mapped-xattr,id=host0 ''; @@ -84,6 +84,7 @@ -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