aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

[aws-eks] Automatically identify k8s resource deprecations on EKS updates

Open stefanolczak opened this issue 6 years ago • 1 comments

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

  1. Deploy EKS 1.15 from CDK and add k8s resource that uses deprecated API - i.e:
apiVersion: extensions/v1beta1
kind: DaemonSet
  1. Update EKS to 1.16 using CDK without any problems.
  2. Destroy stack and deploy EKS 1.16 from scratch.
  3. 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

stefanolczak avatar Jun 03 '20 12:06 stefanolczak

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.

github-actions[bot] avatar Jun 28 '22 00:06 github-actions[bot]