Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding aws testing infra #1

Merged
merged 7 commits into from Jun 14, 2021
Merged

adding aws testing infra #1

merged 7 commits into from Jun 14, 2021

Conversation

RinkiyaKeDad
Copy link
Collaborator

Signed-off-by: RinkiyaKeDad arshsharma461@gmail.com

Making a WIP PR so that reviewing errors is easier 馃檪

Signed-off-by: RinkiyaKeDad <arshsharma461@gmail.com>
@jetstack-bot jetstack-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 8, 2021
Signed-off-by: RinkiyaKeDad <arshsharma461@gmail.com>
Signed-off-by: RinkiyaKeDad <arshsharma461@gmail.com>
@RinkiyaKeDad
Copy link
Collaborator Author

@jakexks here's the complete error message:

Error: error deleting subnet (subnet-010a94bd448bec453): timeout while waiting for state to become 'destroyed' (last state: 'pending', timeout: 20m0s)



Error: Kubernetes cluster unreachable: stat ./kubeconfig_cert-manager-cluster: no such file or directory



Error: Error waiting for internet gateway (igw-0063ea481a3796a7e) to detach: timeout while waiting for state to become 'detached' (last state: 'detaching', timeout: 15m0s)



Error: error deleting subnet (subnet-0be126a106b762223): timeout while waiting for state to become 'destroyed' (last state: 'pending', timeout: 20m0s)



Error: Kubernetes cluster unreachable: stat ./kubeconfig_cert-manager-cluster: no such file or directory



Error: Error deleting VPC: DependencyViolation: The vpc 'vpc-088e1c7a864ce269f' has dependencies and cannot be deleted.
        status code: 400, request id: 71fe787d-c7e3-431f-b13c-bafac3708c37

aws/main.tf Outdated

provider "helm" {
kubernetes {
config_path = "${path.module}/kubeconfig_cert-manager-cluster" ## check this
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did use ${path.module} here but even then it fails midway saying the file doesn't exist but when I run terraform apply again then it works.

aws/main.tf Outdated
Comment on lines 72 to 74
kubernetes {
config_path = "${path.module}/kubeconfig_cert-manager-cluster" ## check this
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
kubernetes {
config_path = "${path.module}/kubeconfig_cert-manager-cluster" ## check this
}
kubernetes {
host = data.aws_eks_cluster.cluster.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority.0.data)
exec {
api_version = "client.authentication.k8s.io/v1alpha1"
args = ["eks", "get-token", "--cluster-name", module.eks.cluster_id]
command = "aws"
}
}

Terraform can construct a dependency graph if you directly reference other terraform resources. The reason you're getting an error some of the time is you're referencing a direct path to a config file that may or may not be there at the time terraform evaluates it

aws/main.tf Show resolved Hide resolved
@RinkiyaKeDad
Copy link
Collaborator Author

Thanks for reviewing @jakexks! I added the changes you suggested but I'm still not able to figure out how to get out of the current state I'm stuck in. After these changes

When I run terraform apply I get:

Error: Kubernetes cluster unreachable: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable



Error: Kubernetes cluster unreachable: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable

And if I run terraform destroy I get:

Error: Kubernetes cluster unreachable: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable



Error: Error waiting for internet gateway (igw-0063ea481a3796a7e) to detach: timeout while waiting for state to become 'detached' (last state: 'detaching', timeout: 15m0s)



Error: error deleting subnet (subnet-010a94bd448bec453): timeout while waiting for state to become 'destroyed' (last state: 'pending', timeout: 20m0s)



Error: Error deleting VPC: DependencyViolation: The vpc 'vpc-088e1c7a864ce269f' has dependencies and cannot be deleted.
        status code: 400, request id: cda89d89-3ec8-4042-b0a3-78a6f6e01330



Error: Kubernetes cluster unreachable: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable

Is there a way to reset everything and start from scratch with these new changes? 馃槄

@RinkiyaKeDad
Copy link
Collaborator Author

Update: So I deleted all the files terraform generates and just let the main.tf and variables.tf be. This time terraform apply worked in one go without stopping in mid and gave the load balancer hostname as the output. Even terraform destroy worked without errors. So YAAAAY!

Signed-off-by: RinkiyaKeDad <arshsharma461@gmail.com>
Signed-off-by: RinkiyaKeDad <arshsharma461@gmail.com>
Signed-off-by: RinkiyaKeDad <arshsharma461@gmail.com>
@RinkiyaKeDad RinkiyaKeDad changed the title [WIP] adding aws testing infra adding aws testing infra Jun 10, 2021
@jetstack-bot jetstack-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 10, 2021
@RinkiyaKeDad
Copy link
Collaborator Author

@jakexks I forgot that you had mentioned that we don't even need the load balancer hostname as output now since we use the route 53 zone. This means the error during terraform apply doesn't occur now. With that out of the way, the PR is ready please review when free :)

Signed-off-by: RinkiyaKeDad <arshsharma461@gmail.com>
Copy link
Member

@jakexks jakexks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@jetstack-bot jetstack-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 14, 2021
@jetstack-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jakexks, RinkiyaKeDad

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants