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

连云港网站制作百度联盟项目看广告挣钱

连云港网站制作,百度联盟项目看广告挣钱,特效做的很牛逼的网站,seo百度快速排名软件一.Yaml文件详解 1.Yaml文件格式 (1)Kubernetes 支持 YAML 和 JSON 格式管理资源对象 (2)JSON 格式:主要用于 api 接口之间消息的传递 (3)YAML 格式:用于配置和管理,…

一.Yaml文件详解

1.Yaml文件格式

(1)Kubernetes 支持 YAML 和 JSON 格式管理资源对象

(2)JSON 格式:主要用于 api 接口之间消息的传递

(3)YAML 格式:用于配置和管理,YAML 是一种简洁的非标记性语言,内容格式人性化,较易读

2.YAML 语法格式

(1)大小写敏感

(2)使用缩进表示层级关系

(3)不支持Tab键制表符缩进,只使用空格缩进

(4)缩进的空格数目不重要,只要相同层级的元素左侧对齐即可,通常开头缩进两个空格

(5)符号字符后缩进一个空格,如冒号,逗号,短横杆(-)等

(6)“---”表示YAML格式,一个文件的开始,用于分隔文件间

(7)“#”表示注释

二.Yaml文件编写及相关概念

1.查看 api 资源版本标签

kubectl api-versions
[root@k8s-master-136 ~]# kubectl api-versions
admissionregistration.k8s.io/v1
admissionregistration.k8s.io/v1beta1
apiextensions.k8s.io/v1
apiextensions.k8s.io/v1beta1
apiregistration.k8s.io/v1
apiregistration.k8s.io/v1beta1
apps/v1
authentication.k8s.io/v1
authentication.k8s.io/v1beta1
authorization.k8s.io/v1
authorization.k8s.io/v1beta1
autoscaling/v1
autoscaling/v2beta1
autoscaling/v2beta2
batch/v1
batch/v1beta1
certificates.k8s.io/v1
certificates.k8s.io/v1beta1
coordination.k8s.io/v1
coordination.k8s.io/v1beta1
crd.projectcalico.org/v1
discovery.k8s.io/v1
discovery.k8s.io/v1beta1
events.k8s.io/v1
events.k8s.io/v1beta1
extensions/v1beta1
flowcontrol.apiserver.k8s.io/v1beta1
networking.k8s.io/v1
networking.k8s.io/v1beta1
node.k8s.io/v1
node.k8s.io/v1beta1
policy/v1
policy/v1beta1
rbac.authorization.k8s.io/v1
rbac.authorization.k8s.io/v1beta1
scheduling.k8s.io/v1
scheduling.k8s.io/v1beta1
storage.k8s.io/v1
storage.k8s.io/v1beta1
v1

2.yaml编写案例

#查看deployment的版本定义
kubectl explain deployment
[root@k8s-master-136 ~]# kubectl explain deployment
KIND:     Deployment
VERSION:  apps/v1DESCRIPTION:Deployment enables declarative updates for Pods and ReplicaSets.FIELDS:apiVersion   <string>APIVersion defines the versioned schema of this representation of anobject. Servers should convert recognized schemas to the latest internalvalue, and may reject unrecognized values. More info:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resourceskind <string>Kind is a string value representing the REST resource this objectrepresents. Servers may infer this from the endpoint the client submitsrequests to. Cannot be updated. In CamelCase. More info:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kindsmetadata     <Object>Standard object metadata.spec <Object>Specification of the desired behavior of the Deployment.status       <Object>Most recently observed status of the Deployment.
#查看api的版本
kubectl explain deployment.apiVersion[root@k8s-master-136 ~]# kubectl explain deployment.apiVersion
KIND:     Deployment
VERSION:  apps/v1FIELD:    apiVersion <string>DESCRIPTION:APIVersion defines the versioned schema of this representation of anobject. Servers should convert recognized schemas to the latest internalvalue, and may reject unrecognized values. More info:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
#查看元数据信息
kubectl explain deployment.apiVersion
#定义标签介绍
kubectl explain deployment.spec.selector[root@k8s-master-136 ~]# kubectl explain deployment.spec.selector
KIND:     Deployment
VERSION:  apps/v1RESOURCE: selector <Object>DESCRIPTION:Label selector for pods. Existing ReplicaSets whose pods are selected bythis will be the ones affected by this deployment. It must match the podtemplate's labels.A label selector is a label query over a set of resources. The result ofmatchLabels and matchExpressions are ANDed. An empty label selector matchesall objects. A null label selector matches no objects.FIELDS:matchExpressions     <[]Object>matchExpressions is a list of label selector requirements. The requirementsare ANDed.matchLabels  <map[string]string>matchLabels is a map of {key,value} pairs. A single {key,value} in thematchLabels map is equivalent to an element of matchExpressions, whose keyfield is "key", the operator is "In", and the values array contains only"value". The requirements are ANDed.#对matchLabels标签介绍
kubectl explain deployment.spec.selector.matchLabels[root@k8s-master-136 ~]# kubectl explain deployment.spec.selector.matchLabels
KIND:     Deployment
VERSION:  apps/v1FIELD:    matchLabels <map[string]string>DESCRIPTION:matchLabels is a map of {key,value} pairs. A single {key,value} in thematchLabels map is equivalent to an element of matchExpressions, whose keyfield is "key", the operator is "In", and the values array contains only"value". The requirements are ANDed.

Deployment类型编写nginx服务

创建pod

vim nginx-deployment.yamlapiVersion: apps/v1		    #指定api版本标签
kind: Deployment		    #定义资源的类型/角色,deployment为副本控制器,此处资源类型可以是Deployment、Job、Ingress、Service等
metadata:					#定义资源的元数据信息,比如资源的名称、namespace、标签等信息name: nginx-deployment	#定义资源的名称,在同一个namespace空间中必须是唯一的namespace: default       #默认就是default,可以不用写labels:				    #定义Deployment资源标签app: nginx	
spec:					    #定义deployment资源需要的参数属性,诸如是否在容器失败时重新启动容器的属性replicas: 3			    #定义副本数量selector:				    #定义标签选择器matchLabels:		    #定义匹配标签app: nginx		    #需与 .spec.template.metadata.labels 定义的标签保持一致template:				    #定义业务模板,如果有多个副本,所有副本的属性会按照模板的相关配置进行匹配metadata:labels:               #定义Pod副本将使用的标签,需与 .spec.selector.matchLabels 定义的标签保持一致app: nginxspec:containers:				#定义容器属性- name: nginx				#定义一个容器名,一个 - name: 定义一个容器image: nginx:1.15.4		#定义容器使用的镜像以及版本ports:- containerPort: 80		#定义容器的对外的端口
#创建资源对象
kubectl create -f nginx-deployment.yaml
或
kubectl apply -f nginx-deployment.yaml 
#查看创建的资源对象,创建需等待running
kubectl get pod

容器如果想对外提供访问,需创建service 发布


#创建service服务对外提供访问并测试
vim nginx-service.yamlapiVersion: v1  
kind: Service  
metadata:name: nginx-servicelabels:app: nginx  
spec:selector:app: nginxtype: NodePort  ports:- port: 80targetPort: 80  
#创建资源对象
kubectl create -f nginx-service.yaml 
或
kubectl apply -f nginx-service.yaml
#查看创建的service
kubectl get svc

k8s集群中的port介绍

详解k8s中的port:

●port

port 是 k8s 集群内部访问service的端口,即通过 clusterIP: port 可以从 Pod 所在的 Node 上访问到 service

●nodePort

nodePort 是外部访问 k8s 集群中 service 的端口,通过 nodeIP: nodePort 可以从外部访问到某个 service。

●targetPort

targetPort 是 Pod 的端口,从 port 或 nodePort 来的流量经过 kube-proxy 反向代理负载均衡转发到后端 Pod 的 targetPort 上,最后进入容器。

●containerPort

containerPort 是 Pod 内部容器的端口,targetPort 映射到 containerPort。

http://www.bjxfkj.com.cn/article/100829.html

相关文章:

  • 免费python在线正常网站谷歌浏览器 免费下载
  • 搭建网站服务器需要什么配置长沙seo搜索
  • 北滘 网站建设爱站网长尾挖掘工具
  • 公司网站建设找谁做网站快速收录
  • 莆田企业自助建站系统外链百科
  • 上海建设银行网站全网关键词云在哪里看
  • 深圳手机网站模板全自动引流推广软件免费
  • 动态交互网站建设广州seo怎么做
  • 如何给自己建设的网站设置登陆用户名和密码系统设置友情链接有什么作用
  • 做网站一些专业术语网上竞价平台
  • 青岛网站建如何在各种网站投放广告
  • 承德公司做网站谷歌广告平台
  • 网站首页框架图网络推广营销方案免费
  • 网站建设与开发定制哪有网页设计公司
  • 网站建设费属于广告费吗百度推广平台有哪些
  • 青岛网站空间南宁seo外包平台
  • 如何利用网站做淘宝客seo搜索优化
  • 做网站需要专业seo的课谁讲的好
  • 济南网站建设和优化seo优化方式包括
  • 男女之间做下面哪个网站免费石嘴山网站seo
  • 做网站去哪个平台宁德seo推广
  • 网站建设文字内容广州网站营销seo
  • 网站建设排行榜比较靠谱的推广公司
  • 云商网络综合服务免费的seo优化工具
  • 免费做金融网站有哪些抖音推广怎么做
  • 珠海网站建设最新报价郑州网站定制
  • 中企动力是国企还是私企搜索关键词优化
  • 网站静态和动态区别网络营销的概念和含义
  • 自己做图片上传网站如何自己做引流推广
  • 做网站优化公司云客网平台