equinix-labs / terraform-equinix-kubernetes-cluster

Kubernetes cluster deployment on Equinix Metal
https://registry.terraform.io/modules/equinix-labs/kubernetes-cluster/equinix/latest
Apache License 2.0
1 stars 5 forks source link

feat: Add example to install CNI by default and make cluster-provider kubeadm param optional #33

Closed aayushrangwala closed 11 months ago

aayushrangwala commented 11 months ago

Fixes: https://github.com/equinix-labs/terraform-equinix-kubernetes-cluster/issues/32 Fixes: https://github.com/equinix-labs/terraform-equinix-kubernetes-cluster/issues/34

Signed-off-by: Ayush Rangwala ayush.rangwala@gmail.com

cprivitere commented 11 months ago

Ok, tried to run this and found a couple things. First, I think we want to add the provider block to this example. Right now just trying to run it causes an error cause the provider block is missing and no value for auth_token is defined.

Two, I think the tfvars template could use some changes: First, rename it to terraform.tfvars.example (small change but means you only have to delete the .example off the end). Second, I suggest adding some comments to the file like below:

# User API token for Equinix Metal
auth_token           = "YOUR_TOKEN_HERE"
# Optional, choose a specific flannel version, leave blank for latest
flannel_version      = ""
kube_vip_version     = "v0.6.2"
kubernetes_version   = "v1.28.1"
metro                = "da"
# Equinix Metal Project ID
project_id           = "YOUR_PROJECT_ID"
# Optional, where you want to store your SSH key
ssh_private_key_path = ""

This removes the unused cpem variable which casued an error message if you defined it in here but didn't use it in the module. It also removes what looks like actual API keys from the example. Finally, I alphabetized the variables.

aayushrangwala commented 11 months ago

First, I think we want to add the provider block to this example. Right now just trying to run it causes an error cause the provider block is missing and no value for auth_token is defined.

Strange behaviour but I ran it on my local without the equinix provider and it was successful. I will try again

Screenshot 2023-10-03 at 9 39 53 PM Screenshot 2023-10-03 at 9 39 44 PM

rename it to terraform.tfvars.example Yes that was a miss.

aayushrangwala commented 11 months ago

Ok, tried to run this and found a couple things. First, I think we want to add the provider block to this example. Right now just trying to run it causes an error cause the provider block is missing and no value for auth_token is defined.

Two, I think the tfvars template could use some changes: First, rename it to terraform.tfvars.example (small change but means you only have to delete the .example off the end). Second, I suggest adding some comments to the file like below:

# User API token for Equinix Metal
auth_token           = "YOUR_TOKEN_HERE"
# Optional, choose a specific flannel version, leave blank for latest
flannel_version      = ""
kube_vip_version     = "v0.6.2"
kubernetes_version   = "v1.28.1"
metro                = "da"
# Equinix Metal Project ID
project_id           = "YOUR_PROJECT_ID"
# Optional, where you want to store your SSH key
ssh_private_key_path = ""

This removes the unused cpem variable which casued an error message if you defined it in here but didn't use it in the module. It also removes what looks like actual API keys from the example. Finally, I alphabetized the variables.

Yes, that was right. I missed committing adding provider. Fixed that

displague commented 11 months ago

The tfdocs in the example README.md don't match. We have a bot that will chase a PR with a correcting PR so not too worried about that.