Skip to content

Test AiStor on VMs

Allan Roger Reid edited this page Nov 12, 2024 · 21 revisions

Obtain a VM.

Provide your SSH public key (or GitHub key) to Allan. A curl command like the following returns a JSON object containing all your configured keys:

`curl https://api.github.com/users/myname/keys` 

Allan will configure a unique VM with a NodePort, allowing you ssh access to the host and browser access to the AiStor console.

For example:

VM:

ssh ubuntu@a.b.c.d -p 3xxxx

VM setup

On the VM, install the following tools:

### Kind
sudo curl -L "https://kind.sigs.k8s.io/dl/v0.23.0/kind-$(uname)-amd64" -o /usr/local/bin/kind && sudo chmod +x /usr/local/bin/kind
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"  | bash
sudo install -o root -g root -m 0755 kustomize /usr/local/bin/kustomize


### Kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl


### Docker
sudo apt-get update
sudo apt-get install -y docker.io make npm
sudo groupadd docker
sudo usermod -aG docker ubuntu
newgrp docker

Clone the repo, create a Kind cluster and install AiStor

The following clones the aistor repo into a new directory and installs AiStor:

rm -rf ~/github/aistor && mkdir -p ~/github && cd ~/github
git clone https://github.com/miniohq/aistor.git
kind delete cluster --name aistor
kind create cluster --config ~/github/aistor/testing/kind-config-x4.yaml --name aistor
kubectl apply -f http://ns-3.k1.min.dev/dev/crds.yaml && kubectl apply -f http://ns-3.k1.min.dev/dev/aistor.yaml

Example output:

git clone https://github.com/miniohq/aistor.git
kind delete cluster --name aistor
kind create cluster --config ~/github/aistor/testing/kind-config-x4.yaml --name aistor
kubectl apply -k ~/github/aistor/resources/edge/
Cloning into 'aistor'...
The authenticity of host 'github.com (140.82.116.3)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
remote: Enumerating objects: 52043, done.
remote: Counting objects: 100% (3439/3439), done.
remote: Compressing objects: 100% (989/989), done.
remote: Total 52043 (delta 2397), reused 3272 (delta 2337), pack-reused 48604 (from 1)
Receiving objects: 100% (52043/52043), 58.95 MiB | 19.49 MiB/s, done.
Resolving deltas: 100% (41275/41275), done.
Deleting cluster "aistor" ...
Creating cluster "aistor" ...
 ✓ Ensuring node image (kindest/node:v1.30.0) 🖼 
 ✓ Preparing nodes 📦 📦 📦 📦 📦  
 ✓ Writing configuration 📜 
 ✓ Starting control-plane 🕹️ 
 ✓ Installing CNI 🔌 
 ✓ Installing StorageClass 💾 
 ✓ Joining worker nodes 🚜 
Set kubectl context to "kind-aistor"
You can now use your cluster with:

kubectl cluster-info --context kind-aistor

Thanks for using kind! 😊
namespace/aistor created
serviceaccount/aistor-sa created
clusterrole.rbac.authorization.k8s.io/aistor-sa-role created
clusterrolebinding.rbac.authorization.k8s.io/aistor-sa-binding created
service/aistor created
service/aistor-hl created
statefulset.apps/aistor created

To reapply the latest code, run the following then recreate the NodePort service

See https://github.com/allanrogerr/public/wiki/Test-AiStor-on-VMs#set-up-nodeport-to-expose-the-console-service

cd ~/github/aistor
kubectl delete ns aistor
git pull
kubectl apply -f http://ns-3.k1.min.dev/dev/crds.yaml && kubectl apply -f http://ns-3.k1.min.dev/dev/aistor.yaml

Set up NodePort to expose the console service. A NodePort is also available for MinIO API access.

The following command configures a NodePort for accessing the console in a browser:

kubectl patch service -n aistor aistor -p '{"spec":{"ports":[{"name": "http","port": 8444,"targetPort": 8444,"protocol": "TCP","nodePort":30080}],"type": "NodePort"}}'

Access the Route provided to connect to the console

In a browser, go to your console URL to access the AiStor console.

https://<vm name>-vm-images.apps.openshift.min.dev/setup

e.g.

https://miniohq-allan-1-vm-images.apps.openshift.min.dev/setup

Example, if your console terminal states ubuntu@miniohq-allan-2, then navigate to https://miniohq-allan-2-vm-images.apps.openshift.min.dev

image
Clone this wiki locally