twitter-sentiment
by nghiattr
A Helm chart for Kubernetes
About this chart
Twitter sentiment with OSBA
Multi container / managed service application deployed using Helm chart, Kubernetes service catalog, and Open Service Broker for Azure.
Prerequisites
Kubernetes cluster with Helm installed.
Install service catalog:
helm repo add svc-cat https://svc-catalog-charts.storage.googleapis.com
helm install svc-cat/catalog --name catalog --namespace catalog --set controllerManager.healthcheck.enabled=false
If on a non-RBAC enabled cluster, run:
helm install svc-cat/catalog --name catalog --namespace catalog --set rbacEnable=false --set controllerManager.healthcheck.enabled=false
Azure Identity
Generate Azure identity, requires the Azure CLI:
SERVICE_PRINCIPAL=$(az ad sp create-for-rbac)
AZURE_CLIENT_ID=$(echo $SERVICE_PRINCIPAL | cut -d '"' -f 4)
AZURE_CLIENT_SECRET=$(echo $SERVICE_PRINCIPAL | cut -d '"' -f 16)
AZURE_TENANT_ID=$(echo $SERVICE_PRINCIPAL | cut -d '"' -f 20)
AZURE_SUBSCRIPTION_ID=$(az account show --query id --output tsv)
Install the Open Service Broker for Azure
This installs a fork of the Open Service broker for Azure. A PR is in place to have Text Analytics added as an OSBA package.
helm repo add azure https://kubernetescharts.blob.core.windows.net/azure
helm install azure/open-service-broker-azure --name osba --namespace osba \
--set azure.subscriptionId=$AZURE_SUBSCRIPTION_ID \
--set azure.tenantId=$AZURE_TENANT_ID \
--set azure.clientId=$AZURE_CLIENT_ID \
--set azure.clientSecret=$AZURE_CLIENT_SECRET \
--set modules.minStability=experimental \
--set image.repository=neilpeterson/osba-updated \
--set image.tag=latest
Installing the Chart
Install the Twitter sentiment chart.
helm install azure-samples/twitter-sentiment --set consumerKey=<> --set consumerSecret=<> --set accessToken=<> --set accessTokenSecret=<>
Configuration
The following table lists the configurable parameters of the azure-vote chart and the default values.
| Parameter | Description | Default |
|---|---|---|
| twitterSecretName | Twitter API consumer secret. | twitter-api |
| consumerKey | Twitter API consumer key. | control |
| burstNconsumerSecretode | Twitter API consumer secret. | null |
| accessToken | Twitter API access token. | null |
| accessTokenSecret | Twitter API access token secret. | null |
| filterText | Text to analyze. | Seattle |
| plan | Azure Text Analytics tier. | standard-b1 |
| resourceGroup | Azure resource group where all services are created. | twitter-sentiment |
Deploy twitter-sentiment with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has twitter-sentiment on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the charttwitter-sentiment is pinned at v0.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply