I have a project that uses Dapr and it works fine locally using Docker Compose. I have previously used Kompose to generate the k8 manifest files from the Docker Compose. It created:
- dapr-placement-deployment.yaml
- api-x-deployment.yaml
- api-x-service.yaml
- api-x-dapr-deployment.yaml
- api-x-dapr-claim0-persistentvolumeclaim.yaml
- api-y-deployment.yaml
- api-y-service.yaml
- api-y-dapr-deployment.yaml
- api-y-dapr-claim0-persistentvolumeclaim.yaml
- rabbitmq-deployment.yaml
Here is an example of the generated ..dapr-claim0-persistentvolumeclaim.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
io.kompose.service: api-x-dapr-claim0
name: api-x-dapr-claim0
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
Here is an example of the generated ..dapr-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: C:....kubernetes-komposetoolskompose.exe convert -f test/docker-compose.yml -o ./k8s/
kompose.version: 1.32.0 (765fde254)
labels:
io.kompose.service: api-x-email-api-dapr
name: api-x-dapr
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: api-x-dapr
strategy:
type: Recreate
template:
metadata:
annotations:
kompose.cmd: C:.....kubernetes-komposetoolskompose.exe convert -f test/docker-compose.yml -o ./k8s/
kompose.version: 1.32.0 (765fde254)
labels:
io.kompose.network/test-default: "true"
io.kompose.service: api-x-dapr
spec:
containers:
- args:
- ./daprd
- -app-id
- emailapi-dapr
- -app-port
- "8080"
- -app-protocol
- http
- -components-path
- /DaprComponents
- -log-level
- debug
image: daprio/daprd:latest
name: apix-dapr
volumeMounts:
- mountPath: /DaprComponents
name: api-x-dapr-claim0
restartPolicy: Always
volumes:
- name: api-x-dapr-claim0
persistentVolumeClaim:
claimName: api-x-dapr-claim0
I have also added the following manifests to create Cluster IP services
- dapr-placement-service.yaml
- api-x-dapr-service.yaml
- api-y-dapr-service.yaml
- rabbitmq-service.yaml
When making a call to the deployed api-x and it publishes a call to api-y using Dapr, I get the following error:
Publish operation failed: the Dapr endpoint indicated a failure
I have noticed that there is no link of the ...dapr-deployment.yaml
in the k8 manifest files I have (like there is in the Docker Compose under the "network_mode"
) ie.
api-x-dapr:
image: "daprio/daprd:latest"
container_name: ${DOCKER_REGISTRY-}apix-dapr
restart: always
command: [
"./daprd",
"-app-id", "apix-dapr",
"-app-port", "8080",
"-app-protocol", "http",
"-components-path", "/DaprComponents",
"-log-level", "debug"
]
volumes:
- "./DaprComponents/:/DaprComponents"
depends_on:
- redis
- api-x
network_mode: "service:api-x"