-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
protokube - gossip memory leak #13974
Comments
Hi, we are facing the same issue. Is there any update about this? Or if this is known bug which can not be fixed in near future, can you maybe share how to migrate gossip based DNS cluster to route53 DNS cluster. |
This is largely missing documentation right now. But a user shared on slack that switching from gossip to memberlist provides significant benefits: #7436 Unfortunate that this issue got closed without a conclusion, but I think we need to revisit that. |
Regarding migrating from gossip to route53, this is simply not possible since gossip is linked to the immutable cluster name. But try switching to memberlist first. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
Switching to memberlist resolved the issue, after scale up to 300 nodes there weren't any noticable increase in memory, CPU or network bandwidth increase. Thank you @olemarkus for your help |
For anyone else encountering this, we were able to resolve the issue by restarting The daemonset you can use to do that looks something like this: apiVersion: apps/v1
kind: DaemonSet
metadata:
name: restart-protokube
namespace: kube-system
labels:
app: restart-protokube
spec:
selector:
matchLabels:
app: restart-protokube
template:
metadata:
labels:
app: restart-protokube
spec:
containers:
- name: restart-protokube
image: alpine
command:
- nsenter
args:
- '-t'
- '1'
- '-m'
- '-u'
- '-i'
- '-n'
- "systemctl"
- "restart"
- "protokube"
securityContext:
privileged: true
hostNetwork: true
hostPID: true # This allows the pod to interact with the host's PID namespace
hostIPC: true
volumes:
- name: cgroup
hostPath:
path: /sys/fs/cgroup
- name: tmp
emptyDir: {}
- name: run
emptyDir: {}
restartPolicy: Always
tolerations:
- operator: "Exists" Dont forget to delete the daemonset afterwards or else it will keep running and restarting protokube. We also explored ways of switching the GossipSecret and then rotating 2/3 masters, workers, then the last master but it was a longer and more error prone process. The |
Although restarting nodes help to resolve the issue, long term solution for this to not happen again is to upgrade gossip protocol. For us, this issue was always happening at about 200 nodes before we upgraded. In the meantime after upgrading we doubled the number of nodes in cluster and everything is running stable. At the time of writing this, switching to memberlist gossip protocol was best solution, it is worth now exploring if KOPS has alternative solutions. I know they were some work in progress at the time, I think there were some info on KOPS Slack about that few months ago. I suggest checking the link from my last comment to find more info. |
/kind bug
1. What
kops
version are you running? The commandkops version
, will displaythis information.
1.23.2
2. What Kubernetes version are you running?
kubectl version
will print theversion if a cluster is running or provide the Kubernetes version specified as
a
kops
flag.1.23.7
3. What cloud provider are you using?
AWS
4. What commands did you run? What is the simplest way to reproduce this issue?
N/A
5. What happened after the commands executed?
N/A
6. What did you expect to happen?
N/A
7. Please provide your cluster manifest. Execute
kops get --name my.example.com -o yaml
to display your cluster manifest.You may want to remove your cluster name and other sensitive information.
8. Please run the commands with most verbose logging by adding the
-v 10
flag.Paste the logs into this report, or in a gist and provide the gist link here.
9. Anything else do we need to know?
Kubernetes cluster with ~200 nodes, control-plane nodes were 16Gi. Gitlab runners started scaling after which API server started restarting. Increased control-plane node size to 32Gi, but Cluster couldn't pass validation so I couldn't restart them.
I ran
kops rolling-update
for 3 control-plane instance groups with--cloudonly
flagAfter they booted, API server were working fine except for etcd-events, those started working as expected after events ttl expired.
Day after I realized lot of nodes were crashing, in particular the instance groups where nodes are 4Gi, after investigation we realized protokube is using over 3Gi of memory so nodes were running OOM.
Upgrade of KOPS to 1.24 didn't help (I upgraded almost all nodes, while in parallel I were looking for another solution, there was still few nodes left I didn't upgrade)
The issue stopped after I ran daemonset that restarted all
protokube
processes (at all nodes) at the same timeWhile debugging I noticed in journalctl logs of protokube that there were a lot of nodes that didn't exist any more.
The unusual part of logs were:
And after that:
I copied just the part of it, but there were hundred of those at the same time. After removing, same nodes would appear again. That process would go in a loop.
After synchronous restart of all protokube processes, memory usage came back to normal (on most nodes I were looking at, it went from 30% back to 0.3%) and there were no more loops of removing the same nodes.
My guess is that the wrong node list were propagating through gossip protocol
The text was updated successfully, but these errors were encountered: