|NO.Z.00225|——————————|CloudNative|——|KuberNetes&细粒度权限控制.V09|——|RBAC.v01|临时容器概述|

一、临时容器概述
### --- 官方地址:

~~~     https://kubernetes.io/docs/reference/access-authn-authz/rbac/
### --- 注意事项:

~~~     k8s 1.19+已经弃用basic_auth_file的认证方式,
~~~     如果集群大于1.19+ 请使用课程讲解的serviceaccount的认证方式,更灵活更好用。
二、权限
### --- 基于用户密码实现用户不同的权限
~~~     基于用户名密码实现不同用户有不同的权限
~~~     基于ServiceAccount实现不同的SA有不同的权限
- --authentication-mode=basic,token
- --token-ttl=86400
~~~     # 注意:k8s 1.18+后可以直接使用kubectl alpha debug使用临时容器(也需要开启feature),比如启动一个session直接进行调试:
~~~     kubectl alpha debug alpine-85949985b6-qqztl -i --image=busybox
~~~     或者给某个pod加上一个临时容器,名字叫debugger:
kubectl alpha debug --image=myproj/debug-tools -c debugger mypod
~~~     # k8s 1.20+ 直接使用kubectl debug mypod -it --image=busybox即可,省去了kubectl alpha的alpha
### --- 临时容器:
~~~     1.16+: 就是在原有的Pod上,添加一个临时的Container,
~~~     这个Container可以包含我们排查问题所有的工具,netstat、ps、top,jstat、jmap。
--feature-gates=EphemeralContainers=true \
### --- 打开共享目录:
~~~     DaemonSet需要单独配置:shareProcessNamespace
~~~     Deployment不需要单独配置:默认是开启的
~~~     StatefulSet待确认

 
 
 
 
 
 
 
 
 

Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
                                                                                                                                                   ——W.S.Landor

 

 

posted on   yanqi_vip  阅读(28)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示