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

版权:本作品采用「本文版权归作者和博客园共有,欢迎转载,但必须给出原文链接,并保留此段声明,否则保留追究法律责任的权利。」许可协议进行许可。

posted @   SpringCore  阅读(21)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
more_horiz
keyboard_arrow_up light_mode palette
选择主题
点击右上角即可分享
微信分享提示