From bb1687212166d3a887b380e2ca7eb5cf7b4c97aa Mon Sep 17 00:00:00 2001 From: vardhaman22 Date: Thu, 22 Aug 2024 20:20:02 +0530 Subject: [PATCH] added streaming server addr configuration for cri-dockerd --- cluster/plan.go | 15 +++++++++++++-- types/rke_types.go | 4 ++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/cluster/plan.go b/cluster/plan.go index 069d695c0..8ff1d5e12 100644 --- a/cluster/plan.go +++ b/cluster/plan.go @@ -64,8 +64,10 @@ const ( EncryptionProviderConfigArgument = "encryption-provider-config" - KubeletCRIDockerdNameEnv = "RKE_KUBELET_CRIDOCKERD" - KubeletDualStackNameEnv = "RKE_KUBELET_CRIDOCKERD_DUALSTACK" + KubeletCRIDockerdNameEnv = "RKE_KUBELET_CRIDOCKERD" + KubeletDualStackNameEnv = "RKE_KUBELET_CRIDOCKERD_DUALSTACK" + CRIDockerdStreamServerAddressEnv = "CRIDOCKERD_STREAM_SERVER_ADDRESS" + CRIDockerdStreamServerPortEnv = "CRIDOCKERD_STREAM_SERVER_PORT" ) var ( @@ -623,6 +625,15 @@ func (c *Cluster) BuildKubeletProcess(host *hosts.Host, serviceOptions v3.Kubern Env = append(Env, // Enable running cri-dockerd fmt.Sprintf("%s=%s", KubeletCRIDockerdNameEnv, "true")) + + if c.CRIDockerdStreamServerAddress != "" { + Env = append(Env, fmt.Sprintf("%s=%s", CRIDockerdStreamServerAddressEnv, c.CRIDockerdStreamServerAddress)) + } + + if c.CRIDockerdStreamServerPort != "" { + Env = append(Env, fmt.Sprintf("%s=%s", CRIDockerdStreamServerPortEnv, c.CRIDockerdStreamServerPort)) + } + if c.multipleCIDRsConfigured() { Env = append(Env, // Enable cri-dockerd flag for dual-stack diff --git a/types/rke_types.go b/types/rke_types.go index fe734bf65..77d0730a2 100644 --- a/types/rke_types.go +++ b/types/rke_types.go @@ -66,6 +66,10 @@ type RancherKubernetesEngineConfig struct { DNS *DNSConfig `yaml:"dns" json:"dns,omitempty"` // Upgrade Strategy for the cluster UpgradeStrategy *NodeUpgradeStrategy `yaml:"upgrade_strategy,omitempty" json:"upgradeStrategy,omitempty"` + // Stream Server Address for cri-dockerd + CRIDockerdStreamServerAddress string `yaml:"cri_dockerd_stream_server_address" json:"criDockerdStreamServerAddress,omitempty"` + // Stream Server Port for cri-dockerd + CRIDockerdStreamServerPort string `yaml:"cri_dockerd_stream_server_port" json:"criDockerdStreamServerPort,omitempty"` } func (r *RancherKubernetesEngineConfig) ObjClusterName() string {