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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict kubernetes worker Nodes while configuring Jenkinsx on AWS #7960

Closed
kranthisonuk opened this issue Sep 24, 2021 · 22 comments
Closed

Comments

@kranthisonuk
Copy link

How do we restrict the size of VM's or worker nodes of EKS . I have followed the below document for setup but not able to restrict the size of worker nodes VM's.

https://jenkins-x.io/v3/admin/platforms/eks/

@robervexcel
Copy link

If you use eks-jx terraform module for eks deployment, you would use these values:
https://github.com/jenkins-x/terraform-aws-eks-jx#inputs -> volume_size

@kranthisonuk
Copy link
Author

kranthisonuk commented Oct 8, 2021 via email

@robervexcel
Copy link

I think you will need to read something: https://jenkins-x.io/v3/admin/setup/ and https://jenkins-x.io/v3/admin/platforms/
In main.tf file in your terraform repository include this option

@kranthisonuk
Copy link
Author

kranthisonuk commented Oct 8, 2021 via email

@ankitm123
Copy link
Member

Once this PR is merged, you should be able to use volume_size and volume_type for launch templates. jenkins-x/terraform-aws-eks-jx#314.
The PR also has an example.

@kranthisonuk
Copy link
Author

kranthisonuk commented Oct 9, 2021 via email

@kranthisonuk
Copy link
Author

kranthisonuk commented Oct 12, 2021 via email

@ankitm123
Copy link
Member

I dont see the image, also u need to use the latest version of the module.

@kranthisonuk
Copy link
Author

kranthisonuk commented Oct 13, 2021 via email

@ankitm123
Copy link
Member

ankitm123 commented Oct 13, 2021

also u need to use the latest version of the module.

I recently updated the documentation a bit, check it: https://jenkins-x.io/v3/admin/platforms/eks/
You need to use the latest version.

@kranthisonuk
Copy link
Author

I have followed the below doc when run terraform plan i see below error
https://jenkins-x.io/v3/admin/platforms/eks/
terraform plan
var.profile
Profile stored in aws config or credentials file

Your query returned no results. Please change your search criteria and try again.

│ with module.eks-jx.module.cluster.module.eks.data.aws_ami.eks_worker[0],
│ on .terraform/modules/eks-jx.cluster.eks/data.tf line 20, in data "aws_ami" "eks_worker":
│ 20: data "aws_ami" "eks_worker" {

@ankitm123
Copy link
Member

Related to this? jx3-gitops-repositories/jx3-terraform-eks#26 (comment)

Or you dont have proper access ...

@kranthisonuk
Copy link
Author

Hi ,
Thanks a lot it helped , but after terraform apply i see below error but worker nodes are created though.
Error: error waiting for KMS Key (204f3cbe-2d3b-49e2-92f2-f8afb936e52e) policy propagation: timeout while waiting for state to become 'TRUE' (last state: 'FALSE', timeout: 5m0s)

│ with module.eks-jx.module.vault.aws_kms_key.kms_vault_unseal[0],
│ on .terraform/modules/eks-jx/modules/vault/main.tf line 98, in resource "aws_kms_key" "kms_vault_unseal":
│ 98: resource "aws_kms_key" "kms_vault_unseal" {

@ankitm123
Copy link
Member

Most probably related to this: hashicorp/terraform-provider-aws#20588 and hashicorp/terraform-provider-aws#21225
Try downgrading aws provider version to 3.52.0, and it should work.

@ankitm123
Copy link
Member

Also you could try re-running terraform apply, and see if this issue persists ...

@kranthisonuk
Copy link
Author

kranthisonuk commented Oct 21, 2021 via email

@kranthisonuk
Copy link
Author

kranthisonuk commented Oct 21, 2021 via email

@ankitm123
Copy link
Member

│ Error: Error creating IAM User jenkins-x-vault: EntityAlreadyExists: User
with name jenkins-x-vault already exists.

Delete the user, and re-try?

@ankitm123
Copy link
Member

Closing this ticket, as the original issue was fixed.

@kranthisonuk
Copy link
Author

Hi Ankit,

Have deleted and recreated the user but after the time lapse we get the same error.

module.eks-jx.module.cluster.module.vpc.aws_route_table_association.public[2]: Creation complete after 1s [id=rtbassoc-0b77fb1278af30128]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [10s elapsed]
module.eks-jx.module.cluster.module.vpc.aws_route_table_association.public[0]: Still creating... [10s elapsed]
module.eks-jx.module.cluster.module.vpc.aws_route_table_association.public[0]: Creation complete after 14s [id=rtbassoc-04cae4f6f0b5bc1f9]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [20s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [30s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [40s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [50s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [1m0s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [1m10s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [1m20s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [1m30s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [1m40s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [1m50s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [2m0s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [2m10s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [2m20s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [2m30s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [2m40s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [2m50s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [3m0s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [3m10s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [3m20s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [3m30s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [3m40s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [3m50s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [4m0s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [4m10s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [4m20s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [4m30s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [4m40s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [4m50s elapsed]
module.eks-jx.module.cluster.module.eks.aws_eks_cluster.this[0]: Still creating... [5m0s elapsed]

with module.eks-jx.module.vault.helm_release.vault-instance[0],
│ on .terraform/modules/eks-jx/modules/vault/charts.tf line 11, in resource
"helm_release" "vault-instance":
│ 11: resource "helm_release" "vault-instance" {

@kranthisonuk
Copy link
Author

Hi,
I have created new user in AWS and tried , now getting below error.

terraform plan
var.profile
Profile stored in aws config or credentials file

Enter a value: root


│ Error: error configuring Terraform AWS Provider: no valid credential sources for Terraform AWS Provider found.

│ Please see https://registry.terraform.io/providers/hashicorp/aws
│ for more information about providing credentials.

│ Error: NoCredentialProviders: no valid providers in chain. Deprecated.
│ For verbose messaging see aws.Config.CredentialsChainVerboseErrors


│ with provider["registry.terraform.io/hashicorp/aws"],
│ on main.tf line 1, in provider "aws":
│ 1: provider "aws" {

@ankitm123
Copy link
Member

It seems root profile does not have the right access. You could check if the profile is valid, or try AWS_PROFILE=root terraform apply and see if it works ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants