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

(aws-eks): integration tests can't be deployed #24266

Closed
pahud opened this issue Feb 22, 2023 · 2 comments · Fixed by #24276
Closed

(aws-eks): integration tests can't be deployed #24266

pahud opened this issue Feb 22, 2023 · 2 comments · Fixed by #24276
Assignees
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service bug This issue is a bug. effort/small Small work item – less than a day of effort p2

Comments

@pahud
Copy link
Contributor

pahud commented Feb 22, 2023

Describe the bug

Integ tests in aws-eks using hashicorp/http-echo as the k8s deployment container image can't be deployed and is having the error:

Error: container has runAsNonRoot and image will run as root

image

This is because hashicorp/http-echo#11 and the deployment should run as 1005 described here:

https://github.com/hashicorp/http-echo/blob/672da300fbd66957bb6037e8d0369632752d1456/docker/alpine/Dockerfile#L15

Similarly, integ.eks-service-account-sdk-call can't be deployed because it's run as non-root and should be defined in the security-context of the pod as well.

Expected Behavior

integ tests integ.alb-controller.ts and integ.eks-service-account-sdk-call should be deployed

Current Behavior

integ.alb-controller.ts and integ.eks-service-account-sdk-call.ts can't be deployed

Reproduction Steps

just deploy the integ.alb-controller.ts and integ.eks-service-account-sdk-call.ts as described in the doc.

Possible Solution

define the non-user in the securityContext. i.e.

    const ingress = new kplus.Deployment(chart, 'Deployment', {
      containers: [{ 
        image: 'hashicorp/http-echo',
        args: ['-text', 'hello'],
        port: 5678,
        securityContext: {
          user: 1005,
        },
      }],
    })

Additional Information/Context

No response

CDK CLI Version

2.66.0

Framework Version

No response

Node.js Version

v16.17.0

OS

Linux

Language

Typescript

Language Version

No response

Other information

No response

@pahud pahud added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 22, 2023
@github-actions github-actions bot added the @aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service label Feb 22, 2023
@pahud
Copy link
Contributor Author

pahud commented Feb 22, 2023

PR underway.

@pahud pahud self-assigned this Feb 22, 2023
@pahud pahud added p2 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. labels Feb 22, 2023
@mergify mergify bot closed this as completed in #24276 Feb 22, 2023
mergify bot pushed a commit that referenced this issue Feb 22, 2023
This PR fixes the integ tests errors in aws-eks and addresses the following issues:

`integ.alb-controller.ts` has `runAsNonRoot` error and should define a non-root user in securityContext of the pod definition to ensure successful k8s deployment.

`integ.eks-service-account-sdk-call.ts` should define a non-root user as well and increase the timeout of `BucketPinger` from the default 1 min to 3 min as the deployment could take up to 2 minutes or more. The base docker image from docker hub for this test has been replaced with the same image in ECR public to avoid potential throttling.

I have manually run the two integ tests in my account and both successfully deploy with no error now.

Closes #24266

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Naumel pushed a commit that referenced this issue Feb 22, 2023
This PR fixes the integ tests errors in aws-eks and addresses the following issues:

`integ.alb-controller.ts` has `runAsNonRoot` error and should define a non-root user in securityContext of the pod definition to ensure successful k8s deployment.

`integ.eks-service-account-sdk-call.ts` should define a non-root user as well and increase the timeout of `BucketPinger` from the default 1 min to 3 min as the deployment could take up to 2 minutes or more. The base docker image from docker hub for this test has been replaced with the same image in ECR public to avoid potential throttling.

I have manually run the two integ tests in my account and both successfully deploy with no error now.

Closes #24266

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Naumel pushed a commit that referenced this issue Feb 24, 2023
This PR fixes the integ tests errors in aws-eks and addresses the following issues:

`integ.alb-controller.ts` has `runAsNonRoot` error and should define a non-root user in securityContext of the pod definition to ensure successful k8s deployment.

`integ.eks-service-account-sdk-call.ts` should define a non-root user as well and increase the timeout of `BucketPinger` from the default 1 min to 3 min as the deployment could take up to 2 minutes or more. The base docker image from docker hub for this test has been replaced with the same image in ECR public to avoid potential throttling.

I have manually run the two integ tests in my account and both successfully deploy with no error now.

Closes #24266

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
beck3905 pushed a commit to beck3905/aws-cdk that referenced this issue Feb 28, 2023
This PR fixes the integ tests errors in aws-eks and addresses the following issues:

`integ.alb-controller.ts` has `runAsNonRoot` error and should define a non-root user in securityContext of the pod definition to ensure successful k8s deployment.

`integ.eks-service-account-sdk-call.ts` should define a non-root user as well and increase the timeout of `BucketPinger` from the default 1 min to 3 min as the deployment could take up to 2 minutes or more. The base docker image from docker hub for this test has been replaced with the same image in ECR public to avoid potential throttling.

I have manually run the two integ tests in my account and both successfully deploy with no error now.

Closes aws#24266

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
homakk pushed a commit to homakk/aws-cdk that referenced this issue Mar 13, 2023
This PR fixes the integ tests errors in aws-eks and addresses the following issues:

`integ.alb-controller.ts` has `runAsNonRoot` error and should define a non-root user in securityContext of the pod definition to ensure successful k8s deployment.

`integ.eks-service-account-sdk-call.ts` should define a non-root user as well and increase the timeout of `BucketPinger` from the default 1 min to 3 min as the deployment could take up to 2 minutes or more. The base docker image from docker hub for this test has been replaced with the same image in ECR public to avoid potential throttling.

I have manually run the two integ tests in my account and both successfully deploy with no error now.

Closes aws#24266

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
homakk pushed a commit to homakk/aws-cdk that referenced this issue Mar 28, 2023
This PR fixes the integ tests errors in aws-eks and addresses the following issues:

`integ.alb-controller.ts` has `runAsNonRoot` error and should define a non-root user in securityContext of the pod definition to ensure successful k8s deployment.

`integ.eks-service-account-sdk-call.ts` should define a non-root user as well and increase the timeout of `BucketPinger` from the default 1 min to 3 min as the deployment could take up to 2 minutes or more. The base docker image from docker hub for this test has been replaced with the same image in ECR public to avoid potential throttling.

I have manually run the two integ tests in my account and both successfully deploy with no error now.

Closes aws#24266

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service bug This issue is a bug. effort/small Small work item – less than a day of effort p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant