Skip to content

Instantly share code, notes, and snippets.

View lenadroid's full-sized avatar

Lena lenadroid

View GitHub Profile
@lenadroid
lenadroid / create-kafka.sh
Last active April 13, 2018 00:04
ARM template deployment for HDInsight Kafka cluster in a virtual network
export RESOURCE_GROUP_NAME="..."
export REGION="West US"
az group create --name $RESOURCE_GROUP_NAME --location "$REGION"
az group deployment create --resource-group $RESOURCE_GROUP_NAME --template-file kafka.json --parameters @kafka-params.json
export TOPIC_NAME="tweets"
export ZOOKEEPER_SERVERS="your comma separated zookeeper servers"
/usr/hdp/current/kafka-broker/bin/kafka-topics.sh --create --replication-factor 3 --partitions 4 --topic $TOPIC_NAME --zookeeper $ZOOKEEPER_SERVERS
@lenadroid
lenadroid / get-kafka-and-zookeeper-hosts.sh
Last active April 5, 2018 22:48
Script to run to get Kafka and Zookeeper node hostnames
# Set cluster variables
export KAFKA_USERNAME="..."
export KAFKA_PASSWORD="..."
export KAFKA_CLUSTERNAME="..."
# Get Kafka broker hostnames
export KAFKA_BROKERS=$(curl -u $KAFKA_USERNAME:$KAFKA_PASSWORD -G "https://$KAFKA_CLUSTERNAME.azurehdinsight.net/api/v1/clusters/$KAFKA_CLUSTERNAME/services/KAFKA/components/KAFKA_BROKER" | jq -r '["\(.host_components[].HostRoles.host_name):9092"] | join(",")')
echo $KAFKA_BROKERS
# Get Zookeeper node hostnames
@lenadroid
lenadroid / kube-az.tf
Created February 23, 2018 21:33
Managed Kubernetes Service Terraform
resource "azurerm_resource_group" "KubeTerraform" {
name = "${var.rg_name}"
location = "${var.region}"
}
resource "azurerm_kubernetes_cluster" "KubeTerraform" {
name = "${var.cluster_name}"
location = "${azurerm_resource_group.KubeTerraform.location}"
resource_group_name = "${azurerm_resource_group.KubeTerraform.name}"
kubernetes_version = "1.8.2"
@lenadroid
lenadroid / fsharp-job.json
Created November 15, 2017 22:39
Job Definition
apiVersion: batch/v1
kind: Job
metadata:
name: "process-item-$START"
labels:
jobgroup: fsharpjob
spec:
template:
metadata:
name: fsharpjob
@lenadroid
lenadroid / Dockerfile
Last active January 12, 2018 20:06
Example F# Job template for Kubernetes
FROM fsharp
COPY . .
RUN mono ./.paket/paket.bootstrapper.exe
RUN mono ./.paket/paket.exe restore
RUN mono .paket/paket.exe install
@lenadroid
lenadroid / kube-az.tf
Last active November 10, 2017 03:42
ACS Kubernetes Terraform
resource "azurerm_resource_group" "KubeTerraform" {
name = "${var.rg_name}"
location = "East US"
}
resource "azurerm_container_service" "KubeTerraform" {
name = "${var.kube_cluster_name}"
location = "${azurerm_resource_group.KubeTerraform.location}"
resource_group_name = "${azurerm_resource_group.KubeTerraform.name}"
orchestration_platform = "Kubernetes"
@lenadroid
lenadroid / kube-deploy.parameters.json
Last active October 23, 2018 15:08
AKS managed Kubernetes cluster with Azure Resource Manager
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"dnsNamePrefix": {
"value": "<your value>"
},
"sshRSAPublicKey": {
"value": "<your value>"
},
@lenadroid
lenadroid / pdxfood
Created May 23, 2017 04:02
Awesome #PDX food places
Downtown/West Portland:
Seres Restaurant and Bar (Chinese)
Andina
The Original Dinerant (Breakfast)
Masu Sushi
Bamboo Sushi SW
Thai Peacock Restaurant
Pine State Biscuits
Urban Farmer Portland
Portland City Grill
// Lists all processes of the runtime with their statuses, execution time, etc.
runtime.ShowProcesses()
// Lists all cluster machines with the info for CPU, memory, network usage, etc.
runtime.ShowWorkers()
// Gets runtime logs as an array of LogRecords
runtime.GetLogs()
// Attaches specified logger to the runtime