Updated README and deactivated kubectl and rke install

master
Meliurwen 4 years ago
parent 6b7a908e50
commit 0f2d304f4c
Signed by: meliurwen
GPG Key ID: 818A8B35E9F1CE10
  1. 61
      README.md
  2. 7
      custom/install_kubectl.sh
  3. 0
      custom/install_rke.sh
  4. 4
      custom/main.sh
  5. 2
      preseed/preseed.cfg

@ -0,0 +1,61 @@
# Debian unattended install
> **ATTENTION:** this repo is focused on my thesis work so expect some mess and low generalization.
## Usage
Get help:
```sh
./regeniso-sid.sh -h
```
### Examples:
> **Note:** `preseed/kube.cfg` at the moment works only with the _netinst_ image. The reason is that with the _netinst-minimal_ I should manually install some kernel modules (`cdrom` for example) and at the moment I don't know how to do this.
Generate a _netinst_ with a _kube_ preseed:
```sh
./regeniso-sid.sh preseed/kube.cfg netinst stable amd64 auto "bluetooth.blacklist=yes bnep.blacklist=yes"
```
## Initialize the VM
Create a VM and launch the unattended install.
Minimal requirements:
+ 2 Cores
+ 3GB RAM (8GB for a decent experience)
Once the unattended installation finished successfully we should prepare the environment inside the VM.
Launch this script:
```sh
/srv/custom/main.sh
```
Once it concluded successfully shut down the VM.
Use the image of the first VM as a base and create 3 different linked volumes:
```sh
qemu-img create -f qcow2 -b baseImage.qcow2 deltaImage.qcow2
```
Create 3 clones of the base VM and associate at each one a delta image. Beware that each VM **_must_** have a different MAC address.
Launch the 3 VM clones and in one of them (usually the first) login and then install Rancher:
Login without polluting the _known hosts_ file:
```sh
ssh virtualuser@ipAddress -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"
```
And then launch this to install Rancher:
```sh
docker run -d --restart=unless-stopped -p 80:80 -p 443:443 --privileged rancher/rancher
```

@ -50,10 +50,15 @@ systemctl restart kubelet
echo "Pulling some base images.." echo "Pulling some base images.."
kubeadm config images pull kubeadm config images pull
echo "Initializing kuvernetes.." echo "Initializing kubernetes.."
kubeadm init kubeadm init
echo "Adding kubernetes config to this user home folder (useful for non-root users)..." echo "Adding kubernetes config to this user home folder (useful for non-root users)..."
mkdir -p "$HOME/.kube" mkdir -p "$HOME/.kube"
cp -i /etc/kubernetes/admin.conf "$HOME/.kube/config" cp -i /etc/kubernetes/admin.conf "$HOME/.kube/config"
chown "$(id -u)":"$(id -g)" "$HOME/.kube/config" chown "$(id -u)":"$(id -g)" "$HOME/.kube/config"
# This last one thanks to:
# https://stackoverflow.com/questions/53814150/how-to-setup-a-2-node-kubernetes-cluster-in-custom-environment
echo "export KUBECONFIG=/etc/kubernetes/admin.conf" | tee -a ~/.bashrc

@ -11,8 +11,8 @@ eval "${SCRIPTPATH}/install_packages.sh"
eval "${SCRIPTPATH}/install_docker.sh" eval "${SCRIPTPATH}/install_docker.sh"
eval "${SCRIPTPATH}/install_docker-compose.sh" eval "${SCRIPTPATH}/install_docker-compose.sh"
eval "${SCRIPTPATH}/disable_swap.sh" eval "${SCRIPTPATH}/disable_swap.sh"
eval "${SCRIPTPATH}/install_kubectl.sh"
eval "${SCRIPTPATH}/install_rancher.sh"
eval "${SCRIPTPATH}/generate_ssh_cluster.sh" eval "${SCRIPTPATH}/generate_ssh_cluster.sh"
#eval "${SCRIPTPATH}/install_kubectl.sh"
#eval "${SCRIPTPATH}/install_rke.sh"
apt-get clean apt-get clean

@ -463,5 +463,3 @@ d-i debian-installer/exit/poweroff boolean true
# directly, or use the apt-install and in-target commands to easily install # directly, or use the apt-install and in-target commands to easily install
# packages and run commands in the target system. # packages and run commands in the target system.
#d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh #d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh
d-i preseed/late_command string modprobe usb-storage isofs; mkdir -p /cdrom; mount /dev/cdrom /cdrom; cp -r /cdrom/custom /target/srv/custom

Loading…
Cancel
Save