apiVersion: v1
kind: Service
metadata:
  name: redis-master
  labels:
    app: redis
    role: master
    tier: backend
spec:
  ports:
  - name: redis
    port: 6379
    targetPort: 6379
    protocol: TCP
    nodePort: 30001 # 固定外連的port
  selector:
    app: redis-deployment
    role: master
    tier: backend
  type: NodePort   #開啟外部port