Skip to content

Add proper validation for VPC v2 cluster deployment #2444

@Amulyam24

Description

@Amulyam24

/kind feature
/area provider/ibmcloud

While deploying a VPC cluster with v2 flow, certain errors are thrown during reconciliation when the resources are being created.
Errors:

  1. When subnets are mentioned without zones such as
network:
    controlPlaneSubnets:
      - name: ibm-vpc-subnet-cp-0
      - name: ibm-vpc-subnet-cp-1
    workerSubnets:
      - name: ibm-vpc-subnet-worker-0
      - name: ibm-vpc-subnet-worker-1

it fails with

error failed reconciling control plane subnet: error subnet zone must be defined for subnet ibm-vpc-subnet-cp-0

  1. When network is added in spec and load balancers are missing such as
network:
    controlPlaneSubnets:
      - name: ibm-vpc-subnet-cp-0
      - name: ibm-vpc-subnet-cp-1
    workerSubnets:
      - name: ibm-vpc-subnet-worker-0
      - name: ibm-vpc-subnet-worker-1

it fails with

Message: error no load balancers specified for cluster
Reason: LoadBalancerReconciliationFailed
Severity: Error
Status: False
Type: LoadBalancerReady

Such errors can be avoided by either adding validation in webhooks or the reconciliation logic could create subnets/LBs by constructing zone on demand from zone/region specified in spec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/provider/ibmcloudIssues or PRs related to ibmcloud providerkind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions