0

Deployed redis in my Kubernetes. How can I access that redis from the local machine my redis-service.yaml is :

apiVersion: v1
kind: Service
metadata:
  name: redis
  labels:
    app: redis
spec:
  type: NodePort
  ports:
  - port: 6379
    targetPort: 6379
    nodePort: 30369
  selector:
    app: redis

have any idea about this ?? when I try on my local machine, it shows me the error:

Could not connect to Redis at http://5******7:30369/:6379: Name or service not known
ashique
  • 935
  • 2
  • 8
  • 26

1 Answers1

0

You will just need to provide url as

http://<your k8s ip>:<nodeport>

No need to add the targetPort in the url