github.com/kotalco/kotal@v0.3.0/apis/chainlink/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  // APICredentials is api credentials
     9  type APICredentials struct {
    10  	// Email is user email
    11  	Email string `json:"email"`
    12  	// PasswordSecretName is the k8s secret name that holds password
    13  	PasswordSecretName string `json:"passwordSecretName"`
    14  }
    15  
    16  // NodeSpec defines the desired state of Node
    17  type NodeSpec struct {
    18  	// Image is Chainlink node client image
    19  	Image string `json:"image,omitempty"`
    20  	// ExtraArgs is extra arguments to pass down to the cli
    21  	ExtraArgs shared.ExtraArgs `json:"extraArgs,omitempty"`
    22  	// Replicas is number of replicas
    23  	// +kubebuilder:validation:Enum=0;1
    24  	Replicas *uint `json:"replicas,omitempty"`
    25  	// EthereumChainId is ethereum chain id
    26  	EthereumChainId uint `json:"ethereumChainId"`
    27  	// EthereumWSEndpoint is ethereum websocket endpoint
    28  	EthereumWSEndpoint string `json:"ethereumWsEndpoint"`
    29  	// EthereumHTTPEndpoints is ethereum http endpoints
    30  	// +listType=set
    31  	EthereumHTTPEndpoints []string `json:"ethereumHttpEndpoints,omitempty"`
    32  	// LinkContractAddress is link contract address
    33  	LinkContractAddress string `json:"linkContractAddress"`
    34  	// DatabaseURL is postgres database connection URL
    35  	DatabaseURL string `json:"databaseURL"`
    36  	// KeystorePasswordSecretName is k8s secret name that holds keystore password
    37  	KeystorePasswordSecretName string `json:"keystorePasswordSecretName"`
    38  	// APICredentials is api credentials
    39  	APICredentials APICredentials `json:"apiCredentials"`
    40  	// CORSDomains is the domains from which to accept cross origin requests
    41  	// +listType=set
    42  	CORSDomains []string `json:"corsDomains,omitempty"`
    43  	// CertSecretName is k8s secret name that holds tls.key and tls.cert
    44  	CertSecretName string `json:"certSecretName,omitempty"`
    45  	// TLSPort is port used for HTTPS connections
    46  	TLSPort uint `json:"tlsPort,omitempty"`
    47  	// P2PPort is port used for p2p communcations
    48  	P2PPort uint `json:"p2pPort,omitempty"`
    49  	// API enables node API server
    50  	API bool `json:"api,omitempty"`
    51  	// APIPort is port used for node API and GUI
    52  	APIPort uint `json:"apiPort,omitempty"`
    53  	// SecureCookies enables secure cookies for authentication
    54  	SecureCookies bool `json:"secureCookies,omitempty"`
    55  	// Logging is logging verboisty level
    56  	// +kubebuilder:validation:Enum=debug;info;warn;error;panic
    57  	Logging shared.VerbosityLevel `json:"logging,omitempty"`
    58  	// Resources is node compute and storage resources
    59  	shared.Resources `json:"resources,omitempty"`
    60  }
    61  
    62  // NodeStatus defines the observed state of Node
    63  type NodeStatus struct {
    64  	Client string `json:"client,omitempty"`
    65  }
    66  
    67  // +kubebuilder:object:root=true
    68  // +kubebuilder:subresource:status
    69  
    70  // Node is the Schema for the nodes API
    71  // +kubebuilder:printcolumn:name="Client",type=string,JSONPath=".status.client"
    72  // +kubebuilder:printcolumn:name="EthereumChainId",type=number,JSONPath=".spec.ethereumChainId"
    73  // +kubebuilder:printcolumn:name="LinkContractAddress",type=string,JSONPath=".spec.linkContractAddress",priority=10
    74  type Node struct {
    75  	metav1.TypeMeta   `json:",inline"`
    76  	metav1.ObjectMeta `json:"metadata,omitempty"`
    77  
    78  	Spec   NodeSpec   `json:"spec,omitempty"`
    79  	Status NodeStatus `json:"status,omitempty"`
    80  }
    81  
    82  // +kubebuilder:object:root=true
    83  
    84  // NodeList contains a list of Node
    85  type NodeList struct {
    86  	metav1.TypeMeta `json:",inline"`
    87  	metav1.ListMeta `json:"metadata,omitempty"`
    88  	Items           []Node `json:"items"`
    89  }
    90  
    91  func init() {
    92  	SchemeBuilder.Register(&Node{}, &NodeList{})
    93  }