mirror of
https://github.com/kelseyhightower/kubernetes-the-hard-way.git
synced 2025-12-16 01:38:58 +03:00
Refresh and add Apple Silicon (#338)
* Delete CKA stuff. It's covered in CKA repo * Rename nodes * Cluster up again * Update issue template * Update README * Begin rearranging docs * Update links * Initial mac instructions * iterm2 image * update ssh-copy-id to be cross platform * remove vagrant specific * Apple scripts WIP * Add var for architecture * order input files * Apple build working! * auto-locate docs * install sshpass * Set execute bit * apple done! * install sshpass * edits * Corrections * kube version output * Adjustments * Adjustments
This commit is contained in:
27
apple-silicon/scripts/01-setup-hosts.sh
Executable file
27
apple-silicon/scripts/01-setup-hosts.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Set hostfile entries
|
||||
sudo sed -i "/$(hostname)/d" /etc/hosts
|
||||
cat /tmp/hostentries | sudo tee -a /etc/hosts &> /dev/null
|
||||
|
||||
# Export internal IP of primary NIC as an environment variable
|
||||
echo "PRIMARY_IP=$(ip route | grep default | awk '{ print $9 }')" | sudo tee -a /etc/environment > /dev/null
|
||||
|
||||
# Export architecture as environment variable to download correct versions of software
|
||||
echo "ARCH=arm64" | sudo tee -a /etc/environment > /dev/null
|
||||
|
||||
# Enable password auth in sshd so we can use ssh-copy-id
|
||||
# Enable password auth in sshd so we can use ssh-copy-id
|
||||
sudo sed -i --regexp-extended 's/#?PasswordAuthentication (yes|no)/PasswordAuthentication yes/' /etc/ssh/sshd_config
|
||||
sudo sed -i --regexp-extended 's/#?Include \/etc\/ssh\/sshd_config.d\/\*.conf/#Include \/etc\/ssh\/sshd_config.d\/\*.conf/' /etc/ssh/sshd_config
|
||||
sudo sed -i 's/KbdInteractiveAuthentication no/KbdInteractiveAuthentication yes/' /etc/ssh/sshd_config
|
||||
sudo systemctl restart sshd
|
||||
|
||||
if [ "$(hostname)" = "controlplane01" ]
|
||||
then
|
||||
sh -c 'sudo apt update' &> /dev/null
|
||||
sh -c 'sudo apt-get install -y sshpass' &> /dev/null
|
||||
fi
|
||||
|
||||
# Set password for ubuntu user (it's something random by default)
|
||||
echo 'ubuntu:ubuntu' | sudo chpasswd
|
||||
Reference in New Issue
Block a user