Skip to content

Instantly share code, notes, and snippets.

View brusMX's full-sized avatar

Bruno brusMX

View GitHub Profile
@brusMX
brusMX / obtainAzureSP.sh
Last active November 17, 2017 00:37
Interactive command to obtain an Azure Service Principal. Requires Azure CLI 2.0 and jq-1.5
#!/bin/bash
# Interactively create an Azure Service Principal for any of your subscriptions
# Author: Bruno Medina (@brusmx)
# Requirements:
# - Azure Cli 2.0
# - jq-1.5
#
# Example of usage:
# ./obtainSP.sh
ROLE="Contributor"
@brusMX
brusMX / create-managed-1-7-k8s-cluster.sh
Last active September 14, 2017 16:43
These are a set of instructions to deploy a Kubernetes cluster to Azure with ACS-Engine. K8s v 1.7 and managed disks
#!/bin/bash
# NOT A SCRIPT
# Commands to deploy Kubernetes cluster with k8s 1.7 and managed disks
# Author: Bruno Medina (@brusmx)
# Requirements:
# - Azure Cli 2.0 (Using 2.0.16)
# - jq (Using 1.5)
# - acs-engine (using release acs-engine-v0.6.0-darwin-amd64 | MD5 checksum(acs-engine-v0.6.0-darwin-amd64/acs-engine) = b124d5ca90dcf5bdd0d9da5699ba776b )
# - managed-disks-cluster.json most be at the same level of this
@brusMX
brusMX / create-hybrid-vnet.sh
Created September 13, 2017 23:25
Script that uses the Azure CLI 2.0 to deploy two vnets in two regions, it sets up a gateway between them to communicate and set up a VPN
#!/bin/bash
# Interactively create an Azure Service Principal for any of your subscriptions
# Author: Bruno Medina (@brusmx)
# Requirements:
# - Azure Cli 2.0
#
# Example of usage:
# sh create-hybrid-vnet.sh
# Making sure it's connected
#!/bin/bash
# Interactively create an Azure Container service with kubernetes and custom Agent pools
# Author: Bruno Medina (@brusmx)
# Requirements:
# - Azure Cli 2.0
# - jq
#
# Example of usage:
# ./create-acs-k8s-custom-agent-pools.sh
@brusMX
brusMX / getAzureServicePrincipal.sh
Created January 6, 2018 00:51
Obtain a Service Principal in bash using the Azure Cli 2.0
#!/bin/bash
# Interactively create an Azure Service Principal for any of your subscriptions
# Author: Bruno Medina (@brusmx)
# Requirements:
# - Azure Cli 2.0
#
# Example of usage:
# chmod +x obtainSP.sh
# ./obtainSP.sh
echo "Obtain a Service Principal for one of your Azure Subscriptions."
@brusMX
brusMX / getAzureServicePrincipal.sh
Created January 6, 2018 00:51
Obtain a Service Principal in bash using the Azure Cli 2.0
#!/bin/bash
# Interactively create an Azure Service Principal for any of your subscriptions
# Author: Bruno Medina (@brusmx)
# Requirements:
# - Azure Cli 2.0
#
# Example of usage:
# chmod +x obtainSP.sh
# ./obtainSP.sh
echo "Obtain a Service Principal for one of your Azure Subscriptions."
+ source /opt/azure/containers/provision_source.sh
++ cat /etc/lsb-release /etc/os-release
++ awk '{print toupper($0)}'
++ tr -d 'ID="'
++ grep '^ID='
+ OS=UBUNTU
+ UBUNTU_OS_NAME=UBUNTU
+ RHEL_OS_NAME=RHEL
+ COREOS_OS_NAME=COREOS
+ KUBECTL=/usr/local/bin/kubectl
apiVersion: v1
kind: Service
metadata:
name: win-webserver
labels:
app: win-webserver
spec:
ports:
# the port that this service should serve on
- port: 80
.vscode
.env
*.env
*.env.BACKUP
*.env.BACKUP*
job.json
job-prep.sh
*.zip
@brusMX
brusMX / export-all.sh
Last active July 27, 2018 21:28
test export vars
#!/bin/bash
# Check if all the variables are there to execute:
# https://raw.githubusercontent.com/Microsoft/openshift-container-platform/master/scripts/deployOpenShift.sh
export SUDOUSER=$1
export PASSWORD="$2"
export MASTER=$3
export MASTERPUBLICIPHOSTNAME=$4
export MASTERPUBLICIPADDRESS=$5
export INFRA=$6
export NODE=$7