Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit 637701d

Browse files
authored
Merge pull request #409 from cprivitere/cprivitere/issue401
📖 Document usage of hardware reservations
2 parents c99f581 + 1a36759 commit 637701d

File tree

3 files changed

+41
-67
lines changed

3 files changed

+41
-67
lines changed

README.md

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ This is the official [cluster-api](https://github.com/kubernetes-sigs/cluster-ap
1010

1111
![Packetbot works hard to keep Kubernetes cluster in a good shape](./docs/banner.png)
1212

13-
14-
### Requirements
13+
## Requirements
1514

1615
To use the cluster-api to deploy a Kubernetes cluster to Equinix Metal, you need the following:
1716

@@ -27,11 +26,11 @@ and [k3d](https://github.com/rancher/k3d).
2726

2827
Once you have your cluster, ensure your `KUBECONFIG` environment variable is set correctly.
2928

30-
### Getting Started
29+
## Getting Started
3130

3231
You should then follow the [Cluster API Quick Start Guide](https://cluster-api.sigs.k8s.io/user/quick-start.html), selecting the 'Equinix Metal' tabs where offered.
3332

34-
#### Defaults
33+
### Defaults
3534

3635
If you do not change the generated `yaml` files, it will use defaults. You can look in the [templates/cluster-template.yaml](./templates/cluster-template.yaml) file for details.
3736

@@ -42,30 +41,52 @@ If you do not change the generated `yaml` files, it will use defaults. You can l
4241
* `POD_CIDR` (defaults to `192.168.0.0/16`)
4342
* `SERVICE_CIDR` (defaults to `172.26.0.0/16`)
4443
* `WORKER_MACHINE_COUNT` (defaults to `0`)
44+
45+
### Reserved Hardware
46+
47+
If you'd like to use reserved instances for your cluster, you need to edit your cluster yaml and add a hardwareReservationID field to your PacketMachineTemplates. That field can contain either a comma-separated list of hardware reservation IDs you'd like to use (which will cause it to ignore the facility and machineType you've specified), or just "next-available" to let the controller pick one that's available (that matches the machineType and facility you've specified). Here's an example:
48+
49+
```yaml
50+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
51+
kind: PacketMachineTemplate
52+
metadata:
53+
name: my-cluster-control-plane
54+
namespace: default
55+
spec:
56+
template:
57+
spec:
58+
billingCycle: hourly
59+
machineType: c3.small.x86
60+
os: ubuntu_18_04
61+
sshKeys:
62+
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDvMgVEubPLztrvVKgNPnRe9sZSjAqaYj9nmCkgr4PdK username@computer
63+
tags: []
64+
#If you want to specify the exact machines to use, provide a comma separated list of UUIDs
65+
hardwareReservationID: "b537c5aa-2ef3-11ed-a261-0242ac120002,b537c5aa-2ef3-11ed-a261-0242ac120002"
66+
#Or let the controller pick from available reserved hardware in the project that matches machineType and facility with `next-available`
67+
#hardwareReservationID: "next-available"
68+
```
4569

4670
## Community, discussion, contribution, and support
4771

4872
Learn how to engage with the Kubernetes community on the [community page](http://kubernetes.io/community/).
4973

74+
Equinix has a [cluster-api guide](https://metal.equinix.com/developers/guides/kubernetes-cluster-api/)
75+
5076
You can reach the maintainers of this project at:
5177

52-
* Chat with us on [Slack](http://slack.k8s.io/) in the [#cluster-api-provider-packet][#cluster-api-provider-packet slack] channel
78+
* Chat with us on [Slack](http://slack.k8s.io/) in the [#cluster-api-provider-packet](https://kubernetes.slack.com/archives/C8TSNPY4T) channel
5379
* Subscribe to the [SIG Cluster Lifecycle](https://groups.google.com/forum/#!forum/kubernetes-sig-cluster-lifecycle) Google Group for access to documents and calendars
5480

55-
5681
## Development and Customizations
82+
5783
The following section describes how to use the cluster-api provider for packet (CAPP) as a regular user.
5884
You do _not_ need to clone this repository, or install any special tools, other than the standard
5985
`kubectl` and `clusterctl`; see below.
6086

6187
* To build CAPP and to deploy individual components, see [docs/BUILD.md](./docs/BUILD.md).
6288
* To build CAPP and to cut a proper release, see [docs/RELEASE.md](./docs/RELEASE.md).
6389

64-
65-
### Code of conduct
90+
## Code of conduct
6691

6792
Participation in the Kubernetes community is governed by the [Kubernetes Code of Conduct](code-of-conduct.md).
68-
69-
[owners]: https://git.k8s.io/community/contributors/guide/owners.md
70-
[Creative Commons 4.0]: https://git.k8s.io/website/LICENSE
71-
[#cluster-api-provider-packet slack]: https://kubernetes.slack.com/archives/C8TSNPY4T

docs/concepts/machine.md

Lines changed: 7 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,30 @@
11
# PacketMachine CRD
22

33
PacketMachine is the name of the resource that identifies a
4-
[Device](equinixMetalDeviceAPI) on Packet.
4+
[Device](https://metal.equinix.com/developers/api/devices/#devices-createdevice) on Packet.
55

66
This is an example of it:
77

88
```yaml
9-
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
9+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
1010
kind: PacketMachine
1111
metadata:
1212
name: "qa-controlplane-0"
1313
spec:
14-
OS: "ubuntu_18_04"
14+
os: "ubuntu_18_04"
1515
billingCycle: hourly
16-
machineType: "t2.small"
16+
machineType: "c3.small.x86"
1717
sshKeys:
18-
- "your-sshkey-name"
18+
- "Your SSH public key"
1919
tags: []
2020
```
2121
22-
It is a [Kubernetes Custom Resource Definition (CRD)](openapi-types) as everything
22+
It is a [Kubernetes Custom Resource Definition (CRD)](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) as everything
2323
else in the cluster-api land.
2424
2525
The reported fields in the example are the most common one but you can see the
2626
full list of supported parameters as part of the OpenAPI definition available
2727
[here](../../config/crd/bases/infrastructure.cluster.x-k8s.io_packetclusters.yaml)
2828
searching for `kind: PacketMachine`.
2929

30-
The `PacketMachine`, `PacketCluster`, and `PacketMachineTemplate` CRD specs are also documented at [docs.crds.dev](https://doc.crds.dev/github.com/kubernetes-sigs/cluster-api-provider-packet).
31-
32-
## Reserved instances
33-
34-
Packet provides the possibility to [reserve
35-
hardware](equinix-metal-docs-reserved-hardware) in order to have to power you need
36-
always available.
37-
38-
> Reserved hardware gives you the ability to reserve specific servers for a
39-
> committed period of time. Unlike hourly on-demand, once you reserve hardware,
40-
> you will have access to that specific hardware for the duration of the
41-
> reservation.
42-
43-
You can specify the reservation ID using the field `hardwareReservationID`:
44-
45-
```yaml
46-
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
47-
kind: PacketMachine
48-
metadata:
49-
name: "qa-controlplane-0"
50-
spec:
51-
OS: "ubuntu_18_04"
52-
facility:
53-
- "dfw2"
54-
billingCycle: hourly
55-
machineType: "t2.small"
56-
sshKeys:
57-
- "your-sshkey-name"
58-
hardwareReservationID: "d3cb029a-c5e4-4e2b-bafc-56266639685f"
59-
tags: []
60-
```
61-
62-
### pros and cons
63-
64-
Hardware reservation is a great feature, this chapter is about the feature
65-
described above and nothing more.
66-
It covers a very simple use case, you have a set of machines that you created
67-
statically in the YAML and you like to have them using a reservation ID.
68-
69-
It does not work in combination of PacketMachineTemplate and MachineDeployment
70-
where the pool of PacketMachine is dynamically managed by the cluster-api
71-
controllers. You can track progress on this scenario subscribing to the issue
72-
["Add support for reservation IDs with MachineDeployment #136"](github-issue-resid-dynamic) on GitHub.
73-
74-
[equinixMetalDeviceAPI]: https://metal.equinix.com/developers/api/devices/#devices-createdevice
75-
[openapi-types]: https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/
76-
[equinix-metal-docs-reserved-hardware]: https://metal.equinix.com/developers/docs/deploy/reserved/
77-
[github-issue-resid-dynamic]: https://github.com/packethost/cluster-api-provider-packet/issues/136
30+
The `PacketMachine`, `PacketCluster`, and `PacketMachineTemplate` CRD specs are also documented at [docs.crds.dev](https://doc.crds.dev/github.com/kubernetes-sigs/cluster-api-provider-packet).

docs/contribution/e2e_test.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ export TAG=<my_tag>
6060
export SKIP_IMAGE_BUILD=1
6161
make docker-build-all docker-push-all
6262
./scripts/ci-e2e-capi.sh
63-
```
63+
```

0 commit comments

Comments
 (0)