summaryrefslogtreecommitdiff
path: root/BINARIES.md
blob: 9e9d21b806a88a82c57af2f9d14fabe495f6f3bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
# Binary Acquisition and Packaging

## Overview

This document specifies exact versions, download sources, and installation paths for all software components in the cluster-from-systemd project.

## Design Decision: Hybrid Package Strategy

**Approach**: Use distro packages where stable, upstream binaries for latest features.

**Rationale**:
- **Distro packages** (dnf/yum): Base system, containerd, utilities (reliable, security updates)
- **Upstream binaries**: Kubernetes, etcd (need specific versions, faster release cycle)
- **Container images**: Kafka, Ceph (easier to version-lock, upstream-supported)
- **Compiled from source**: Only if unavoidable (minimize complexity)

## Base Distribution

**Choice**: Rocky Linux 9.3 (or Fedora 39)

**Rationale**:
- RHEL-compatible (enterprise acceptance)
- systemd 252+ (needed features)
- SELinux integration
- Long support lifecycle (Rocky: ~10 years)

**Alternative**: Fedora 39 for bleeding-edge testing, migrate to Rocky for production.

## Component Versions (2025-01-15 snapshot)

### Kubernetes Cluster
- **Kubernetes**: v1.29.1 (upstream binaries)
- **etcd**: v3.5.11 (upstream binaries)
- **containerd**: 1.7.11 (distro package)
- **runc**: 1.1.10 (distro package)
- **CNI plugins**: v1.4.0 (upstream binaries)
- **Calico**: v3.27.0 (manifest/container images)

### Storage (Ceph)
- **Ceph**: Reef 18.2.1 (distro package from CentOS SIG)
- **ceph-common**: 18.2.1
- **ceph-mon**: 18.2.1
- **ceph-osd**: 18.2.1
- **ceph-mds**: 18.2.1

### Messaging
- **Kafka**: 3.6.1 (upstream tarball)
- **OpenJDK**: 17.0.9 (distro package - required by Kafka)
- **Mosquitto**: 2.0.18 (distro package)

### DNS
- **CoreDNS**: v1.11.1 (upstream binary)

### Utilities
- **yq**: v4.40.5 (YAML processor)
- **jq**: 1.6 (distro package)
- **curl**: latest (distro)
- **openssl**: latest (distro)

## Binary Installation Paths

```
/usr/local/bin/
├── kubeadm                    # Kubernetes cluster bootstrapper
├── kubectl                    # Kubernetes CLI
├── kubelet                    # Kubernetes node agent
├── kube-apiserver            # Kubernetes API server
├── kube-controller-manager   # Kubernetes controller
├── kube-scheduler            # Kubernetes scheduler
├── etcd                      # etcd binary
├── etcdctl                   # etcd CLI
├── coredns                   # CoreDNS binary
└── yq                        # YAML processor

/usr/bin/ (via distro packages)
├── containerd
├── ctr
├── runc
├── ceph
├── ceph-mon
├── ceph-osd
├── mosquitto
├── mosquitto_passwd
├── java (OpenJDK)
└── jq

/opt/
├── kafka/                    # Kafka installation
│   ├── bin/
│   │   ├── kafka-server-start.sh
│   │   ├── kafka-topics.sh
│   │   └── ...
│   ├── config/
│   │   └── kraft/
│   └── libs/
└── cni/                      # CNI plugins
    └── bin/
        ├── bridge
        ├── host-local
        ├── loopback
        └── ...
```

## Download Sources and Installation

### 1. Kubernetes Binaries

**Version**: v1.29.1
**Source**: https://github.com/kubernetes/kubernetes/releases
**Architecture**: amd64 (x86_64)

```bash
#!/bin/bash
# tools/download-kubernetes.sh

KUBE_VERSION="v1.29.1"
ARCH="amd64"
BASE_URL="https://dl.k8s.io/release/${KUBE_VERSION}/bin/linux/${ARCH}"

BINARIES=(
  "kubeadm"
  "kubectl"
  "kubelet"
  "kube-apiserver"
  "kube-controller-manager"
  "kube-scheduler"
  "kube-proxy"
)

for binary in "${BINARIES[@]}"; do
  echo "Downloading $binary..."
  curl -L "${BASE_URL}/${binary}" -o "/usr/local/bin/${binary}"
  chmod +x "/usr/local/bin/${binary}"
done

# Verify
kubelet --version
kubectl version --client
```

**Checksums**: Download and verify
```bash
curl -L "${BASE_URL}/kubelet.sha256" -o kubelet.sha256
echo "$(cat kubelet.sha256) /usr/local/bin/kubelet" | sha256sum --check
```

### 2. etcd

**Version**: v3.5.11
**Source**: https://github.com/etcd-io/etcd/releases

```bash
#!/bin/bash
# tools/download-etcd.sh

ETCD_VERSION="v3.5.11"
ARCH="amd64"
TARBALL="etcd-${ETCD_VERSION}-linux-${ARCH}.tar.gz"
URL="https://github.com/etcd-io/etcd/releases/download/${ETCD_VERSION}/${TARBALL}"

curl -L "$URL" -o "/tmp/${TARBALL}"
tar xzf "/tmp/${TARBALL}" -C /tmp
mv /tmp/etcd-${ETCD_VERSION}-linux-${ARCH}/etcd /usr/local/bin/
mv /tmp/etcd-${ETCD_VERSION}-linux-${ARCH}/etcdctl /usr/local/bin/
chmod +x /usr/local/bin/etcd /usr/local/bin/etcdctl

# Verify
etcd --version
etcdctl version
```

### 3. containerd + runc (Distro Packages)

**Source**: Rocky Linux 9 AppStream repository

```bash
#!/bin/bash
# tools/install-container-runtime.sh

dnf install -y \
  containerd.io \
  runc \
  containernetworking-plugins

# Or from Docker repo for newer version
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
dnf install -y containerd.io

# Configure containerd
mkdir -p /etc/containerd
containerd config default > /etc/containerd/config.toml

# Enable systemd cgroup driver (required for Kubernetes)
sed -i 's/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.toml

systemctl enable containerd
```

### 4. CNI Plugins

**Version**: v1.4.0
**Source**: https://github.com/containernetworking/plugins/releases

```bash
#!/bin/bash
# tools/download-cni-plugins.sh

CNI_VERSION="v1.4.0"
ARCH="amd64"
CNI_TARBALL="cni-plugins-linux-${ARCH}-${CNI_VERSION}.tgz"
URL="https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/${CNI_TARBALL}"

mkdir -p /opt/cni/bin
curl -L "$URL" -o "/tmp/${CNI_TARBALL}"
tar xzf "/tmp/${CNI_TARBALL}" -C /opt/cni/bin

chmod +x /opt/cni/bin/*
ls -lh /opt/cni/bin/
```

### 5. Calico CNI

**Version**: v3.27.0
**Source**: https://docs.tigera.io/calico/latest/getting-started/kubernetes/self-managed-onprem/onpremises

**Installation method**: Kubernetes manifest (applied after cluster init)

```bash
#!/bin/bash
# tools/install-calico.sh
# Run AFTER first master is initialized

CALICO_VERSION="v3.27.0"
kubectl apply -f "https://raw.githubusercontent.com/projectcalico/calico/${CALICO_VERSION}/manifests/calico.yaml"
```

**Embedded in ISO**: Download manifest at build time, apply at bootstrap.

```bash
# At ISO build time
mkdir -p /etc/kubernetes/manifests/calico
curl -L "https://raw.githubusercontent.com/projectcalico/calico/v3.27.0/manifests/calico.yaml" \
  -o /etc/kubernetes/manifests/calico/calico.yaml
```

### 6. Ceph (Distro Packages)

**Version**: Reef 18.2.1
**Source**: CentOS Storage SIG repository

```bash
#!/bin/bash
# tools/install-ceph.sh

# Add Ceph repository
cat > /etc/yum.repos.d/ceph.repo <<EOF
[ceph]
name=Ceph packages for \$basearch
baseurl=https://download.ceph.com/rpm-reef/el9/\$basearch
enabled=1
gpgcheck=1
gpgkey=https://download.ceph.com/keys/release.asc

[ceph-noarch]
name=Ceph noarch packages
baseurl=https://download.ceph.com/rpm-reef/el9/noarch
enabled=1
gpgcheck=1
gpgkey=https://download.ceph.com/keys/release.asc
EOF

# Install Ceph packages
dnf install -y \
  ceph-common \
  ceph-mon \
  ceph-osd \
  ceph-mds \
  ceph-mgr \
  python3-ceph-argparse \
  python3-cephfs

# Verify
ceph --version
```

### 7. Kafka

**Version**: 3.6.1
**Source**: https://kafka.apache.org/downloads

```bash
#!/bin/bash
# tools/install-kafka.sh

KAFKA_VERSION="3.6.1"
SCALA_VERSION="2.13"
TARBALL="kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz"
URL="https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/${TARBALL}"

# Install Java (required)
dnf install -y java-17-openjdk-headless

# Download and extract Kafka
curl -L "$URL" -o "/tmp/${TARBALL}"
tar xzf "/tmp/${TARBALL}" -C /opt/
mv "/opt/kafka_${SCALA_VERSION}-${KAFKA_VERSION}" /opt/kafka

# Create symlink for easy updates
ln -sf /opt/kafka /opt/kafka-current

# Verify
/opt/kafka/bin/kafka-topics.sh --version
```

### 8. Mosquitto (Distro Package)

**Version**: 2.0.18
**Source**: EPEL repository

```bash
#!/bin/bash
# tools/install-mosquitto.sh

# Enable EPEL
dnf install -y epel-release

# Install Mosquitto
dnf install -y mosquitto mosquitto-clients

# Verify
mosquitto -h | head -1
```

### 9. CoreDNS

**Version**: v1.11.1
**Source**: https://github.com/coredns/coredns/releases

```bash
#!/bin/bash
# tools/download-coredns.sh

COREDNS_VERSION="1.11.1"
ARCH="amd64"
TARBALL="coredns_${COREDNS_VERSION}_linux_${ARCH}.tgz"
URL="https://github.com/coredns/coredns/releases/download/v${COREDNS_VERSION}/${TARBALL}"

curl -L "$URL" -o "/tmp/${TARBALL}"
tar xzf "/tmp/${TARBALL}" -C /tmp
mv /tmp/coredns /usr/local/bin/
chmod +x /usr/local/bin/coredns

# Verify
coredns -version
```

### 10. Utilities

```bash
#!/bin/bash
# tools/install-utilities.sh

# Install from distro repos
dnf install -y \
  jq \
  curl \
  openssl \
  iproute \
  iputils \
  bind-utils \
  wget \
  vim \
  tmux \
  htop

# Install yq (YAML processor)
YQ_VERSION="v4.40.5"
YQ_BINARY="yq_linux_amd64"
curl -L "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/${YQ_BINARY}" \
  -o /usr/local/bin/yq
chmod +x /usr/local/bin/yq

# Verify
yq --version
jq --version
```

## Complete Installation Script

**Script**: `tools/install-all-binaries.sh`

```bash
#!/bin/bash
# Master script to install all binaries in correct order

set -euo pipefail

echo "==> Installing base system packages..."
dnf update -y
dnf install -y epel-release

echo "==> Installing container runtime..."
./tools/install-container-runtime.sh

echo "==> Installing Kubernetes binaries..."
./tools/download-kubernetes.sh

echo "==> Installing etcd..."
./tools/download-etcd.sh

echo "==> Installing CNI plugins..."
./tools/download-cni-plugins.sh

echo "==> Installing Ceph..."
./tools/install-ceph.sh

echo "==> Installing Kafka..."
./tools/install-kafka.sh

echo "==> Installing Mosquitto..."
./tools/install-mosquitto.sh

echo "==> Installing CoreDNS..."
./tools/download-coredns.sh

echo "==> Installing utilities..."
./tools/install-utilities.sh

echo "==> Downloading Calico manifest..."
mkdir -p /etc/kubernetes/manifests/calico
curl -L "https://raw.githubusercontent.com/projectcalico/calico/v3.27.0/manifests/calico.yaml" \
  -o /etc/kubernetes/manifests/calico/calico.yaml

echo "==> Binary installation complete!"
echo ""
echo "Installed versions:"
kubelet --version
etcd --version
containerd --version
ceph --version
java -version 2>&1 | head -1
mosquitto -h 2>&1 | head -1
coredns -version
```

## Package List for ISO Builder

**File**: `configs/package-list.txt`

```
# Base system
@core
@standard
kernel
kernel-modules
kernel-modules-extra
systemd
systemd-networkd
systemd-resolved

# Networking
NetworkManager
iproute
iputils
bind-utils
iptables
nftables

# Container runtime (from Docker repo)
containerd.io

# Development tools (for troubleshooting)
strace
tcpdump
lsof
vim
tmux
htop

# Python (for cluster scripts)
python3
python3-pip
python3-pyyaml

# Java (for Kafka)
java-17-openjdk-headless

# MQTT
mosquitto
mosquitto-clients

# Utilities
jq
curl
wget
openssl
tar
gzip
```

## Dependency Tree

```
Kubernetes
├── containerd
│   └── runc
├── CNI plugins
└── etcd

Ceph
├── python3-ceph-argparse
└── ceph-common

Kafka
└── java-17-openjdk-headless

Mosquitto
└── (no dependencies)

CoreDNS
└── (no dependencies)
```

## Version Lock Strategy

**Problem**: Prevent unexpected version changes between builds.

**Solution**: Pin exact versions in scripts, not "latest".

**Update process**:
1. Test new versions in dev environment
2. Update version variables in download scripts
3. Rebuild ISO
4. Run integration tests
5. Deploy to production

## Verification Checklist

Run after binary installation:

```bash
#!/bin/bash
# tools/verify-binaries.sh

ERRORS=0

check_binary() {
  local binary=$1
  local version_flag=${2:---version}

  if ! command -v "$binary" &>/dev/null; then
    echo "ERROR: Binary not found: $binary"
    ((ERRORS++))
  else
    echo "✓ $binary: $($binary $version_flag 2>&1 | head -1)"
  fi
}

echo "==> Verifying installed binaries..."

# Kubernetes
check_binary kubelet --version
check_binary kubectl version --client
check_binary kube-apiserver --version
check_binary kube-controller-manager --version
check_binary kube-scheduler --version

# Container runtime
check_binary containerd --version
check_binary runc --version

# etcd
check_binary etcd --version
check_binary etcdctl version

# Ceph
check_binary ceph --version

# Kafka
if [[ -x /opt/kafka/bin/kafka-topics.sh ]]; then
  echo "✓ Kafka: $(/opt/kafka/bin/kafka-topics.sh --version 2>&1)"
else
  echo "ERROR: Kafka not found"
  ((ERRORS++))
fi

# Mosquitto
check_binary mosquitto -h

# CoreDNS
check_binary coredns -version

# Utilities
check_binary yq --version
check_binary jq --version

# CNI plugins
if [[ -d /opt/cni/bin ]]; then
  echo "✓ CNI plugins: $(ls /opt/cni/bin | wc -l) binaries installed"
else
  echo "ERROR: CNI plugins directory not found"
  ((ERRORS++))
fi

if [[ $ERRORS -gt 0 ]]; then
  echo "==> Verification FAILED with $ERRORS errors"
  exit 1
fi

echo "==> Verification PASSED"
```

## Storage Requirements

**Disk space needed for binaries**:

```
Kubernetes binaries:    ~500 MB
etcd:                   ~30 MB
containerd/runc:        ~50 MB
CNI plugins:            ~40 MB
Ceph packages:          ~150 MB
Kafka:                  ~100 MB
Mosquitto:              ~5 MB
CoreDNS:                ~50 MB
Base system:            ~2 GB
-----------------------------------
Total:                  ~3 GB

Recommended ISO size:   8 GB (includes configs, logs, temp space)
```

## Update Strategy

**Minor version updates** (e.g., 1.29.1 → 1.29.2):
1. Update version variable in download script
2. Rebuild ISO
3. Test in staging

**Major version updates** (e.g., 1.29 → 1.30):
1. Review Kubernetes changelog
2. Update API versions in manifests
3. Test upgrade path (rolling update)
4. Update documentation

## Airgapped Installation

For environments without internet access:

```bash
#!/bin/bash
# tools/create-binary-bundle.sh
# Download all binaries for offline installation

BUNDLE_DIR="./binary-bundle"
mkdir -p "$BUNDLE_DIR"

# Download all binaries to local directory
# Modify download scripts to save to $BUNDLE_DIR instead of /usr/local/bin

# Create tarball
tar czf binary-bundle.tar.gz "$BUNDLE_DIR"

# On target system:
# tar xzf binary-bundle.tar.gz
# ./binary-bundle/install-offline.sh
```

## Next Steps

1. Implement all download scripts in `tools/`
2. Test binary installation on clean Rocky 9 VM
3. Create version-lock manifest (SHA256 checksums)
4. Integrate with ISO builder kickstart
5. Add to validation workflow (`verify-binaries.sh`)
6. Document upgrade procedures

---

**P.S.** This is the unglamorous but critical work—getting the right bits in the right place. Using distro packages where possible keeps maintenance sane; upstream binaries for Kubernetes give you version control. The scripts are copy-paste ready. Next doc should be **BOOTSTRAP.md** to define the initialization sequence.