Skip to content

Instantly share code, notes, and snippets.

View kasunsjc's full-sized avatar
:octocat:
Focusing

Kasun Rajapakse kasunsjc

:octocat:
Focusing
View GitHub Profile
name: Deploy to AKS Cluster
on:
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
name: Flask Application
on:
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v1
#Login to Azure
az login
#Select the subscription
az account set -s "<SUB_NAME>"
#Create a Resource Group
az group create --location southeastasia --name "ACRBuild-RG"
#Create ACR
<#
* Author - Kasun Rajapakse
* Script - Get VMs Antimalware not installed
#>
#Get the subscriptions
Write-Host "Getting Subscription Details" -ForegroundColor "Yellow"
Get-AzSubscription | Where-Object {$PSItem.State -eq "Enabled"} | Export-Csv -Path .\subscriptions.csv
#Import the Subscriptions
Write-Host "Importing Subscriptions" -ForegroundColor "Yellow"
<#
* Author - Kasun Rajapakse
* Script - Get VMs Antimalware not installed
#>
#Get the subscriptions
Write-Host "Getting Subscription Details" -ForegroundColor "Yellow"
Get-AzSubscription | Where-Object {$PSItem.State -eq "Enabled"} | Export-Csv -Path .\subscriptions.csv
#Import the Subscriptions
Write-Host "Importing Subscriptions" -ForegroundColor "Yellow"
#Install the latest module
Install-Module -Name Az -Repository PSGallery
#Initialize the following with your resource group and storage account names
$rgname = "LifeCyclePolicy-RG"
$saAccountName = "lifecyclepolicysa"
$location = "southeastasia"
#Create Storage Account
New-AzResourceGroup -Name $rgname -Location $location -Verbose
#!/bin/bash
RG_NAME=TF-State-RG
SA_NAME=tfstatekasunsa
CONTAINER_NAME=tfstate
# Create resource group
az group create --name $RG_NAME --location eastus
# Create storage account
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: grafana-ingress
namespace: monitoring
annotations:
kubernetes.io/ingress.class: nginx
cert-manager.io/cluster-issuer: letsencrypt-prod
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
@kasunsjc
kasunsjc / cluster-issuer.yaml
Created January 9, 2020 03:48
Cert-Manager ClusterIssuer
apiVersion: cert-manager.io/v1alpha2
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
namespace: ingress-basic
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: <Email>
privateKeySecretRef:
#Create Resource Group
$ResourceGroup = (New-AzResourceGroup -Name VM-UpdateMgt -Location "Southeast Asia").ResourceGroupName
#Create ARM Deployment
New-AzResourceGroupDeployment -Name VM-UpdateMgt -ResourceGroupName $ResourceGroup -Mode Incremental -TemplateFile ./azuredeploy.json -TemplateParameterFile ./azuredeploy-parm.json -Verbose
#Configure Update Management
$duration = New-TimeSpan -Hours 2
$StartTime = (Get-Date "02:00:00").AddDays(5)