-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better prompt and optional bash_history for seedbox
- Loading branch information
Showing
8 changed files
with
102 additions
and
70 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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,24 @@ | ||
#!/bin/bash | ||
|
||
./configNode.sh | ||
|
||
if [[ ! -n ${KUBE_JOIN_COMMAND} ]]; then | ||
printf "Run 'kubeadm token create --print-join-command' in the master to get a join command. Then re-run this script with KUBE_JOIN_COMMAND=command ./2-configK8SNode.sh" | ||
exit 1 | ||
fi; | ||
|
||
printf "\nJoin Kubernetes Cluster ==================================================================================\n" | ||
if [ ! -f "kubeadminit.lock" ]; then | ||
sudo systemctl enable kubelet.service | ||
# how to get this automatically | ||
eval ${KUBE_JOIN_COMMAND} | ||
touch kubeadminit.lock | ||
else | ||
printf "\nNOTE: Looks like kubeadm init already ran. If you want to run it again, delete kubeadminit.lock =========\n" | ||
fi; | ||
|
||
printf "\n\n=========================================================================================================\n" | ||
printf "Node is now joined. Verify that is running:\n" | ||
kubectl get nodes | ||
kubectl get ds --namespace=kube-system | ||
printf "\n\n" |
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
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,65 @@ | ||
#!/bin/bash | ||
|
||
if [[ $EUID = 0 ]]; then | ||
printf "Don't run this script as root" | ||
exit 1 | ||
fi | ||
|
||
printf "\nGet docker ===============================================================================================\n" | ||
if [ ! -f docker-ce-17.03.2.ce-1.fc25.x86_64.rpm ]; then | ||
wget https://download.docker.com/linux/fedora/25/x86_64/stable/Packages/docker-ce-17.03.2.ce-1.fc25.x86_64.rpm || exit 1 | ||
wget https://download.docker.com/linux/fedora/25/x86_64/stable/Packages/docker-ce-selinux-17.03.2.ce-1.fc25.noarch.rpm || exit 1 | ||
|
||
printf "\nInstall docker & deps ====================================================================================\n" | ||
sudo dnf -y install policycoreutils-python || exit 1 | ||
sudo mkdir -p /var/lib/docker || exit 1 | ||
sudo rpm -i docker-ce-selinux-17.03.2.ce-1.fc25.noarch.rpm || exit 1 | ||
sudo rpm -i docker-ce-17.03.2.ce-1.fc25.x86_64.rpm || exit 1 | ||
fi; | ||
|
||
printf "\nEnable docker ============================================================================================\n" | ||
sudo systemctl enable --now docker || exit 1 | ||
|
||
printf "\nVerify docker is working by running hello-world ==========================================================\n" | ||
sudo docker run --rm hello-world || exit 1 | ||
|
||
printf "\nDisable SELINUX because kubelet doesnt support it ========================================================\n" | ||
sudo setenforce 0 | ||
echo "SELINUX=disabled" | sudo tee /etc/sysconfig/selinux | ||
|
||
if [ ! -f /etc/yum.repos.d/kubernetes.repo ]; then | ||
printf "\nInstall kubelet, kubeadm, crictl(needed by kubelet), cockpit (nice fedora dashboard):" | ||
sudo bash -c 'cat <<EOF > /etc/yum.repos.d/kubernetes.repo | ||
[kubernetes] | ||
name=Kubernetes | ||
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 | ||
enabled=1 | ||
gpgcheck=1 | ||
repo_gpgcheck=1 | ||
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg | ||
exclude=kube* | ||
[kubernetes-unstable] | ||
name=Kubernetes-unstable | ||
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64-unstable | ||
enabled=0 | ||
gpgcheck=1 | ||
repo_gpgcheck=1 | ||
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg | ||
exclude=kube* | ||
EOF' | ||
fi; | ||
|
||
sudo dnf -y install --enablerepo=kubernetes kubelet kubectl kubeadm --disableexcludes=kubernetes || exit 1 | ||
sudo dnf -y install cockpit-docker cockpit-kubernetes cockpit-pcp || exit 1 | ||
|
||
printf "\nEnabling cockpit =========================================================================================\n" | ||
sudo systemctl enable --now cockpit.socket || exit 1 | ||
|
||
printf "\nDisabling swap ===========================================================================================\n" | ||
sudo swapoff -a || exit 1 | ||
|
||
printf "\nDisabling the firewall ===================================================================================\n" | ||
sudo systemctl stop firewalld | ||
sudo systemctl disable firewalld | ||
sudo dnf -y remove firewalld |
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