Skip to content

Instantly share code, notes, and snippets.

View janakiramm's full-sized avatar

Janakiram MSV janakiramm

View GitHub Profile
@janakiramm
janakiramm / azuredeploy.json
Last active August 26, 2017 14:34
ARM Template to Deploy ACI Container
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"variables": {
"containerName": "",
"containerImage": "",
"imageRegistryLoginServer":"",
"imageRegistryUsername":"",
"imageRegistryPassword":"",
"dbConnectionString" : ""
export LOC=eastus
export RG=todoapp
export DB=tododb0708
export REG=todoacr
# Test the app locally
docker run -d --name db mongo
docker run -d -p 80:3000 --link db:db --name todo janakiramm/todo
az group create --name myResourceGroup --location westus
az container create --name mycontainer --image nginx --resource-group myResourceGroup --ip-address public
@janakiramm
janakiramm / web.yaml
Created August 26, 2017 16:36
Pod Definition to Create ACI Instance
apiVersion: v1
kind: Pod
metadata:
name: web
labels:
name: web
app: todoapp
spec:
containers:
- image: janakiramm/todo
@janakiramm
janakiramm / gke-aci-demo.sh
Created August 26, 2017 16:51
Script to deploy an app in Azure Container Instances through the Kubernetes cluster running in Google Container Engine
# Configure GKE
gcloud container clusters create gke-aci --zone us-west1-a
gcloud container clusters get-credentials gke-aci --zone us-west1-a
kubectl get nodes
# Create an Azure Resource Group & Service Principal
az group create --name gke-aci --location westus
az account list -o table
az ad sp create-for-rbac --role=Contributor --scopes /subscriptions/<subscriptionId>/resourceGroups/gke-aci
az provider register -n Microsoft.ContainerInstance
apiVersion: v1
kind: Service
metadata:
name: myapp
labels:
app: myapp
spec:
type: ClusterIP
ports:
- port: 80
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: app-gateway
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
import numpy as np, cv2, sys
import memcache
import time
sys.path.append('../../../')
from hsapi import ObjectDetector
from grovepi import *
from twilio.rest import Client
@janakiramm
janakiramm / lifx_gcf.js
Created February 21, 2019 04:37
Google Cloud Function to Control LiFX Smart Bulb
exports.bulb = (event, callback) => {
const https = require('https')
// Access the payload
const msg = event.data;
const data = Buffer.from(msg.data, 'base64').toString();
const token = 'Bearer <put your LiFX API token here>'
console.log(data);
cat <<EOF | sudo tee /etc/rancher/rke2/config.yaml
kube-controller-manager-arg:
- "cluster-signing-legacy-unknown-cert-file=/var/lib/rancher/rke2/server/tls/server-ca.crt"
- "cluster-signing-legacy-unknown-key-file=/var/lib/rancher/rke2/server/tls/server-ca.key"
write-kubeconfig-mode: "0644"
write-kubeconfig: "/root/.kube/config"
cni: "calico"
tls-san:
- triton
- 10.148.0.60