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

coreDNS部署

coredns.yaml

apiVersion: v1
kind: ServiceAccount
metadata:name: corednsnamespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:labels:kubernetes.io/bootstrapping: rbac-defaultsname: system:coredns
rules:- apiGroups:- ""resources:- endpoints- services- pods- namespacesverbs:- list- watch- apiGroups:- discovery.k8s.ioresources:- endpointslicesverbs:- list- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:annotations:rbac.authorization.kubernetes.io/autoupdate: "true"labels:kubernetes.io/bootstrapping: rbac-defaultsname: system:coredns
roleRef:apiGroup: rbac.authorization.k8s.iokind: ClusterRolename: system:coredns
subjects:
- kind: ServiceAccountname: corednsnamespace: kube-system
---
apiVersion: v1
kind: ConfigMap
metadata:name: corednsnamespace: kube-system
data:Corefile: |.:53 {errorshealth {lameduck 5s}readykubernetes cluster.local REVERSE_CIDRS {fallthrough in-addr.arpa ip6.arpa}prometheus :9153forward . 114.114.114.114 {max_concurrent 1000}cache 30loopreloadloadbalance}
---
apiVersion: apps/v1
kind: Deployment
metadata:name: corednsnamespace: kube-systemlabels:k8s-app: kube-dnskubernetes.io/name: "CoreDNS"app.kubernetes.io/name: coredns
spec:# replicas: not specified here:# 1. Default is 1.# 2. Will be tuned in real time if DNS horizontal auto-scaling is turned on.strategy:type: RollingUpdaterollingUpdate:maxUnavailable: 1selector:matchLabels:k8s-app: kube-dnsapp.kubernetes.io/name: corednstemplate:metadata:labels:k8s-app: kube-dnsapp.kubernetes.io/name: corednsspec:priorityClassName: system-cluster-criticalserviceAccountName: corednstolerations:- key: "CriticalAddonsOnly"operator: "Exists"nodeSelector:kubernetes.io/os: linuxaffinity:podAntiAffinity:requiredDuringSchedulingIgnoredDuringExecution:- labelSelector:matchExpressions:- key: k8s-appoperator: Invalues: ["kube-dns"]topologyKey: kubernetes.io/hostnamecontainers:- name: corednsimage: coredns/coredns:1.9.4imagePullPolicy: IfNotPresentresources:limits:memory: 170Mirequests:cpu: 100mmemory: 70Miargs: [ "-conf", "/etc/coredns/Corefile" ]volumeMounts:- name: config-volumemountPath: /etc/corednsreadOnly: trueports:- containerPort: 53name: dnsprotocol: UDP- containerPort: 53name: dns-tcpprotocol: TCP- containerPort: 9153name: metricsprotocol: TCPsecurityContext:allowPrivilegeEscalation: falsecapabilities:add:- NET_BIND_SERVICEdrop:- allreadOnlyRootFilesystem: truelivenessProbe:httpGet:path: /healthport: 8080scheme: HTTPinitialDelaySeconds: 60timeoutSeconds: 5successThreshold: 1failureThreshold: 5readinessProbe:httpGet:path: /readyport: 8181scheme: HTTPdnsPolicy: Defaultvolumes:- name: config-volumeconfigMap:name: corednsitems:- key: Corefilepath: Corefile
---
apiVersion: v1
kind: Service
metadata:name: kube-dnsnamespace: kube-systemannotations:prometheus.io/port: "9153"prometheus.io/scrape: "true"labels:k8s-app: kube-dnskubernetes.io/cluster-service: "true"kubernetes.io/name: "CoreDNS"app.kubernetes.io/name: coredns
spec:selector:k8s-app: kube-dnsapp.kubernetes.io/name: corednsclusterIP: 10.96.0.10ports:- name: dnsport: 53protocol: UDP- name: dns-tcpport: 53protocol: TCP- name: metricsport: 9153protocol: TCP
 
kubectl apply -f coredns.yaml
docker pull coredns/coredns:1.9.4
docker save -o coredns.tar coredns/coredns:1.9.4
ctr -n k8s.io image import coredns.tar

 

http://www.jsqmd.com/news/455270/

相关文章:

  • Flutter 三方库 flutter_native_splash 的鸿蒙化适配指南 - 掌握原生启动页自动化配置技术、助力鸿蒙应用构建极致第一印象与零闪烁开启的视觉美学体系
  • 震惊!这些竟是超好用的AI获客渠道服务商!
  • Granite TimeSeries FlowState R1生成多元时间序列预测效果:关联指标协同分析
  • ChatGPT私有化部署实战指南:从零搭建到生产环境避坑
  • 保姆级教学:圣女司幼幽-造相Z-Turbo模型提示词编写技巧
  • LiuJuan20260223Zimage模型企业级部署架构设计:高可用与弹性伸缩
  • 国际大师课|系统生产语言成型(精品可可,精品巧克力)
  • OWL ADVENTURE作品集:多模态AI在像素小镇中的视觉探索
  • 开源语音合成革新者VOICEVOX:零成本实现专业级语音创作
  • SDR++全攻略:从零开始掌握跨平台软件无线电
  • LangGraph RemoteGraph:本地图与远程图的组合机制解析
  • 【linux内核】内存管理
  • 腾讯优图视觉模型作品集:Youtu-VL-4B生成的多模态案例展示
  • 为什么你的MCP应用在OAuth 2026下返回“consent_required”却从未触发授权页?深度解析PKCE扩展参数缺失引发的静默失败(含RFC 9126第4.2条合规校验表)
  • 深入解析 CosyVoice 2.0 整合包:架构设计与性能优化实践
  • UniApp升级Vue3必看:getAppWebview方法迁移指南与常见问题排查
  • BGE Reranker-v2-m3在法律文书检索中的应用实践
  • 基于改进的YOLO的智慧监控之翻越护栏识别 危险翻越行为的实时检测与预警 深度学习数据集 翻越栏杆危险行为检测 监控安全监测第10541期
  • 3大突破让开发者轻松实现专业语音合成:VOICEVOX开源解决方案全解析
  • Django智能客服系统实战:从零搭建到生产环境部署
  • 手把手教你用华为IPD方法论管理产品需求:从市场调研到PRD文档编写全流程
  • ERNIE-4.5-0.3B-PT模型微服务化:Docker+K8s部署指南
  • SAP采购信息记录修改记录查询
  • 3个步骤掌握ROFL-Player:英雄联盟回放文件全流程管理指南
  • 避坑指南:WPF嵌入ECharts图表遇到的3个典型问题及解决方案
  • Windows用户福音:WSL2+Docker轻松部署Qwen2.5-Coder-1.5B
  • MCP 2.0安全规范入门到精通:从协议帧结构解密→签名验签实现→国密SM2/SM4迁移路径(含OpenSSL 3.0适配代码)
  • Visual C++运行库全方位修复指南:从错误诊断到系统优化
  • d2s-editor:高效简易的暗黑2存档编辑工具
  • 2025年AI面试工具排名:哪款评估结果真的有参考价值?​