--- apiVersion: v1 kind: Service metadata: name: redis-svc namespace: app02 labels: app: redis spec: type: NodePort ports: - port: 30080 targetPort: 6379 nodePort: 30001 selector: app: app02-redis --- apiVersion: apps/v1 kind: Deployment metadata: name: app02-redis namespace: app02 labels: app: redis spec: replicas: 1 selector: matchLabels: app: redis template: metadata: labels: app: redis name: redis-pod spec: containers: - name: redis image: redis volumeMounts: - name: redis-conf mountPath: "/usr/local/etc" command: - "redis-server" args: - "/usr/local/etc/config/redis.conf" volumes: - name: redis-conf configMap: name: redis-conf items: - key: redis.conf path: config/redis.conf