Skip to content

Bugfix: VPC api call failures could cause deletion of all nodes#570

Open
akaokunc wants to merge 1 commit into
linode:mainfrom
akaokunc:bugfix/vpc-api-call-failure-could-lead-to-nodes-deletion
Open

Bugfix: VPC api call failures could cause deletion of all nodes#570
akaokunc wants to merge 1 commit into
linode:mainfrom
akaokunc:bugfix/vpc-api-call-failure-could-lead-to-nodes-deletion

Conversation

@akaokunc
Copy link
Copy Markdown
Contributor

Hello, I was trying find a bug in cooperation between linode LKE api provider and linode CCM to explain unexpected behavior which I have seen on few clusters. I'm not sure I found the root cause of the issue I was observing, but I do believe I have found at least related one.

Here's the possible failure chain:

  1. GetVPCIPAddresses or GetVPCIPv6Addresses returns error, that error would only be logged but the node will be skipped on writing to cache, due to condition:
if len(options.Options.VPCNames) > 0 && len(vpcNodes[instance.ID]) == 0 {
    continue  // instance skipped — vpcNodes is empty due to the failed API call
}
  1. InstanceExists returns false, nil for every node, because linodeByID finds nothing in the empty cache and returns cloudprovider.InstanceNotFound which InstanceExists converts to false, nil.

  2. The cache is written with an empty map and lastUpdate is stamped nc.nodes = newNodes; nc.lastUpdate = time.Now(), so the bad data persists for the full TTL period (default 15s).

  3. The K8s node lifecycle controller deletes such nodes.

General:

  • Have you removed all sensitive information, including but not limited to access keys and passwords?
  • Have you checked to ensure there aren't other open or closed Pull Requests for the same bug/feature/question?

Pull Request Guidelines:

  1. Does your submission pass tests?
  2. [n] Have you added tests?
  3. Are you addressing a single feature in this PR?
  4. Are your commits atomic, addressing one change per commit?
  5. Are you following the conventions of the language?
  6. Have you saved your large formatting changes for a different PR, so we can focus on your work?
  7. Have you explained your rationale for why this feature is needed?
  8. [n] Have you linked your PR to an open issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant