🔨 chore: fix gitlab + helm

Signed-off-by: dyn <oss+dyn@xtrm.me>
This commit is contained in:
dyn
2025-12-18 10:22:04 +01:00
parent 8715501fd8
commit af6278f414
4 changed files with 36 additions and 12 deletions

View File

@ -1,5 +1,10 @@
#!/usr/bin/env sh #!/usr/bin/env sh
if [ -z "$KUBECONFIG" ]; then
echo "KUBECONFIG is not set"
exit 1
fi
set -x set -x
k3d cluster create inception-of-things k3d cluster create inception-of-things
@ -45,7 +50,7 @@ kubectl apply -n argocd -f "$SCRIPT_DIR/../confs/argocd-app.yml"
echo '>' echo '>'
echo '> App is starting (this takes around ~30 seconds)...' echo '> App is starting (this takes around ~30 seconds)...'
echo '>' 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 \ kubectl wait --namespace dev \
--for=condition=ready pod \ --for=condition=ready pod \
--selector=app=app-p3 \ --selector=app=app-p3 \
@ -64,16 +69,32 @@ helm upgrade --install gitlab gitlab/gitlab \
--timeout 1200s \ --timeout 1200s \
--set global.hosts.domain=gitlab-app.com \ --set global.hosts.domain=gitlab-app.com \
--set global.hosts.externalIP=0.0.0.0 \ --set global.hosts.externalIP=0.0.0.0 \
--set global.hosts.https=false --set global.hosts.https=false \
--disable-openapi-validation
echo '>' echo '>'
echo '> GitLab is starting (this takes around ~10 minutes)...' echo '> GitLab is starting (this takes around ~10 minutes)...'
echo '>' echo '>'
sleep 10
echo '> Starting watch...'
sleep 5
kubectl wait --namespace gitlab \ # So we have a progress-ish indicator visual
--for=condition=available \ while true; do
--timeout=1200s \ ready=$(kubectl get pods -n gitlab --no-headers 2>/dev/null | grep -E "([0-9]+)/\1" | wc -l)
deployment/gitlab-webservice-default 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 & # kubectl port-forward -n gitlab svc/gitlab-webservice-default 8081:8181 1>/dev/null 2>/dev/null &

View File

@ -111,9 +111,12 @@
vagrant vagrant
k3d k3d
kubectl
kubernetes-helm kubernetes-helm
]; ];
shellInit = ''
export KUBECONFIG=$HOME/.kube/config
'';
}; };
system.stateVersion = "24.11"; system.stateVersion = "24.11";

8
vm/flake.lock generated
View File

@ -38,16 +38,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1765779637, "lastModified": 1765934234,
"narHash": "sha256-KJ2wa/BLSrTqDjbfyNx70ov/HdgNBCBBSQP3BIzKnv4=", "narHash": "sha256-pJjWUzNnjbIAMIc5gRFUuKCDQ9S1cuh3b2hKgA7Mc4A=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "1306659b587dc277866c7b69eb97e5f07864d8c4", "rev": "af84f9d270d404c17699522fab95bbf928a2d92f",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-unstable", "ref": "nixpkgs-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View File

@ -2,7 +2,7 @@
description = "A NixOS configuration for the Inception of Things"; description = "A NixOS configuration for the Inception of Things";
inputs = { 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"; systems.url = "github:nix-systems/x86_64-linux";
nixos-generators = { nixos-generators = {
url = "github:nix-community/nixos-generators"; url = "github:nix-community/nixos-generators";