first commit

main
SLW\ARNAUA 2023-05-15 08:34:59 +02:00
commit 51591c63a7
1 changed files with 96 additions and 0 deletions

96
script.sh Normal file
View File

@ -0,0 +1,96 @@
#!/bin/sh
# Author : NTT Data AG
# Date : 11-05-2023
# update resources
function update {
}
# install necessary packages
function install_resources {
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
}
# install k3s
# docs: https://docs.k3s.io/installation/configuration
function 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
k3s kubectl get pods -A
}
# fetch helm resources
# docs: https://helm.sh/docs/intro/install/
function install_helm {
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
}
git
https://www.liquidweb.com/kb/how-to-install-and-configure-git-on-fedora-22/#:~:text=1%20Introduction.%20Git%20is%20a%20widely%20adopted%2C%20distributed,for%20git.%20Using%20the%20%E2%80%93global%20option...%20More%20
sudo dnf -y update
sudo dnf -y install git
checkout sockshop
https://microservices-demo.github.io/deployment/kubernetes-start.html
git clone https://github.com/microservices-demo/microservices-demo.git
k3s kubectl create namespace sock-shop
k3s kubectl apply -f complete-demo.yaml
other
k3s kubectl get pods -n sock-shop
function get_k3s {
  write_progress "Installing K3s (${K3SVERSION}) with NGINX instead of Traefik Ingress"
  curl -sfL https://get.k3s.io | INSTALL_K3S_CHANNEL="${K3SVERSION}" INSTALL_K3S_SYMLINK="skip" K3S_KUBECONFIG_MODE="644" INSTALL_K3S_EXEC="--disable=traefik" sh -
  # set the kubeconfig
  export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
  kubectl get pods -A
  # install ingress nginx
  helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
  helm repo update
  echo "####### EW "
  helm install ingress-nginx ingress-nginx/ingress-nginx --version="${NGINX_INGRESS_VERSION}"
  # wait for nginx to be ready
}