EKS: CDK cluster update event keeps seeing `LoggingUpdate`, making it impossible to update the EKS version
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the bug
We're trying to update our EKS cluster to a new version (e.g. 1.29 => 1.30), and are running into an issue where the EKS cluster custom resource throws an error `Only one type of update - VpcConfigUpdate, LoggingUpdate, EndpointAccessUpdate, or AuthModeUpdate can be allowed`. The issue is that the custom resource thinks that there is both a `LoggingUpdate` and an EKS version update, while we're not doing logging updates.
### Regression Issue
- [ ] Select this option if this issue appears to be a regression.
### Last Known Working CDK Version
_No response_
### Expected Behavior
When doing an EKS version update, without any other changes, the custom resource should not detect a `LoggingUpdate`.
### Current Behavior
Upon inspection of the custom resource logs, we can see that it's getting the following event props:
- oldProps:
```
{
...
"logging": {
"clusterLogging": [
{
"types": [],
"enabled": true
}
]
},
...
}
```
- newProps:
```
{
...
"logging": {},
...
}
```
So that causes the custom resource to see a difference in the logging config.
However, both props are incorrect as far as I can see:
- The `oldProps` clusterLogging property should have `enabled: false`, as that's also what is configured on the actual cluster (which can be seen when running `aws eks describe-cluster`).
- The `newProps` should be the same as `oldProps` (apart from the cluster version), since we're not doing any changes except for the version
So it looks like there's something going wrong when disabling logs, causing it to have a mismatch between what's in the `oldProps` event properties, and what's actually configured in the cluster.
### Reproduction Steps
For an existing EKS cluster created using the EKS `Cluster` construct:
- Enable one or more of the ClusterLogging types
- Disable all ClusterLogging types (i.e. pass an empty array)
- Bump the EKS version of the cluster => this should cause the error due to the `loggingConfig` being incorrect in the `oldProps` and `newProps`
The workaround is to temporarily enable one of the logging types, then do the EKS update, and afterwards remove the logging types again.
### Possible Solution
_No response_
### Additional Information/Context
_No response_
### CDK CLI Version
2.176.0
### Framework Version
_No response_
### Node.js Version
v20.18.1
### OS
Mac/Debian
### Language
TypeScript
### Language Version
5.5.4
### Other information
_No response_
Contributor guide
Research direction
Start at the EKS Cluster construct and its custom resource handling for loggingConfig, then reproduce the sequence of enabling logging, disabling all logging types, and updating the EKS version. Done means the version update no longer detects a LoggingUpdate when logging is unchanged, while the workaround is no longer needed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, kubernetes, typescript
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100