11 Star 1 Fork 10

src-openEuler/eggo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0015-delete-apiserver-kubelet-https-flag-and-add-lb-bind-.patch 4.21 KB
一键复制 编辑 原始数据 按行查看 历史
zhangxiaoyu 提交于 2022-09-19 20:03 . fix makefile build error
From 83a2ad6a3b68180d0c926280500dd20ee715f26e Mon Sep 17 00:00:00 2001
From: zhangxiaoyu <zhangxiaoyu58@huawei.com>
Date: Wed, 15 Dec 2021 10:32:29 +0800
Subject: [PATCH 15/17] delete apiserver kubelet-https flag, and add lb bind
port in firewall
Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
---
cmd/configs.go | 13 +++++++++++--
.../binary/commontools/systemdservices.go | 1 -
pkg/utils/template/template_test.go | 2 --
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/cmd/configs.go b/cmd/configs.go
index beefd9d..326e889 100644
--- a/cmd/configs.go
+++ b/cmd/configs.go
@@ -300,7 +300,7 @@ func fillPackageConfig(ccfg *api.ClusterConfig, icfg *InstallConfig) {
}
}
-func fillOpenPort(ccfg *api.ClusterConfig, openports map[string][]*OpenPorts, dnsType string) {
+func fillOpenPort(ccfg *api.ClusterConfig, openports map[string][]*OpenPorts, dnsType string, lb LoadBalance) {
// key: master, worker, etcd, loadbalance
for t, p := range openports {
role, ok := toTypeInt[t]
@@ -316,6 +316,15 @@ func fillOpenPort(ccfg *api.ClusterConfig, openports map[string][]*OpenPorts, dn
ccfg.RoleInfra[api.Master].OpenPorts =
append(ccfg.RoleInfra[api.Master].OpenPorts, infra.CorednsPorts...)
}
+
+ if lb.Ip != "" && lb.BindPort > 0 {
+ ccfg.RoleInfra[api.LoadBalance].OpenPorts =
+ append(ccfg.RoleInfra[api.LoadBalance].OpenPorts, &api.OpenPorts{
+ Port: lb.BindPort,
+ Protocol: "tcp",
+ })
+ return
+ }
}
func defaultHostName(clusterID string, nodeType string, i int) string {
@@ -588,7 +597,7 @@ func toClusterdeploymentConfig(conf *DeployConfig) *api.ClusterConfig {
fillLoadBalance(&ccfg.LoadBalancer, conf.LoadBalance)
fillAPIEndPoint(&ccfg.APIEndpoint, conf)
fillPackageConfig(ccfg, &conf.InstallConfig)
- fillOpenPort(ccfg, conf.OpenPorts, conf.Service.DNS.CorednsType)
+ fillOpenPort(ccfg, conf.OpenPorts, conf.Service.DNS.CorednsType, conf.LoadBalance)
ccfg.WorkerConfig.KubeletConf.EnableServer = conf.EnableKubeletServing
fillExtrArgs(ccfg, conf.ConfigExtraArgs)
diff --git a/pkg/clusterdeployment/binary/commontools/systemdservices.go b/pkg/clusterdeployment/binary/commontools/systemdservices.go
index 0a17ee2..3b32e22 100644
--- a/pkg/clusterdeployment/binary/commontools/systemdservices.go
+++ b/pkg/clusterdeployment/binary/commontools/systemdservices.go
@@ -44,7 +44,6 @@ func SetupAPIServerService(r runner.Runner, ccfg *api.ClusterConfig, hcf *api.Ho
"--client-ca-file": "/etc/kubernetes/pki/ca.crt",
"--kubelet-client-certificate": "/etc/kubernetes/pki/apiserver-kubelet-client.crt",
"--kubelet-client-key": "/etc/kubernetes/pki/apiserver-kubelet-client.key",
- "--kubelet-https": "true",
"--proxy-client-cert-file": "/etc/kubernetes/pki/front-proxy-client.crt",
"--proxy-client-key-file": "/etc/kubernetes/pki/front-proxy-client.key",
"--tls-cert-file": "/etc/kubernetes/pki/apiserver.crt",
diff --git a/pkg/utils/template/template_test.go b/pkg/utils/template/template_test.go
index 2d13329..ae46d48 100644
--- a/pkg/utils/template/template_test.go
+++ b/pkg/utils/template/template_test.go
@@ -156,7 +156,6 @@ func TestCreateSystemdServiceTemplate(t *testing.T) {
"--client-ca-file=/etc/kubernetes/pki/ca.crt",
"--kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt",
"--kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key",
- "--kubelet-https=true",
"--proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt",
"--proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key",
"--tls-cert-file=/etc/kubernetes/pki/apiserver.crt",
@@ -195,7 +194,6 @@ ExecStart=/usr/bin/kube-apiserver \
--client-ca-file=/etc/kubernetes/pki/ca.crt \
--kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt \
--kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key \
- --kubelet-https=true \
--proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt \
--proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key \
--tls-cert-file=/etc/kubernetes/pki/apiserver.crt \
--
2.25.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/eggo.git
git@gitee.com:src-openeuler/eggo.git
src-openeuler
eggo
eggo
master

搜索帮助