Quickstart
This guide is the quickest way to get started and experience Conductor and takes approximately 10 minutes. You will create a local Kubernetes cluster, install Dapr and Conductor, deploy a sample application, and troubleshoot a simulated infrastructure failure.
Prerequisites
Review the complete list of Conductor requirements for various configurations. This quickstart requires the following:
- A Conductor Free account.
- Kubernetes command-line tool kubectl.
- Helm or Dapr CLI to deploy the sample application from GitHub.
1. Create a Kubernetes cluster
Conductor is compatible with Minikube, Kind, and most other Kubernetes distributions. Follow the respective installation guide suitable for your operating system and hardware architecture. This guide demonstrates the installation and configuration for Kind and Minikube on MacOS.
- Minikube
- Kind
Refer to Minikube for installation instructions across various environments. To install Minikube on MacOS using Homebrew, execute:
brew install minikube
After installation, start a local Kubernetes cluster using Minikube. The default configuration allocates 2 CPUs and 2GB of memory, which is sufficient to run everything in this quickstart.
minikube start
Verify that Kubernetes is operational with:
minikube status
Refer to Kind for installation instructions across different environments. To install Kind on MacOS using Homebrew, execute:
brew install kind
After installation, create a Kubernetes cluster including a control plane and two worker nodes, with exposed container ports to the host machine:
kind create cluster --name conductor-quickstart --config=
<(echo "
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
extraPortMappings:
- containerPort: 80
hostPort: 8081
protocol: TCP
- containerPort: 443
hostPort: 8443
protocol: TCP
- role: worker
- role: worker
")
Verify that Kubernetes is operational with:
kind get clusters
Conductor depends on metrics server, which is pre-installed on some managed Kubernetes distributions. In this quickstart, the metrics server will be installed using Conductor.
2. Create a Cluster Connection
If you do not have a Conductor account, first sign up for Conductor Free. Log in to the Conductor console to create your first cluster connection.
-
Name your cluster connection and select
Local (MiniKube, Kind, Docker Desktop)
as the Kubernetes distribution. -
Choose
Install prerequisites
to install the metrics server. -
Choose
Install Dapr
to install the latest version of Dapr control plane with recommended settings for local development. Alternatively, you can install Dapr into Kubernetes using Dapr CLI as part of the sample application dependencies installation later. -
Press
Create
to generate the Kubernetes manifests required for installing the Conductor agent and the selected Dapr configuration on the cluster.
3. Install Conductor Agent
The quickest way to install the Conductor Agent on your Kubernetes cluster is to copy and apply the generated manifest:
Copy
the generated command and execute it locally with kubectl
:
kubectl apply -f "YOUR_UNIQUE_CLUSTER_CONNECTION_TOKEN"
This installs the Conductor agent and links it to your Conductor cluster connection. The agent status in the Conductor console will switch from Offline
to Online
, and the Dapr control plane will display Healthy
.
4. Run a Sample Dapr Application
With Conductor connected to Kubernetes, you're ready to run a Daprized application. We will deploy a straightforward distributed application from the Hello Kubernetes tutorial by the Dapr project. This application includes a Python App that generates messages and a Node App that saves these messages into a Redis state store. To streamline the deployment process, the conductor-quickstart repository will be used. This repo contains the necessary deployment and configuration files to install the Dapr applications.
Install Dapr and Redis
We will explore two methods to install Dapr and Redis on Kubernetes, using either Conductor and Helm, or Dapr CLI alone.
- Helm
- Dapr CLI
If you enabled Dapr installation while creating a Conductor cluster connection, the Dapr control plane should already be installed on Kubernetes. To deploy a Redis instance for development purposes, use the following Helm commands:
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm install redis bitnami/redis --set cluster.enabled=false --set replica.replicaCount=0 --set fullnameOverride=dapr-dev-redis
This command installs a single-container Redis cluster named dapr-dev-redis
to align with the component and secret references in the sample application.
This option is feasible if you have NOT opted to install Dapr during the Conductor cluster connection creation. Dapr CLI can install Redis only together with Dapr. Execute:
dapr init -k --dev
This command installs Dapr, a clustered Redis instance comprising 4 containers, Zipkin, and applies the Dapr component configuration.
Deploy the Sample Application
With Dapr and Redis installed, you can now deploy the sample application. You can directly apply it onto the cluster from GitHub or clone the application repository and apply it locally.
- From Remote
- From Local
Apply Kubernetes resources directly from the remote GitHub repository.
kubectl apply -f https://raw.githubusercontent.com/diagrid-labs/conductor-quickstart/main/deploy.yaml
Clone the conductor-quickstart
repository and apply the Kubernetes resources locally.
git clone git@github.com:diagrid-labs/conductor-quickstart.git
cd conductor-quickstart
kubectl apply -f deploy.yaml
This deployment creates pythonapp
and nodeapp
Deployments, along with a Service for nodeapp
, and configures a Dapr statestore component as well as a resiliency policy.
To monitor the initialization of the applications, navigate to the Applications tab in the Conductor console after selecting the appropriate cluster connection.
Verify that the components are initialized successfully using the Initialization Status
and check the resiliency policy remains inactive on the Resiliency tab.
The advisor panel displays potential improvements for your application. For a real-time view of the application's network topology, click on Apps Graph
on the Applications page.
Troubleshoot a Failure
To simulate an infrastructure failure, scale down the Redis instances to zero.
kubectl scale statefulset dapr-dev-redis-master --replicas=0
In Conductor, observe the failure through various indicators:
- The Component List will display the
statestore
component'sInitialization Status
asError
after scaling down. - The
nodeapp
application's component metrics graphs will show an increase in error rates. - The resiliency policy will activate and the retry rates will start increasing.
- After a few minutes, there will be issues detected based on
App Component Error Rate
andHTTP Error Rate
metrics. - The
Apps Graph
will highlight the erroneous component and its impact on the dependent applications.
To restore the application, scale the Redis instance back up to one.
kubectl scale statefulset dapr-dev-redis-master --replicas=1
Next steps
You are now equipped to use Conductor for automating Dapr management and improving insights into your Dapr Kubernetes workloads. For further exploration of Conductor features and to visualize additional failure scenarios, consider installing the Pizza Store System.