Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

K8S加固操作调整修改方式,避免多次重启控制面pod #2708

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

denglouping
Copy link
Collaborator

K8S加固操作调整修改方式,避免多次重启控制面pod

@abstractmj abstractmj requested a review from bingoct October 26, 2023 04:26
@@ -42,85 +42,92 @@ if [ -z "${goversion}" ];then
job_fail "get go version failed, configure etcd failed"
fi

mkdir /tmp/backup
cp /etc/kubernetes/manifests/* /tmp/backup
cp /etc/kubernetes/manifests/* ./
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./ 还是用绝对路径吧。 ${ROOT}/ 这种

@@ -42,85 +42,92 @@ if [ -z "${goversion}" ];then
job_fail "get go version failed, configure etcd failed"
fi

mkdir /tmp/backup
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

备份最好加上时间路径。比如 /tmp/backup/k8s-{timestamp}这种

Copy link
Collaborator

@bingoct bingoct Oct 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 151 同样 kubeconfig.conf 和 config.conf 都用绝对路径。备份的文件扔到/tmp/backup/k8s-{timestamp}

line 139, 如果要用 crictl,需要带上runtime-endpoint crictl --runtime-endpoint unix:///run/containerd/containerd.sock ps。 目前crictl 没有去配置。直接运行会抛出错误:

# crictl ps
WARN[0000] runtime connect using default endpoints: [unix:///var/run/dockershim.sock unix:///run/containerd/containerd.sock unix:///run/crio/crio.sock unix:///var/run/cri-dockerd.sock]. As the default settings are now deprecated, you should set the endpoint instead. 
WARN[0000] image connect using default endpoints: [unix:///var/run/dockershim.sock unix:///run/containerd/containerd.sock unix:///run/crio/crio.sock unix:///var/run/cri-dockerd.sock]. As the default settings are now deprecated, you should set the endpoint instead. 
E1026 14:28:59.770572   95905 remote_runtime.go:390] "ListContainers with filter from runtime service failed" err="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial unix /var/run/dockershim.sock: connect: connection refused\"" filter="&ContainerFilter{Id:,State:&ContainerStateValue{State:CONTAINER_RUNNING,},PodSandboxId:,LabelSelector:map[string]string{},}"
FATA[0000] listing containers: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /var/run/dockershim.sock: connect: connection refused" 

1.kube-proxy修改为只在第一台master操作
2.yaml配置文件修改备份与操作的目录
@abstractmj abstractmj merged commit 14ccc68 into TencentBlueKing:master Oct 27, 2023
10 checks passed
wenxinlee2015 added a commit that referenced this pull request Oct 27, 2023
* github-bk-bcs/master:
  K8S加固操作调整修改方式,避免多次重启控制面pod (#2708)
  feat:编辑器输入{激活输入联想 (#2712)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants