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

[Feature Request]About the new field definition of configmap in the filtering framework #773

Closed
yingjianjian opened this issue Mar 9, 2022 · 13 comments · Fixed by #749 or #790
Closed
Assignees
Labels
kind/feature kind/feature

Comments

@yingjianjian
Copy link
Member

yingjianjian commented Mar 9, 2022

What would you like to be added:
Regarding the discussion of #749 , I feel that the configmap configuration for the custom filtering framework is more complicated. I want to discuss the field definition through this issue

At present, my thoughts are as follows. If you have any questions, please correct me. Welcome to discuss together.:

serviceTopologyFilter:
  servicetopology:
   - user_agent: coredns
     name: coredns
     resources:
       - endpointslices
       - endpoints
     verbs:
	- "list"
	- "watch"
	    
   - user_agent: kube-proxy
     name: servicetopology
     resources:
       - endpointslices
     verbs:
       - "list"
       - "watch"
	    
    - user_agent: nginx-ingress-controller
      name: ingresscontroller
      resources:
	- endpoints
      verbs:
	- "list"
	- "watch"
	    
  discardcloudservice:
    - user_agent: kube-proxy
      name: discardcloud
      resources:
         - services
      verbs:
         - "list"
         - "watch"
  	    
  masterservice:
    - user_agent: kubelet
      name: masterservice
      resources:
        - services
      verbs:
        - "list"
        - "watch"

Why is this needed:
To customize the filter box

others
/kind feature

@yingjianjian yingjianjian added the kind/feature kind/feature label Mar 9, 2022
@rambohe-ch
Copy link
Member

@yingjianjian what fields do end users need to configure in the configmap kube-system/yurthub-cfg?

@yingjianjian
Copy link
Member Author

@yingjianjian what fields do end users need to configure in the configmap kube-system/yurthub-cfg?

In order to improve flexibility, all fields are basically configured. Currently, the fields that need to be defined are user_agent, name, resources, verbs. For the verbs field, I think it can be defined as the default value? I think the configuration of the addons verbs field should be consistent, I don't know if my idea is correct

@rambohe-ch
Copy link
Member

rambohe-ch commented Mar 9, 2022

@yingjianjian what fields do end users need to configure in the configmap kube-system/yurthub-cfg?

In order to improve flexibility, all fields are basically configured. Currently, the fields that need to be defined are user_agent, name, resources, verbs. For the verbs field, I think it can be defined as the default value? I think the configuration of the addons verbs field should be consistent, I don't know if my idea is correct

@yingjianjian Thanks for your feedback. because we want to use resource name(like endpoints, endpointslices) as filter name. and end user can configure specified user-agent and request to use specified filter. so maybe define the format as following:

filter_{name}:  user-agent1/verb1,verb2#user-agent2/verb1,verb2

so if end users want to configure to filter endpoints and endpointslices response of kube-proxy and coredns list/watch requests. the configuration maybe look as following:

apiVersion: v1
data:
  cache_agents: ""
  filter_endpoints: "kube-proxy/list,watch#coredns/list,watch"
  filter_endpointslices: "kube-proxy/list,watch#coredns/list,watch"
kind: ConfigMap
metadata:
  name: yurt-hub-cfg
  namespace: kube-system

btw: to add yaml configuration in configmap is so complicated, and end user also feel not easy to use i think.

@rambohe-ch
Copy link
Member

@zzguang @DrmagicE @hhstu Do you have any comments about this issue?

@yingjianjian
Copy link
Member Author

yingjianjian commented Mar 9, 2022

@yingjianjian what fields do end users need to configure in the configmap kube-system/yurthub-cfg?

In order to improve flexibility, all fields are basically configured. Currently, the fields that need to be defined are user_agent, name, resources, verbs. For the verbs field, I think it can be defined as the default value? I think the configuration of the addons verbs field should be consistent, I don't know if my idea is correct

@yingjianjian Thanks for your feedback. because we want to use resource name(like endpoints, endpointslices) as filter name. and end user can configure specified user-agent and request to use specified filter. so maybe define the format as following:

filter_{name}:  user-agent1/verb1,verb2#user-agent2/verb1,verb2

so if end users want to configure to filter endpoints and endpointslices response of kube-proxy and coredns list/watch requests. the configuration maybe look as following:

apiVersion: v1
data:
  cache_agents: ""
  filter_endpoints: "kube-proxy/list,watch#coredns/list,watch"
  filter_endpointslices: "kube-proxy/list,watch#coredns/list,watch"
kind: ConfigMap
metadata:
  name: yurt-hub-cfg
  namespace: kube-system

btw: to add yaml configuration in configmap is so complicated, and end user also feel not easy to use i think.

Is it easy to configure errors with too much configuration?
How do you see this?

apiVersion: v1
data:
  cache_agents: ""
  filter_endpoints: 
   - kube-proxy/list,watch
   - coredns/list,watch
  filter_endpointslices: 
   - kube-proxy/list,watch
   - coredns/list,watch
  filter_discardcloudservice:
   - kube-proxy/list,watch
  filter_masterservice:
   -  kubelet/list,watch
kind: ConfigMap
metadata:
  name: yurt-hub-cfg
  namespace: kube-system

@hhstu
Copy link
Member

hhstu commented Mar 9, 2022

我对 新的serviceTopologyFilter 的定义本身没有什么异议,但对我来说 * 就足够。
原因:我目前没有遇到过哪个资源不需要本地 cache 的,业务的服务几乎不会用到 k8s 的资源,平台用到 k8s 的资源的都需要 cache。
从易用性角度讲,如果要实现 新的serviceTopologyFilter,请保留 * 😁

@rambohe-ch
Copy link
Member

@hhstu This new filed is not for cache_agents, a new field is added for configuring filters.

@rambohe-ch
Copy link
Member

Is it easy to configure errors with too much configuration? How do you see this?

apiVersion: v1
data:
  cache_agents: ""
  filter_endpoints: 
   - kube-proxy/list,watch
   - coredns/list,watch
  filter_endpointslices: 
   - kube-proxy/list,watch
   - coredns/list,watch
  filter_discardcloudservice:
   - kube-proxy/list,watch
  filter_masterservice:
   -  kubelet/list,watch
kind: ConfigMap
metadata:
  name: yurt-hub-cfg
  namespace: kube-system

@yingjianjian Thanks for your reply. because the format of ConfigMap.Data is map[string]string, so the -kube-proxy/list,watch is not supported in configmap.

@yingjianjian
Copy link
Member Author

Is it easy to configure errors with too much configuration? How do you see this?

apiVersion: v1
data:
  cache_agents: ""
  filter_endpoints: 
   - kube-proxy/list,watch
   - coredns/list,watch
  filter_endpointslices: 
   - kube-proxy/list,watch
   - coredns/list,watch
  filter_discardcloudservice:
   - kube-proxy/list,watch
  filter_masterservice:
   -  kubelet/list,watch
kind: ConfigMap
metadata:
  name: yurt-hub-cfg
  namespace: kube-system

@yingjianjian Thanks for your reply. because the format of ConfigMap.Data is map[string]string, so the -kube-proxy/list,watch is not supported in configmap.

yes i read that wrong that is it possible to show line breaks so that it is a bit more passable?

@yingjianjian
Copy link
Member Author

Check whether the startup parameter etcd-servers-overrides of kube-apsierver can be in the following format:
filter_{name}: user-agent1#verb1;verb2, user-agent2#verb1;verb2

@rambohe-ch
Copy link
Member

Check whether the startup parameter etcd-servers-overrides of kube-apsierver can be in the following format: filter_{name}: user-agent1#verb1;verb2, user-agent2#verb1;verb2

@yingjianjian agree +1, consistent with startup parameter format of kube-apiserver.

@zzguang do you have any comments?

@zzguang
Copy link
Member

zzguang commented Mar 10, 2022

agree +1, it means that one feature can use multi resources filters, and one resource filter can be used by multi features conveniently.

@rambohe-ch
Copy link
Member

/assign @yingjianjian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature kind/feature
Projects
None yet
4 participants