[aws-eks] Automatically identify k8s resource deprecations on EKS updates
In each major update of Kubernetes there can be some API deprecations. For example in 1.16 there were many of them: https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/. In CDK we can add kubernetes resources to cluster and they are deployed by custom CF resources using kubectl. When we upgrade EKS to newer version the API version of every running resource is automatically updated by AWS but we can still have manifests referencing removed API version in our CF templates. The manifests are not changed during EKS update so the CDK custom resources doesn't trigger update via kubectl. That can lead to problem that we have different manifests in CF templates than resources that are actually deployed in our Kubernetes cluster. The problem can be noticed only when deploying EKS cluster from scratch because then we notice errors that the API version is not available anymore. It would be nice to have some kind of redeploy process of every added k8s resource after EKS version update is complete so we can spot the errors during EKS update.
Reproduction Steps
- Deploy EKS 1.15 from CDK and add k8s resource that uses deprecated API - i.e:
apiVersion: extensions/v1beta1
kind: DaemonSet
- Update EKS to 1.16 using CDK without any problems.
- Destroy stack and deploy EKS 1.16 from scratch.
- Notice there are errors from kubectl.
Error Log
96/101 | 1:10:23 PM | CREATE_FAILED | Custom::AWSCDK-EKS-KubernetesResource | EksCluster/EksCluster/manifest-DaemonSet/Resource/Default (EksClustermanifestDaemonSetD4243115) Failed to create resource. Error: b'error: unable to recognize "/tmp/manifest.yaml": no matches for kind "DaemonSet" in version "extensions/v1beta1"\n'
Environment
- CLI Version : 1.42
- Framework Version:
- Node.js Version:
- OS :
- Language (Version):
Other
This is :bug: Bug Report
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.