k0s-install.sh 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/usr/bin/env bash
  2. # Copyright (c) 2021-2023 tteck
  3. # Author: tteck (tteckster)
  4. # License: MIT
  5. # https://github.com/tteck/Proxmox/raw/main/LICENSE
  6. source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
  7. color
  8. verb_ip6
  9. catch_errors
  10. setting_up_container
  11. network_check
  12. update_os
  13. msg_info "Installing Dependencies"
  14. $STD apt-get install -y curl
  15. $STD apt-get install -y sudo
  16. $STD apt-get install -y mc
  17. $STD apt-get install -y git
  18. msg_ok "Installed Dependencies"
  19. msg_info "Installing k0s Kubernetes"
  20. $STD bash <(curl -sSLf https://get.k0s.sh)
  21. $STD k0s install controller --single
  22. $STD k0s start
  23. mkdir -p /etc/k0s
  24. k0s config create > /etc/k0s/k0s.yaml
  25. msg_ok "Installed k0s Kubernetes"
  26. read -r -p "Would you like to add Helm Package Manager? <y/N> " prompt
  27. if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
  28. msg_info "Installing Helm"
  29. $STD bash <(curl -sSLf https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3)
  30. msg_ok "Installed Helm"
  31. fi
  32. motd_ssh
  33. customize
  34. msg_info "Cleaning up"
  35. $STD apt-get autoremove
  36. $STD apt-get autoclean
  37. msg_ok "Cleaned"