aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2019-01-05 16:58:27 +0000
committerGravatar GitHub <noreply@github.com> 2019-01-05 16:58:27 +0000
commit652b9a69d852ca22565676b99be16bd93359d145 (patch)
tree0e5f4ea44dd2f11e6f8832d0aeb922195419f6c4
parent35b74eb197f839fea8e2a842b764e775c64b04f8 (diff)
downloadcoredns-652b9a69d852ca22565676b99be16bd93359d145.tar.gz
coredns-652b9a69d852ca22565676b99be16bd93359d145.tar.zst
coredns-652b9a69d852ca22565676b99be16bd93359d145.zip
plugin/kubernetes: add memory usage guidelines (#2424)
Add words in object.go on the memory use and put some future ideas in there to use even less (if we have to at some point). Signed-off-by: Miek Gieben <miek@miek.nl>
-rw-r--r--plugin/kubernetes/object/object.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/plugin/kubernetes/object/object.go b/plugin/kubernetes/object/object.go
index fb944b7ad..7a6ffac12 100644
--- a/plugin/kubernetes/object/object.go
+++ b/plugin/kubernetes/object/object.go
@@ -1,3 +1,18 @@
+// Package object holds functions that convert the objects from the k8s API in
+// to a more memory efficient structures.
+//
+// Adding new fields to any of the structures defined in pod.go, endpoint.go
+// and service.go should not be done lightly as this increases the memory use
+// and will leads to OOMs in the k8s scale test.
+//
+// We can do some optimizations here as well. We store IP addresses as strings,
+// this might be moved to uint32 (for v4) for instance, but then we need to
+// convert those again.
+//
+// Also the msg.Service use in this plugin may be deprecated at some point, as
+// we don't use most of those features anyway and would free us from the *etcd*
+// dependency, where msg.Service is defined. And should save some mem/cpu as we
+// convert to and from msg.Services.
package object
import (