Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
367 views
in Technique[技术] by (71.8m points)

kubernetes - 如何在kubernetes中获取启用准入控制器列表?(How to obtain the enable admission controller list in kubernetes?)

AFAIK, the admission controller is the last pass before the submission to the database.

(AFAIK,准入控制器是提交到数据库之前的最后一遍。)

However I cannot know which one is enabled, Is there a way to know which one is taking effect?

(但是我不知道启用了哪一个,是否有办法知道哪个正在生效?)

Thanks.

(谢谢。)

  ask by Weiwei Jiang translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The kube-apiserver is running in your kube-apiserver-< example.com > container.

(kube-apiserver在您的kube-apiserver- <example.com>容器中运行。)

The application does not have a get method at the moment to obtain the enabled admission plugins, but you can get the startup parameters from its command line.

(该应用程序目前尚无get方法来获取已启用的准入插件,但是您可以从其命令行获取启动参数。)

kubectl -n kube-system describe po kube-apiserver-example.com

Another way, to see what is in the container: unfortunately there is no "ps" command in the container, but you can get the initial process command parameters from /proc , something like that:

(另一种查看容器中内容的方法:不幸的是,容器中没有“ ps”命令,但是您可以从/ proc获得初始过程命令参数,如下所示:)

kubectl -n kube-system exec kube-apiserver-example.com -- sed 's/--/
/g' /proc/1/cmdline

It will be probably like :

(它可能像:)

enable-admission-plugins=NodeRestriction

(enable-admission-plugins = NodeRestriction)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...