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
@kasunsjc
kasunsjc / LogReader.yaml
Created April 1, 2019 08:07
AKS Log Reader Permission
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: containerHealth-log-reader
rules:
- apiGroups: [""]
resources: ["pods/log"]
verbs: ["get"]
---
apiVersion: rbac.authorization.k8s.io/v1
@kasunsjc
kasunsjc / DeployRancherARM.azcli
Last active May 2, 2019 04:41
Rancher-Node Server
#.azcli used in VS Code to create Azure CLI Scripts
#Create Resource Group
az group create --location southeastasia --resource-group Rancher-rg
az group deployment create --resource-group Rancher-rg --mode Incremental --name Rancher-deployment --template-file RancherVM.json --parameters RencherVM-Parameters.json --verbose
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"UbuntuVMPIPName": {
"type": "string",
"defaultValue": "ubuntu-pip",
"metadata": {
"description": "Name of the Linux VM Public IP"
}
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"VMName": {
"value": "Rancher"
},
"UbuntuVMPIPName": {
"value": "ubuntu-pip"
@kasunsjc
kasunsjc / win-container-sampleapp.yaml
Created May 19, 2019 05:26
Windows Container Sample App -AKS
apiVersion: apps/v1
kind: Deployment
metadata:
name: sample
labels:
app: sample
spec:
replicas: 1
template:
metadata:
"resources": [
{
"name": "windowsVM1AzureDiagnostics",
"type": "extensions",
"apiVersion": "2017-03-30",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "windowsVM1AzureDiagnostics"
},
"dependsOn": [
{
"apiVersion": "[variables('apiVersion').oms]",
"type": "Microsoft.OperationalInsights/workspaces",
"name": "[parameters('omsWorkspaceName')]",
"location": "[resourceGroup().location]",
"properties": {
"sku": {
"Name": "[parameters('omsServiceTier')]"
},
"retention": "[parameters('omsDataRetention')]"
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"StorageAccountName": {
"type": "string",
"defaultValue": "azureupdate3442",
"metadata": {
"description": "Storage Account Name"
}
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"StorageAccountName":{
"value": "updatemgt3293"
},
"VMName":{
"value": "update-mgt"
},
#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)