Dapr: Dapr Operator not issuing Cluster IP on Kubernetes

Created on 30 Jul 2020  路  4Comments  路  Source: dapr/dapr

In what area(s)?

/area placement

What version of Dapr?

0.9.0

Expected Behavior

Dapr Sidecar Services to have Cluster IP address

Actual Behavior

None Cluster IP address

Steps to Reproduce the Problem

  1. Install Dapr to Kubernetes environment using Helm 3
helm repo add dapr https://daprio.azurecr.io/helm/v1/repo
helm repo update
helm install dapr dapr/dapr --namespace my-namespace
  1. Deploy application to Kubernetes: kubectl apply -f app.yaml

app.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: appname
  namespace: my-namespace
  labels:
    app: appname
spec:
  replicas: 1
  selector:
    matchLabels:
      app: appname
  template:
    metadata:
      labels:
        app: appname
      annotations:
        dapr.io/enabled: "true"
        dapr.io/id: "appname"
        dapr.io/port: "3000"
        dapr.io/log-level: "debug"
    spec:
      containers:
      - name: appname
        image: appnameapp:latest
        ports:
        - containerPort: 8080
kinbug

All 4 comments

Hey @skmaingi thanks for opening this issue.

The Dapr operator creates k8s services for Dapr internal use - these do not have ClusterIP's on purpose. The reason why we don't generate ClusterIP's is because we need Headless services to refresh DNS records when new endpoints are getting added. This is because of a gRPC client side load balancing design issue.

As a user, you should not interact with these k8s services. The dapr sidecar should only be reached via localhost by the app in the pod, and Dapr itself takes care of interacting with other sidecars in the cluster.

If for any reason you want to invoke a Dapr sidecar outside of the pod, you can easily create a Kubernetes service yourself that select the pod that has the sidecar, with targetPort of 3500 for HTTP and 50001 for gRPC.

Hey @yaron2, Thank you for the support.

For confirmation, if a Dapr Sidecar service does not have an internal(private) cluster IP, an Ingress controller with sidecar can still reach it?

Correct.

Thank you for assistance.

Was this page helpful?
0 / 5 - 0 ratings