twitter-sentiment

by nghiattr

Helm chartv0.1.0Verified publisher

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.

ParameterDescriptionDefault
twitterSecretNameTwitter API consumer secret.twitter-api
consumerKeyTwitter API consumer key.control
burstNconsumerSecretodeTwitter API consumer secret.null
accessTokenTwitter API access token.null
accessTokenSecretTwitter API access token secret.null
filterTextText to analyze.Seattle
planAzure Text Analytics tier.standard-b1
resourceGroupAzure 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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the charttwitter-sentiment is pinned at v0.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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