Skip to content

Commit 867ba61

Browse files
Merge pull request #19 from randomizedcoder/2025_10_30
fan2go working
2 parents f1a1883 + 0de47a0 commit 867ba61

File tree

130 files changed

+16104
-237
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+16104
-237
lines changed

chromebox/chromebox1/configuration.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
#./k8s_master.nix
2929
#./k3s_master.nix
3030
#./k3s_node.nix
31+
# Modular Kubernetes configuration
32+
./kubernetes.nix
33+
./kubernetes_addonManager.nix
34+
./kubernetes_etcd.nix
35+
./kubernetes_networking.nix
36+
./kubernetes_runtime.nix
3137
];
3238

3339
# boot.loader.grub = {

chromebox/chromebox1/flake.lock

Lines changed: 126 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chromebox/chromebox1/flake.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,12 @@
2323
# https://github.com/nix-community/disko/
2424
disko.url = "github:nix-community/disko";
2525
disko.inputs.nixpkgs.follows = "nixpkgs";
26+
# https://gitlab.com/luxzeitlos/k8nix - Kubernetes addon management
27+
k8nix.url = "gitlab:luxzeitlos/k8nix";
28+
k8nix.inputs.nixpkgs.follows = "nixpkgs";
2629
};
2730

28-
outputs = inputs@{ nixpkgs, disko, home-manager, ... }:
31+
outputs = inputs@{ nixpkgs, disko, home-manager, k8nix, ... }:
2932
let
3033
system = "x86_64-linux";
3134
pkgs = import nixpkgs {
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
#!/bin/bash
2+
# Helmfile installation script for Cilium and Hubble
3+
# This script installs Cilium and Hubble using Helmfile for declarative management
4+
5+
set -euo pipefail
6+
7+
# Configuration
8+
CILIUM_VERSION="1.18.2"
9+
NAMESPACE="kube-system"
10+
HELMFILE_PATH="/home/das/nixos/chromebox/chromebox1/helmfile.yaml"
11+
12+
# Colors for output
13+
RED='\033[0;31m'
14+
GREEN='\033[0;32m'
15+
YELLOW='\033[1;33m'
16+
NC='\033[0m' # No Color
17+
18+
# Logging functions
19+
log_info() {
20+
echo -e "${GREEN}[INFO]${NC} $1"
21+
}
22+
23+
log_warn() {
24+
echo -e "${YELLOW}[WARN]${NC} $1"
25+
}
26+
27+
log_error() {
28+
echo -e "${RED}[ERROR]${NC} $1"
29+
}
30+
31+
# Check if kubectl is available and cluster is accessible
32+
check_kubectl() {
33+
if ! command -v kubectl &> /dev/null; then
34+
log_error "kubectl is not installed or not in PATH"
35+
exit 1
36+
fi
37+
38+
if ! kubectl cluster-info &> /dev/null; then
39+
log_error "Cannot connect to Kubernetes cluster"
40+
exit 1
41+
fi
42+
43+
log_info "Kubernetes cluster is accessible"
44+
}
45+
46+
# Check if Helm and Helmfile are available
47+
check_helm() {
48+
if ! command -v helm &> /dev/null; then
49+
log_error "Helm is not installed or not in PATH"
50+
exit 1
51+
fi
52+
53+
if ! command -v helmfile &> /dev/null; then
54+
log_error "Helmfile is not installed or not in PATH"
55+
exit 1
56+
fi
57+
58+
log_info "Helm is available: $(helm version --short)"
59+
log_info "Helmfile is available: $(helmfile version)"
60+
}
61+
62+
# Install Cilium and Hubble using Helmfile
63+
install_with_helmfile() {
64+
log_info "Installing Cilium and Hubble using Helmfile..."
65+
66+
if [ ! -f "${HELMFILE_PATH}" ]; then
67+
log_error "Helmfile configuration not found at ${HELMFILE_PATH}"
68+
exit 1
69+
fi
70+
71+
# Update repositories
72+
log_info "Updating Helm repositories..."
73+
helmfile -f "${HELMFILE_PATH}" repos
74+
75+
# Apply the Helmfile configuration
76+
log_info "Applying Helmfile configuration..."
77+
helmfile -f "${HELMFILE_PATH}" apply
78+
79+
log_info "Cilium and Hubble installation completed via Helmfile"
80+
}
81+
82+
# Wait for Cilium to be ready
83+
wait_for_cilium() {
84+
log_info "Waiting for Cilium to be ready..."
85+
kubectl wait --for=condition=ready pod -l k8s-app=cilium -n ${NAMESPACE} --timeout=300s
86+
log_info "Cilium is ready"
87+
}
88+
89+
# Main installation function
90+
main() {
91+
log_info "Starting Cilium and Hubble installation via Helmfile"
92+
93+
check_kubectl
94+
check_helm
95+
install_with_helmfile
96+
wait_for_cilium
97+
98+
log_info "Cilium and Hubble installation completed successfully!"
99+
log_info "You can now use:"
100+
log_info " - kubectl get pods -n ${NAMESPACE} # Check Cilium pods"
101+
log_info " - cilium status # Check Cilium status"
102+
log_info " - kubectl port-forward -n ${NAMESPACE} svc/hubble-ui 12000:80 # Access Hubble UI"
103+
log_info " - helmfile -f ${HELMFILE_PATH} status # Check Helmfile status"
104+
}
105+
106+
# Run main function
107+
main "$@"

chromebox/chromebox1/helmfile.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
repositories:
2+
- name: cilium
3+
url: https://helm.cilium.io/
4+
5+
releases:
6+
- name: cilium
7+
namespace: kube-system
8+
chart: cilium/cilium
9+
version: 1.18.2
10+
values:
11+
- hubble:
12+
relay:
13+
enabled: true
14+
ui:
15+
enabled: true
16+
- ipam:
17+
mode: kubernetes
18+
- kubeProxyReplacement: strict
19+
- k8sServiceHost: "172.16.40.178" # Will be updated per node
20+
- k8sServicePort: 6443

0 commit comments

Comments
 (0)