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

feat: restructure HW information in Server resources (v1alpha2) #823

Merged
merged 1 commit into from
Apr 14, 2022

Conversation

smira
Copy link
Member

@smira smira commented Apr 14, 2022

This is basically subset of PR #735 with only CRD changes without actual
code changes to use new CRDs. As storage version is v1alpha2, every
access goes twice via conversion webhooks (for better test coverage).

Other parts of #735 will be incorporated in a follow-up PR, I decided to
split things up for easier review.

Example:

$ kubectl get servers.v1alpha1.metal.sidero.dev 49fd7c2d-1ba4-4157-8cc0-3f7212f119f0 -o yaml
...
  cpu:
    manufacturer: QEMU
    version: pc-q35-6.0
  hostname: pxe-3
  managementApi:
    endpoint: 172.25.0.1:39565
  system:
    family: Unknown
    manufacturer: QEMU
    productName: Standard PC (Q35 + ICH9, 2009)
    serialNumber: Unknown
    skuNumber: Unknown
    version: pc-q35-6.0
$ kubectl get servers.v1alpha2.metal.sidero.dev 49fd7c2d-1ba4-4157-8cc0-3f7212f119f0 -o yaml
...
  hardware:
    compute:
      processors:
      - manufacturer: QEMU
        productName: pc-q35-6.0
    system:
      family: Unknown
      manufacturer: QEMU
      productName: Standard PC (Q35 + ICH9, 2009)
      serialNumber: Unknown
      skuNumber: Unknown
      version: pc-q35-6.0

We can make more changes to v1alpha2 resources in follow-up PRs.

Co-authored-by: Gerard de Leeuw gdeleeuw@leeuwit.nl
Signed-off-by: Gerard de Leeuw gdeleeuw@leeuwit.nl
Signed-off-by: Andrey Smirnov andrey.smirnov@talos-systems.com

This is basically subset of PR siderolabs#735 with only CRD changes without actual
code changes to use new CRDs. As storage version is v1alpha2, every
access goes twice via conversion webhooks (for better test coverage).

Other parts of siderolabs#735 will be incorporated in a follow-up PR, I decided to
split things up for easier review.

Example:

```bash
$ kubectl get servers.v1alpha1.metal.sidero.dev 49fd7c2d-1ba4-4157-8cc0-3f7212f119f0 -o yaml
...
  cpu:
    manufacturer: QEMU
    version: pc-q35-6.0
  hostname: pxe-3
  managementApi:
    endpoint: 172.25.0.1:39565
  system:
    family: Unknown
    manufacturer: QEMU
    productName: Standard PC (Q35 + ICH9, 2009)
    serialNumber: Unknown
    skuNumber: Unknown
    version: pc-q35-6.0
$ kubectl get servers.v1alpha2.metal.sidero.dev 49fd7c2d-1ba4-4157-8cc0-3f7212f119f0 -o yaml
...
  hardware:
    compute:
      processors:
      - manufacturer: QEMU
        productName: pc-q35-6.0
    system:
      family: Unknown
      manufacturer: QEMU
      productName: Standard PC (Q35 + ICH9, 2009)
      serialNumber: Unknown
      skuNumber: Unknown
      version: pc-q35-6.0
```

We can make more changes to v1alpha2 resources in follow-up PRs.

Co-authored-by: Gerard de Leeuw <gdeleeuw@leeuwit.nl>
Signed-off-by: Gerard de Leeuw <gdeleeuw@leeuwit.nl>
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
@@ -0,0 +1,118 @@
// This Source Code Form is subject to the terms of the Mozilla Public
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel it would be great to extract that and share the validation code between v1 and v2, but I'm not sure if it goes against the best practices 🤷‍♂️

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, validation might be different across the two I guess? as we evolve the types

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may still have common parts I guess.

@smira
Copy link
Member Author

smira commented Apr 14, 2022

/m

@talos-bot talos-bot merged commit e4bb416 into siderolabs:master Apr 14, 2022
smira added a commit to smira/sidero that referenced this pull request Apr 14, 2022
This is final part of siderolabs#735, previous part in siderolabs#823.

This imports all remaining changes with some fixups minus the webhook
changes.

This change adds detailed hardware information to the Server CRD.
Hardware info is extracted by the agent from SMBIOS.
The ServerClass CRD is also updated so more precise qualifiers can be used.

Co-authored-by: Gerard de Leeuw <gdeleeuw@leeuwit.nl>
Signed-off-by: Gerard de Leeuw <gdeleeuw@leeuwit.nl>
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
smira added a commit to smira/sidero that referenced this pull request Apr 15, 2022
This is final part of siderolabs#735, previous part in siderolabs#823.

This imports all remaining changes with some fixups minus the webhook
changes.

This change adds detailed hardware information to the Server CRD.
Hardware info is extracted by the agent from SMBIOS.
The ServerClass CRD is also updated so more precise qualifiers can be used.

Co-authored-by: Gerard de Leeuw <gdeleeuw@leeuwit.nl>
Signed-off-by: Gerard de Leeuw <gdeleeuw@leeuwit.nl>
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
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.

4 participants