mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Add etcd ports constant
This commit is contained in:
parent
8012b9583e
commit
66e846fa26
@ -112,7 +112,7 @@ func RunPlan(flags *planFlags) error {
|
|||||||
etcdClient = client
|
etcdClient = client
|
||||||
} else {
|
} else {
|
||||||
client, err := etcdutil.NewFromStaticPod(
|
client, err := etcdutil.NewFromStaticPod(
|
||||||
[]string{"localhost:2379"},
|
[]string{fmt.Sprintf("localhost:%d", constants.EtcdListenClientPort)},
|
||||||
constants.GetStaticPodDirectory(),
|
constants.GetStaticPodDirectory(),
|
||||||
upgradeVars.cfg.CertificatesDir,
|
upgradeVars.cfg.CertificatesDir,
|
||||||
)
|
)
|
||||||
|
@ -81,6 +81,9 @@ const (
|
|||||||
// EtcdServerKeyName defines etcd's server key name
|
// EtcdServerKeyName defines etcd's server key name
|
||||||
EtcdServerKeyName = "etcd/server.key"
|
EtcdServerKeyName = "etcd/server.key"
|
||||||
|
|
||||||
|
// EtcdListenClientPort defines the port etcd listen on for client traffic
|
||||||
|
EtcdListenClientPort = 2379
|
||||||
|
|
||||||
// EtcdPeerCertAndKeyBaseName defines etcd's peer certificate and key base name
|
// EtcdPeerCertAndKeyBaseName defines etcd's peer certificate and key base name
|
||||||
EtcdPeerCertAndKeyBaseName = "etcd/peer"
|
EtcdPeerCertAndKeyBaseName = "etcd/peer"
|
||||||
// EtcdPeerCertName defines etcd's peer certificate name
|
// EtcdPeerCertName defines etcd's peer certificate name
|
||||||
@ -88,6 +91,9 @@ const (
|
|||||||
// EtcdPeerKeyName defines etcd's peer key name
|
// EtcdPeerKeyName defines etcd's peer key name
|
||||||
EtcdPeerKeyName = "etcd/peer.key"
|
EtcdPeerKeyName = "etcd/peer.key"
|
||||||
|
|
||||||
|
// EtcdListenPeerPort defines the port etcd listen on for peer traffic
|
||||||
|
EtcdListenPeerPort = 2380
|
||||||
|
|
||||||
// EtcdHealthcheckClientCertAndKeyBaseName defines etcd's healthcheck client certificate and key base name
|
// EtcdHealthcheckClientCertAndKeyBaseName defines etcd's healthcheck client certificate and key base name
|
||||||
EtcdHealthcheckClientCertAndKeyBaseName = "etcd/healthcheck-client"
|
EtcdHealthcheckClientCertAndKeyBaseName = "etcd/healthcheck-client"
|
||||||
// EtcdHealthcheckClientCertName defines etcd's healthcheck client certificate name
|
// EtcdHealthcheckClientCertName defines etcd's healthcheck client certificate name
|
||||||
|
@ -180,7 +180,7 @@ func getAPIServerCommand(cfg *kubeadmapi.InitConfiguration) []string {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Default to etcd static pod on localhost
|
// Default to etcd static pod on localhost
|
||||||
defaultArguments["etcd-servers"] = "https://127.0.0.1:2379"
|
defaultArguments["etcd-servers"] = fmt.Sprintf("https://127.0.0.1:%d", kubeadmconstants.EtcdListenClientPort)
|
||||||
defaultArguments["etcd-cafile"] = filepath.Join(cfg.CertificatesDir, kubeadmconstants.EtcdCACertName)
|
defaultArguments["etcd-cafile"] = filepath.Join(cfg.CertificatesDir, kubeadmconstants.EtcdCACertName)
|
||||||
defaultArguments["etcd-certfile"] = filepath.Join(cfg.CertificatesDir, kubeadmconstants.APIServerEtcdClientCertName)
|
defaultArguments["etcd-certfile"] = filepath.Join(cfg.CertificatesDir, kubeadmconstants.APIServerEtcdClientCertName)
|
||||||
defaultArguments["etcd-keyfile"] = filepath.Join(cfg.CertificatesDir, kubeadmconstants.APIServerEtcdClientKeyName)
|
defaultArguments["etcd-keyfile"] = filepath.Join(cfg.CertificatesDir, kubeadmconstants.APIServerEtcdClientKeyName)
|
||||||
|
@ -181,7 +181,7 @@ func TestGetAPIServerCommand(t *testing.T) {
|
|||||||
"--requestheader-allowed-names=front-proxy-client",
|
"--requestheader-allowed-names=front-proxy-client",
|
||||||
"--authorization-mode=Node,RBAC",
|
"--authorization-mode=Node,RBAC",
|
||||||
"--advertise-address=1.2.3.4",
|
"--advertise-address=1.2.3.4",
|
||||||
"--etcd-servers=https://127.0.0.1:2379",
|
fmt.Sprintf("--etcd-servers=https://127.0.0.1:%d", kubeadmconstants.EtcdListenClientPort),
|
||||||
"--etcd-cafile=" + testCertsDir + "/etcd/ca.crt",
|
"--etcd-cafile=" + testCertsDir + "/etcd/ca.crt",
|
||||||
"--etcd-certfile=" + testCertsDir + "/apiserver-etcd-client.crt",
|
"--etcd-certfile=" + testCertsDir + "/apiserver-etcd-client.crt",
|
||||||
"--etcd-keyfile=" + testCertsDir + "/apiserver-etcd-client.key",
|
"--etcd-keyfile=" + testCertsDir + "/apiserver-etcd-client.key",
|
||||||
@ -225,7 +225,7 @@ func TestGetAPIServerCommand(t *testing.T) {
|
|||||||
"--requestheader-allowed-names=front-proxy-client",
|
"--requestheader-allowed-names=front-proxy-client",
|
||||||
"--authorization-mode=Node,RBAC",
|
"--authorization-mode=Node,RBAC",
|
||||||
"--advertise-address=4.3.2.1",
|
"--advertise-address=4.3.2.1",
|
||||||
"--etcd-servers=https://127.0.0.1:2379",
|
fmt.Sprintf("--etcd-servers=https://127.0.0.1:%d", kubeadmconstants.EtcdListenClientPort),
|
||||||
"--etcd-cafile=" + testCertsDir + "/etcd/ca.crt",
|
"--etcd-cafile=" + testCertsDir + "/etcd/ca.crt",
|
||||||
"--etcd-certfile=" + testCertsDir + "/apiserver-etcd-client.crt",
|
"--etcd-certfile=" + testCertsDir + "/apiserver-etcd-client.crt",
|
||||||
"--etcd-keyfile=" + testCertsDir + "/apiserver-etcd-client.key",
|
"--etcd-keyfile=" + testCertsDir + "/apiserver-etcd-client.key",
|
||||||
@ -264,7 +264,7 @@ func TestGetAPIServerCommand(t *testing.T) {
|
|||||||
"--requestheader-allowed-names=front-proxy-client",
|
"--requestheader-allowed-names=front-proxy-client",
|
||||||
"--authorization-mode=Node,RBAC",
|
"--authorization-mode=Node,RBAC",
|
||||||
"--advertise-address=2001:db8::1",
|
"--advertise-address=2001:db8::1",
|
||||||
"--etcd-servers=https://127.0.0.1:2379",
|
fmt.Sprintf("--etcd-servers=https://127.0.0.1:%d", kubeadmconstants.EtcdListenClientPort),
|
||||||
"--etcd-cafile=" + testCertsDir + "/etcd/ca.crt",
|
"--etcd-cafile=" + testCertsDir + "/etcd/ca.crt",
|
||||||
"--etcd-certfile=" + testCertsDir + "/apiserver-etcd-client.crt",
|
"--etcd-certfile=" + testCertsDir + "/apiserver-etcd-client.crt",
|
||||||
"--etcd-keyfile=" + testCertsDir + "/apiserver-etcd-client.key",
|
"--etcd-keyfile=" + testCertsDir + "/apiserver-etcd-client.key",
|
||||||
@ -397,7 +397,7 @@ func TestGetAPIServerCommand(t *testing.T) {
|
|||||||
"--requestheader-allowed-names=front-proxy-client",
|
"--requestheader-allowed-names=front-proxy-client",
|
||||||
"--authorization-mode=Node,RBAC",
|
"--authorization-mode=Node,RBAC",
|
||||||
"--advertise-address=2001:db8::1",
|
"--advertise-address=2001:db8::1",
|
||||||
"--etcd-servers=https://127.0.0.1:2379",
|
fmt.Sprintf("--etcd-servers=https://127.0.0.1:%d", kubeadmconstants.EtcdListenClientPort),
|
||||||
"--etcd-cafile=" + testCertsDir + "/etcd/ca.crt",
|
"--etcd-cafile=" + testCertsDir + "/etcd/ca.crt",
|
||||||
"--etcd-certfile=" + testCertsDir + "/apiserver-etcd-client.crt",
|
"--etcd-certfile=" + testCertsDir + "/apiserver-etcd-client.crt",
|
||||||
"--etcd-keyfile=" + testCertsDir + "/apiserver-etcd-client.key",
|
"--etcd-keyfile=" + testCertsDir + "/apiserver-etcd-client.key",
|
||||||
@ -441,7 +441,7 @@ func TestGetAPIServerCommand(t *testing.T) {
|
|||||||
"--requestheader-allowed-names=front-proxy-client",
|
"--requestheader-allowed-names=front-proxy-client",
|
||||||
"--authorization-mode=Node,RBAC",
|
"--authorization-mode=Node,RBAC",
|
||||||
"--advertise-address=1.2.3.4",
|
"--advertise-address=1.2.3.4",
|
||||||
"--etcd-servers=https://127.0.0.1:2379",
|
fmt.Sprintf("--etcd-servers=https://127.0.0.1:%d", kubeadmconstants.EtcdListenClientPort),
|
||||||
"--etcd-cafile=" + testCertsDir + "/etcd/ca.crt",
|
"--etcd-cafile=" + testCertsDir + "/etcd/ca.crt",
|
||||||
"--etcd-certfile=" + testCertsDir + "/apiserver-etcd-client.crt",
|
"--etcd-certfile=" + testCertsDir + "/apiserver-etcd-client.crt",
|
||||||
"--etcd-keyfile=" + testCertsDir + "/apiserver-etcd-client.key",
|
"--etcd-keyfile=" + testCertsDir + "/apiserver-etcd-client.key",
|
||||||
@ -488,7 +488,7 @@ func TestGetAPIServerCommand(t *testing.T) {
|
|||||||
"--requestheader-allowed-names=front-proxy-client",
|
"--requestheader-allowed-names=front-proxy-client",
|
||||||
"--authorization-mode=Node,RBAC",
|
"--authorization-mode=Node,RBAC",
|
||||||
"--advertise-address=9.9.9.9",
|
"--advertise-address=9.9.9.9",
|
||||||
"--etcd-servers=https://127.0.0.1:2379",
|
fmt.Sprintf("--etcd-servers=https://127.0.0.1:%d", kubeadmconstants.EtcdListenClientPort),
|
||||||
"--etcd-cafile=" + testCertsDir + "/etcd/ca.crt",
|
"--etcd-cafile=" + testCertsDir + "/etcd/ca.crt",
|
||||||
"--etcd-certfile=" + testCertsDir + "/apiserver-etcd-client.crt",
|
"--etcd-certfile=" + testCertsDir + "/apiserver-etcd-client.crt",
|
||||||
"--etcd-keyfile=" + testCertsDir + "/apiserver-etcd-client.key",
|
"--etcd-keyfile=" + testCertsDir + "/apiserver-etcd-client.key",
|
||||||
@ -534,7 +534,7 @@ func TestGetAPIServerCommand(t *testing.T) {
|
|||||||
"--requestheader-allowed-names=front-proxy-client",
|
"--requestheader-allowed-names=front-proxy-client",
|
||||||
"--authorization-mode=Node,RBAC,ABAC",
|
"--authorization-mode=Node,RBAC,ABAC",
|
||||||
"--advertise-address=1.2.3.4",
|
"--advertise-address=1.2.3.4",
|
||||||
"--etcd-servers=https://127.0.0.1:2379",
|
fmt.Sprintf("--etcd-servers=https://127.0.0.1:%d", kubeadmconstants.EtcdListenClientPort),
|
||||||
"--etcd-cafile=" + testCertsDir + "/etcd/ca.crt",
|
"--etcd-cafile=" + testCertsDir + "/etcd/ca.crt",
|
||||||
"--etcd-certfile=" + testCertsDir + "/apiserver-etcd-client.crt",
|
"--etcd-certfile=" + testCertsDir + "/apiserver-etcd-client.crt",
|
||||||
"--etcd-keyfile=" + testCertsDir + "/apiserver-etcd-client.key",
|
"--etcd-keyfile=" + testCertsDir + "/apiserver-etcd-client.key",
|
||||||
@ -576,7 +576,7 @@ func TestGetAPIServerCommand(t *testing.T) {
|
|||||||
"--requestheader-allowed-names=front-proxy-client",
|
"--requestheader-allowed-names=front-proxy-client",
|
||||||
"--authorization-mode=Node,RBAC",
|
"--authorization-mode=Node,RBAC",
|
||||||
"--advertise-address=1.2.3.4",
|
"--advertise-address=1.2.3.4",
|
||||||
"--etcd-servers=https://127.0.0.1:2379",
|
fmt.Sprintf("--etcd-servers=https://127.0.0.1:%d", kubeadmconstants.EtcdListenClientPort),
|
||||||
"--etcd-cafile=" + testCertsDir + "/etcd/ca.crt",
|
"--etcd-cafile=" + testCertsDir + "/etcd/ca.crt",
|
||||||
"--etcd-certfile=" + testCertsDir + "/apiserver-etcd-client.crt",
|
"--etcd-certfile=" + testCertsDir + "/apiserver-etcd-client.crt",
|
||||||
"--etcd-keyfile=" + testCertsDir + "/apiserver-etcd-client.key",
|
"--etcd-keyfile=" + testCertsDir + "/apiserver-etcd-client.key",
|
||||||
@ -618,7 +618,7 @@ func TestGetAPIServerCommand(t *testing.T) {
|
|||||||
"--requestheader-allowed-names=front-proxy-client",
|
"--requestheader-allowed-names=front-proxy-client",
|
||||||
"--authorization-mode=Node,RBAC,Webhook",
|
"--authorization-mode=Node,RBAC,Webhook",
|
||||||
"--advertise-address=1.2.3.4",
|
"--advertise-address=1.2.3.4",
|
||||||
"--etcd-servers=https://127.0.0.1:2379",
|
fmt.Sprintf("--etcd-servers=https://127.0.0.1:%d", kubeadmconstants.EtcdListenClientPort),
|
||||||
"--etcd-cafile=" + testCertsDir + "/etcd/ca.crt",
|
"--etcd-cafile=" + testCertsDir + "/etcd/ca.crt",
|
||||||
"--etcd-certfile=" + testCertsDir + "/apiserver-etcd-client.crt",
|
"--etcd-certfile=" + testCertsDir + "/apiserver-etcd-client.crt",
|
||||||
"--etcd-keyfile=" + testCertsDir + "/apiserver-etcd-client.key",
|
"--etcd-keyfile=" + testCertsDir + "/apiserver-etcd-client.key",
|
||||||
|
@ -71,7 +71,7 @@ func GetEtcdPodSpec(cfg *kubeadmapi.InitConfiguration) v1.Pod {
|
|||||||
staticpodutil.NewVolumeMount(certsVolumeName, cfg.CertificatesDir+"/etcd", false),
|
staticpodutil.NewVolumeMount(certsVolumeName, cfg.CertificatesDir+"/etcd", false),
|
||||||
},
|
},
|
||||||
LivenessProbe: staticpodutil.EtcdProbe(
|
LivenessProbe: staticpodutil.EtcdProbe(
|
||||||
cfg, kubeadmconstants.Etcd, 2379, cfg.CertificatesDir,
|
cfg, kubeadmconstants.Etcd, kubeadmconstants.EtcdListenClientPort, cfg.CertificatesDir,
|
||||||
kubeadmconstants.EtcdCACertName, kubeadmconstants.EtcdHealthcheckClientCertName, kubeadmconstants.EtcdHealthcheckClientKeyName,
|
kubeadmconstants.EtcdCACertName, kubeadmconstants.EtcdHealthcheckClientCertName, kubeadmconstants.EtcdHealthcheckClientKeyName,
|
||||||
),
|
),
|
||||||
}, etcdMounts)
|
}, etcdMounts)
|
||||||
@ -81,10 +81,10 @@ func GetEtcdPodSpec(cfg *kubeadmapi.InitConfiguration) v1.Pod {
|
|||||||
func getEtcdCommand(cfg *kubeadmapi.InitConfiguration) []string {
|
func getEtcdCommand(cfg *kubeadmapi.InitConfiguration) []string {
|
||||||
defaultArguments := map[string]string{
|
defaultArguments := map[string]string{
|
||||||
"name": cfg.GetNodeName(),
|
"name": cfg.GetNodeName(),
|
||||||
"listen-client-urls": "https://127.0.0.1:2379",
|
"listen-client-urls": fmt.Sprintf("https://127.0.0.1:%d", kubeadmconstants.EtcdListenClientPort),
|
||||||
"advertise-client-urls": "https://127.0.0.1:2379",
|
"advertise-client-urls": fmt.Sprintf("https://127.0.0.1:%d", kubeadmconstants.EtcdListenClientPort),
|
||||||
"listen-peer-urls": "https://127.0.0.1:2380",
|
"listen-peer-urls": fmt.Sprintf("https://127.0.0.1:%d", kubeadmconstants.EtcdListenPeerPort),
|
||||||
"initial-advertise-peer-urls": "https://127.0.0.1:2380",
|
"initial-advertise-peer-urls": fmt.Sprintf("https://127.0.0.1:%d", kubeadmconstants.EtcdListenPeerPort),
|
||||||
"data-dir": cfg.Etcd.Local.DataDir,
|
"data-dir": cfg.Etcd.Local.DataDir,
|
||||||
"cert-file": filepath.Join(cfg.CertificatesDir, kubeadmconstants.EtcdServerCertName),
|
"cert-file": filepath.Join(cfg.CertificatesDir, kubeadmconstants.EtcdServerCertName),
|
||||||
"key-file": filepath.Join(cfg.CertificatesDir, kubeadmconstants.EtcdServerKeyName),
|
"key-file": filepath.Join(cfg.CertificatesDir, kubeadmconstants.EtcdServerKeyName),
|
||||||
@ -95,7 +95,7 @@ func getEtcdCommand(cfg *kubeadmapi.InitConfiguration) []string {
|
|||||||
"peer-trusted-ca-file": filepath.Join(cfg.CertificatesDir, kubeadmconstants.EtcdCACertName),
|
"peer-trusted-ca-file": filepath.Join(cfg.CertificatesDir, kubeadmconstants.EtcdCACertName),
|
||||||
"peer-client-cert-auth": "true",
|
"peer-client-cert-auth": "true",
|
||||||
"snapshot-count": "10000",
|
"snapshot-count": "10000",
|
||||||
"initial-cluster": fmt.Sprintf("%s=https://127.0.0.1:2380", cfg.GetNodeName()),
|
"initial-cluster": fmt.Sprintf("%s=https://127.0.0.1:%d", cfg.GetNodeName(), kubeadmconstants.EtcdListenPeerPort),
|
||||||
}
|
}
|
||||||
|
|
||||||
command := []string{"etcd"}
|
command := []string{"etcd"}
|
||||||
|
@ -17,6 +17,7 @@ limitations under the License.
|
|||||||
package etcd
|
package etcd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"reflect"
|
"reflect"
|
||||||
@ -135,10 +136,10 @@ func TestGetEtcdCommand(t *testing.T) {
|
|||||||
expected: []string{
|
expected: []string{
|
||||||
"etcd",
|
"etcd",
|
||||||
"--name=foo",
|
"--name=foo",
|
||||||
"--listen-client-urls=https://127.0.0.1:2379",
|
fmt.Sprintf("--listen-client-urls=https://127.0.0.1:%d", kubeadmconstants.EtcdListenClientPort),
|
||||||
"--advertise-client-urls=https://127.0.0.1:2379",
|
fmt.Sprintf("--advertise-client-urls=https://127.0.0.1:%d", kubeadmconstants.EtcdListenClientPort),
|
||||||
"--listen-peer-urls=https://127.0.0.1:2380",
|
fmt.Sprintf("--listen-peer-urls=https://127.0.0.1:%d", kubeadmconstants.EtcdListenPeerPort),
|
||||||
"--initial-advertise-peer-urls=https://127.0.0.1:2380",
|
fmt.Sprintf("--initial-advertise-peer-urls=https://127.0.0.1:%d", kubeadmconstants.EtcdListenPeerPort),
|
||||||
"--data-dir=/var/lib/etcd",
|
"--data-dir=/var/lib/etcd",
|
||||||
"--cert-file=" + kubeadmconstants.EtcdServerCertName,
|
"--cert-file=" + kubeadmconstants.EtcdServerCertName,
|
||||||
"--key-file=" + kubeadmconstants.EtcdServerKeyName,
|
"--key-file=" + kubeadmconstants.EtcdServerKeyName,
|
||||||
@ -149,7 +150,7 @@ func TestGetEtcdCommand(t *testing.T) {
|
|||||||
"--peer-trusted-ca-file=" + kubeadmconstants.EtcdCACertName,
|
"--peer-trusted-ca-file=" + kubeadmconstants.EtcdCACertName,
|
||||||
"--snapshot-count=10000",
|
"--snapshot-count=10000",
|
||||||
"--peer-client-cert-auth=true",
|
"--peer-client-cert-auth=true",
|
||||||
"--initial-cluster=foo=https://127.0.0.1:2380",
|
fmt.Sprintf("--initial-cluster=foo=https://127.0.0.1:%d", kubeadmconstants.EtcdListenPeerPort),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -174,8 +175,8 @@ func TestGetEtcdCommand(t *testing.T) {
|
|||||||
"--name=bar",
|
"--name=bar",
|
||||||
"--listen-client-urls=https://10.0.1.10:2379",
|
"--listen-client-urls=https://10.0.1.10:2379",
|
||||||
"--advertise-client-urls=https://10.0.1.10:2379",
|
"--advertise-client-urls=https://10.0.1.10:2379",
|
||||||
"--listen-peer-urls=https://127.0.0.1:2380",
|
fmt.Sprintf("--listen-peer-urls=https://127.0.0.1:%d", kubeadmconstants.EtcdListenPeerPort),
|
||||||
"--initial-advertise-peer-urls=https://127.0.0.1:2380",
|
fmt.Sprintf("--initial-advertise-peer-urls=https://127.0.0.1:%d", kubeadmconstants.EtcdListenPeerPort),
|
||||||
"--data-dir=/var/lib/etcd",
|
"--data-dir=/var/lib/etcd",
|
||||||
"--cert-file=" + kubeadmconstants.EtcdServerCertName,
|
"--cert-file=" + kubeadmconstants.EtcdServerCertName,
|
||||||
"--key-file=" + kubeadmconstants.EtcdServerKeyName,
|
"--key-file=" + kubeadmconstants.EtcdServerKeyName,
|
||||||
@ -186,7 +187,7 @@ func TestGetEtcdCommand(t *testing.T) {
|
|||||||
"--peer-trusted-ca-file=" + kubeadmconstants.EtcdCACertName,
|
"--peer-trusted-ca-file=" + kubeadmconstants.EtcdCACertName,
|
||||||
"--snapshot-count=10000",
|
"--snapshot-count=10000",
|
||||||
"--peer-client-cert-auth=true",
|
"--peer-client-cert-auth=true",
|
||||||
"--initial-cluster=bar=https://127.0.0.1:2380",
|
fmt.Sprintf("--initial-cluster=bar=https://127.0.0.1:%d", kubeadmconstants.EtcdListenPeerPort),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -205,10 +206,10 @@ func TestGetEtcdCommand(t *testing.T) {
|
|||||||
expected: []string{
|
expected: []string{
|
||||||
"etcd",
|
"etcd",
|
||||||
"--name=wombat",
|
"--name=wombat",
|
||||||
"--listen-client-urls=https://127.0.0.1:2379",
|
fmt.Sprintf("--listen-client-urls=https://127.0.0.1:%d", kubeadmconstants.EtcdListenClientPort),
|
||||||
"--advertise-client-urls=https://127.0.0.1:2379",
|
fmt.Sprintf("--advertise-client-urls=https://127.0.0.1:%d", kubeadmconstants.EtcdListenClientPort),
|
||||||
"--listen-peer-urls=https://127.0.0.1:2380",
|
fmt.Sprintf("--listen-peer-urls=https://127.0.0.1:%d", kubeadmconstants.EtcdListenPeerPort),
|
||||||
"--initial-advertise-peer-urls=https://127.0.0.1:2380",
|
fmt.Sprintf("--initial-advertise-peer-urls=https://127.0.0.1:%d", kubeadmconstants.EtcdListenPeerPort),
|
||||||
"--data-dir=/etc/foo",
|
"--data-dir=/etc/foo",
|
||||||
"--cert-file=" + kubeadmconstants.EtcdServerCertName,
|
"--cert-file=" + kubeadmconstants.EtcdServerCertName,
|
||||||
"--key-file=" + kubeadmconstants.EtcdServerKeyName,
|
"--key-file=" + kubeadmconstants.EtcdServerKeyName,
|
||||||
@ -219,7 +220,7 @@ func TestGetEtcdCommand(t *testing.T) {
|
|||||||
"--peer-trusted-ca-file=" + kubeadmconstants.EtcdCACertName,
|
"--peer-trusted-ca-file=" + kubeadmconstants.EtcdCACertName,
|
||||||
"--snapshot-count=10000",
|
"--snapshot-count=10000",
|
||||||
"--peer-client-cert-auth=true",
|
"--peer-client-cert-auth=true",
|
||||||
"--initial-cluster=wombat=https://127.0.0.1:2380",
|
fmt.Sprintf("--initial-cluster=wombat=https://127.0.0.1:%d", kubeadmconstants.EtcdListenPeerPort),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -341,7 +341,7 @@ func performEtcdStaticPodUpgrade(waiter apiclient.Waiter, pathMgr StaticPodPathM
|
|||||||
// Initialize the new etcd client if it wasn't pre-initialized
|
// Initialize the new etcd client if it wasn't pre-initialized
|
||||||
if newEtcdClient == nil {
|
if newEtcdClient == nil {
|
||||||
client, err := etcdutil.NewFromStaticPod(
|
client, err := etcdutil.NewFromStaticPod(
|
||||||
[]string{"localhost:2379"},
|
[]string{fmt.Sprintf("localhost:%d", constants.EtcdListenClientPort)},
|
||||||
constants.GetStaticPodDirectory(),
|
constants.GetStaticPodDirectory(),
|
||||||
cfg.CertificatesDir,
|
cfg.CertificatesDir,
|
||||||
)
|
)
|
||||||
@ -417,7 +417,7 @@ func StaticPodControlPlane(waiter apiclient.Waiter, pathMgr StaticPodPathManager
|
|||||||
} else {
|
} else {
|
||||||
// etcd Static Pod
|
// etcd Static Pod
|
||||||
client, err := etcdutil.NewFromStaticPod(
|
client, err := etcdutil.NewFromStaticPod(
|
||||||
[]string{"localhost:2379"},
|
[]string{fmt.Sprintf("localhost:%d", constants.EtcdListenClientPort)},
|
||||||
constants.GetStaticPodDirectory(),
|
constants.GetStaticPodDirectory(),
|
||||||
cfg.CertificatesDir,
|
cfg.CertificatesDir,
|
||||||
)
|
)
|
||||||
|
@ -879,7 +879,7 @@ func RunInitMasterChecks(execer utilsexec.Interface, cfg *kubeadmapi.InitConfigu
|
|||||||
if cfg.Etcd.Local != nil {
|
if cfg.Etcd.Local != nil {
|
||||||
// Only do etcd related checks when no external endpoints were specified
|
// Only do etcd related checks when no external endpoints were specified
|
||||||
checks = append(checks,
|
checks = append(checks,
|
||||||
PortOpenCheck{port: 2379},
|
PortOpenCheck{port: kubeadmconstants.EtcdListenClientPort},
|
||||||
DirAvailableCheck{Path: cfg.Etcd.Local.DataDir},
|
DirAvailableCheck{Path: cfg.Etcd.Local.DataDir},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user