Updating the Helm files

We are going to switch the microservice deployment from using the local Kafka instance to using the Azure-hosted, Kafka-compatible Event Hub instance:

  1. First, let's delete the local deployment:
helm del --purge social-network
  1. Modify the ./deployment/helm/user-service/templates/deployment.yaml file to change line 32 until the name: SPRING_PROFILES_ACTIVE line:
            - name: SPRING_CLOUD_STREAM_KAFKA_BINDER_BROKERS
value: "<your eventhub name>.servicebus.windows.net:9093"
- name: SPRING_CLOUD_STREAM_KAFKA_BINDER_DEFAULT_BROKER_PORT
value: "9093"
- name: SPRING_CLOUD_STREAM_KAFKA_BINDER_CONFIGURATION_SECURITY_PROTOCOL
value: "SASL_SSL"
- name: SPRING_CLOUD_STREAM_KAFKA_BINDER_CONFIGURATION_SASL_MECHANISM
value: "PLAIN"
- name: SPRING_CLOUD_STREAM_KAFKA_BINDER_CONFIGURATION_SASL_JAAS_CONFIG
value: 'org.apache.kafka.common.security.plain.PlainLoginModule required username="$ConnectionString" password="Endpoint=sb://<youreventhub name>... copy the entire connection string that you copied from azure portal'

The modified file will have a section that is similar to the following:

 - name: SPRING_CLOUD_STREAM_KAFKA_BINDER_BROKERS
value: "myhandsonaks.servicebus.windows.net:9093"
- name: SPRING_CLOUD_STREAM_KAFKA_BINDER_DEFAULT_BROKER_PORT
value: "9093"
- name: SPRING_CLOUD_STREAM_KAFKA_BINDER_CONFIGURATION_SECURITY_PROTOCOL
value: "SASL_SSL"
- name: SPRING_CLOUD_STREAM_KAFKA_BINDER_CONFIGURATION_SASL_MECHANISM
value: "PLAIN"
- name: SPRING_CLOUD_STREAM_KAFKA_BINDER_CONFIGURATION_SASL_JAAS_CONFIG
value: 'org.apache.kafka.common.security.plain.PlainLoginModule required username="$ConnectionString" password="Endpoint=sb://handsonaks-serverless.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=eJ7l5CMBiBnL5gsELsWjWZ4W+liOgXIUH4Pj2wFJugI="
  1. The same changes have to be made to the following files:
./deployment/helm/friend-service/templates/deployment.yaml
./deployment/helm/recommendation-service/templates/deployment.yaml
  1. Disable the Kafka deployment by setting the enabled: value to false in deployment/helm/social-network/values.yaml:
nameOverride: social-network
fullNameOverride: social-network

kafka:
enabled: false
  1. Run the deployment as follows:
helm install --namespace social-network --name social-network --set fullNameOverride=social-network   deployment/helm/social-network
  1. Wait for all the pods to be up, and then run the following command to verify that the install worked:
# port forward the service locally
kubectl --namespace social-network port-forward svc/edge-service 9000 &
# Generates a 15 person social network using serial API calls
bash ./deployment/sbin/generate-serial.sh
  1. You can see the activity on the Azure portal in the following screenshot:

Clicking on the friend Event Hub and then Metrics, we can see the number of messages that came through and how many came over time (you have to Add the Incoming Messages metric with the EntityName = 'friend' filter), as shown in the following screenshot:

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

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