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

微信登录 网站开发mvc5 网站开发

微信登录 网站开发,mvc5 网站开发,营销型网站服务,重庆智能网站建设设计测试通过http访问apiServer curl没有证书不能通过https来访问apiServer需要使用kubectl代理 #使用kubectl代理 kubectl proxy --port8111& #curl访问 api/v1 是资源所属群组/版本 即创建资源时定义的apiVersion #后边跟的是要访问的资源 #查看所有命名空间 #查看核心资源用…

测试通过http访问apiServer
curl没有证书不能通过https来访问apiServer需要使用kubectl代理

#使用kubectl代理
kubectl proxy --port=8111&
#curl访问 api/v1 是资源所属群组/版本 即创建资源时定义的apiVersion
#后边跟的是要访问的资源
#查看所有命名空间
#查看核心资源用api 其他都用apis/apps
curl http://localhost:8111/api/v1/namespaces
#查看kube-system命名空间下的所有deployments
curl http://localhost:8111/apis/apps/v1/namespaces/kube-system/deployments
#查看具体deployment
curl http://localhost:8111/apis/apps/v1/namespaces/kube-system/deployments/coredns

k8s认证授权分两类
一类是集群外访问apiServer
一类是集群内部资源的认证授权例如对pod.svc等资源
每个pod在创建时 都会有个默认的认证信息 例如:

Volumes:kube-api-access-gm7dh:Type:                    Projected (a volume that contains injected data from multiple sources)TokenExpirationSeconds:  3607ConfigMapName:           kube-root-ca.crtConfigMapOptional:       <nil>DownwardAPI:             true

k8s 默认使用serviceAccount管理权限
serviceAccount本身不对权限管理 只是创建个账号 进行认证
授权是rbac来管理

#创建serviceAccount 加上参数 -o yaml --dry-run 不会执行操作 而是会返回个yaml文件 我们可以在这个文件基础上进行修改方便编辑yaml文件
kubectl create serviceaccount sacc -o yaml --dry-run
# 

创建serviceAccount

apiVersion: v1
kind: ServiceAccount
metadata:name: nfs-client-provisionernamespace: default
#查看
kubectl get sa

对应pod

apiVersion: v1
kind: Pod
metadata:name: sa-nginx-podnamespace: default
spec:containers:- name: nginx-containersimage: docker.io/library/nginxserviceAccountName: ssa-test

查看 kubectl 配置

#查看kubectl 配置 包括连接的集群 账号等
kubectl config view

rbac授权方式

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:name: cluster-role-test
rules:- apiGroups: [""]resources: ["persistentvolumes"]verbs: ["get", "list", "watch", "create", "delete"]- apiGroups: [""]resources: ["persistentvolumeclaims"]verbs: ["get", "list", "watch", "update"]- apiGroups: ["storage.k8s.io"]resources: ["storageclasses"]verbs: ["get", "list", "watch"]- apiGroups: [""]resources: ["events"]verbs: ["create", "update", "patch"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:name: cluster-role-binding-test
subjects: #sa对象绑定到角色- kind: ServiceAccountname: ssa-test #sa对象namespace: default
roleRef:kind: ClusterRolename: cluster-role-test #角色apiGroup: rbac.authorization.k8s.io

ClusterRole与Role区别 :
ClusterRole不限制namespace
Role:只能限制在一个namespace中

http://www.yayakq.cn/news/899144/

相关文章:

  • 门户型网站建设平台搭建与拆除流程
  • 徐老师在那个网站做发视频下载品牌网站建设968
  • 免费企业黄页网站网址amh面板安装wordpress
  • 怎样打开网站单页网站建站
  • python 建设网站芜湖网站开发公司
  • 游戏交易网站怎么做网站建设一般的长宽
  • 诀窍的网站找事做网站
  • 教育网站集群建设方案北京行业网站建设
  • 网站做cpa赚钱吗wordpress 角色权限表
  • 蓝鸟E4A做网站程序HTML转WordPress主题
  • 建材网站建设 南宁交投建设集团网站
  • 自己做网站免费h5长页面怎么制作
  • 专门做高端网站设计的云华设计厦门城乡建设厅网站
  • 重庆餐饮加盟网站建设哈尔滨人社app官网
  • 网站用户运营网站系统维护一般多久
  • 旅游网站开发中国互联网站建设中心建站中心
  • 网站优化的方式有哪些网站建设定制网站建设公司
  • 石家庄谁会搭建网站上海浦东建设管理有限公司网站
  • 企业门户网站费用dede还是wordpress
  • 西安旅游网站开发牡丹菏泽网站建设
  • 咋样建设网站公司网站做论坛
  • 南昌行业网站建设引用网站代码
  • 专业的网站制作开发公司建网站的公司时
  • 余姚网站建设找哪家seo基础教程
  • 小鱼在线网站建设北京招聘网站设计师
  • 北京做建筑信息的网站砍价小程序怎么赚钱
  • 网站建设年终总结网页设计与制作课程思政教学设计
  • 所有复刻手表网站网络定制剧
  • qt 网站开发网络平台的运营
  • 怎么做应援网站成都今天消息