diff --git a/README.md b/README.md index a81e4af..a231849 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ In order to run PKE, you need to meet the following requirements. #### Operating system -`pke` currently is available for CentOS 7.x, RHEL 7.x. and **Ubuntu 18.04 LTS**. +`pke` currently is available for CentOS 8.x, RHEL 8.x. and **Ubuntu 20.04 LTS**. > We recommend using Ubuntu since it contains a much newer Kernel version. If you need support for an OS not listed above feel free to contact us. diff --git a/Vagrantfile b/Vagrantfile index 92baf0a..fd6d3db 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -15,26 +15,18 @@ Vagrant.configure("2") do |config| $num_instances = 4 - # centos 8 nodes + # almalinux 8 nodes (1..$num_instances).each do |n| - config.vm.define "centos#{n}" do |node| - node.vm.box = "centos/8" - - # Monkey patch for https://github.com/dotless-de/vagrant-vbguest/issues/367 - class Foo < VagrantVbguest::Installers::CentOS - def has_rel_repo? - unless instance_variable_defined?(:@has_rel_repo) - rel = release_version - @has_rel_repo = communicate.test("yum repolist") - end - @has_rel_repo - end + config.vm.define "almalinux#{n}" do |node| + node.vm.box = "boxomatic/almalinux-8" + node.vm.box_version = "20220116.0.1" + class Foo < VagrantVbguest::Installers::Linux def install_kernel_devel(opts=nil, &block) - cmd = "yum update kernel -y" + cmd = "dnf update kernel -y" communicate.sudo(cmd, opts, &block) - cmd = "yum install -y kernel-devel" + cmd = "dnf install -y kernel-devel" communicate.sudo(cmd, opts, &block) cmd = "shutdown -r now" @@ -48,9 +40,9 @@ Vagrant.configure("2") do |config| node.vbguest.installer = Foo node.vm.network "private_network", ip: "192.168.64.#{n+10}" - node.vm.hostname = "centos#{n}" + node.vm.hostname = "almalinux#{n}" node.vm.provider "virtualbox" do |vb| - vb.name = "centos#{n}" + vb.name = "almalinux#{n}" vb.memory = "2048" vb.cpus = "2" vb.customize ["modifyvm", :id, "--audio", "none"] @@ -68,14 +60,14 @@ Vagrant.configure("2") do |config| echo 'ip_tables' >> /etc/modules-load.d/iptables.conf echo 'set host name resolution' cat >> /etc/hosts <> /etc/hosts < /etc/docker/daemon.json < /etc/environment'" +vagrant ssh almalinux1 -c "sudo /scripts/pke-multi-master1.sh '$KUBERNETES_VERSION' '192.168.64.11:6443'" +vagrant ssh almalinux1 -c 'sudo cat /etc/kubernetes/admin.conf' > pke-multi-config.yaml +vagrant ssh almalinux1 -c "sudo /banzaicloud/pke token list -o json" > build/token.json + + +TOKEN=`jq -r '.tokens[] | select(.expired == false) | .token' build/token.json` +CERTHASH=`jq -r '.tokens[] | select(.expired == false) | .hash' build/token.json` + +echo "" +echo "Using '$TOKEN' and '$CERTHASH' to join other nodes to the cluster" + +# install second master node +echo "" +echo "= almalinux2 ========================================================================" +vagrant up almalinux2 +vagrant ssh almalinux2 -c "sudo /scripts/pke-multi-mastern.sh '$KUBERNETES_VERSION' '192.168.64.11:6443' '$TOKEN' '$CERTHASH' 192.168.64.12" + +# install third master node +echo "" +echo "= almalinux3 ========================================================================" +vagrant up almalinux3 +vagrant ssh almalinux3 -c "sudo /scripts/pke-multi-mastern.sh '$KUBERNETES_VERSION' '192.168.64.11:6443' '$TOKEN' '$CERTHASH' 192.168.64.13" + +# install worker node +echo "" +echo "= almalinux4 ========================================================================" +vagrant up almalinux4 +vagrant ssh almalinux4 -c "sudo /scripts/pke-multi-worker.sh '$KUBERNETES_VERSION' '192.168.64.11:6443' '$TOKEN' '$CERTHASH'" + +export KUBECONFIG=$PWD/pke-multi-config.yaml + +echo "" +echo "You can access your PKE cluster either:" +echo "- from your host machine accessing the cluster via kubectl. Please run:" +echo "export KUBECONFIG=$PWD/pke-multi-config.yaml" +echo "" +echo "- or starting a shell in the virtual machine. Please run:" +echo "vagrant ssh almalinux1 -c 'sudo -s'" diff --git a/almalinux8-single-upgrade.sh b/almalinux8-single-upgrade.sh new file mode 100755 index 0000000..3a1d5b0 --- /dev/null +++ b/almalinux8-single-upgrade.sh @@ -0,0 +1,8 @@ +#!/bin/bash -e + +# build latest pke tool +GOOS=linux make pke + +KUBERNETES_VERSION="${1:-v1.21.0}" + +vagrant ssh almalinux1 -c "sudo /banzaicloud/pke upgrade master --kubernetes-version='$KUBERNETES_VERSION'" diff --git a/centos8-single.sh b/almalinux8-single.sh similarity index 59% rename from centos8-single.sh rename to almalinux8-single.sh index cec1952..d54d3b6 100755 --- a/centos8-single.sh +++ b/almalinux8-single.sh @@ -5,9 +5,9 @@ GOOS=linux make pke KUBERNETES_VERSION="${1:-v1.20.6}" -vagrant up centos1 -vagrant ssh centos1 -c "sudo /scripts/pke-single.sh '$KUBERNETES_VERSION' '192.168.64.11:6443' containerd cilium" -vagrant ssh centos1 -c 'sudo cat /etc/kubernetes/admin.conf' > pke-single-config.yaml +vagrant up almalinux1 +vagrant ssh almalinux1 -c "sudo /scripts/pke-single.sh '$KUBERNETES_VERSION' '192.168.64.11:6443' containerd cilium" +vagrant ssh almalinux1 -c 'sudo cat /etc/kubernetes/admin.conf' > pke-single-config.yaml export KUBECONFIG=$PWD/pke-single-config.yaml @@ -17,4 +17,4 @@ echo "- from your host machine accessing the cluster via kubectl. Please run:" echo "export KUBECONFIG=$PWD/pke-single-config.yaml" echo "" echo "- or starting a shell in the virtual machine. Please run:" -echo "vagrant ssh centos1 -c 'sudo -s'" +echo "vagrant ssh almalinux1 -c 'sudo -s'" diff --git a/centos8-multi-upgrade.sh b/centos8-multi-upgrade.sh deleted file mode 100755 index b6ab197..0000000 --- a/centos8-multi-upgrade.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -e - -# build latest pke tool -GOOS=linux make pke - -KUBERNETES_VERSION="${1:-v1.21.0}" - -# upgrade first master node -echo "" -echo "= centos1 ========================================================================" -vagrant ssh centos1 -c "sudo /banzaicloud/pke upgrade master --kubernetes-version='$KUBERNETES_VERSION'" - -# waiting 10 seconds because of apiserver -sleep 10 - -# upgrade second master node -echo "" -echo "= centos2 ========================================================================" -vagrant ssh centos2 -c "sudo /banzaicloud/pke upgrade master --kubernetes-version='$KUBERNETES_VERSION' --kubernetes-additional-control-plane" - -# upgrade third master node -echo "" -echo "= centos3 ========================================================================" -vagrant ssh centos3 -c "sudo /banzaicloud/pke upgrade master --kubernetes-version='$KUBERNETES_VERSION' --kubernetes-additional-control-plane" - -# upgrade worker node -echo "" -echo "= centos4 ========================================================================" -vagrant ssh centos4 -c "sudo /banzaicloud/pke upgrade worker --kubernetes-version='$KUBERNETES_VERSION'" diff --git a/centos8-multi.sh b/centos8-multi.sh deleted file mode 100755 index 76d6b34..0000000 --- a/centos8-multi.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -e - -# prerequisitesSkipping phase due to missing Pipeline API endpoint credentials -jq --version || (echo "Please install jq command line tool. https://stedolan.github.io/jq/" && exit 1) - -# build latest pke tool -GOOS=linux make pke - -KUBERNETES_VERSION="${1:-v1.20.6}" - -# install first master node -echo "" -echo "= centos1 ========================================================================" -vagrant up centos1 -vagrant ssh centos1 -c "sudo sh -c 'echo -n "LANG=en_US.utf-8\nLC_ALL=en_US.utf-8" > /etc/environment'" -vagrant ssh centos1 -c "sudo /scripts/pke-multi-master1.sh '$KUBERNETES_VERSION' '192.168.64.11:6443'" -vagrant ssh centos1 -c 'sudo cat /etc/kubernetes/admin.conf' > pke-multi-config.yaml -vagrant ssh centos1 -c "sudo /banzaicloud/pke token list -o json" > build/token.json - - -TOKEN=`jq -r '.tokens[] | select(.expired == false) | .token' build/token.json` -CERTHASH=`jq -r '.tokens[] | select(.expired == false) | .hash' build/token.json` - -echo "" -echo "Using '$TOKEN' and '$CERTHASH' to join other nodes to the cluster" - -# install second master node -echo "" -echo "= centos2 ========================================================================" -vagrant up centos2 -vagrant ssh centos2 -c "sudo /scripts/pke-multi-mastern.sh '$KUBERNETES_VERSION' '192.168.64.11:6443' '$TOKEN' '$CERTHASH' 192.168.64.12" - -# install third master node -echo "" -echo "= centos3 ========================================================================" -vagrant up centos3 -vagrant ssh centos3 -c "sudo /scripts/pke-multi-mastern.sh '$KUBERNETES_VERSION' '192.168.64.11:6443' '$TOKEN' '$CERTHASH' 192.168.64.13" - -# install worker node -echo "" -echo "= centos4 ========================================================================" -vagrant up centos4 -vagrant ssh centos4 -c "sudo /scripts/pke-multi-worker.sh '$KUBERNETES_VERSION' '192.168.64.11:6443' '$TOKEN' '$CERTHASH'" - -export KUBECONFIG=$PWD/pke-multi-config.yaml - -echo "" -echo "You can access your PKE cluster either:" -echo "- from your host machine accessing the cluster via kubectl. Please run:" -echo "export KUBECONFIG=$PWD/pke-multi-config.yaml" -echo "" -echo "- or starting a shell in the virtual machine. Please run:" -echo "vagrant ssh centos1 -c 'sudo -s'" diff --git a/centos8-single-upgrade.sh b/centos8-single-upgrade.sh deleted file mode 100755 index 17543ae..0000000 --- a/centos8-single-upgrade.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -e - -# build latest pke tool -GOOS=linux make pke - -KUBERNETES_VERSION="${1:-v1.21.0}" - -vagrant ssh centos1 -c "sudo /banzaicloud/pke upgrade master --kubernetes-version='$KUBERNETES_VERSION'"