Skip to content

Instantly share code, notes, and snippets.

View janakiramm's full-sized avatar

Janakiram MSV janakiramm

View GitHub Profile
az group create --name myResourceGroup --location westus
az container create --name mycontainer --image nginx --resource-group myResourceGroup --ip-address public
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 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" : ""
@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
@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);
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
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
# add RKE2 binaries to path
export PATH=$PATH:/var/lib/rancher/rke2/bin
echo "export PATH=$PATH:/var/lib/rancher/rke2/bin" >> ~/.bashrc
# copy RKE2 kubeconfig file to the default location
mkdir ~/.kube
cp /etc/rancher/rke2/rke2.yaml ~/.kube/config
chmod 600 ~/.kube/config
# verify the configuration