apiVersion: apps/v1
kind: Deployment
metadata:
  name: nacos
  namespace: liyuan
  labels:
    app: nacos
spec:
  selector:
    matchLabels:
      app: nacos
  template:
    metadata:
      labels:
        app: nacos
    spec:
      volumes:
      - name: application-conf
        configMap:
          name: nacos-application-conf
      containers:

      - name: nacos
        image: nacos/nacos-server
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 8848
          name: nacos-port
        env:
        # 此处写成脱机版就可以使用内置的数据源,无需远程连接数据源
          - name: MODE
            value: "standalone"
        resources:
          requests:
            cpu: "0.5"
            memory: "1024Mi"
          limits:
            cpu: "0.5"
            memory: "1024Mi"
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: nacos
  name: nacos-svc
  namespace: liyuan
spec:
  ports:
  - port: 8848
    targetPort: 8848
    nodePort: 30009
  selector:
    app: nacos
  type: NodePort

在这里插入图片描述

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐