k8s相关部署文件
1.控制器
1.生成后改改
kubectl create deployment coreqi-api --image=docker.io/fanqi/coreqi_api:latest --dry-run=client -o yaml > /home/coreqi_dm.yaml
2.手撸
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
generation: 1
labels:
app: coreqi-api
name: coreqi-api
namespace: default
resourceVersion: "11682"
uid: cdafc268-9869-4616-a22a-913ca6d1ea57
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: coreqi-api
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
app: coreqi-api
spec:
containers:
- image: docker.io/fanqi/coreqi_api:latest
imagePullPolicy: IfNotPresent
name: coreqi-api
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
status: {}
3.创建并查看结果
kubectl apply -f /home/coreqi_dm.yaml
kubectl get deployment,pods
2.Service
1.生成后改改
kubectl expose deploy coreqi-api --port=6000 --target-port=6001 --type=NodePort -o yaml --dry-run=client > /home/coreqi_svc.yaml
2.手撸
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app: coreqi-api
name: coreqi-api
spec:
ports:
- port: 6000
protocol: TCP
targetPort: 6001
selector:
app: coreqi-api
type: NodePort
status:
loadBalancer: {}
3.创建并查看结果
kubectl apply -f /home/coreqi_svc.yaml
kubectl get svc
3.Ingress
1.生成后改改
作者:奇
出处:https://www.cnblogs.com/fanqisoft/p/17479975.html
版权:本作品采用「本文版权归作者和博客园共有,欢迎转载,但必须给出原文链接,并保留此段声明,否则保留追究法律责任的权利。」许可协议进行许可。
分类:
Kubernetes
如果文章内容对您有所帮助,欢迎赞赏.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!