-
Install and configure AWS CLI.
-
Install Terraform. Recommend v0.13.5.
-
Install
jq
,pv
, andbzip2
. -
Set the below environment variables.
export TF_VAR_owner=YOUR_NAME export TF_VAR_eks_cluster_iam_role_name=YOUR_EKS_ROLE export TF_VAR_eks_iam_instance_profile_name=YOUR_EKS_WORKER_NODE_PROFILE export TF_VAR_eks_key_pair_name=YOUR_KEY_PAIR_TO_ACCESS_WORKER_NODE
TF_VAR_owner
may be set so that you can identify your own cloud resources. It should be one word, with no spaces and in lower case.TF_VAR_eks_cluster_iam_role_name
may be created following this AWS guide.TF_VAR_eks_iam_instance_profile_name
may be created following this AWS guide.TF_VAR_eks_key_pair_name
must be configured following this AWS cli documentation. The public key imported to AWS should be~/.ssh/id_rsa.pub
. Follow the documentation to create a new key then import if this key doesn't exist. This key pair will be used to access worker node via ssh.
./hack/install-cloud-tools.sh
The install cloud tools script copies the
required bash and terraform scripts to the user home directory, under
~/terraform/
.
Create an EKS cluster using the provided terraform scripts. Once the EKS cluster
is created, worker nodes are accessible via their external IP using ssh.
Terraform state files and other runtime info will be stored under
~/tmp/terraform-eks/
. You can also create an EKS cluster in other ways and
deploy prerequisites manually.
This also deploys cert-manager v1.8.2
and Antrea v1.8
.
~/terraform/eks create
To deploy the latest version of nephe (built from the main branch), use the checked-in deployment yaml:
~/terraform/eks kubectl apply -f https://raw.githubusercontent.com/antrea-io/nephe/main/config/nephe.yml
Issue kubectl commands to EKS cluster using the helper scripts. To run kubectl
commands directly, set KUBECONFIG
environment variable.
~/terraform/eks kubectl ...
export KUBECONFIG=~/tmp/terraform-eks/kubeconfig
Loading locally built antrea/nephe
images to EKS cluster.
~/terraform/eks load antrea/nephe
~/terraform/eks output
~/terraform/eks destroy
Additionally, you can also create compute VPC with 3 VMs using terraform
scripts for testing purpose. Each VM will have a public IP and an Apache Tomcat
server deployed on port 80. Use curl <PUBLIC_IP>:80
to access a sample web
page. Create or obtain AWS key and secret and configure the below environment
variables.
export TF_VAR_region=YOUR_REGION
export TF_VAR_aws_access_key_id=YOUR_AWS_KEY
export TF_VAR_aws_access_key_secret=YOUR_AWS_KEY_SECRET
export TF_VAR_aws_key_pair_name=YOU_AWS_KEY_PAIR
./hack/install-cloud-tools.sh
~/terraform/aws-tf create
Terraform state files and other runtime info will be stored under
~/tmp/terraform-aws/
~/terraform/aws-tf output
~/terraform/aws-tf destroy