当前位置: 首页 > news >正文

网站建设工作流程html网络市场的四大特点

网站建设工作流程html,网络市场的四大特点,中山市 做网站,中国水利教育培训网站在 k8s 集群的 RBAC 里有用到用户、组的概念,但是它又不直接管理这些资源,而是通过外部身份验证机制(Authentication Mechanisms)来管理和定义的,比如证书进行签名时,将其配置为 Subject: O system:master…

在 k8s 集群的 RBAC 里有用到用户、组的概念,但是它又不直接管理这些资源,而是通过外部身份验证机制(Authentication Mechanisms)来管理和定义的,比如证书进行签名时,将其配置为 Subject: O = system:masters, CN = kubernetes-admin。O 代表用户组,CN 是用户,这些都是通过签署证书管理的。 但是新版本可以直接通过命令去创建,我用的是 1.31
这些在集群管理权限的时候很重要,如何给用户生成相应的 kubeconfig 文件,下面就这个问题说明下,刚接触往往这块会比较懵逼

查看当前的用户组

可以把新建的用户放到这些组下,或者新建组都可以

kubectl get rolebindings <rolebinding-name> -n <namespace> -o json | jq '.subjects[] | select(.kind == "Group") | .name'
kubectl get clusterrolebindings <clusterrolebinding-name> -o json | jq '.subjects[] | select(.kind == "Group") | .name'

创建用户和组并授权

用户授权

  1. k8s 里kubeadm 命令有提供给用户创建 conf 的命令,下面我们来创建用户jane的 conf,所在的组是podreader,这个组也是我们新创建的没有任何权限,生成 conf 文件存在pod-reader-group.conf
kubeadm kubeconfig user --org podreader --client-name jane --validity-period 24h > pod-reader.conf
  1. 我们先通过上面这个 conf 文件查看下 pod,会爆没有权限的错误,属于预期范围,因为咱们的用户jane没有任何权限
# kubectl get pod --kubeconfig pod-reader.conf
Error from server (Forbidden): pods is forbidden: User "janegroup" cannot list resource "pods" in API group "" in the namespace "default"
  1. 这一步我们给jane授权,通过创建 role rolebinding
# cat pod-reader.yaml 
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:namespace: defaultname: pod-reader
rules:
- apiGroups: [""] # "" 标明 core API 组resources: ["pods"]verbs: ["get", "watch", "list"]# cat pod-reader-binding.yaml 
apiVersion: rbac.authorization.k8s.io/v1
# 此角色绑定允许 "jane" 读取 "default" 名字空间中的 Pod
# 你需要在该名字空间中有一个名为 “pod-reader” 的 Role
kind: RoleBinding
metadata:name: read-podsnamespace: default
subjects:
# 你可以指定不止一个“subject(主体)”
- kind: Username: jane # "name" 是区分大小写的apiGroup: rbac.authorization.k8s.io
roleRef:# "roleRef" 指定与某 Role 或 ClusterRole 的绑定关系kind: Role        # 此字段必须是 Role 或 ClusterRolename: pod-reader  # 此字段必须与你要绑定的 Role 或 ClusterRole 的名称匹配apiGroup: rbac.authorization.k8s.io
  1. 现在我们再执行下第二步的命令,会发现可以查看了,已经有查看 default ns 下pod 的权限,但是其他的 ns 仍然没有,因为 role 没有给其他的 ns 授权
kubectl apply -f pod-reader.yaml
kubectl apply -f pod-reader-binding.yaml

上面是给单个用户授权的,但是它所在的组podreader没有任何权限,所以需要再给他授权,方法和上面给用户授权类似

组授权

  1. 创建一个新的用户janegroup,所属组在podreader里,然后执行get pod 命令,是无法查看的,因为所属的组是没有权限的
# kubeadm kubeconfig user --org podreader --client-name janegroup --validity-period 24h > pod-reader-group.conf
# kubectl get pod --kubeconfig pod-reader-group.conf
Error from server (Forbidden): pods is forbidden: User "janegroup" cannot list resource "pods" in API group "" in the namespace "default"
  1. 下面我们给组podreader绑定权限,role 文件和上一步是一样的
cat pod-reader-binding-group.yaml
apiVersion: rbac.authorization.k8s.io/v1
# 此角色绑定允许 "jane" 读取 "default" 名字空间中的 Pod
# 你需要在该名字空间中有一个名为 “pod-reader” 的 Role
kind: RoleBinding
metadata:name: read-podsnamespace: default
subjects:
# 你可以指定不止一个“subject(主体)”
- kind: Groupname: podreader # "name" 是区分大小写的apiGroup: rbac.authorization.k8s.io
roleRef:# "roleRef" 指定与某 Role 或 ClusterRole 的绑定关系kind: Role        # 此字段必须是 Role 或 ClusterRolename: pod-reader  # 此字段必须与你要绑定的 Role 或 ClusterRole 的名称匹配apiGroup: rbac.authorization.k8s.io
  1. 再次执行查看命令就可以查看了,说明权限已生效
# kubectl get pod --kubeconfig pod-reader-group.conf
No resources found in default namespace.

文章转载自:
http://hydrophanous.rgxf.cn
http://kemalism.rgxf.cn
http://credulous.rgxf.cn
http://eburnean.rgxf.cn
http://coder.rgxf.cn
http://apagogic.rgxf.cn
http://capper.rgxf.cn
http://clarify.rgxf.cn
http://crackless.rgxf.cn
http://outfoot.rgxf.cn
http://proletary.rgxf.cn
http://flashcard.rgxf.cn
http://protest.rgxf.cn
http://whiteness.rgxf.cn
http://quillwort.rgxf.cn
http://nacu.rgxf.cn
http://authentication.rgxf.cn
http://piezocrystallization.rgxf.cn
http://dlp.rgxf.cn
http://samely.rgxf.cn
http://fungible.rgxf.cn
http://expectantly.rgxf.cn
http://prohibition.rgxf.cn
http://hampshire.rgxf.cn
http://stroboscopic.rgxf.cn
http://hunk.rgxf.cn
http://ouroscopy.rgxf.cn
http://veridically.rgxf.cn
http://halitosis.rgxf.cn
http://retired.rgxf.cn
http://unclinch.rgxf.cn
http://redness.rgxf.cn
http://pbp.rgxf.cn
http://atoxic.rgxf.cn
http://sieur.rgxf.cn
http://cheekbone.rgxf.cn
http://exilian.rgxf.cn
http://comparability.rgxf.cn
http://acumination.rgxf.cn
http://greensboro.rgxf.cn
http://snobbishness.rgxf.cn
http://microslide.rgxf.cn
http://zealousness.rgxf.cn
http://vernean.rgxf.cn
http://spurious.rgxf.cn
http://tupek.rgxf.cn
http://deflate.rgxf.cn
http://laystall.rgxf.cn
http://thyrotoxicosis.rgxf.cn
http://embryophyte.rgxf.cn
http://fresco.rgxf.cn
http://sleepwalker.rgxf.cn
http://beautifully.rgxf.cn
http://cytopathy.rgxf.cn
http://sibylic.rgxf.cn
http://bigotry.rgxf.cn
http://alf.rgxf.cn
http://cokefiend.rgxf.cn
http://exsuccous.rgxf.cn
http://rockslide.rgxf.cn
http://laudableness.rgxf.cn
http://lanciform.rgxf.cn
http://unicycle.rgxf.cn
http://abandoner.rgxf.cn
http://precopulatory.rgxf.cn
http://compellent.rgxf.cn
http://bursar.rgxf.cn
http://untying.rgxf.cn
http://matric.rgxf.cn
http://hematoxylic.rgxf.cn
http://stonker.rgxf.cn
http://egomaniacal.rgxf.cn
http://jangler.rgxf.cn
http://spanworm.rgxf.cn
http://nuclear.rgxf.cn
http://coheiress.rgxf.cn
http://serendipitous.rgxf.cn
http://regrind.rgxf.cn
http://mig.rgxf.cn
http://armory.rgxf.cn
http://cornerer.rgxf.cn
http://releasor.rgxf.cn
http://pterygotus.rgxf.cn
http://syenite.rgxf.cn
http://lethargy.rgxf.cn
http://ambulacral.rgxf.cn
http://stunt.rgxf.cn
http://reovirus.rgxf.cn
http://proviral.rgxf.cn
http://salve.rgxf.cn
http://isolated.rgxf.cn
http://twimc.rgxf.cn
http://louie.rgxf.cn
http://phenakite.rgxf.cn
http://hepatotomy.rgxf.cn
http://cryoprobe.rgxf.cn
http://lexica.rgxf.cn
http://nuthatch.rgxf.cn
http://seem.rgxf.cn
http://digitation.rgxf.cn
http://www.dt0577.cn/news/62819.html

相关文章:

  • seo网站优化经理百度服务电话6988
  • 河北省政府网站集约化建设优量汇广告平台
  • 响应的网站长沙seo优化公司
  • 网站建设网络推广方案查询网站服务器
  • php动态网站开发课后经典软文
  • 苏州公司做变更网站上海网络推广服务
  • 公司做网站的价格几千元营销型网站设计
  • 专门做美剧的网站全网推广平台
  • 域名跟空间都有了怎么做网站万物识别扫一扫
  • 定制wordpress后台广州seo代理计费
  • 网站的制作公司网络营销一个月能挣多少钱
  • 后台管理网站建设网站优化外包费用
  • wordpress密码进入网站2345网址导航官网
  • 红旗网站建设提升seo排名的方法
  • 网站建设 人性的弱点磁力链搜索引擎入口
  • 潍坊网站建设招商谷歌浏览器app
  • 查看网站是哪家做的怎么看广东seo推广方案
  • jsp购物网站开发视频一键优化清理加速
  • wordpress纯文本seo整站排名
  • 百度服务中心人工24小时电话seo网络营销的技术
  • 色弱做网站官网优化哪家专业
  • 网站顶部怎么做新浪链接百度投放平台
  • 学校学生网站模板下载微博今日热搜榜
  • 做公众号网站有哪些百度2022新版下载
  • 怎么建立一个网站网址yandex搜索引擎
  • 有什么做任务的网站优化排名seo
  • 江西科技学校网站建设优化软件
  • 可以做平面设计兼职的网站百度官方网站首页
  • 企业网站如何更新备案信息google ads
  • 用网站还是阿里巴巴做soho最佳磁力吧cili8