|
| 1 | +# Conformance tests for kubeasz kubernetes cluster |
| 2 | + |
| 3 | +## Node Provisioning |
| 4 | + |
| 5 | +Provision 3 nodes for your cluster (OS: Ubuntu 24.04) |
| 6 | + |
| 7 | +1 master node (4c16g) |
| 8 | + |
| 9 | +2 worker node (4c16g) |
| 10 | + |
| 11 | +for a High-Availability Kubernetes Cluster, read [more](https://github.com/easzlab/kubeasz/blob/master/docs/setup/00-planning_and_overall_intro.md) |
| 12 | + |
| 13 | +## Install the cluster |
| 14 | + |
| 15 | +(1) Download 'kubeasz' code, the binaries and offline images |
| 16 | + |
| 17 | +``` |
| 18 | +export release=3.7.0 |
| 19 | +curl -C- -fLO --retry 3 https://github.com/easzlab/kubeasz/releases/download/${release}/ezdown |
| 20 | +chmod +x ./ezdown |
| 21 | +./ezdown -D -m '' |
| 22 | +``` |
| 23 | + |
| 24 | +(2) install an all-in-one cluster |
| 25 | + |
| 26 | +``` |
| 27 | +./ezdown -S |
| 28 | +source ~/.bashrc |
| 29 | +dk ezctl start-aio |
| 30 | +``` |
| 31 | + |
| 32 | +(3) Add two worker nodes |
| 33 | + |
| 34 | +``` bash |
| 35 | +ssh-copy-id ${worker1_ip} |
| 36 | +dk ezctl add-node default ${worker1_ip} |
| 37 | + |
| 38 | +ssh-copy-id ${worker2_ip} |
| 39 | +dk ezctl add-node default ${worker2_ip} |
| 40 | +``` |
| 41 | + |
| 42 | +## Run Conformance Test |
| 43 | + |
| 44 | +The standard tool for running these tests is [Sonobuoy](https://github.com/heptio/sonobuoy). |
| 45 | + |
| 46 | +Download a [binary release](https://github.com/heptio/sonobuoy/releases) of the CLI |
| 47 | + |
| 48 | +Deploy a Sonobuoy pod to your cluster with: |
| 49 | + |
| 50 | +``` |
| 51 | +$ sonobuoy run --mode=certified-conformance |
| 52 | +``` |
| 53 | + |
| 54 | +**NOTE:** You can run the command synchronously by adding the flag `--wait` but be aware that running the Conformance tests can take an hour or more. |
| 55 | + |
| 56 | +View actively running pods: |
| 57 | + |
| 58 | +``` |
| 59 | +$ sonobuoy status |
| 60 | +``` |
| 61 | + |
| 62 | +To inspect the logs: |
| 63 | + |
| 64 | +``` |
| 65 | +$ sonobuoy logs |
| 66 | +``` |
| 67 | + |
| 68 | +Once `sonobuoy status` shows the run as `completed`, copy the output directory from the main Sonobuoy pod to a local directory: |
| 69 | + |
| 70 | +``` |
| 71 | +$ outfile=$(sonobuoy retrieve) |
| 72 | +``` |
| 73 | + |
| 74 | +This copies a single `.tar.gz` snapshot from the Sonobuoy pod into your local |
| 75 | +`.` directory. Extract the contents into `./results` with: |
| 76 | + |
| 77 | +``` |
| 78 | +mkdir ./results; tar xzf $outfile -C ./results |
| 79 | +``` |
| 80 | + |
| 81 | +**NOTE:** The two files required for submission are located in the tarball under **plugins/e2e/results/global/{e2e.log,junit.xml}**. |
| 82 | + |
| 83 | +To clean up Kubernetes objects created by Sonobuoy, run: |
| 84 | + |
| 85 | +``` |
| 86 | +sonobuoy delete |
| 87 | +``` |
0 commit comments