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

invalid type for io.x-k8s.cluster.infrastructure.v1alpha3.AWSMachinePool.spec.subnets: got "string", expected "map" #2464

Closed
chessman opened this issue Jun 2, 2021 · 12 comments · Fixed by #2903
Assignees
Labels
kind/documentation Categorizes issue or PR as related to documentation. lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@chessman
Copy link

chessman commented Jun 2, 2021

/kind bug

What steps did you take and what happened:

I followed steps from https://cluster-api-aws.sigs.k8s.io/topics/machinepools.html

apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
kind: AWSMachinePool
metadata:
  name: capi-test-mp-0
  namespace: default
spec:
  availabilityZones:
  - "eu-central-1"
  awsLaunchTemplate:
    instanceType: t3.large
    sshKeyName: capi
  maxSize: 10
  minSize: 1
  subnets:
    - "eu-central-1a"

After applying the configuration, I got

error validating "capi-test.yaml": error validating data: ValidationError(AWSMachinePool.spec.subnets[0]): invalid type for io.x-k8s.cluster.infrastructure.v1alpha3.AWSMachinePool.spec.subnets: got "string", expected "map"; if you choose to ignore these errors, turn validation off with --validate=false

What did you expect to happen:

No error as it is the same as in the provided documentation.

Anything else you would like to add:

This configuration works:

subnets:
  - id: eu-central-1a

Subnets field has []infrav1.AWSResourceReference type, so it requires an object, not a string.

Environment:

  • Cluster-api-provider-aws version: v0.6.6
  • Kubernetes version: (use kubectl version): v1.21.1
  • OS (e.g. from /etc/os-release): Debian GNU/Linux 11 (bullseye)
@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 2, 2021
@sedefsavas
Copy link
Contributor

sedefsavas commented Jun 3, 2021

Thanks for reporting. This is a documentation issue not a bug I think. Contributions are welcome as well.

/milestone Next
/kind documentation

@k8s-ci-robot k8s-ci-robot added this to the Next milestone Jun 3, 2021
@k8s-ci-robot k8s-ci-robot added the kind/documentation Categorizes issue or PR as related to documentation. label Jun 3, 2021
@sedefsavas sedefsavas removed the kind/bug Categorizes issue or PR as related to a bug. label Jun 3, 2021
@chessman
Copy link
Author

chessman commented Jun 3, 2021

@sedefsavas I continued configuring the cluster and got an error

    Message:               failed to create AWSMachinePool: failed to create autoscaling group: ValidationError: The subnet ID 'eu-central-1a' does not exist
                           status code: 400, request id: 7f6e0e3b-8cca-4c31-ab11-79367adcd946

It means that "id: eu-central-1a" is also not a proper configuration. I replaced it with a subnet ID (subnet-xxxxxxxxx) and it worked out. But this ID gets known after the cluster is provisioned, so it's impossible to specify it beforehand.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 1, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 1, 2021
@shivi28
Copy link
Contributor

shivi28 commented Oct 24, 2021

When we apply cluster-template-machinepool.yaml then it's not mandatory to provide subnet field and perhaps it's useful if we want to use any existing subnet.
IMO we can remove this subnet field from template flavour and documentation .
Wanted to know your thoughts @sedefsavas ?

@shivi28
Copy link
Contributor

shivi28 commented Oct 24, 2021

/lifecycle active

@k8s-ci-robot k8s-ci-robot added lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Oct 24, 2021
@sedefsavas sedefsavas modified the milestones: Next, v1.0.x Nov 1, 2021
@sedefsavas
Copy link
Contributor

/triage accepted

@k8s-ci-robot k8s-ci-robot added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Nov 1, 2021
@sedefsavas
Copy link
Contributor

@shivi28
Let's keep the subnets in the documentation only. This issue is created because we had no correct example on defining subnets in MachinePools.

@sedefsavas
Copy link
Contributor

/priority backlog

@k8s-ci-robot k8s-ci-robot added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Nov 1, 2021
@sedefsavas
Copy link
Contributor

I think you forgot to assign yourself.
/assign @shivi28

@shivi28
Copy link
Contributor

shivi28 commented Nov 2, 2021

Thanks @sedefsavas, I have updated the template and doc

@sedefsavas sedefsavas modified the milestones: v1.0.x, v1.1.0 Nov 15, 2021
@sedefsavas
Copy link
Contributor

Since this is documentation, I am bumping the milestone to the next release.
/milestone v1.2.0

@k8s-ci-robot k8s-ci-robot removed this from the v1.1.0 milestone Nov 16, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.2.0 milestone Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/documentation Categorizes issue or PR as related to documentation. lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants