github.com/kotalco/kotal@v0.3.0/apis/near/v1alpha1/node.go (about)

     1  package v1alpha1
     2  
     3  import (
     4  	"github.com/kotalco/kotal/apis/shared"
     5  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
     6  )
     7  
     8  // NodeSpec defines the desired state of Node
     9  type NodeSpec struct {
    10  	// Image is NEAR node client image
    11  	Image string `json:"image,omitempty"`
    12  	// ExtraArgs is extra arguments to pass down to the cli
    13  	ExtraArgs shared.ExtraArgs `json:"extraArgs,omitempty"`
    14  	// Replicas is number of replicas
    15  	// +kubebuilder:validation:Enum=0;1
    16  	Replicas *uint `json:"replicas,omitempty"`
    17  	// Network is NEAR network to join and sync
    18  	// +kubebuilder:validation:Enum=mainnet;testnet;betanet
    19  	Network string `json:"network"`
    20  	// NodePrivateKeySecretName is the secret name holding node Ed25519 private key
    21  	NodePrivateKeySecretName string `json:"nodePrivateKeySecretName,omitempty"`
    22  	// ValidatorSecretName is the secret name holding node Ed25519 validator key
    23  	ValidatorSecretName string `json:"validatorSecretName,omitempty"`
    24  	// MinPeers is minimum number of peers to start syncing/producing blocks
    25  	MinPeers uint `json:"minPeers,omitempty"`
    26  	// Archive keeps old blocks in the storage
    27  	Archive bool `json:"archive,omitempty"`
    28  	// P2PPort is p2p port
    29  	P2PPort uint `json:"p2pPort,omitempty"`
    30  	// RPC enables JSON-RPC server
    31  	RPC bool `json:"rpc,omitempty"`
    32  	// RPCPort is JSON-RPC server listening port
    33  	RPCPort uint `json:"rpcPort,omitempty"`
    34  	// PrometheusPort is prometheus exporter port
    35  	PrometheusPort uint `json:"prometheusPort,omitempty"`
    36  	// TelemetryURL is telemetry service URL
    37  	TelemetryURL string `json:"telemetryURL,omitempty"`
    38  	// Bootnodes is array of boot nodes to bootstrap network from
    39  	// +listType=set
    40  	Bootnodes []string `json:"bootnodes,omitempty"`
    41  	// Resources is node compute and storage resources
    42  	shared.Resources `json:"resources,omitempty"`
    43  }
    44  
    45  // NodeStatus defines the observed state of Node
    46  type NodeStatus struct {
    47  	Client string `json:"client,omitempty"`
    48  }
    49  
    50  // +kubebuilder:object:root=true
    51  // +kubebuilder:subresource:status
    52  
    53  // Node is the Schema for the nodes API
    54  // +kubebuilder:printcolumn:name="Network",type=string,JSONPath=".spec.network"
    55  // +kubebuilder:printcolumn:name="Client",type=string,JSONPath=".status.client"
    56  // +kubebuilder:printcolumn:name="Validator",type=boolean,JSONPath=".spec.validator",priority=10
    57  type Node struct {
    58  	metav1.TypeMeta   `json:",inline"`
    59  	metav1.ObjectMeta `json:"metadata,omitempty"`
    60  
    61  	Spec   NodeSpec   `json:"spec,omitempty"`
    62  	Status NodeStatus `json:"status,omitempty"`
    63  }
    64  
    65  // +kubebuilder:object:root=true
    66  
    67  // NodeList contains a list of Node
    68  type NodeList struct {
    69  	metav1.TypeMeta `json:",inline"`
    70  	metav1.ListMeta `json:"metadata,omitempty"`
    71  	Items           []Node `json:"items"`
    72  }
    73  
    74  func init() {
    75  	SchemeBuilder.Register(&Node{}, &NodeList{})
    76  }