Реализовать lab3 в общем Helm-релизе с Traefik, TLS и HPA
This commit is contained in:
@@ -16,6 +16,8 @@ const (
|
||||
|
||||
// Controller contains settings owned exclusively by the HTTP transport.
|
||||
type Controller struct {
|
||||
// InstanceID identifies this API process to the load balancer diagnostics.
|
||||
InstanceID string
|
||||
// Host is the IP address on which the listener binds.
|
||||
Host string
|
||||
// Port is the TCP port, in the range 1..65535.
|
||||
@@ -85,6 +87,7 @@ func defaultController() *Controller {
|
||||
|
||||
// loadEnvironment applies environment overrides to this configuration section.
|
||||
func (cfg *Controller) loadEnvironment() error {
|
||||
cfg.InstanceID = os.Getenv("INSTANCE_ID")
|
||||
if host, exists := os.LookupEnv("APP_HOST"); exists {
|
||||
cfg.Host = host
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import (
|
||||
|
||||
// Persistence contains database, cache and session settings.
|
||||
type Persistence struct {
|
||||
// CursorKey is the shared base64 signing key supplied through a secret.
|
||||
CursorKey string
|
||||
// DatabaseURL identifies the PostgreSQL database.
|
||||
DatabaseURL string
|
||||
// Shards maps stable identities to Valkey addresses.
|
||||
@@ -25,6 +27,7 @@ type Persistence struct {
|
||||
// NewPersistence loads dependency settings separately from HTTP configuration.
|
||||
func NewPersistence() (*Persistence, error) {
|
||||
cfg := &Persistence{
|
||||
CursorKey: os.Getenv("CURSOR_SIGNING_KEY"),
|
||||
DatabaseURL: os.Getenv("DATABASE_URL"),
|
||||
Coordinator: os.Getenv("VALKEY_COORDINATOR"),
|
||||
Shards: make(map[string]string),
|
||||
|
||||
Reference in New Issue
Block a user