This repository was archived by the owner on Aug 12, 2025. It is now read-only.
  
  
  - 
                Notifications
    You must be signed in to change notification settings 
- Fork 42
Hardware reservation support for machine #137
          
     Merged
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            2 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      
    File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| PacketMachine is the name of the resource that identifies a | ||
| [Device](packetDeviceAPI) on Packet. | ||
|  | ||
| This is an example of it: | ||
|  | ||
| ```yaml | ||
| apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 | ||
| kind: PacketMachine | ||
| metadata: | ||
| name: "qa-master-0" | ||
| spec: | ||
| OS: "ubuntu_18_04" | ||
| facility: | ||
| - "dfw2" | ||
| billingCycle: hourly | ||
| machineType: "t2.small" | ||
| sshKeys: | ||
| - "your-sshkey-name" | ||
| tags: [] | ||
| ``` | ||
|  | ||
| It is a [Kubernetes Custom Resource Definition (CRD)](crd-docs) as everything | ||
| else in the cluster-api land. | ||
|  | ||
| The reported fields in the example are the most common one but you can see the | ||
| full list of supported parameters as part of the OpenAPI definition available | ||
| [here](config/resources/crd/bases/infrastructure.cluster.x-k8s.io_packetmachines.yaml) | ||
| searching for `kind: PacketMachine`. | ||
|  | ||
| ## Reserved instances | ||
|  | ||
| Packet provides the possibility to [reserve | ||
| hardware](packet-docs-reserved-hardware) in order to have to power you need | ||
| always available. | ||
|  | ||
| > Reserved hardware gives you the ability to reserve specific servers for a | ||
| > committed period of time. Unlike hourly on-demand, once you reserve hardware, | ||
| > you will have access to that specific hardware for the duration of the | ||
| > reservation. | ||
|  | ||
| You can specify the reservation ID using the field `hardwareReservationID`: | ||
|  | ||
| ``` | ||
| apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 | ||
| kind: PacketMachine | ||
| metadata: | ||
| name: "qa-master-0" | ||
| spec: | ||
| OS: "ubuntu_18_04" | ||
| facility: | ||
| - "dfw2" | ||
| billingCycle: hourly | ||
| machineType: "t2.small" | ||
| sshKeys: | ||
| - "your-sshkey-name" | ||
| hardwareReservationID: "d3cb029a-c5e4-4e2b-bafc-56266639685f" | ||
| tags: [] | ||
| ``` | ||
|  | ||
| ### pros and cons | ||
|  | ||
| Hardware reservation is a great feature, this chapter is about the feature | ||
| described above and nothing more. | ||
| It covers a very simple use case, you have a set of machines that you created | ||
| statically in the YAML and you like to have them using a reservation ID. | ||
|  | ||
| It does not work in combination of PacketMachineTemplate and MachineDeployment | ||
| where the pool of PacketMachine is dynamically managed by the cluster-api | ||
| controllers. You can track progress on this scenario subscribing to the issue | ||
| ["Add support for reservation IDs with MachineDeployment #136"](github-issue-resid-dynamic) on GitHub. | ||
|  | ||
| [packetDeviceAPI]: https://www.packet.com/developers/api/devices/#devices-createDevice | ||
| [crd-docs]: https://github.com/packethost/cluster-api-provider-packet/blob/master/config/resources/crd/bases/infrastructure.cluster.x-k8s.io_packetmachines.yaml | ||
| [openapi-types]: https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/ | ||
| [packet-docs-reserved-hardware]: https://www.packet.com/developers/docs/getting-started/deployment-options/reserved-hardware/ | ||
| [github-issue-resid-dynamic]: https://github.com/packethost/cluster-api-provider-packet/issues/136 | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.