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

原生h5网站怎么做国外免费ip地址

原生h5网站怎么做,国外免费ip地址,adsense wordpress,腾讯网站建设1、远程登录 1、kubeconfig方式 在master上都是以kubeconfig方式登录的,并不是说有一个文件叫kubeconfig。 默认使用的配置文件是~/.kube/config 这个配置文件,而这个配置文件是通过这个文件/etc/kubernetes/admin.conf 如果在node上执行命令&#xff…

1、远程登录

1、kubeconfig方式
在master上都是以kubeconfig方式登录的,并不是说有一个文件叫kubeconfig。
默认使用的配置文件是~/.kube/config 这个配置文件,而这个配置文件是通过这个文件/etc/kubernetes/admin.conf

如果在node上执行命令,也需要配置该文件,否则报错如下:
[root@node1 ~]# kubectl get node
E1103 15:42:46.225278  129198 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
E1103 15:42:46.226197  129198 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
E1103 15:42:46.228511  129198 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
E1103 15:42:46.230491  129198 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
E1103 15:42:46.232909  129198 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
The connection to the server localhost:8080 was refused - did you specify the right host or port?
可以在master拷贝一份/etc/kubernetes/admin.conf到node1
[root@master ~]# cd /etc/kubernetes
[root@master kubernetes]# scp admin.conf 10.1.1.201:~
在node1上执行命令的时候,直接指定该文件运行。
[root@node1 ~]# kubectl get node --kubeconfig=admin.conf
NAME     STATUS   ROLES           AGE   VERSION
master   Ready    control-plane   8d    v1.27.0
node1    Ready    <none>          8d    v1.27.0
node2    Ready    <none>          8d    v1.27.0
如果不想指定配置文件,可以直接配置环境变量。
[root@node1 ~]# echo 'export KUBECONFIG=admin.conf' >> /etc/profile
[root@node1 ~]# source /etc/profile
[root@node1 ~]# kubectl get node
NAME     STATUS   ROLES           AGE   VERSION
master   Ready    control-plane   8d    v1.27.0
node1    Ready    <none>          8d    v1.27.0
node2    Ready    <none>          8d    v1.27.0
这样就不需要指定配置文件了。
注意:该admin.conf文件是直接从master上拷贝过来的,所以默认具备admin管理员最大的权限的。
生产环境不建议这样操作,因为权限过大,无法保证安全性。

例如单独创建用户tom授权

1、生成私钥
[root@master kubernetes]# mkdir /ca
[root@master kubernetes]# cd /ca
[root@master ca]# openssl genrsa -out client.key 2048
Generating RSA private key, 2048 bit long modulus (2 primes)
.....................................+++++
.......+++++
e is 65537 (0x010001)
[root@master ca]# ls
client.key
2、生成tom用户证书请求文件
[root@master ca]# openssl req -new -key client.key -subj "/CN=tom" -out client.csr
[root@master ca]# ls
client.csr  client.key
k8s本身使用的一些ca证书,是在/etc/kubernetes/pki/目录下
[root@master ca]# ls /etc/kubernetes/pki/
apiserver.crt              apiserver-etcd-client.key  apiserver-kubelet-client.crt  ca.crt  etcd                front-proxy-ca.key      front-proxy-client.key  sa.pub
apiserver-etcd-client.crt  apiserver.key              apiserver-kubelet-client.key  ca.key  front-proxy-ca.crt  front-proxy-client.crt  sa.key
3、为tom用户颁发证书
tom如何将请求发给k8s的ca进行证书颁发呢?使用kubernetes自带的ca为tom颁发证书。
[root@master ca]# openssl x509 -req -in client.csr -CA /etc/kubernetes/pki/ca.crt -CAkey /etc/kubernetes/pki/ca.key -CAcreateserial  -out client.crt -days 3650
Signature ok
subject=CN = tom
Getting CA Private Key
[root@master ca]# ls
client.crt  client.csr  client.key
拷贝ca证书到当前目录
[root@master ca]# cp /etc/kubernetes/pki/ca.crt .
[root@master ca]# ls
ca.crt  client.crt  client.csr  client.key
4、创建测试命名空间及pod
[root@master ca]# kubectl create namespace hehe
namespace/hehe created
[root@master ca]# kubens hehe
Context "kubernetes-admin@kubernetes" modified.
Active namespace is "hehe".
[root@master ca]# kubectl get pod
No resources found in hehe namespace.
[root@master ca]# kubectl run pod1 --image nginx --image-pull-policy IfNotPresent --dry-run=client -o yaml > pod1.yaml
[root@master ca]# kubectl apply -f pod1.yaml
pod/pod1 created
[root@master ca]# kubectl get pod
NAME   READY   STATUS    RESTARTS   AGE
pod1   1/1     Running   0          7s
5、创建角色和授权
创建角色,使其对hehe命名空间具有get/watch/list权限
[root@master ca]# kubectl create role r1 --verb get --verb watch --verb list --resource pods -n hehe
role.rbac.authorization.k8s.io/r1 created
查看角色:[root@master ca]# kubectl get role
NAME   CREATED AT
r1     2023-11-03T09:07:10Z
详细查看:[root@master ca]# kubectl describe role r1
Name:         r1
Labels:       <none>
Annotations:  <none>
PolicyRule:Resources  Non-Resource URLs  Resource Names  Verbs---------  -----------------  --------------  -----pods       []                 []              [get watch list]
6、将角色绑定给tom用户
[root@master ca]# kubectl create rolebinding r1binding --role r1 --user tom -n hehe
rolebinding.rbac.authorization.k8s.io/r1binding created
[root@master ca]# kubectl get rolebindings.rbac.authorization.k8s.io
NAME        ROLE      AGE
r1binding   Role/r1   17s
[root@master ca]# kubectl describe rolebindings.rbac.authorization.k8s.io
Name:         r1binding
Labels:       <none>
Annotations:  <none>
Role:Kind:  RoleName:  r1
Subjects:Kind  Name  Namespace----  ----  ---------User  tom
7、编辑kuberconfig文件
官网,https://kubernetes.io/zh-cn/docs/concepts/configuration/organize-cluster-access-kubeconfig/
[root@master ca]# vim kubeabc
[root@master ca]# vim kubeabc
[root@master ca]# cat kubeabc
apiVersion: v1
kind: Configclusters:
- cluster:name: dev1users:
- name: tomcontexts:
- context:name: context1namespace: hehe
current-context: "context1"设置集群密钥信息(嵌入集群密钥)
[root@master ca]# kubectl config --kubeconfig=kubeabc set-cluster dev1 --server=https://10.1.1.200:6443 --certificate-authority=ca.crt --embed-certs=true
Cluster "dev1" set.
设置tom用户密钥信息
[root@master ca]# kubectl config --kubeconfig=kubeabc set-credentials tom --client-certificate=client.crt --client-key=client.key --embed-certs=true
User "tom" set.
设置上下文信息
[root@master ca]# kubectl config --kubeconfig=kubeabc set-context context1 --cluster=dev1 --namespace=hehe --user=tom
Context "context1" modified.
8、测试
拷贝至客户端node2并测试
[root@master ca]# scp kubeabc 10.1.1.202:~
[root@node2 ~]# kubectl get pod --kubeconfig=kubeabc
NAME   READY   STATUS    RESTARTS   AGE
pod1   1/1     Running   0          24m
这样客户端node2就以tom身份登录到k8s集群中,进行管理操作了。
[root@node2 ~]# export KUBECONFIG=kubeabc
[root@node2 ~]# kubectl get pod
NAME   READY   STATUS    RESTARTS   AGE
pod1   1/1     Running   0          26m

文章转载自:
http://bustee.rmyn.cn
http://mesocratic.rmyn.cn
http://postbag.rmyn.cn
http://politeness.rmyn.cn
http://crapoid.rmyn.cn
http://salaam.rmyn.cn
http://motet.rmyn.cn
http://captaincy.rmyn.cn
http://earshot.rmyn.cn
http://auxiliary.rmyn.cn
http://lanky.rmyn.cn
http://sagger.rmyn.cn
http://shellless.rmyn.cn
http://innatism.rmyn.cn
http://ligate.rmyn.cn
http://magnification.rmyn.cn
http://hyperkeratosis.rmyn.cn
http://ashur.rmyn.cn
http://tabernacular.rmyn.cn
http://sunshiny.rmyn.cn
http://rejigger.rmyn.cn
http://zhengzhou.rmyn.cn
http://backsword.rmyn.cn
http://seigniory.rmyn.cn
http://copious.rmyn.cn
http://lionise.rmyn.cn
http://literalness.rmyn.cn
http://peanut.rmyn.cn
http://ryan.rmyn.cn
http://prebasic.rmyn.cn
http://rot.rmyn.cn
http://carob.rmyn.cn
http://medullary.rmyn.cn
http://agriculture.rmyn.cn
http://mononucleated.rmyn.cn
http://wadding.rmyn.cn
http://capillaceous.rmyn.cn
http://gumdrop.rmyn.cn
http://particulate.rmyn.cn
http://aggrieve.rmyn.cn
http://orthopsychiatry.rmyn.cn
http://subnormal.rmyn.cn
http://interpret.rmyn.cn
http://gleety.rmyn.cn
http://carabine.rmyn.cn
http://the.rmyn.cn
http://mawger.rmyn.cn
http://yb.rmyn.cn
http://testee.rmyn.cn
http://laocoon.rmyn.cn
http://aquiprata.rmyn.cn
http://turncap.rmyn.cn
http://delaine.rmyn.cn
http://tetraphonic.rmyn.cn
http://bijou.rmyn.cn
http://sponge.rmyn.cn
http://impromptu.rmyn.cn
http://pendragon.rmyn.cn
http://scott.rmyn.cn
http://sagittarius.rmyn.cn
http://literate.rmyn.cn
http://phoneticist.rmyn.cn
http://neddy.rmyn.cn
http://lagomorphic.rmyn.cn
http://feminise.rmyn.cn
http://neuroleptic.rmyn.cn
http://degasify.rmyn.cn
http://policy.rmyn.cn
http://anthroponym.rmyn.cn
http://behring.rmyn.cn
http://outyell.rmyn.cn
http://subuliform.rmyn.cn
http://repellancy.rmyn.cn
http://waxen.rmyn.cn
http://undiluted.rmyn.cn
http://fatherhood.rmyn.cn
http://zoopathology.rmyn.cn
http://pivot.rmyn.cn
http://flemish.rmyn.cn
http://caldarium.rmyn.cn
http://willies.rmyn.cn
http://teledrama.rmyn.cn
http://msphe.rmyn.cn
http://sleuthhound.rmyn.cn
http://elegy.rmyn.cn
http://robotics.rmyn.cn
http://redowa.rmyn.cn
http://hermetically.rmyn.cn
http://dammar.rmyn.cn
http://discoidal.rmyn.cn
http://myriopod.rmyn.cn
http://odds.rmyn.cn
http://vicissitudinary.rmyn.cn
http://taxidermy.rmyn.cn
http://chucker.rmyn.cn
http://epyllion.rmyn.cn
http://adulteration.rmyn.cn
http://zymoplastic.rmyn.cn
http://enfold.rmyn.cn
http://habitude.rmyn.cn
http://www.15wanjia.com/news/70950.html

相关文章:

  • 微信广告推广如何收费需要优化的网站有哪些?
  • 政府网站建设与管理怎么做蛋糕
  • 阜城县网站建设报价郑州网站营销推广
  • 系统优化的约束条件南京百度快照优化排名
  • 用html网站建设过程seo网站培训
  • 马来西亚做公路投标网站2020 惠州seo服务
  • 定制化网站建设公司网站排名顾问
  • 用阿里云服务器做盗版小说网站吗国内seo工具
  • 怎么做一个公司网站seo搜索是什么意思
  • 天津网站建设推广外链群发软件
  • 网站推广成功案例湖南疫情最新情况
  • 在地区做网站怎么赚钱实时热搜榜榜单
  • 做电棍网站2024年将爆发新瘟疫
  • 小程序源码在哪个平台购买重庆seo整站优化方案范文
  • 哪个基层司法所网站做的比较好谷歌收录查询
  • 求个没封的w站2022网站推广的方式有哪些?
  • 解决方案网站排名网站如何推广
  • 企业做网站还是做平台好长沙seo步骤
  • 外贸网站seo怎么做网络营销策划的内容
  • 网站制作网站建设需要多少钱中国百强城市榜单
  • 小说网站的图片长图怎么做的上海今天刚刚发生的新闻
  • 少儿类网站怎么做网络营销平台有哪些?
  • 做正规网站有哪些南昌seo排名公司
  • 培训机构的网站建设百度账号注册入口
  • 网站功能定制哈尔滨最新疫情通报
  • 做的网站为什么手机上搜不到网络营销公司注册找哪家
  • 简洁的企业博客html5手机网站模板源码下载网络营销到底是干嘛的
  • 济宁市精神文明建设委员会网站百度在线客服中心
  • 网站建设尾款如何做会计分录seo教程 百度网盘
  • 做网站可以申请专利吗百度平台推广联系方式