|
| 1 | +PacketMachine is the name of the resource that identifies a |
| 2 | +[Device](packetDeviceAPI) on Packet. |
| 3 | + |
| 4 | +This is an example of it: |
| 5 | + |
| 6 | +```yaml |
| 7 | +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 |
| 8 | +kind: PacketMachine |
| 9 | +metadata: |
| 10 | + name: "qa-master-0" |
| 11 | +spec: |
| 12 | + OS: "ubuntu_18_04" |
| 13 | + facility: |
| 14 | + - "dfw2" |
| 15 | + billingCycle: hourly |
| 16 | + machineType: "t2.small" |
| 17 | + sshKeys: |
| 18 | + - "your-sshkey-name" |
| 19 | + tags: [] |
| 20 | +``` |
| 21 | +
|
| 22 | +It is a [Kubernetes Custom Resource Definition (CRD)](crd-docs) as everything |
| 23 | +else in the cluster-api land. |
| 24 | +
|
| 25 | +The reported fields in the example are the most common one but you can see the |
| 26 | +full list of supported parameters as part of the OpenAPI definition available |
| 27 | +[here](config/resources/crd/bases/infrastructure.cluster.x-k8s.io_packetmachines.yaml) |
| 28 | +searching for `kind: PacketMachine`. |
| 29 | + |
| 30 | +## Reserved instances |
| 31 | + |
| 32 | +Packet provides the possibility to [reserve |
| 33 | +hardware](packet-docs-reserved-hardware) in order to have to power you need |
| 34 | +always available. |
| 35 | + |
| 36 | +> Reserved hardware gives you the ability to reserve specific servers for a |
| 37 | +> committed period of time. Unlike hourly on-demand, once you reserve hardware, |
| 38 | +> you will have access to that specific hardware for the duration of the |
| 39 | +> reservation. |
| 40 | + |
| 41 | +You can specify the reservation ID using the field `hardwareReservationID`: |
| 42 | + |
| 43 | +``` |
| 44 | +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 |
| 45 | +kind: PacketMachine |
| 46 | +metadata: |
| 47 | + name: "qa-master-0" |
| 48 | +spec: |
| 49 | + OS: "ubuntu_18_04" |
| 50 | + facility: |
| 51 | + - "dfw2" |
| 52 | + billingCycle: hourly |
| 53 | + machineType: "t2.small" |
| 54 | + sshKeys: |
| 55 | + - "your-sshkey-name" |
| 56 | + hardwareReservationID: "d3cb029a-c5e4-4e2b-bafc-56266639685f" |
| 57 | + tags: [] |
| 58 | +``` |
| 59 | + |
| 60 | +### pros and cons |
| 61 | + |
| 62 | +Hardware reservation is a great feature, this chapter is about the feature |
| 63 | +described above and nothing more. |
| 64 | +It covers a very simple use case, you have a set of machines that you created |
| 65 | +statically in the YAML and you like to have them using a reservation ID. |
| 66 | + |
| 67 | +It does not work in combination of PacketMachineTemplate and MachineDeployment |
| 68 | +where the pool of PacketMachine is dynamically managed by the cluster-api |
| 69 | +controllers. You can track progress on this scenario subscribing to the issue |
| 70 | +["Add support for reservation IDs with MachineDeployment #136"](github-issue-resid-dynamic) on GitHub. |
| 71 | + |
| 72 | +[packetDeviceAPI]: https://www.packet.com/developers/api/devices/#devices-createDevice |
| 73 | +[crd-docs]: https://github.com/packethost/cluster-api-provider-packet/blob/master/config/resources/crd/bases/infrastructure.cluster.x-k8s.io_packetmachines.yaml |
| 74 | +[openapi-types]: https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/ |
| 75 | +[packet-docs-reserved-hardware]: https://www.packet.com/developers/docs/getting-started/deployment-options/reserved-hardware/ |
| 76 | +[github-issue-resid-dynamic]: https://github.com/packethost/cluster-api-provider-packet/issues/136 |
0 commit comments