Repository navigation
pkg/controller: add possibility of user defined rule files - #2
Conversation
| }, | ||
| }, | ||
| }, { | ||
| Name: "rules-reloader", |
There was a problem hiding this comment.
So just having a single reloader does not work?
Does it generally not work recursively on a directory or is this just per-volume-mount?
For example, if we build a single rule ConfigMap in the controller from several ones, we'd always have nested directories as we'd store the individual files in <rule-ConfigMap-name>/<origPath> depending on their source ConfigMap.
There was a problem hiding this comment.
At least with the current implementation of the configmap reloader (fsnotify is not recursive) this is how we need to do it. I'll look into maybe extending the reloader to accept a glob instead of a single path to watch.
|
I think the name is fine. We also dictate the name if the user wants to provide their own configuration. We can actually just do both. If we later extend by allowing to provide a selector over ConfigMaps, the controller would write all their summarized contents into the ConfigMap with the fixed name. Doesn't have to be in this PR, but we have to figure out our labeling approach, i.e. do we consistently use the Do we also or instead want to use - apiVersion: v1
kind: Pod
metadata:
annotations:
kubernetes.io/created-by: |
{"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"ReplicaSet","namespace":"default","name":"prometheus-main-3075796463","uid":"df360d3f-9c67-11e6-ac9f-2607313a24d5","apiVersion":"extensions","resourceVersion":"3067"}}
creationTimestamp: 2016-10-27T17:07:42Z
generateName: prometheus-main-3075796463-
labels:
pod-template-hash: "3075796463"
prometheus.coreos.com/name: prometheus-main
prometheus.coreos.com/type: prometheus
name: prometheus-main-3075796463-kkkv6
namespace: default
ownerReferences:
- apiVersion: extensions/v1beta1
controller: true
kind: ReplicaSet
name: prometheus-main-3075796463
uid: df360d3f-9c67-11e6-ac9f-2607313a24d5
resourceVersion: "14032"
# ... |
| @@ -1,5 +1,6 @@ | |||
| build: | |||
| go build github.com/coreos/kube-prometheus-controller/cmd/controller | |||
| go install github.com/coreos/kube-prometheus-controller/cmd/controller | |||
There was a problem hiding this comment.
@fabxc Let me know if you have an opinion about this, I just do it because it means faster compiling. Not attached to it.
There was a problem hiding this comment.
Mh, this kinda breaks my process of GOOS=linux make && make container.
For me builds are very fast with go build to – definitely seems to cache the built packages.
There was a problem hiding this comment.
Ok little experiment shows that an occasional go install already speeds up everything quite drastically .. will revert to the old makefile
|
The namespacing makes sense, I think we should have both, the labels and the owner reference, it will help big time when we get to GC'ing things. |
|
👍 |
monitor and alert on k8s components
Add apiserver config of kubernetes_sd_config to prometheus spec.
empty pr to trigger build
@fabxc
Main question on this is whether we want to enforce a user to create the
<prometheus-name>-rulesConfigMap? Or do we want to go full on and do the managed ConfigMap?