github.com/kotalco/kotal@v0.3.0/apis/ethereum2/v1alpha1/beacon_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  // BeaconNodeSpec defines the desired state of BeaconNode
     9  type BeaconNodeSpec struct {
    10  	// Image is Ethereum 2.0 Beacon 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  
    18  	// Network is the network to join
    19  	Network string `json:"network"`
    20  	// Client is the Ethereum 2.0 client to use
    21  	Client Ethereum2Client `json:"client"`
    22  	// ExecutionEngineEndpoint is Ethereum Execution engine node endpoint
    23  	ExecutionEngineEndpoint string `json:"executionEngineEndpoint"`
    24  	// JWTSecretName is kubernetes secret name holding JWT secret
    25  	JWTSecretName string `json:"jwtSecretName"`
    26  	// FeeRecipient is ethereum address collecting transaction fees
    27  	FeeRecipient shared.EthereumAddress `json:"feeRecipient,omitempty"`
    28  
    29  	// CheckpointSyncURL is trusted beacon node rest api endpoint
    30  	CheckpointSyncURL string `json:"checkpointSyncUrl,omitempty"`
    31  
    32  	// REST enables Beacon REST API
    33  	REST bool `json:"rest,omitempty"`
    34  	// RESTPort is Beacon REST API server port
    35  	RESTPort uint `json:"restPort,omitempty"`
    36  
    37  	// RPC enables RPC server
    38  	RPC bool `json:"rpc,omitempty"`
    39  	// RPCPort is RPC server port
    40  	RPCPort uint `json:"rpcPort,omitempty"`
    41  
    42  	// GRPC enables GRPC gateway server
    43  	GRPC bool `json:"grpc,omitempty"`
    44  	// GRPCPort is GRPC gateway server port
    45  	GRPCPort uint `json:"grpcPort,omitempty"`
    46  
    47  	// CertSecretName is k8s secret name that holds tls.key and tls.cert
    48  	CertSecretName string `json:"certSecretName,omitempty"`
    49  
    50  	// Logging is logging verboisty level
    51  	// +kubebuilder:validation:Enum=off;fatal;error;warn;info;debug;trace;all;notice;crit;panic;none
    52  	Logging shared.VerbosityLevel `json:"logging,omitempty"`
    53  
    54  	// Hosts is a list of hostnames to to whitelist for API access
    55  	// +listType=set
    56  	Hosts []string `json:"hosts,omitempty"`
    57  	// CORSDomains is the domains from which to accept cross origin requests
    58  	// +listType=set
    59  	CORSDomains []string `json:"corsDomains,omitempty"`
    60  
    61  	// P2PPort is p2p and discovery port
    62  	P2PPort uint `json:"p2pPort,omitempty"`
    63  
    64  	// Resources is node compute and storage resources
    65  	shared.Resources `json:"resources,omitempty"`
    66  }
    67  
    68  // BeaconNodeStatus defines the observed state of BeaconNode
    69  type BeaconNodeStatus struct {
    70  }
    71  
    72  // +kubebuilder:object:root=true
    73  
    74  // BeaconNode is the Schema for the beaconnodes API
    75  // +kubebuilder:printcolumn:name="Client",type=string,JSONPath=".spec.client"
    76  // +kubebuilder:printcolumn:name="Network",type=string,JSONPath=".spec.network"
    77  type BeaconNode struct {
    78  	metav1.TypeMeta   `json:",inline"`
    79  	metav1.ObjectMeta `json:"metadata,omitempty"`
    80  
    81  	Spec   BeaconNodeSpec   `json:"spec,omitempty"`
    82  	Status BeaconNodeStatus `json:"status,omitempty"`
    83  }
    84  
    85  // +kubebuilder:object:root=true
    86  
    87  // BeaconNodeList contains a list of BeaconNodes
    88  type BeaconNodeList struct {
    89  	metav1.TypeMeta `json:",inline"`
    90  	metav1.ListMeta `json:"metadata,omitempty"`
    91  	Items           []BeaconNode `json:"items"`
    92  }
    93  
    94  func init() {
    95  	SchemeBuilder.Register(&BeaconNode{}, &BeaconNodeList{})
    96  }