Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added node pool name validation #3592

Merged
merged 1 commit into from
Nov 19, 2021
Merged

Added node pool name validation #3592

merged 1 commit into from
Nov 19, 2021

Conversation

akijakya
Copy link
Contributor

@akijakya akijakya commented Nov 15, 2021

Q A
Bug fix? no
New feature? yes
API breaks? no
Deprecations? no
Related issues fixes #2622
License Apache 2.0

What's in this PR?

Adding validation for node pool names (only accept lowercase characters and numbers) for clusters created on AWS.

Why?

The eks-create-asg Cadence workflow errors if there are special characters because the node pool name gets attached to the stack name; also the configure-nodepool-labels workflow errors if there are uppercase characters in the nood pool name resulting in unsuccessful cluster creation, so it is useful if a validator catches these cases even before the cluster creation begins.

Additional context

Example config.yaml:

{
  "cloud": "amazon",
  "location": "eu-west-1",
  "name": "test-validation",
  "properties": {
    "eks": {
      "nodePools": {
        "pool1X": {
          "autoscaling": true,
          "count": 5,
          "instanceType": "t3a.small",
          "maxCount": 10,
          "minCount": 2
        }
      },
      "version": "1.20"
    }
  },
  "secretName": "secret_name"
}

Response (banzai CLI):

ERRO[0013] failed to create cluster: 400 Bad Request (err pipeline.GenericOpenAPIError, request=map[cloud:amazon location:eu-west-1 name:test-validation properties:map[eks:map[nodePools:map[pool1X:map[autoscaling:true count:5 instanceType:t3a.small maxCount:10 minCount:2]] version:1.20]] secretName:secret_name], response={"code":400,"message":"node pool name 'pool1X' invalid: a DNS-1123 subdomain must consist of lower case alphanumeric characters","error":"node pool name 'pool1X' invalid: a DNS-1123 subdomain must consist of lower case alphanumeric characters"}
)
Error: failed to create cluster: 400 Bad Request
failed to create cluster: 400 Bad Request

Checklist

  • Implementation tested (with at least one cloud provider)
  • Code meets the Developer Guide
  • [] OpenAPI and Postman files updated (if needed)
  • [] User guide and development docs updated (if needed)
  • [] Related Helm chart(s) updated (if needed)

@akijakya akijakya added cloud/aws area/node-pool Kubernetes cluster node pools labels Nov 15, 2021
@akijakya akijakya requested a review from pregnor November 15, 2021 13:47
@akijakya akijakya self-assigned this Nov 15, 2021
pkg/common/common.go Outdated Show resolved Hide resolved
pkg/common/common.go Outdated Show resolved Hide resolved
internal/cluster/distribution/eks/ekscluster/eks.go Outdated Show resolved Hide resolved
@akijakya akijakya force-pushed the validate-node-pool-name branch 2 times, most recently from d721a83 to a6314c7 Compare November 16, 2021 11:36
@akijakya akijakya force-pushed the validate-node-pool-name branch from a6314c7 to e7a9f7d Compare November 19, 2021 08:24
@akijakya akijakya force-pushed the validate-node-pool-name branch from e7a9f7d to 5dc676c Compare November 19, 2021 13:51
@akijakya akijakya merged commit 0f95b8a into master Nov 19, 2021
@akijakya akijakya deleted the validate-node-pool-name branch November 19, 2021 14:08
@akijakya akijakya changed the title feat: add node pool name validation Added node pool name validation Jan 31, 2022
@akijakya akijakya mentioned this pull request Feb 1, 2022
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validate node pool name
2 participants