diff --git a/bonus/scripts/argo-install.sh b/bonus/scripts/argo-install.sh index 98d0a42..a570918 100755 --- a/bonus/scripts/argo-install.sh +++ b/bonus/scripts/argo-install.sh @@ -1,5 +1,10 @@ #!/usr/bin/env sh +if [ -z "$KUBECONFIG" ]; then + echo "KUBECONFIG is not set" + exit 1 +fi + set -x k3d cluster create inception-of-things @@ -45,7 +50,7 @@ kubectl apply -n argocd -f "$SCRIPT_DIR/../confs/argocd-app.yml" echo '>' echo '> App is starting (this takes around ~30 seconds)...' echo '>' -sleep 2 # THIS SLEEP IS REQUIRED, IT BREAKS WITHOUT IT, TRUST -kiroussa +sleep 5 # THIS SLEEP IS REQUIRED, IT BREAKS WITHOUT IT, TRUST -kiroussa kubectl wait --namespace dev \ --for=condition=ready pod \ --selector=app=app-p3 \ @@ -64,16 +69,32 @@ helm upgrade --install gitlab gitlab/gitlab \ --timeout 1200s \ --set global.hosts.domain=gitlab-app.com \ --set global.hosts.externalIP=0.0.0.0 \ - --set global.hosts.https=false + --set global.hosts.https=false \ + --disable-openapi-validation echo '>' echo '> GitLab is starting (this takes around ~10 minutes)...' echo '>' +sleep 10 +echo '> Starting watch...' +sleep 5 -kubectl wait --namespace gitlab \ - --for=condition=available \ - --timeout=1200s \ - deployment/gitlab-webservice-default +# So we have a progress-ish indicator visual +while true; do + ready=$(kubectl get pods -n gitlab --no-headers 2>/dev/null | grep -E "([0-9]+)/\1" | wc -l) + total=$(kubectl get pods -n gitlab --no-headers 2>/dev/null | wc -l) + + clear + kubectl get pods -n gitlab + + if [ "$ready" -eq "$total" ] && [ "$total" -gt 0 ]; then + echo "All GitLab pods are ready!" + sleep 5 + break + fi + + sleep 30 +done # kubectl port-forward -n gitlab svc/gitlab-webservice-default 8081:8181 1>/dev/null 2>/dev/null & diff --git a/vm/configuration.nix b/vm/configuration.nix index 6bc7a1b..83af699 100644 --- a/vm/configuration.nix +++ b/vm/configuration.nix @@ -111,9 +111,12 @@ vagrant k3d - kubectl kubernetes-helm ]; + + shellInit = '' + export KUBECONFIG=$HOME/.kube/config + ''; }; system.stateVersion = "24.11"; diff --git a/vm/flake.lock b/vm/flake.lock index 51ecc98..404938f 100644 --- a/vm/flake.lock +++ b/vm/flake.lock @@ -38,16 +38,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1765779637, - "narHash": "sha256-KJ2wa/BLSrTqDjbfyNx70ov/HdgNBCBBSQP3BIzKnv4=", + "lastModified": 1765934234, + "narHash": "sha256-pJjWUzNnjbIAMIc5gRFUuKCDQ9S1cuh3b2hKgA7Mc4A=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1306659b587dc277866c7b69eb97e5f07864d8c4", + "rev": "af84f9d270d404c17699522fab95bbf928a2d92f", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } diff --git a/vm/flake.nix b/vm/flake.nix index 33a0395..e845b99 100644 --- a/vm/flake.nix +++ b/vm/flake.nix @@ -2,7 +2,7 @@ description = "A NixOS configuration for the Inception of Things"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + nixpkgs.url = "github:nixos/nixpkgs?ref=nixpkgs-unstable"; systems.url = "github:nix-systems/x86_64-linux"; nixos-generators = { url = "github:nix-community/nixos-generators";