Documentation
¶
Overview ¶
Package erpcproxy provides a Pulumi component for deploying an eRPC proxy service to Kubernetes.
Index ¶
Constants ¶
const ( // Component identification ComponentKind = "signet:erpc-proxy:ErpcProxy" // Resource name suffixes ServiceAccountSuffix = "-sa" ConfigMapSuffix = "-config" SecretSuffix = "-secrets" DeploymentSuffix = "-deployment" ServiceSuffix = "-service" // Default values DefaultReplicas = 1 DefaultHttpPort = 4000 DefaultMetricsPort = 4001 DefaultImage = "ghcr.io/erpc/erpc:latest" DefaultLogLevel = "info" DefaultMaxTimeoutMs = "30s" DefaultMemoryRequest = "256Mi" DefaultMemoryLimit = "2Gi" DefaultCpuRequest = "100m" DefaultCpuLimit = "1000m" DefaultGoGC = "40" DefaultGoMemLimit = "1900MiB" // Environment variable names EnvGoGC = "GOGC" EnvGoMemLimit = "GOMEMLIMIT" // Config file name ConfigFileName = "erpc.yaml" ConfigMountPath = "/home/nonroot" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErpcProxyComponent ¶
type ErpcProxyComponent struct {
pulumi.ResourceState
ServiceAccount *corev1.ServiceAccount
ConfigMap *corev1.ConfigMap
Secret *corev1.Secret
Deployment *appsv1.Deployment
Service *corev1.Service
}
ErpcProxyComponent represents a Pulumi component that deploys an eRPC proxy service
func NewErpcProxy ¶
func NewErpcProxy(ctx *pulumi.Context, args ErpcProxyComponentArgs, opts ...pulumi.ResourceOption) (*ErpcProxyComponent, error)
NewErpcProxy creates a new eRPC proxy component with the given configuration.
func (*ErpcProxyComponent) GetMetricsURL ¶
func (c *ErpcProxyComponent) GetMetricsURL() pulumi.StringOutput
GetMetricsURL returns the metrics URL for the eRPC proxy
func (*ErpcProxyComponent) GetServiceURL ¶
func (c *ErpcProxyComponent) GetServiceURL() pulumi.StringOutput
GetServiceURL returns the service URL for the eRPC proxy
type ErpcProxyComponentArgs ¶
type ErpcProxyComponentArgs struct {
Namespace string `pulumi:"namespace" validate:"required"`
Name string `pulumi:"name" validate:"required"`
Image string `pulumi:"image" validate:"required"`
Config ErpcProxyConfig `pulumi:"config" validate:"required"`
ApiKeys map[string]string `pulumi:"apiKeys"`
Resources ErpcProxyResources `pulumi:"resources"`
Replicas int `pulumi:"replicas"`
}
ErpcProxyComponentArgs represents the public-facing arguments for the eRPC proxy component
func (*ErpcProxyComponentArgs) Validate ¶
func (args *ErpcProxyComponentArgs) Validate() error
Validate validates the ErpcProxyComponentArgs
type ErpcProxyConfig ¶
type ErpcProxyConfig struct {
LogLevel string `pulumi:"logLevel"`
Database ErpcProxyDatabaseConfig `pulumi:"database"`
Server ErpcProxyServerConfig `pulumi:"server"`
Projects []ErpcProxyProjectConfig `pulumi:"projects" validate:"required,min=1"`
}
ErpcProxyConfig represents the eRPC proxy configuration
func (*ErpcProxyConfig) Validate ¶
func (c *ErpcProxyConfig) Validate() error
Validate validates the ErpcProxyConfig
type ErpcProxyDatabaseConfig ¶
type ErpcProxyDatabaseConfig struct {
Type string `pulumi:"type"`
ConnectionUrl string `pulumi:"connectionUrl"`
}
ErpcProxyDatabaseConfig represents database configuration
func (*ErpcProxyDatabaseConfig) Validate ¶
func (d *ErpcProxyDatabaseConfig) Validate() error
Validate validates the ErpcProxyDatabaseConfig
type ErpcProxyEnv ¶
ErpcProxyEnv represents environment variables for the eRPC proxy
type ErpcProxyFailoverConfig ¶
type ErpcProxyFailoverConfig struct {
MaxRetries int `pulumi:"maxRetries"`
BackoffMs int `pulumi:"backoffMs"`
BackoffMaxMs int `pulumi:"backoffMaxMs"`
BackoffFactor int `pulumi:"backoffFactor"`
Duration string `pulumi:"duration"`
}
ErpcProxyFailoverConfig represents failover configuration
func (*ErpcProxyFailoverConfig) Validate ¶
func (f *ErpcProxyFailoverConfig) Validate() error
Validate validates the ErpcProxyFailoverConfig
type ErpcProxyNetworkConfig ¶
type ErpcProxyNetworkConfig struct {
ChainId int `pulumi:"chainId" validate:"required"`
Architecture string `pulumi:"architecture" validate:"required"`
Failover ErpcProxyFailoverConfig `pulumi:"failover"`
}
ErpcProxyNetworkConfig represents a network configuration
func (*ErpcProxyNetworkConfig) Validate ¶
func (n *ErpcProxyNetworkConfig) Validate() error
Validate validates the ErpcProxyNetworkConfig
type ErpcProxyProjectConfig ¶
type ErpcProxyProjectConfig struct {
Id string `pulumi:"id" validate:"required"`
Networks []ErpcProxyNetworkConfig `pulumi:"networks" validate:"required,min=1"`
Upstreams []ErpcProxyUpstreamConfig `pulumi:"upstreams" validate:"required,min=1"`
RateLimitBudget string `pulumi:"rateLimitBudget"`
}
ErpcProxyProjectConfig represents a project configuration
func (*ErpcProxyProjectConfig) Validate ¶
func (p *ErpcProxyProjectConfig) Validate() error
Validate validates the ErpcProxyProjectConfig
type ErpcProxyResources ¶
type ErpcProxyResources struct {
MemoryRequest string `pulumi:"memoryRequest"`
MemoryLimit string `pulumi:"memoryLimit"`
CpuRequest string `pulumi:"cpuRequest"`
CpuLimit string `pulumi:"cpuLimit"`
}
ErpcProxyResources represents resource requirements
func (*ErpcProxyResources) Validate ¶
func (r *ErpcProxyResources) Validate() error
Validate validates the ErpcProxyResources
type ErpcProxyServerConfig ¶
type ErpcProxyServerConfig struct {
HttpHostV4 string `pulumi:"httpHostV4"`
HttpPortV4 int `pulumi:"httpPortV4"`
MaxTimeout string `pulumi:"maxTimeout"`
}
ErpcProxyServerConfig represents server configuration
func (*ErpcProxyServerConfig) Validate ¶
func (s *ErpcProxyServerConfig) Validate() error
Validate validates the ErpcProxyServerConfig
type ErpcProxyUpstreamConfig ¶
type ErpcProxyUpstreamConfig struct {
Id string `pulumi:"id" validate:"required"`
Type string `pulumi:"type" validate:"required"`
Endpoint string `pulumi:"endpoint" validate:"required"`
RateLimitBudget string `pulumi:"rateLimitBudget"`
MaxRetries int `pulumi:"maxRetries"`
Timeout string `pulumi:"timeout"`
}
ErpcProxyUpstreamConfig represents an upstream configuration
func (*ErpcProxyUpstreamConfig) Validate ¶
func (u *ErpcProxyUpstreamConfig) Validate() error
Validate validates the ErpcProxyUpstreamConfig