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

Bugfix: kubelet on edge node keeps restarting issue #370

Merged
merged 12 commits into from
Aug 12, 2021
17 changes: 11 additions & 6 deletions pkg/yurtctl/util/edgenode/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,29 +60,34 @@ metadata:
namespace: kube-system
spec:
volumes:
- name: hub-dir
- name: pki
hostPath:
path: /var/lib/yurthub
type: DirectoryOrCreate
path: /etc/kubernetes/pki
type: Directory
Copy link
Member

Choose a reason for hiding this comment

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

/var/lib/yurthub should be kept for yurthub certificates storage. and /etc/kubernetes/pki is not need to added because /etc/kubernetes hostpath has already mounted.

- name: kubernetes
hostPath:
path: /etc/kubernetes
type: Directory
- name: pem-dir
hostPath:
path: /var/lib/kubelet/pki
type: Directory
containers:
- name: yurt-hub
image: __yurthub_image__
imagePullPolicy: IfNotPresent
volumeMounts:
- name: hub-dir
mountPath: /var/lib/yurthub
- name: kubernetes
mountPath: /etc/kubernetes
- name: pki
mountPath: /etc/kubernetes/pki
- name: pem-dir
mountPath: /var/lib/kubelet/pki
command:
- yurthub
- --v=2
- --server-addr=__kubernetes_service_addr__
- --node-name=$(NODE_NAME)
- --join-token=__join_token__
Copy link
Member

Choose a reason for hiding this comment

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

Why delete parameter --join-token which generated when converted by yurtctl.

Copy link
Contributor Author

@Windrow Windrow Jun 28, 2021

Choose a reason for hiding this comment

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

join-token is not specified in openyurt/config/yaml-templateyurthub.yaml, as well. I think it is not a must if we do not use hubself mode.

Precisely to say, this is the trick to make yurthub not use hubself mode but kubelet mode.

I0628 15:53:18.792549       1 cert_mgr.go:372] no join token, so use kubelet config to bootstrap hub

I have to admit, it's a workaround for the issue I encountered, but not a proper cure to the root cause.

Copy link
Member

Choose a reason for hiding this comment

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

@Windrow join-token can be generated by yurtctl, and we suggest that use hubself mode with join-token to generate yurthub client certificate that used to connect kube-apiserver. so we need to keep --join-token parameter for yurthub.

livenessProbe:
httpGet:
host: 127.0.0.1
Expand Down