Skip to content

Commit

Permalink
Add fullNodePeers config option (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
Starttoaster authored Nov 24, 2024
1 parent 6c1f718 commit 0338d59
Show file tree
Hide file tree
Showing 31 changed files with 434 additions and 46 deletions.
58 changes: 56 additions & 2 deletions DEPRECATIONS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,65 @@
# Deprecations

## ChiaFarmer

### fullNodePeer

* Deprecated in: 0.12.6
* Expected to be removed in: 1.0.0

The `fullNodePeer` API field was deprecated in favor of the more versatile `fullNodePeers` list field. The latter being the preferred way to specify one or multiple full_node peers for your configuration.

```yaml
spec:
chia:
# fullNodePeer: peer1:8444
fullNodePeers:
- host: peer1
port: 8444
```
## ChiaTimelord
### fullNodePeer
* Deprecated in: 0.12.6
* Expected to be removed in: 1.0.0
The `fullNodePeer` API field was deprecated in favor of the more versatile `fullNodePeers` list field. The latter being the preferred way to specify one or multiple full_node peers for your configuration.

```yaml
spec:
chia:
# fullNodePeer: peer1:8444
fullNodePeers:
- host: peer1
port: 8444
```

## ChiaWallet

### fullNodePeer

* Deprecated in: 0.12.6
* Expected to be removed in: 1.0.0

The `fullNodePeer` API field was deprecated in favor of the more versatile `fullNodePeers` list field. The latter being the preferred way to specify one or multiple full_node peers for your configuration.

```yaml
spec:
chia:
# fullNodePeer: peer1:8444
fullNodePeers:
- host: peer1
port: 8444
```

## ChiaSeeder

### bootstrapPeer

Deprecated in: 0.12.5
Expected to be removed in: 1.0.0
* Deprecated in: 0.12.5
* Expected to be removed in: 1.0.0

The `bootstrapPeer` API field was deprecated in favor of `bootstrapPeers`. The latter being the preferred way to specify multiple bootstrap peers for a seeder installation, which still allows for specifying a single peer.

Expand Down
9 changes: 9 additions & 0 deletions api/v1/chiacommon_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,3 +354,12 @@ type HostPathVolumeConfig struct {
// +optional
Path string `json:"path,omitempty"`
}

// Peer config for a peer - host and port
type Peer struct {
// Host is the IP address or hostname to a full_node peer.
Host string `json:"host"`

// Port is the port number the full_node's peer port is listening on.
Port uint16 `json:"port"`
}
10 changes: 9 additions & 1 deletion api/v1/chiafarmer_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,15 @@ type ChiaFarmerSpecChia struct {

// FullNodePeer defines the farmer's full_node peer in host:port format.
// In Kubernetes this is likely to be <node service name>.<namespace>.svc.cluster.local:8555
FullNodePeer string `json:"fullNodePeer"`
// Either fullNodePeer or fullNodePeers should be specified. fullNodePeers takes precedence.
// Deprecated in favor of fullNodePeers.
// +optional
FullNodePeer *string `json:"fullNodePeer,omitempty"`

// FullNodePeers is a list of hostnames/IPs and port numbers to full_node peers.
// Either fullNodePeer or fullNodePeers should be specified. fullNodePeers takes precedence.
// +optional
FullNodePeers *[]Peer `json:"fullNodePeers,omitempty"`
}

// ChiaFarmerStatus defines the observed state of ChiaFarmer
Expand Down
11 changes: 9 additions & 2 deletions api/v1/chiafarmer_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ spec:
dnsIntroducerAddress: dns-introducer.svc.cluster.local
timezone: "UTC"
logLevel: "INFO"
fullNodePeer: "node.default.svc.cluster.local:58444"
fullNodePeers:
- host: "node.default.svc.cluster.local"
port: 58444
secretKey:
name: "chiakey-secret"
key: "key.txt"
Expand Down Expand Up @@ -78,7 +80,12 @@ spec:
DNSIntroducerAddress: &dnsIntroducerAddress,
},
CASecretName: "chiaca-secret",
FullNodePeer: "node.default.svc.cluster.local:58444",
FullNodePeers: &[]Peer{
{
Host: "node.default.svc.cluster.local",
Port: 58444,
},
},
SecretKey: ChiaSecretKey{
Name: "chiakey-secret",
Key: "key.txt",
Expand Down
4 changes: 4 additions & 0 deletions api/v1/chianode_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ type ChiaNodeSpecChia struct {
// See: https://docs.chia.net/faq/?_highlight=trust#what-are-trusted-peers-and-how-do-i-add-them
// +optional
TrustedCIDRs *[]string `json:"trustedCIDRs,omitempty"`

// FullNodePeers is a list of hostnames/IPs and port numbers to full_node peers.
// +optional
FullNodePeers *[]Peer `json:"fullNodePeers,omitempty"`
}

// ChiaNodeStatus defines the observed state of ChiaNode
Expand Down
9 changes: 9 additions & 0 deletions api/v1/chianode_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ spec:
trustedCIDRs:
- "192.168.0.0/16"
- "10.0.0.0/8"
fullNodePeers:
- host: "node.default.svc.cluster.local"
port: 58444
chiaExporter:
enabled: true
serviceLabels:
Expand Down Expand Up @@ -82,6 +85,12 @@ spec:
},
CASecretName: "chiaca-secret",
TrustedCIDRs: &expectCIDRs,
FullNodePeers: &[]Peer{
{
Host: "node.default.svc.cluster.local",
Port: 58444,
},
},
},
CommonSpec: CommonSpec{
ChiaExporterConfig: SpecChiaExporter{
Expand Down
10 changes: 9 additions & 1 deletion api/v1/chiatimelord_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ type ChiaTimelordSpecChia struct {

// FullNodePeer defines the timelord's full_node peer in host:port format.
// In Kubernetes this is likely to be <node service name>.<namespace>.svc.cluster.local:8555
FullNodePeer string `json:"fullNodePeer"`
// Either fullNodePeer or fullNodePeers should be specified. fullNodePeers takes precedence.
// Deprecated in favor of fullNodePeers.
// +optional
FullNodePeer *string `json:"fullNodePeer,omitempty"`

// FullNodePeers is a list of hostnames/IPs and port numbers to full_node peers.
// Either fullNodePeer or fullNodePeers should be specified. fullNodePeers takes precedence.
// +optional
FullNodePeers *[]Peer `json:"fullNodePeers,omitempty"`
}

// ChiaTimelordStatus defines the observed state of ChiaTimelord
Expand Down
11 changes: 9 additions & 2 deletions api/v1/chiatimelord_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ spec:
dnsIntroducerAddress: dns-introducer.svc.cluster.local
timezone: "UTC"
logLevel: "INFO"
fullNodePeer: "node.default.svc.cluster.local:58444"
fullNodePeers:
- host: "node.default.svc.cluster.local"
port: 58444
chiaExporter:
enabled: true
serviceLabels:
Expand Down Expand Up @@ -75,7 +77,12 @@ spec:
DNSIntroducerAddress: &dnsIntroducerAddress,
},
CASecretName: "chiaca-secret",
FullNodePeer: "node.default.svc.cluster.local:58444",
FullNodePeers: &[]Peer{
{
Host: "node.default.svc.cluster.local",
Port: 58444,
},
},
},
CommonSpec: CommonSpec{
ChiaExporterConfig: SpecChiaExporter{
Expand Down
9 changes: 8 additions & 1 deletion api/v1/chiawallet_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,15 @@ type ChiaWalletSpecChia struct {

// FullNodePeer defines the farmer's full_node peer in host:port format.
// In Kubernetes this is likely to be <node service name>.<namespace>.svc.cluster.local:8555
// Either fullNodePeer or fullNodePeers should be specified. fullNodePeers takes precedence.
// Deprecated in favor of fullNodePeers.
// +optional
FullNodePeer string `json:"fullNodePeer,omitempty"`
FullNodePeer *string `json:"fullNodePeer,omitempty"`

// FullNodePeers is a list of hostnames/IPs and port numbers to full_node peers.
// Either fullNodePeer or fullNodePeers should be specified. fullNodePeers takes precedence.
// +optional
FullNodePeers *[]Peer `json:"fullNodePeers,omitempty"`

// TrustedCIDRs is a list of CIDRs that this chia component should trust peers from
// See: https://docs.chia.net/faq/?_highlight=trust#what-are-trusted-peers-and-how-do-i-add-them
Expand Down
11 changes: 9 additions & 2 deletions api/v1/chiawallet_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ spec:
dnsIntroducerAddress: dns-introducer.svc.cluster.local
timezone: "UTC"
logLevel: "INFO"
fullNodePeer: "node.default.svc.cluster.local:58444"
fullNodePeers:
- host: "node.default.svc.cluster.local"
port: 58444
secretKey:
name: "chiakey-secret"
key: "key.txt"
Expand Down Expand Up @@ -85,7 +87,12 @@ spec:
DNSIntroducerAddress: &dnsIntroducerAddress,
},
CASecretName: "chiaca-secret",
FullNodePeer: "node.default.svc.cluster.local:58444",
FullNodePeers: &[]Peer{
{
Host: "node.default.svc.cluster.local",
Port: 58444,
},
},
SecretKey: ChiaSecretKey{
Name: "chiakey-secret",
Key: "key.txt",
Expand Down
66 changes: 66 additions & 0 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 22 additions & 1 deletion config/crd/bases/k8s.chia.net_chiafarmers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,29 @@ spec:
description: |-
FullNodePeer defines the farmer's full_node peer in host:port format.
In Kubernetes this is likely to be <node service name>.<namespace>.svc.cluster.local:8555
Either fullNodePeer or fullNodePeers should be specified. fullNodePeers takes precedence.
Deprecated in favor of fullNodePeers.
type: string
fullNodePeers:
description: |-
FullNodePeers is a list of hostnames/IPs and port numbers to full_node peers.
Either fullNodePeer or fullNodePeers should be specified. fullNodePeers takes precedence.
items:
description: Peer config for a peer - host and port
properties:
host:
description: Host is the IP address or hostname to a full_node
peer.
type: string
port:
description: Port is the port number the full_node's peer
port is listening on.
type: integer
required:
- host
- port
type: object
type: array
image:
description: Image defines the image to use for the chia component
containers
Expand Down Expand Up @@ -2074,7 +2096,6 @@ spec:
type: string
required:
- caSecretName
- fullNodePeer
- secretKey
type: object
chiaExporter:
Expand Down
Loading

0 comments on commit 0338d59

Please sign in to comment.