Deploying Helm

First, we will deploy this service as is with the use of the local Kafka instance that acts as the event broker.

  1. On Azure Cloud Shell, type the following:
# original code forked from https://github.com/kbastani/event-sourcing-microservices-example.git
git clone https://github.com/gshiva/event-sourcing-microservices-example.git cd event-sourcing-microservices-example

  1. We will use Kafka and ZooKeeper charts from bitnami, so let's add the required helm repo:
helm repo add bitnami https://charts.bitnami.com
helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com
  1. Let's update the dependencies to make the dependent charts available:
helm dep update deployment/helm/social-network
helm dep update deployment/helm/friend-service
helm dep update deployment/helm/user-service
helm dep update deployment/helm/recommendation-service
  1. Next, deploy the microservices:
helm install --namespace social-network --name social-network --set fullNameOverride=social-network 
  deployment/helm/social-network
  1. Check the status of the deployment using the following command:
kubectl get pods -w -n social-network
  1. Wait for about 15-30 minutes until all of the services are up and running. This service does not implement any security, so we use local port forwarding to access the service:
kubectl --namespace social-network port-forward svc/edge-service 9000
  1. Test the services by running the following command:
# Generates a 15 person social network using serial API calls
sh ./deployment/sbin/generate-serial.sh

We have implemented a microservice-based application in a few commands. We have also seen how port forwarding helps in testing applications locally without having to log on to the nodes. The testing application script shows that even a distributed system can easily be tested, given some upfront work.

The next section, we will move away from storing events in the cluster and storing them in Azure Event Hub. By leveraging recently added Kafka support on Azure Event Hubs, and switching to using a more production-ready event store, we will see that the process is straightforward.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset