MongoDB
You can run MongoDB locally using Docker:
You can then interact with the server using .
The easiest way to install MongoDB on Kubernetes is by using the :
This will install MongoDB into the default
namespace. To interact with MongoDB, find the service with: kubectl get svc mongo-mongodb
.
Follow the on-screen instructions to get the root password for MongoDB. The username will be admin
by default.
The next step is to create a Dapr component for MongoDB.
Create the following YAML file named mongodb.yaml
:
Warning
The following example uses the Kubernetes secret store to retrieve the username and password:
To apply the MondoDB state store to Kubernetes, use the CLI:
To run locally, create a components
dir containing the YAML file and provide the path to the dapr run
command with the flag .