flow setup. not tested yet
parent
8f3e5f14c7
commit
0f232626f2
55
setup.sh
55
setup.sh
|
|
@ -9,9 +9,43 @@ app_name=""
|
||||||
# fetch helm resources
|
# fetch helm resources
|
||||||
# docs: https://helm.sh/docs/intro/install/
|
# docs: https://helm.sh/docs/intro/install/
|
||||||
install_helm () {
|
install_helm () {
|
||||||
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
|
# curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
|
||||||
chmod 700 get_helm.sh
|
# chmod 700 get_helm.sh
|
||||||
./get_helm.sh
|
# ./get_helm.sh
|
||||||
|
echo "Helm not support yet."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# install resources
|
||||||
|
# TODO: check if this works
|
||||||
|
install_k3s () {
|
||||||
|
sudo dnf install -y container-selinux
|
||||||
|
sudo dnf install -y https://rpm.rancher.io/k3s/stable/common/centos/8/noarch/k3s-selinux-1.2-2.el8.noarch.rpm
|
||||||
|
|
||||||
|
get_k3s
|
||||||
|
}
|
||||||
|
|
||||||
|
# install k3s
|
||||||
|
# docs: https://docs.k3s.io/installation/configuration
|
||||||
|
get_k3s () {
|
||||||
|
sudo curl -sfL https://get.k3s.io | INSTALL_K3S_SYMLINK="skip" K3S_KUBECONFIG_MODE="644" INSTALL_K3S_EXEC="--disable=traefik" sh -
|
||||||
|
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
|
||||||
|
kubectl get pods -A
|
||||||
|
}
|
||||||
|
|
||||||
|
# install git
|
||||||
|
install_git () {
|
||||||
|
sudo dnf -y update
|
||||||
|
sudo dnf -y install git
|
||||||
|
}
|
||||||
|
|
||||||
|
install_sock_shop () {
|
||||||
|
git clone https://github.com/microservices-demo/microservices-demo.git
|
||||||
|
cd deploy/kubernetes
|
||||||
|
kubectl create namespace sock-shop
|
||||||
|
kubectl apply -f complete-demo.yaml
|
||||||
|
echo "Getting Pods from sock-shop namespace"
|
||||||
|
k3s kubectl get pods -n sock-shop
|
||||||
}
|
}
|
||||||
|
|
||||||
show_help() {
|
show_help() {
|
||||||
|
|
@ -55,22 +89,29 @@ done
|
||||||
|
|
||||||
# Check if --helm was set
|
# Check if --helm was set
|
||||||
if [ "$helm_install" = true ]; then
|
if [ "$helm_install" = true ]; then
|
||||||
echo "Installing helm"
|
install_helm
|
||||||
# install_helm
|
|
||||||
else
|
else
|
||||||
echo "Skipping helm"
|
echo "Skipping helm"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Installing GIT"
|
||||||
|
# install_git
|
||||||
|
|
||||||
|
echo "Installing K3S"
|
||||||
|
# install_k3s
|
||||||
|
|
||||||
# Validate app names
|
# Validate app names
|
||||||
if [ -z "$app_name" ]; then
|
if [ -z "$app_name" ]; then
|
||||||
echo "Please specify app"
|
echo "Please specify app"
|
||||||
else
|
else
|
||||||
case $app_name in
|
case $app_name in
|
||||||
"socks_shop")
|
"sock_shop")
|
||||||
echo "installing sock shop"
|
echo "Installing sock shop"
|
||||||
|
install_sock_shop
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Only following apps allowed"
|
echo "Only following apps allowed"
|
||||||
|
echo "- sock_shop"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue