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
param webAppName string = uniqueString(resourceGroup().id) // Generate unique String for web app name
param sku string = 'S1' // The SKU of App Service Plan
param linuxFxVersion string = 'php|7.4' // The runtime stack of web app
param location string = resourceGroup().location // Location for all resources
var appServicePlanName = toLower('AppServicePlan-${webAppName}')
var webSiteName = toLower('wapp-${webAppName}')
resource appServicePlan 'Microsoft.Web/serverfarms@2020-06-01' = {
name: appServicePlanName
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-kubelinter
labels:
app: nginx
annotations:
ignore-check.kube-linter.io/unset-cpu-requirements : "not required"
ignore-check.kube-linter.io/unset-memory-requirements : "not required"
spec:
name: $(BuildDefinitionName)_$(date:yyyyMMdd)$(rev:.r)
trigger:
branches:
include:
- main
pool:
vmImage: 'ubuntu-latest'
apiVersion: apps/v1
kind: Deployment
metadata:
name: deploy-best-practice
namespace: kubelinter
annotations:
team: database
spec:
replicas: 1
minReadySeconds: 15
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-kubelinter
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
@kasunsjc
kasunsjc / ps-scpod-restored.yml
Last active March 7, 2022 17:11
Pod that use the restored pvc
apiVersion: v1
kind: Pod
metadata:
name: sc-pod-restore
labels:
app: stg-restored
spec:
volumes:
- name: htmlvol
persistentVolumeClaim:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-nginx-vol-restored
spec:
accessModes:
- ReadWriteOnce
storageClassName: managed-csi
resources:
requests:
@kasunsjc
kasunsjc / storage-csi-driver-pod.yaml
Created March 7, 2022 16:00
This pod is used for the storage volume backup demo
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-htmlvol
spec:
storageClassName: "default"
accessModes:
- ReadWriteOnce
resources:
requests:
@kasunsjc
kasunsjc / azure-disk-snapshot.yaml
Last active March 7, 2022 16:53
Create snapshot of the azure disk
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshot
metadata:
name: nginx-vol-snapshot
spec:
volumeSnapshotClassName: csi-azuredisk-vsc
source:
persistentVolumeClaimName: pvc-htmlvol
@kasunsjc
kasunsjc / VolumeSnapshotClass.yaml
Created March 7, 2022 15:48
Azure disk CSI driver create snapshot of the disks
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
name: csi-azuredisk-vsc
driver: disk.csi.azure.com
deletionPolicy: Delete
parameters:
incremental: "true"