|
| 1 | +# Conformance testing Amazon EKS Anywhere |
| 2 | + |
| 3 | +## Setup EKS Anywhere Cluster |
| 4 | + |
| 5 | +Setup EKS Anywhere cluster according to the [EKS Anywhere documentation](https://anywhere.eks.amazonaws.com/). |
| 6 | + |
| 7 | +Create an [EKS Anywhere production cluster](https://anywhere.eks.amazonaws.com/docs/getting-started/production-environment/) to reproduce the EKS Anywhere Conformance e2e results. |
| 8 | + |
| 9 | + |
| 10 | +## Requirements |
| 11 | +Create a Kubernetes cluster on a target workload environment with EKS Anywhere run on an administrative machine. |
| 12 | + |
| 13 | +### Target Workload Environment |
| 14 | + |
| 15 | +The target workload environment will need: |
| 16 | + |
| 17 | +* A vSphere 7+ environment running vCenter |
| 18 | +* Capacity to deploy 6-10VMs |
| 19 | +* DHCP service running in vSphere environment in the primary VM network for your workload cluster |
| 20 | +* One network in vSphere to use for the cluster. This network must have inbound access into vCenter |
| 21 | +* A OVA imported into vSphere and converted into template for the workload VMs |
| 22 | +* User credentials to [create vms and attach networks, etc](https://anywhere.eks.amazonaws.com/docs/reference/vsphere/user-permissions/) |
| 23 | + |
| 24 | +Each VM will require: |
| 25 | + |
| 26 | +* 2 vCPU |
| 27 | +* 8GB RAM |
| 28 | +* 25GB Disk |
| 29 | + |
| 30 | +### Administrative Machine |
| 31 | + |
| 32 | +The administrative machine will need: |
| 33 | + |
| 34 | +* Docker 20.x.x |
| 35 | +* Mac OS (10.15) / Ubuntu (20.04.2 LTS) |
| 36 | +* 4 CPU cores |
| 37 | +* 16GB memory |
| 38 | +* 30GB free disk space |
| 39 | + |
| 40 | +#### Kubectl |
| 41 | + |
| 42 | +On the administrative machine, install and configure the Kubernetes command-line tool |
| 43 | +[kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) |
| 44 | + |
| 45 | +#### Docker |
| 46 | + |
| 47 | +The method to [install Docker](https://docs.docker.com/get-docker/) depends on your operating system and architecture. |
| 48 | +If you are using Ubuntu use the [Docker CE](https://docs.docker.com/engine/install/ubuntu/) installation instructions to install Docker and not the Snap installation. |
| 49 | + |
| 50 | +#### EKS Anywhere |
| 51 | + |
| 52 | +Install [EKS Anywhere](https://anywhere.eks.amazonaws.com/docs/getting-started/install/) on your administrative machine. |
| 53 | + |
| 54 | +#### Sonobuoy |
| 55 | + |
| 56 | +Download a binary release of [sonobuoy](https://github.com/vmware-tanzu/sonobuoy/releases/). |
| 57 | + |
| 58 | +If you are on a Mac, you many need to open the Security & Privacy and approve sonobuoy for |
| 59 | +execution. |
| 60 | + |
| 61 | +```shell |
| 62 | +if [[ "$(uname)" == "Darwin" ]] |
| 63 | +then |
| 64 | + SONOBUOY=https://github.com/vmware-tanzu/sonobuoy/releases/download/v0.50.0/sonobuoy_0.50.0_darwin_amd64.tar.gz |
| 65 | +else |
| 66 | + SONOBUOY=https://github.com/vmware-tanzu/sonobuoy/releases/download/v0.50.0/sonobuoy_0.50.0_linux_386.tar.gz |
| 67 | +fi |
| 68 | +wget -qO- ${SONOBUOY} |tar -xz sonobuoy |
| 69 | +chmod 755 sonobuoy |
| 70 | +``` |
| 71 | + |
| 72 | +## Create EKS Anywhere Cluster |
| 73 | + |
| 74 | +1. Generate a cluster configuration: |
| 75 | + |
| 76 | + ```shell |
| 77 | + CLUSTER_NAME=prod |
| 78 | + eksctl anywhere generate clusterconfig $CLUSTER_NAME --provider vsphere >cluster.yaml |
| 79 | + ``` |
| 80 | + |
| 81 | +1. Populate cluster configuration. For example: |
| 82 | + |
| 83 | + ```yaml |
| 84 | + apiVersion: anywhere.eks.amazonaws.com/v1alpha1 |
| 85 | + kind: Cluster |
| 86 | + metadata: |
| 87 | + name: prod |
| 88 | + spec: |
| 89 | + clusterNetwork: |
| 90 | + cni: cilium |
| 91 | + pods: |
| 92 | + cidrBlocks: |
| 93 | + - 192.168.0.0/16 |
| 94 | + services: |
| 95 | + cidrBlocks: |
| 96 | + - 10.96.0.0/12 |
| 97 | + controlPlaneConfiguration: |
| 98 | + count: 2 |
| 99 | + endpoint: |
| 100 | + host: "198.18.100.79" |
| 101 | + machineGroupRef: |
| 102 | + kind: VSphereMachineConfig |
| 103 | + name: prod-cp |
| 104 | + datacenterRef: |
| 105 | + kind: VSphereDatacenterConfig |
| 106 | + name: prod |
| 107 | + externalEtcdConfiguration: |
| 108 | + count: 3 |
| 109 | + machineGroupRef: |
| 110 | + kind: VSphereMachineConfig |
| 111 | + name: prod-etcd |
| 112 | + kubernetesVersion: "1.31" |
| 113 | + managementCluster: |
| 114 | + name: prod |
| 115 | + workerNodeGroupConfigurations: |
| 116 | + - count: 2 |
| 117 | + machineGroupRef: |
| 118 | + kind: VSphereMachineConfig |
| 119 | + name: prod |
| 120 | + --- |
| 121 | + apiVersion: anywhere.eks.amazonaws.com/v1alpha1 |
| 122 | + kind: VSphereDatacenterConfig |
| 123 | + metadata: |
| 124 | + name: prod |
| 125 | + spec: |
| 126 | + datacenter: "SDDC-Datacenter" |
| 127 | + insecure: false |
| 128 | + network: "/SDDC-Datacenter/network/sddc-cgw-network-1" |
| 129 | + server: "vcenter.sddc-44-239-186-141.vmwarevmc.com" |
| 130 | + thumbprint: "" |
| 131 | + --- |
| 132 | + apiVersion: anywhere.eks.amazonaws.com/v1alpha1 |
| 133 | + kind: VSphereMachineConfig |
| 134 | + metadata: |
| 135 | + name: prod-cp |
| 136 | + spec: |
| 137 | + datastore: "/SDDC-Datacenter/datastore/WorkloadDatastore" |
| 138 | + diskGiB: 25 |
| 139 | + folder: "/SDDC-Datacenter/vm/capv/prod" |
| 140 | + memoryMiB: 8192 |
| 141 | + numCPUs: 2 |
| 142 | + osFamily: bottlerocket |
| 143 | + resourcePool: "*/Resources/Compute-ResourcePool" |
| 144 | + users: |
| 145 | + - name: ec2-user |
| 146 | + sshAuthorizedKeys: |
| 147 | + - "ssh-rsa AAAA..." |
| 148 | + --- |
| 149 | + apiVersion: anywhere.eks.amazonaws.com/v1alpha1 |
| 150 | + kind: VSphereMachineConfig |
| 151 | + metadata: |
| 152 | + name: prod |
| 153 | + spec: |
| 154 | + datastore: "/SDDC-Datacenter/datastore/WorkloadDatastore" |
| 155 | + diskGiB: 25 |
| 156 | + folder: "/SDDC-Datacenter/vm/capv/prod" |
| 157 | + memoryMiB: 8192 |
| 158 | + numCPUs: 2 |
| 159 | + osFamily: bottlerocket |
| 160 | + resourcePool: "*/Resources/Compute-ResourcePool" |
| 161 | + users: |
| 162 | + - name: ec2-user |
| 163 | + sshAuthorizedKeys: |
| 164 | + - "ssh-rsa AAAA..." |
| 165 | + --- |
| 166 | + apiVersion: anywhere.eks.amazonaws.com/v1alpha1 |
| 167 | + kind: VSphereMachineConfig |
| 168 | + metadata: |
| 169 | + name: prod-etcd |
| 170 | + spec: |
| 171 | + datastore: "/SDDC-Datacenter/datastore/WorkloadDatastore" |
| 172 | + diskGiB: 25 |
| 173 | + folder: "/SDDC-Datacenter/vm/capv/prod" |
| 174 | + memoryMiB: 8192 |
| 175 | + numCPUs: 2 |
| 176 | + osFamily: bottlerocket |
| 177 | + resourcePool: "*/Resources/Compute-ResourcePool" |
| 178 | + users: |
| 179 | + - name: ec2-user |
| 180 | + sshAuthorizedKeys: |
| 181 | + - "ssh-rsa AAAA..." |
| 182 | + ``` |
| 183 | +
|
| 184 | +1. Set credential environment variables |
| 185 | +
|
| 186 | + ```shell |
| 187 | + export EKSA_VSPHERE_USERNAME='billy' |
| 188 | + export EKSA_VSPHERE_PASSWORD='t0p$ecret' |
| 189 | + ``` |
| 190 | + |
| 191 | +1. Create a cluster |
| 192 | + |
| 193 | + ```shell |
| 194 | + eksctl anywhere create cluster -f cluster.yaml -v 4 |
| 195 | + ``` |
| 196 | + |
| 197 | +## Replace the default Cilium CNI with Calico CNI |
| 198 | + |
| 199 | +Follow the instructions provided in the [EKS Anywhere documentation](https://anywhere.eks.amazonaws.com/docs/clustermgmt/networking/cluster-replace-cilium/) to uninstall the default Cilium CNI. Once Cilium has been uninstalled successfully, follow the steps in [this Calico blog](https://www.tigera.io/blog/calico-on-eks-anywhere/) to install the Calico CNI on your EKS Anywhere cluster. Ensure that all Nodes are in `Ready` state before proceeding to the next section. |
| 200 | + |
| 201 | +## Run Sonobuoy e2e |
| 202 | +``` |
| 203 | +./sonobuoy run --mode=certified-conformance |
| 204 | +results=$(./sonobuoy retrieve) |
| 205 | +mkdir ./results |
| 206 | +tar xzf $results -C ./results |
| 207 | +./sonobuoy e2e ${results} |
| 208 | +mv results/plugins/e2e/results/global/* . |
| 209 | +``` |
| 210 | + |
| 211 | +## Cleanup |
| 212 | +```shell |
| 213 | +eksctl anywhere delete cluster prod -v 4 |
| 214 | +rm -rf cluster.yaml prod *tar.gz results |
| 215 | +``` |
0 commit comments