aws-samples / eks-cluster-upgrade

Automated Amazon EKS cluster upgrade
MIT No Attribution
154 stars 35 forks source link

Bug: Pre-flight check fails in v0.6.0 for a 1.25 version upgrade #66

Closed quixoticmonk closed 1 year ago

quixoticmonk commented 1 year ago

Expected Behaviour

eksupgrade would complete the pre-flight checks and confirm the upgrade path is available to users on 1.24 version of EKS.

Current Behaviour

eksupgrade fails on pre-flight on the pre-flight indicating the PolicyV1Api doesn't include a list_pod_security_policy attribute.

Code snippet

eksupgrade eksup-cluster 1.25 us-east-1

Possible Solution

Update the logic around invoking pod_security_policies only if the update_version is below 1.25.

preflight_module.py

        if float(update_version) < 1.25:
            pod_security_policies(errors, cluster_name, region, report, customer_report)

Steps to Reproduce

  1. Created a cluster using eksctl eksctl create cluster -f cluster.yaml. Config yaml below
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
  name: eksup-cluster
  region: us-east-1
  version: "1.24"
nodeGroups:
  - name: ng-1
    instanceType: t2.micro
    desiredCapacity: 2
addons: 
- name: vpc-cni
- name: coredns
- name: kube-proxy
  1. Installed eksupgrade using pip install eksupgrade
  2. Ran the eksupgrade command to upgrade the version to 1.25 eksupgrade eksup-cluster 1.25 us-east-1

Amazon EKS upgrade version

0.6.0

Python runtime version

3.9

Packaging format used

PyPi

Debugging logs

ERROR:eksupgrade.src.preflight_module:Pre flight unsuccessful because of the following errors: ["Some error occurred while checking for the policy security policies 'PolicyV1Api' object has no attribute 'list_pod_security_policy'"]
ERROR:eksupgrade.starter:Pre-flight check for cluster eksup-cluster failed!
quixoticmonk commented 1 year ago

Issue is re-opened. The import statements seem to be colliding with the policy api name PolicyV1Api.