github.com/argoproj/argo-cd/v2@v2.10.9/pkg/apis/application/v1alpha1/cluster_constants.go (about)

     1  package v1alpha1
     2  
     3  import (
     4  	"math"
     5  	"time"
     6  
     7  	"github.com/argoproj/argo-cd/v2/util/env"
     8  )
     9  
    10  const (
    11  
    12  	// EnvVarFakeInClusterConfig is an environment variable to fake an in-cluster RESTConfig using
    13  	// the current kubectl context (for development purposes)
    14  	EnvVarFakeInClusterConfig = "ARGOCD_FAKE_IN_CLUSTER"
    15  
    16  	// EnvK8sClientQPS is the QPS value used for the kubernetes client (default: 50)
    17  	EnvK8sClientQPS = "ARGOCD_K8S_CLIENT_QPS"
    18  
    19  	// EnvK8sClientBurst is the burst value used for the kubernetes client (default: twice the client QPS)
    20  	EnvK8sClientBurst = "ARGOCD_K8S_CLIENT_BURST"
    21  
    22  	// EnvK8sClientMaxIdleConnections is the number of max idle connections in K8s REST client HTTP transport (default: 500)
    23  	EnvK8sClientMaxIdleConnections = "ARGOCD_K8S_CLIENT_MAX_IDLE_CONNECTIONS"
    24  
    25  	// EnvK8sTCPTimeout is the duration for TCP timeouts when communicating with K8s API servers
    26  	EnvK8sTCPTimeout = "ARGOCD_K8S_TCP_TIMEOUT"
    27  
    28  	// EnvK8sTCPKeepalive is the interval for TCP keep alive probes to be sent when communicating with K8s API servers
    29  	EnvK8sTCPKeepAlive = "ARGOCD_K8S_TCP_KEEPALIVE"
    30  
    31  	// EnvK8sTLSHandshakeTimeout is the duration for TLS handshake timeouts when establishing connections to K8s API servers
    32  	EnvK8sTLSHandshakeTimeout = "ARGOCD_K8S_TLS_HANDSHAKE_TIMEOUT"
    33  
    34  	// EnvK8sTCPIdleConnTimeout is the duration when idle TCP connection to the K8s API servers should timeout
    35  	EnvK8sTCPIdleConnTimeout = "ARGOCD_K8S_TCP_IDLE_TIMEOUT"
    36  )
    37  
    38  // Configuration variables associated with the Cluster API
    39  var (
    40  
    41  	// K8sClientConfigQPS controls the QPS to be used in K8s REST client configs
    42  	K8sClientConfigQPS float32 = env.ParseFloatFromEnv(EnvK8sClientQPS, 50, 0, math.MaxFloat32)
    43  
    44  	// K8sClientConfigBurst controls the burst to be used in K8s REST client configs
    45  	K8sClientConfigBurst int = env.ParseNumFromEnv(EnvK8sClientBurst, int(2*K8sClientConfigQPS), 0, math.MaxInt32)
    46  
    47  	// K8sMaxIdleConnections controls the number of max idle connections in K8s REST client HTTP transport
    48  	K8sMaxIdleConnections = env.ParseNumFromEnv(EnvK8sClientMaxIdleConnections, 500, 0, math.MaxInt32)
    49  
    50  	// K8sTLSHandshakeTimeout defines the maximum duration to wait for a TLS handshake to complete
    51  	K8sTLSHandshakeTimeout = env.ParseDurationFromEnv(EnvK8sTLSHandshakeTimeout, 10*time.Second, 0, math.MaxInt32*time.Second)
    52  
    53  	// K8sTCPTimeout defines the TCP timeout to use when performing K8s API requests
    54  	K8sTCPTimeout = env.ParseDurationFromEnv(EnvK8sTCPTimeout, 30*time.Second, 0, math.MaxInt32*time.Second)
    55  
    56  	// K8sTCPKeepAlive defines the interval for sending TCP keep alive to K8s API server
    57  	K8sTCPKeepAlive = env.ParseDurationFromEnv(EnvK8sTCPKeepAlive, 30*time.Second, 0, math.MaxInt32*time.Second)
    58  
    59  	// K8sTCPIdleConnTimeout defines the duration for keeping idle TCP connections to the K8s API server
    60  	K8sTCPIdleConnTimeout = env.ParseDurationFromEnv(EnvK8sTCPIdleConnTimeout, 5*time.Minute, 0, math.MaxInt32*time.Second)
    61  
    62  	// K8sServerSideTimeout defines which server side timeout to send with each API request
    63  	K8sServerSideTimeout = env.ParseDurationFromEnv(EnvK8sTCPTimeout, 0, 0, math.MaxInt32*time.Second)
    64  )