Update versions

This commit is contained in:
me 2023-04-09 20:59:30 +02:00
parent 5b475eff7a
commit a0521d44db
2 changed files with 40 additions and 18 deletions

View File

@ -1,6 +1,11 @@
#!/bin/bash
TERRAFORM_VERSION="1.2.6"
USE_DOCKER="false"
INSTALL_TERRAFORM="true"
INSTALL_HELM="true"
# If version is empty, and rpm latest is installed. If bin you need version.
TERRAFORM_VERSION=
TERRAFORM_SOURCE="rpm" #Value rpm|bin
CONTAINER_ENGINE="podman" # Value podman|docker
kind () {
# Install kind
@ -11,18 +16,31 @@ sudo mv ./kind /usr/local/bin/kind
terraform_bin () {
# Install terraform
curl -Lo ./terraform.zip https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip
unzip ./terraform.zip
chmod +x ./terraform
sudo mv ./terraform /usr/local/bin/terraform
if [ "${TERRAFORM_SOURCE}" == bin ]; then
if [ ! -z "${TERRAFORM_VERSION}" ]; then
echo "You need to provide terraform version when to use bin source"
exit
fi
curl -Lo ./terraform.zip https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip
unzip ./terraform.zip
chmod +x ./terraform
sudo mv ./terraform /usr/local/bin/terraform
fi
}
terraform_rpm () {
# Install terraform
sudo dnf install -y dnf-plugins-core
sudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
sudo sed -i 's/^enabled=1/enabled=0/g' /etc/yum.repos.d/hashicorp.repo
sudo dnf -y install terraform-${TERRAFORM_VERSION} --enablerepo hashicorp
if [ "${TERRAFORM_SOURCE}" == bin ]; then
sudo dnf install -y dnf-plugins-core
sudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
if [ ! -z "${TERRAFORM_VERSION}" ]; then
sudo sed -i 's/^enabled=1/enabled=0/g' /etc/yum.repos.d/hashicorp.repo
sudo dnf -y install terraform-${TERRAFORM_VERSION} --enablerepo hashicorp
else
sudo sed -i 's/^enabled=0/enabled=1/g' /etc/yum.repos.d/hashicorp.repo
sudo dnf -y install terraform
fi
fi
}
helm () {
@ -44,7 +62,7 @@ sudo yum install -y kubectl
}
prereq_fedora () {
if [ "$USE_DOCKER" == true ]; then
if [ "${CONTAINER_ENGINE}" == docker ]; then
sudo dnf install -y moby-engine
sudo systemctl enable --now docker.service
else
@ -54,7 +72,11 @@ fi
prereq_fedora
kind
#terraform_bin
terraform_rpm
helm
if [ "${INSTALL_TERRAFORM}" == true ]; then
terraform_bin
terraform_rpm
fi
if [ "${INSTALL_HELM}" == true ]; then
helm
fi
kubectl

View File

@ -3,10 +3,10 @@ apiVersion: kind.x-k8s.io/v1alpha4
name: onethree
nodes:
- role: control-plane
image: kindest/node:v1.23.10@sha256:f047448af6a656fae7bc909e2fab360c18c487ef3edc93f06d78cdfd864b2d12
image: kindest/node:v1.26.3@sha256:61b92f38dff6ccc29969e7aa154d34e38b89443af1a2c14e6cfbd2df6419c66f
- role: worker
image: kindest/node:v1.23.10@sha256:f047448af6a656fae7bc909e2fab360c18c487ef3edc93f06d78cdfd864b2d12
image: kindest/node:v1.26.3@sha256:61b92f38dff6ccc29969e7aa154d34e38b89443af1a2c14e6cfbd2df6419c66f
- role: worker
image: kindest/node:v1.23.10@sha256:f047448af6a656fae7bc909e2fab360c18c487ef3edc93f06d78cdfd864b2d12
image: kindest/node:v1.26.3@sha256:61b92f38dff6ccc29969e7aa154d34e38b89443af1a2c14e6cfbd2df6419c66f
- role: worker
image: kindest/node:v1.23.10@sha256:f047448af6a656fae7bc909e2fab360c18c487ef3edc93f06d78cdfd864b2d12
image: kindest/node:v1.26.3@sha256:61b92f38dff6ccc29969e7aa154d34e38b89443af1a2c14e6cfbd2df6419c66f