Skip to content

Instantly share code, notes, and snippets.

@MattMencel
MattMencel / aks.sh
Last active March 26, 2018 14:43
Setup Azure AKS
# Create Resource Group
az group create --name k8s --location eastus
# Register container service if not already done
az provider register -n Microsoft.ContainerService
# Create AKS Cluster
az aks create -n k8s-cluster -g k8s -c 2 -k 1.9.2 --generate-ssh-keys -l eastus --service-principal SERVICE_PRINCIPAL --client-secret CLIENT_SECRET
# Get kubectl credentials

Keybase proof

I hereby claim:

  • I am mattmencel on github.
  • I am mattmencel (https://keybase.io/mattmencel) on keybase.
  • I have a public key ASAX5N5kGMWuDCU0j85TI3vIU7T1CeIKoE-rV3s8djpffQo

To claim this, I am signing this object:

@MattMencel
MattMencel / aks-cluster-autoscale-pipeline.yaml
Created November 13, 2018 13:38
Cluster Autoscaler ADO Build Pipeline
resources:
- repo: self
queue:
name: Hosted Windows Container
steps:
- task: AzureKeyVault@1
displayName: 'Azure Key Vault: MYKEYVAULT'
inputs:
azureSubscription: 'My Sub'
@MattMencel
MattMencel / azure-pipelines.yml
Last active January 9, 2019 20:36
Terraform Plans with Azure DevOps - Part 1
name: $(BuildDefinitionName).$(DayOfYear)$(Rev:.r)
resources:
repositories:
- repository: Templates
type: git
name: Templates
pool:
name: Terraform Agents
trigger:
batch: true
@MattMencel
MattMencel / DEV-TF-plan.yml
Last active February 13, 2019 14:22
Terraform Plans with Azure DevOps - Part 2
steps:
- task: JamiePhillips.Terraform.TerraformTool.TerraformTool@0
displayName: 'Use Terraform $(terraform.version)'
inputs:
version: '$(terraform.version)'
- script: |
az login --service-principal -u $(SPN-ID) -p $(SPN-SECRET) --tenant $(TENANT-ID)
ACCESS_KEY=`az storage account keys list -n $(STORAGE_ACCT) -o json | jq -r '.[0].value'`
echo "##vso[task.setvariable variable=ACCESS_KEY]$ACCESS_KEY"
@MattMencel
MattMencel / azure-deploy-vsts.yml
Created January 7, 2019 21:34
Deploy VSTS Agent to AKS Cluster with Helm
resources:
- repo: self
clean: true
queue:
name: Hosted Ubuntu 1604
trigger:
batch: true
branches:
include:
- master
@MattMencel
MattMencel / Publish-Terraform-Artifact.yml
Created January 9, 2019 20:37
Publish Terraform Artifact Template
steps:
- script: |
echo "Compressing $(terraform.path) directory..."
tar -czf $(state.key).tar.gz -C $(terraform.path) .
displayName: 'Compress $(terraform.path) Artifact'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: $(state.key).tfplan'
inputs:
PathtoPublish: '$(state.key).tar.gz'
@MattMencel
MattMencel / init.fish
Created January 30, 2019 16:30
Fish Shell Config
#~/.config/omf/init.fish
set -g theme_display_k8s_context yes
set -g theme_display_ruby no
set -g theme_display_user yes
set -g theme_display_hostname yes
set -g theme_powerline_fonts no
set -g theme_nerd_fonts yes
set -g theme_newline_cursor yes
@MattMencel
MattMencel / disk_response.json
Last active March 19, 2019 18:11
Azure API Compute Resource SKU Responses
{
"resourceType": "disks",
"name": "Standard_LRS",
"tier": "Standard",
"size": "S4",
"locations": [
"centralus"
],
"locationInfo": [
{