nacos集成到k8s的yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nacos
  annotations:
    initializer.kubernetes.io/lxcfs: "true"
    io.genesis.annotation: "nacos-server"
spec:
  replicas: 1
  selector:
    matchLabels:
      name: nacos
  template:
    metadata:
      labels:
        name: nacos
    spec:
      containers:
      - name: nacos
        image: nacos/nacos-server:1.4.2
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 8848
        env:
        - name: MODE
          value: "standalone"
        resources:
          limits:
            memory: "2048Mi"
            cpu: "1000m"
          requests:
            memory: "2048Mi"
            cpu: "1000m"
        volumeMounts:
        - name: nacos-server-data
          mountPath: /home/nacos/data
      volumes:
      - name: nacos-server-data
        hostPath:     
          path: /data/nacos/data
          type: DirectoryOrCreate
---
kind: Service
apiVersion: v1
metadata:
  name: nacos
spec:
  type: NodePort
  ports:
  - name: nacos
    port: 8848
    targetPort: 8848
    nodePort: 32001
    protocol: TCP
  selector:
    name: nacos

你可能感兴趣的:(kubernetes,容器,云原生)