Skip to content

operator‐1941

Allan Roger Reid edited this page Mar 13, 2024 · 3 revisions

Set linger and reboot

ssh -p 20492 [email protected] -o "ServerAliveInterval=5" -o "ServerAliveCountMax=100000" -o "StrictHostKeyChecking=off"
loginctl enable-linger ubuntu

Install and verify k3s

sudo apt-get update -y && \
sudo apt-get upgrade -y && \
sudo apt-get install build-essential && \
sudo apt-get install linux-generic -y && \
sudo apt-get dist-upgrade -y && \
sudo apt-get install linux-headers-generic -y && \
sudo touch /dev/kmsg
sudo ln -s /lib/modules/6.2.0-39-generic /lib/modules/6.2.0-35-generic

sudo touch /dev/kmsg
curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE="644" sh -s - --snapshotter=fuse-overlayfs
sudo journalctl -f -u k3s.service
sudo systemctl status k3s

cat <<EOF >> ~/.bashrc 
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
EOF
cat ~/.bashrc 
source ~/.profile

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

Install minio operator

curl -O https://raw.githubusercontent.com/minio/operator/master/helm-releases/operator-5.0.13.tgz
tar -xvf operator-5.0.13.tgz
helm install --namespace minio-operator --create-namespace minio-operator operator-5.0.13.tgz -f ./operator/values.yaml
SA_TOKEN=$(kubectl -n minio-operator get secret console-sa-secret -o jsonpath="{.data.token}" | base64 --decode)
echo $SA_TOKEN
kubectl patch service -n minio-operator console -p '{"spec":{"ports":[{"name": "http","port": 9090,"protocol": "TCP","nodePort":31090}],"type": "NodePort"}}'

Install go

wget https://go.dev/dl/go1.21.7.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.21.7.linux-amd64.tar.gz
cat <<EOF >> $HOME/.profile 
export PATH=$PATH:/usr/local/go/bin:~/go/bin
EOF
cat $HOME/.profile 
source $HOME/.profile
go version

Build & install kubectl-minio plugin

mkdir github && cd github
git clone https://github.com/minio/operator.git
cd ~/github/operator/kubectl-minio
CGO_ENABLED=1 go build --ldflags "-s -w" -trimpath -o ../kubectl-minio

Login to operator and create tenant

image

Confirm minio version is visible

./kubectl-minio tenant list
Tenant 'test', Namespace 'test', Total capacity 1.0 GiB

  Current status: Initialized 
  MinIO version: minio/minio:RELEASE.2024-03-10T02-53-48Z 

Confirm minio version is upgradeable

./kubectl-minio tenant upgrade test --image minio/minio:RELEASE.2024-03-10T02-53-48Z
Upgrade is a one way process. Are you sure to upgrade Tenant 'test/test' from version minio/minio:RELEASE.2024-03-10T02-53-48Z to minio/minio:RELEASE.2024-03-10T02-53-48Z: y

Upgrading Tenant 'test/test'
Clone this wiki locally