hp-zzz / nuvolaris-testing

Builds Nuvolaris test environment and run tests against them

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nuvolaris-testing

This repo includes our test suite and the scripts to build our test environments.

You can discuss it in the #nuvolaris-testing discord channel and in the forum under the category testing.

Check this developer guide for informations how to improve it.

How to build a test cluster in a physical server running Kubernetes

Steps to follow, see below for an example:

Get a remote server running Ubuntu 20.04, say test.server You need at least 64gb of memory and 8 cores.

  1. Change to ansible and generate a ssh keypair in inventory/id_rsa
  2. Copy the public and private key to access the server without password
  3. Generate a configuration running ./config.py, see below for the parameters
  4. run ./play.sh <cluster>
  5. access to the server with Kubernetes in it with kubectl --kubeconfig kubeconfig

Advanced use

Note that full syntax is ./play.sh <cluster> [<tag> [<script>]]

So you can select a tag and execute only a part of the script select by <tag> (not documented here).

Also you can use alternative scripts.

Configuration examples

KVM with Microk8s

Syntax

./config.py kwm <name> <kube-type> <server-hostname> <priv_key-file> <pub_key-file> <node-count> <disk-size-in-gb> <mem-size-in-gb> <num-of-vcpu>

<kube-type> can be microk8s or okd

Example:

# 1 generate keys
cd ansible
ssh-keygen -f inventory/id_rsa
# 2 copy to the test server (change test.server with your own)
ssh-copy-id -i inventory/id_rsa root@test.server
# 3 generate a config names m8s with 4 nodes 20gb disk 8gb memory and 2 vcpu each
./config.py m8s kvm microk8s magrathea.academy inventory/id_rsa inventory/id_rsa.pub 4 20 8 1
# 4 install everything
./play.sh m8s
# 5 check everything works
kubectl --kubeconfig kubeconfig/m8s/kubeconfig get nodes

TODO: add other kinds of kubernetes: k3s, kubeadm etc

AWS

./config.py eks aws <key> <secret>  <region> <vm-type> <node-count> <disk-size>

Example:

/config.py eks aws AAAAAAAAAAAA abcdefghilmnopqrstuwwxyz
#./play.sh eks

Example using microk8s:

# 1 generate keys
cd ansible
ssh-keygen -f inventory/id_rsa
# 2 copy to the test server (change test.server with your own)
ssh-copy-id -i inventory/id_rsa root@test.server
# 3 generate a config names m8s with 4 nodes 20gb disk 8gb memory and 2 vcpu each
./config.py m8s test.server microk8s 4 20 8 2
# 4 install everything
./play.sh m8s
# 5 check everything works
kubectl --kubeconfig kubeconfig/m8s/kubeconfig get nodes

How to destroy the cluster

Select the corresponding cleaninig script with the cluster configuration and select the tag clean.

  • KVM: ./play.sh clean
  • AWS: ./play.sh clean

About

Builds Nuvolaris test environment and run tests against them

License:Apache License 2.0


Languages

Language:JavaScript 60.4%Language:Shell 27.0%Language:Python 12.6%