Skip to content

Instantly share code, notes, and snippets.

Avatar

Janakiram MSV janakiramm

View GitHub Profile
View aci.sh
az group create --name myResourceGroup --location westus
az container create --name mycontainer --image nginx --resource-group myResourceGroup --ip-address public
View aci-demo.sh
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
@janakiramm
janakiramm / azuredeploy.json
Last active Aug 26, 2017
ARM Template to Deploy ACI Container
View azuredeploy.json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"variables": {
"containerName": "",
"containerImage": "",
"imageRegistryLoginServer":"",
"imageRegistryUsername":"",
"imageRegistryPassword":"",
"dbConnectionString" : ""
@janakiramm
janakiramm / web.yaml
Created Aug 26, 2017
Pod Definition to Create ACI Instance
View web.yaml
apiVersion: v1
kind: Pod
metadata:
name: web
labels:
name: web
app: todoapp
spec:
containers:
- image: janakiramm/todo
@janakiramm
janakiramm / gke-aci-demo.sh
Created Aug 26, 2017
Script to deploy an app in Azure Container Instances through the Kubernetes cluster running in Google Container Engine
View gke-aci-demo.sh
# 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
@janakiramm
janakiramm / lifx_gcf.js
Created Feb 21, 2019
Google Cloud Function to Control LiFX Smart Bulb
View lifx_gcf.js
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);
View app-gateway.yaml
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: app-gateway
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
View vehicle.py
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
View myapp.yaml
apiVersion: v1
kind: Service
metadata:
name: myapp
labels:
app: myapp
spec:
type: ClusterIP
ports:
- port: 80
View install-rke2.sh
curl -sfL https://get.rke2.io --output install.sh
chmod +x install.sh
./install.sh
# Enable and activate RKE2 server
systemctl enable rke2-server.service
systemctl start rke2-server.service