-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(eks): unable to create KubernetesResources in another stack #7322
Conversation
kubectl resources such as KubernetesResource and HelmCharts require a custom resource provider. We used to create the resource provider in the stack in which the k8s resource was defined but this resulted in a cyclic reference since the eks.Cluster needs to reference the resource provider and the k8s resource needs to reference the cluster. The solution is that the kubectl resource provider is always created in the stack in which the cluster is defined. This makes sure that references always go in one direction (and also makes much more sense). Fixes #7231
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
if (!this._clusterResource) { | ||
throw new Error('Unable to perform this operation since kubectl is not enabled for this cluster'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there already an existing unit test that covers this?
minor: also maybe simplify error message. since it's internal I think it reads easier as kubectl is not enabled for this cluster. <how to reconcile if possible to fix error>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a test that covers this use case. The error indicates that kubectl is not enabled and that's the possible fix.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Commit Message
fix(eks): unable to create KubernetesResources in another stack (#7322)
kubectl resources such as KubernetesResource and HelmCharts require a custom resource provider. We used to create the resource provider in the stack in which the k8s resource was defined but this resulted in a cyclic reference since the eks.Cluster needs to reference the resource provider and the k8s resource needs to reference the cluster.
The solution is that the kubectl resource provider is always created in the stack in which the cluster is defined. This makes sure that references always go in one direction (and also makes much more sense).
Fixes #7231
End Commit Message
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license