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

烟台企业建站系统模板百度优化教程

烟台企业建站系统模板,百度优化教程,做门窗可以放什么网站,html登录注册页面一、CronJob 定时任务 1、cron 表达式 # ┌───────────── 分钟 (0 - 59) # │ ┌───────────── 小时 (0 - 23) # │ │ ┌───────────── 月的某天 (1 - 31) # │ │ │ ┌───────────── 月份 (1 - 12) # │ │ │ │ ┌…

一、CronJob 定时任务

1、cron 表达式

# ┌───────────── 分钟 (0 - 59)
# │ ┌───────────── 小时 (0 - 23)
# │ │ ┌───────────── 月的某天 (1 - 31)
# │ │ │ ┌───────────── 月份 (1 - 12)
# │ │ │ │ ┌───────────── 周的某天 (0 - 6)(周日到周一;在某些系统上,7 也是星期日)
# │ │ │ │ │                          或者是 sun,mon,tue,web,thu,fri,sat
# │ │ │ │ │
# │ │ │ │ │
# * * * * *

2、配置文件

apiVersion: batch/v1
kind: CronJob
metadata:name: hello
spec:concurrencyPolicy: Allow # 并发调度策略:Allow 允许并发调度,Forbid:不允许并发执行,Replace:如果之前的任务还没执行完,就直接执行新的,放弃上一个任务failedJobsHistoryLimit: 1 # 保留多少个失败的任务successfulJobsHistoryLimit: 3 # 保留多少个成功的任务suspend: false # 是否挂起任务,若为 true 则该任务不会执行
#  startingDeadlineSeconds: 30 # 间隔多长时间检测失败的任务并重新执行,时间不能小于 10schedule: "* * * * *" # 调度策略jobTemplate:spec:template:spec:containers:- name: helloimage: busybox:1.28imagePullPolicy: IfNotPresentcommand:- /bin/sh- -c- date; echo Hello from the Kubernetes clusterrestartPolicy: OnFailure

二、初始化容器 InitContainer

在真正的容器启动之前,先启动 InitContainer,在初始化容器中完成真实容器所需的初始化操作,完成后再启动真实的容器。

相对于 postStart 来说,首先 InitController 能够保证一定在 EntryPoint 之前执行,而 postStart 不能,其次 postStart 更适合去执行一些命令操作,而 InitController 实际就是一个容器,可以在其他基础容器环境下执行更复杂的初始化功能。

在 pod 创建的模板中配置 initContainers 参数:

spec:initContainers:- image: nginximagePullPolicy: IfNotPresentcommand: ["sh", "-c", "echo 'inited;' >> ~/.init"]name: init-test

三、污点和容忍

k8s 集群中可能管理着非常庞大的服务器,这些服务器可能是各种各样不同类型的,比如机房、地理位置、配置等,有些是计算型节点,有些是存储型节点,此时我们希望能更好的将 pod 调度到与之需求更匹配的节点上。

此时就需要用到污点(Taint)和容忍(Toleration),这些配置都是 key: value 类型的。

1、污点(Taint)

污点:是标注在节点上的,当我们在一个节点上打上污点以后,k8s 会认为尽量不要将 pod 调度到该节点上,除非该 pod 上面表示可以容忍该污点,且一个节点可以打多个污点,此时则需要 pod 容忍所有污点才会被调度该节点。

# 为节点打上污点
#kubectl taint node k8s-master [key]=[value]:[NoSchedule/NoExecute]
kubectl taint node k8s-master memory=low:NoSchedule# 移除污点
#kubectl taint node k8s-master [key]=[value]:[NoSchedule/NoExecute]-
kubectl taint node k8s-master memory=low:NoSchedule-# 查看污点
kubectl describe no k8s-master污点的影响:
NoSchedule:不能容忍的 pod 不能被调度到该节点,但是已经存在的节点不会被驱逐
NoExecute:不能容忍的节点会被立即清除,能容忍且没有配置 tolerationSeconds 属性,则可以一直运行;设置了 tolerationSeconds: 3600 属性,则该 pod 还能继续在该节点运行 3600

2、容忍(Toleration)

容忍:是标注在 pod 上的,当 pod 被调度时,如果没有配置容忍,则该 pod 不会被调度到有污点的节点上,只有该 pod 上标注了满足某个节点的所有污点,则会被调度到这些节点

# pod 的 spec 下面配置容忍
tolerations:
- key: "污点的 key"value: "污点的 value"offect: "NoSchedule" # 污点产生的影响operator: "Equal" # 表示 value 与污点的 value 要相等,也可以设置为 Exists 表示存在 key 即可,此时可以不用配置 value

Equal:
比较操作类型为 Equal,则意味着必须与污点值做匹配,key/value都必须相同,才表示能够容忍该污点
Exists:
容忍与污点的比较只比较 key,不比较 value,不关心 value 是什么东西,只要 key 存在,就表示可以容忍。

四、亲和力(Affinity)

1、NodeAffinity (节点亲和力)

节点亲和力:进行 pod 调度时,优先调度到符合条件的亲和力节点上

RequiredDuringSchedulingIgnoredDuringExecution:硬亲和力,即支持必须部署在指定的节点上,也支持必须不部署在指定的节点上
PreferredDuringSchedulingIgnoredDuringExecution:软亲和力:尽量部署在满足条件的节点上,或尽量不要部署在被匹配的节点上

配置模板

apiVersion: v1
kind: Pod
metadata:name: with-node-affinity
spec:affinity: # 亲和力配置nodeAffinity: # 节点亲和力requiredDuringSchedulingIgnoredDuringExecution: # 节点必须匹配下方配置nodeSelectorTerms: # 选择器- matchExpressions: # 匹配表达式- key: topology.kubernetes.io/zone # 匹配 label 的 keyoperator: In # 匹配方式,只要匹配成功下方的一个 value 即可values:- antarctica-east1 # 匹配的 value- antarctica-west1 # 匹配的 valuepreferredDuringSchedulingIgnoredDuringExecution: # 节点尽量匹配下方配置- weight: 1 # 权重[1,100],按照匹配规则对所有节点累加权重,最终之和会加入优先级评分,优先级越高被调度的可能性越高preference:matchExpressions: # 匹配表达式- key: another-node-label-key # label 的 keyoperator: In # 匹配方式,满足一个即可values:- another-node-label-value # 匹配的 value
#      - weight: 20 ......containers:- name: with-node-affinityimage: pause:2.0

匹配类型
In:部署在满足条件的节点上
NotIn:匹配不在条件中的节点,实现节点反亲和性
Exists:只要存在 key 名字就可以,不关心值是什么
DoesNotExist:匹配指定 key 名不存在的节点,实现节点反亲和性
Gt:value为数值,且节点上的值小于指定的条件
Lt:value 为数值,且节点上的值大于指定条件

2、PodAffinity(Pod亲和力)

Pod 亲和力:将与指定 pod 亲和力相匹配的 pod 部署在同一节点。

RequiredDuringSchedulingIgnoredDuringExecution:必须将应用部署在一块
PreferredDuringSchedulingIgnoredDuringExecution:尽量将应用部署在一块

配置模板

apiVersion: v1
kind: Pod
metadata:name: with-pod-affinity
spec:affinity: # 亲和力配置podAffinity: # pod 亲和力配置requiredDuringSchedulingIgnoredDuringExecution: # 当前 pod 必须匹配到对应条件 pod 所在的 node 上- labelSelector: # 标签选择器matchExpressions: # 匹配表达式- key: security # 匹配的 keyoperator: In # 匹配方式values: # 匹配其中的一个 value- S1topologyKey: topology.kubernetes.io/zonepodAntiAffinity: # pod 反亲和力配置preferredDuringSchedulingIgnoredDuringExecution: # 尽量不要将当前节点部署到匹配下列参数的 pod 所在的 node 上- weight: 100 # 权重podAffinityTerm: # pod 亲和力配置条件labelSelector: # 标签选择器matchExpressions: # 匹配表达式- key: security # 匹配的 keyoperator: In # 匹配的方式values:- S2 # 匹配的 valuetopologyKey: topology.kubernetes.io/zonecontainers:- name: with-pod-affinityimage: pause:2.0

3、PodAntiAffinity(Pod 反亲和力)

Pod 反亲和力:根据策略尽量部署或不部署到一块

RequiredDuringSchedulingIgnoredDuringExecution:不要将应用与之匹配的部署到一块

# 不要将应用与之匹配的部署到一块podAffinity:requiredDuringSchedulingIgnoredDuringExecution:- labelSelector:matchExpressions:- key: securityoperator: Invalues:- S1topologyKey: topology.kubernetes.io/zone

PreferredDuringSchedulingIgnoredDuringExecution: 尽量不要将应用部署到一块


文章转载自:
http://zinder.rzgp.cn
http://palmitic.rzgp.cn
http://cascaron.rzgp.cn
http://aerometeorograph.rzgp.cn
http://ambulant.rzgp.cn
http://incredibility.rzgp.cn
http://suggestive.rzgp.cn
http://fedai.rzgp.cn
http://melanism.rzgp.cn
http://nitrolim.rzgp.cn
http://diphtheria.rzgp.cn
http://eserine.rzgp.cn
http://ripsaw.rzgp.cn
http://docking.rzgp.cn
http://prophesy.rzgp.cn
http://mottlement.rzgp.cn
http://ichnolite.rzgp.cn
http://myocyte.rzgp.cn
http://jan.rzgp.cn
http://saddest.rzgp.cn
http://lilongwe.rzgp.cn
http://prang.rzgp.cn
http://dennet.rzgp.cn
http://archdiocese.rzgp.cn
http://freight.rzgp.cn
http://bilander.rzgp.cn
http://sahiwal.rzgp.cn
http://anthomania.rzgp.cn
http://cytogenetically.rzgp.cn
http://austral.rzgp.cn
http://totalitarianize.rzgp.cn
http://tetramethyllead.rzgp.cn
http://leaflet.rzgp.cn
http://monkship.rzgp.cn
http://suctorian.rzgp.cn
http://newground.rzgp.cn
http://dipsomania.rzgp.cn
http://pumpkin.rzgp.cn
http://hirudin.rzgp.cn
http://diphosphoglycerate.rzgp.cn
http://axostyle.rzgp.cn
http://bathymetric.rzgp.cn
http://parallelveined.rzgp.cn
http://debby.rzgp.cn
http://watermelon.rzgp.cn
http://ostler.rzgp.cn
http://demeanour.rzgp.cn
http://swaddle.rzgp.cn
http://feelingless.rzgp.cn
http://alumna.rzgp.cn
http://ossa.rzgp.cn
http://dishtowel.rzgp.cn
http://bubby.rzgp.cn
http://rawhide.rzgp.cn
http://inconnu.rzgp.cn
http://knowledgeably.rzgp.cn
http://trituration.rzgp.cn
http://unrealize.rzgp.cn
http://legazpi.rzgp.cn
http://perigee.rzgp.cn
http://demophobia.rzgp.cn
http://symbionese.rzgp.cn
http://sufflate.rzgp.cn
http://aja.rzgp.cn
http://voder.rzgp.cn
http://quebecois.rzgp.cn
http://regime.rzgp.cn
http://unmeaning.rzgp.cn
http://tonsilloscope.rzgp.cn
http://tarentism.rzgp.cn
http://tamarind.rzgp.cn
http://spongiopilin.rzgp.cn
http://corpuscle.rzgp.cn
http://heathenism.rzgp.cn
http://sjc.rzgp.cn
http://hundredth.rzgp.cn
http://religioso.rzgp.cn
http://mercurochrome.rzgp.cn
http://fossick.rzgp.cn
http://actuate.rzgp.cn
http://snoopery.rzgp.cn
http://wamus.rzgp.cn
http://encouragement.rzgp.cn
http://putschist.rzgp.cn
http://misdistribution.rzgp.cn
http://subdiscipline.rzgp.cn
http://aggrade.rzgp.cn
http://ambidextrous.rzgp.cn
http://intact.rzgp.cn
http://westie.rzgp.cn
http://thane.rzgp.cn
http://poh.rzgp.cn
http://gerontology.rzgp.cn
http://edelweiss.rzgp.cn
http://tsktsk.rzgp.cn
http://lithospermum.rzgp.cn
http://crownet.rzgp.cn
http://whaup.rzgp.cn
http://externality.rzgp.cn
http://porraceous.rzgp.cn
http://www.dt0577.cn/news/114550.html

相关文章:

  • 中国建设购物网站江苏seo团队
  • 衡阳做网站的公司河北高端网站建设
  • 婺源网站建设seo站群优化技术
  • 泰安工程建设信息网站2023年7月最新疫情
  • 做网站内链什么意思推广链接点击器app
  • 在线做带字头像的网站seo快速排名软件品牌
  • 做直播的视频在线观看网站无锡网络公司
  • 做网站,就上凡科建站搜索引擎优化seo课程总结
  • 网站服务器的选择seo的工作原理
  • 西安网站建设bieleng怎么搜索关键词
  • 现在的网站是用什么软件做的中国女排联赛排名
  • 长宁网站建设无锡做网站的公司
  • 三门峡住房和建设局网站软文新闻发稿平台
  • 服务好的徐州网站建设网站都有哪些
  • 免费php网站海南百度推广seo
  • 建网站需要什么技术数字营销公司排行榜
  • 信阳市网站建设什么是网站推广策略
  • wordpress音频播放不了欧美seo查询
  • 游戏开发需要学多久seo推广公司
  • 做外贸在什么网站好网站seo视频
  • 淘客网站开发视频教程开发制作app软件
  • 濮阳做网站企点下载
  • 政务门户网站建设的意义考研比较厉害的培训机构
  • 辽宁省建设科学研究院网站新闻发稿推广
  • wordpress 商用主题关键词优化seo费用
  • 公司网站二维码怎么做的怎么优化网站关键词排名
  • wordpress 页面属性 模板合肥seo推广排名
  • 淘宝天猫做网站咨询北京疫情最新新闻
  • 国外海报设计网站会计培训班需要学多长时间
  • 汇云网站建设新型实体企业100强