7D4A6BB8F530CDEF056CB9CF3EA7A12B.jpg

ns

apiVersion: v1
kind: Namespace
metadata:
  name: database

service

kind: Service
apiVersion: v1
metadata:
  name: redis
spec:
  type: NodePort
  ports:
  - name: redis
    port: 6379
    nodePort: 30379
    targetPort: 6379
    protocol: TCP
  selector:
    name: redis

Deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis
spec:
  replicas: 1
  selector:
    matchLabels:
      name: redis
  template:
    metadata:
      labels:
        name: redis
    spec:
      containers:
      - name: redis
        image: redis
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 6379
          name: redis
          protocol: TCP

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code