-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
239 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,239 @@ | ||
--- | ||
title: How to install Cozystack in Servers.com | ||
linkTitle: Servers.com | ||
description: "How to install Cozystack in Servers.com" | ||
weight: 40 | ||
--- | ||
|
||
## Before installation | ||
|
||
### Network | ||
|
||
**Remove Aggregate Interface** | ||
- Go to **Dedicated Server - Server Details**, and click on the second column (highlighted in blue) to remove the aggregate interface. | ||
- Ensure the status appears as shown in the screenshot. | ||
|
||
![Remove Aggregate Interface](/img/remove_aggregate_interface.png) | ||
|
||
Set Up L2 Network | ||
- Navigate to **Networks - L2 Segment** and click **Add Segment**. | ||
|
||
![L2 Segments](/img/l2_segments1.png) | ||
|
||
![L2 Segments](/img/l2_segments2.png) | ||
|
||
![L2 Segments](/img/l2_segments3.png) | ||
|
||
First, select **Private**, choose the region, add the servers, assign a name, and save it. | ||
- Set the type to **Native**. | ||
|
||
![Type](/img/type_native.png) | ||
|
||
Do the same for Public. | ||
|
||
### Access | ||
- Create SSH keys for server access. | ||
- Go to **Identity and Access > SSH and Keys**. | ||
|
||
![SSH](/img/ssh_gpg_keys1.png) | ||
|
||
- Create new keys or add your own. | ||
|
||
![SSH](/img/ssh_gpg_keys2.png) | ||
![SSH](/img/ssh_gpg_keys3.png) | ||
|
||
## Setup OS | ||
|
||
### Rescue Mode / Access | ||
|
||
- Go to **Dedicated Servers - Server Details**, and click **Reboot to Rescue**. Select your SSH key. | ||
|
||
![Rescue](/img/rescue.png) | ||
|
||
- Connect via SSH | ||
- Log in via SSH using the external IP of the server (**Public IP** in **Details**). | ||
|
||
![Public IP](/img/public_ip.png) | ||
|
||
### Interfaces | ||
- **Interface Information** | ||
- You should have received an email from your provider (Servers.com) containing the MAC addresses of the interfaces. | ||
- Run `ip a` to view network interfaces. | ||
- Record the alias names (altname) for the public and private interfaces with uplink information (needed for network configuration). | ||
|
||
### Setup | ||
|
||
Check Disks: | ||
```bash | ||
# lsblk | ||
|
||
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS | ||
sda 259:4 0 476.9G 0 disk | ||
sdb 259:0 0 476.9G 0 disk | ||
``` | ||
|
||
⚠️ The following commands will erase your data! | ||
Wipe disks | ||
|
||
```bash | ||
sfdisk /dev/sda --delete | ||
sfdisk /dev/sdb --delete | ||
wipefs -a /dev/sda | ||
wipefs -a /dev/sdb | ||
``` | ||
|
||
Set environment variable: | ||
|
||
```bash | ||
DISK=$(lsblk -dn -o NAME,SIZE,TYPE -e 1,7,11,14,15 | sort | sed -n 1p | awk '{print $1}') | ||
echo "DISK=$DISK" | ||
``` | ||
|
||
Download Talos Linux asset from the Cozystack’s [releases page](https://github.com/aenix-io/cozystack/releases), and write it into disk: | ||
```bash | ||
cd /tmp | ||
wget https://github.com/aenix-io/cozystack/releases/latest/download/metal-amd64.raw.xz | ||
xz -d -c /tmp/metal-amd64.raw.xz | dd of="/dev/$DISK" bs=4M oflag=sync | ||
``` | ||
|
||
Resize the partition table and prepare additional partition for the cloud-init data: | ||
|
||
```bash | ||
# resize gpt partition | ||
sgdisk -e "/dev/$DISK" | ||
|
||
# Create 20MB partition in the end of disk | ||
end=$(sgdisk -E "/dev/$DISK") | ||
sgdisk -n7:$(( $end - 40960 )):$end -t7:ef00 "/dev/$DISK" | ||
|
||
# Create FAT filesystem for cloud-init and mount it | ||
PARTITION=$(sfdisk -d "/dev/$DISK" | awk 'END{print $1}' | awk -F/ '{print $NF}') | ||
mkfs.vfat -n CIDATA "/dev/$PARTITION" | ||
mount "/dev/$PARTITION" /mnt | ||
``` | ||
|
||
Umount cloud-init partition, sync changes, and reboot the server: | ||
|
||
```bash | ||
umount /mnt | ||
sync | ||
reboot | ||
``` | ||
|
||
### Talos Network Configuration for Remote Management | ||
- Press **F3** (network configuration). | ||
- Go to **Interfaces** and locate the external interface using the attname from the **Interfaces** section above. | ||
- Configure it with the IP address and subnet information from the server details: | ||
- **Public IP** (with subnet mask). | ||
- **Gateway**. | ||
|
||
![Public IP](/img/public_ip.png) | ||
![Public Networks](/img/public_networks.png) | ||
|
||
## Talos Configuration | ||
|
||
**Installation with Talm** | ||
|
||
1. Run the following command to initialize Talm for Cozystack: | ||
|
||
```bash | ||
talm init -p cozystack | ||
``` | ||
|
||
After initializing, generate a configuration template with the command: | ||
|
||
```bash | ||
talm -n 1.2.3.4 -e 1.2.3.4 template -t templates/controlplane.yaml -i > nodes/node-N.yam | ||
``` | ||
|
||
2. Edit the node configuration file as needed. | ||
|
||
Example configuration: | ||
|
||
```yaml | ||
# talm: nodes=["1.2.3.4"], endpoints=["1.2.3.4"], templates=["templates/controlplane.yaml"] | ||
# THIS FILE IS AUTOGENERATED. DO NOT EDIT IT! | ||
machine: | ||
type: controlplane | ||
kubelet: | ||
extraConfig: | ||
maxPods: 512 | ||
nodeIP: | ||
validSubnets: | ||
- 192.168.100.0/24 | ||
network | ||
interfaces: | ||
- deviceSelector: | ||
busPath: "0000:02:00.1" | ||
addresses: | ||
- 1.2.3.4/29 | ||
routes: | ||
- network: 0.0.0.0/0 | ||
gateway: 1.2.3.3 | ||
- deviceSelector: | ||
busPath: "0000:02:00.0" | ||
addresses: | ||
- 192.168.100.11/24 | ||
vip: | ||
ip: 192.168.100.10 | ||
install: | ||
disk: /dev/sdb | ||
image: ghcr.io/aenix-io/cozystack/talos:v1.8.0 | ||
files: | ||
- content: "[plugins]\n [plugins.\"io.containerd.grpc.v1.cri\"]\n device_ownership_from_security_context = true \n [plugins.\"io.containerd.cri.v1.runtime\"]\n device_ownership_from_security_context = true\n" | ||
permissions: 0o0 | ||
path: /etc/cri/conf.d/20-customization.part | ||
op: create | ||
kernel: | ||
modules: | ||
- name: openvswitch | ||
- name: drbd | ||
parameters: | ||
- usermode_helper=disabled | ||
- name: zfs | ||
- name: spl | ||
cluster: | ||
controlPlane: | ||
endpoint: https://192.168.100.10:6443 | ||
clusterName: aenix-cloud-init | ||
network: | ||
cni: | ||
name: none | ||
dnsDomain: cozy.local | ||
serviceSubnets: | ||
- 10.96.0.0/16 | ||
apiServer: | ||
certSANs: | ||
- 127.0.0.1 | ||
controllerManager: | ||
extraArgs: | ||
bind-address: 0.0.0.0 | ||
proxy: | ||
disabled: true | ||
scheduler: | ||
extraArgs: | ||
bind-address: 0.0.0.0 | ||
discovery: | ||
enabled: false | ||
etcd: | ||
advertisedSubnets: | ||
- 192.168.100.0/24 | ||
allowSchedulingOnControlPlanes: true | ||
``` | ||
![YAML](/img/yaml.png) | ||
**This section isn’t generated automatically:** | ||
1. `busPath` - Obtained from the "Discovered interfaces busPath" by matching the MAC address of the private interface specified in the provider's email. (Out of the two interfaces, select the one with the uplink). | ||
2. `addresses` - Use the address specified for Layer 2 (L2). | ||
|
||
**Execution steps:** | ||
|
||
1. Run `talm apply -f nodeN.yml` for all nodes to apply the configurations. | ||
2. Execute `talm bootstrap -f` for the first node. | ||
3. Use `talm dashboard -f node1.yml -f node2.yml` (or additional files depending on the number of nodes) or `kubectl get nodes`. | ||
|
||
Monitoring: Check the dashboard to see when all nodes reach an operational state. | ||
|
||
Have a great day! |