You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TLDR: Restart control loop when KFO finds event that a job has started a pod in a namespace. Watch jobslist similar to podlist and namespaces. If a namespace has only jobs and no pods, we currently miss informing on new pods from those jobs in that namespaces, unless control loop runs again meanwhile.
factory.Batch().V1().Jobs().Informer()
If factory informer finds new pods for job. Then c.RunOnce() and make controller run again (main control loop).
KubeInformer needs to use batch api v1 to list Jobs and create MiniContainers.
Then we need to use CronJob name as label selector to get the pods for that namespace. If a namespace has only jobs and no running pods from jobs at the time of execution, then KFO will not find it.
Implement KubernetersInformer to find when cronjob starts a pod in a given namespace and make config-reloader restart main loop when a new pod from a job starts?
Note: The job name and pod name are different.
Example code that we need:
var kubeInformerFactory kubeinformers.SharedInformerFactory
// Sync event only
if namespace == "" {
kubeInformerFactory = kubeinformers.NewSharedInformerFactory(kubeClient, 0)
} else {
kubeInformerFactory = kubeinformers.NewSharedInformerFactoryWithOptions(kubeClient, 0, kubeinformers.WithNamespace(namespace))
}
controller := NewController(kubeClient, kubeInformerFactory.Batch().V1().Jobs())
kubeInformerFactory.Start(stopCh)
Update the code below in kube_informer to query jobs and to rerun main control loop of KFO if it finds pods that a job has started?
- add kube pod informer for pods add/rm in namespace we monitor, rerun preprocess configs
- fixesvmware#289
- fixesvmware#253
- fixes issue with respecting `c.cfg.AnnotConfigmapName` on configmap namespaces discovery
- introduces `hashstructure` package for smarter hashing of changing objects
- make smarter hashing for `allConfigsHash` metahashing (without `reflect.DeepEqual()`)
Signed-off-by: Anton Ouzounov <aouzounov@vmware.com>
TLDR: Restart control loop when KFO finds event that a job has started a pod in a namespace. Watch jobslist similar to podlist and namespaces. If a namespace has only jobs and no pods, we currently miss informing on new pods from those jobs in that namespaces, unless control loop runs again meanwhile.
If factory informer finds new pods for job. Then
c.RunOnce()
and make controller run again (main control loop).KubeInformer needs to use batch api v1 to list Jobs and create MiniContainers.
Then we need to use CronJob name as label selector to get the pods for that namespace. If a namespace has only jobs and no running pods from jobs at the time of execution, then KFO will not find it.
Implement KubernetersInformer to find when cronjob starts a pod in a given namespace and make config-reloader restart main loop when a new pod from a job starts?
Example code that we need:
Update the code below in kube_informer to query jobs and to rerun main control loop of KFO if it finds pods that a job has started?
Need to find new pods per job informer event:
https://github.com/vmware/kube-fluentd-operator/blob/master/config-reloader/datasource/kube_informer.go#L26-L33
The text was updated successfully, but these errors were encountered: