Skip to content

Instantly share code, notes, and snippets.

View arunksingh16's full-sized avatar
🏠
Working from home

Arun K Singh arunksingh16

🏠
Working from home
View GitHub Profile
trigger:
- main
jobs:
- job: Build
steps:
- checkout: none
- script: |
touch textfile
echo Building > textfile
#############################################################################
# TERRAFORM PROVIDERS
#############################################################################
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 2.0"
}
Name = "apparm-sample-profile"
[Filesystem]
# read only paths for the container
ReadOnlyPaths = [
"/bin/**",
"/boot/**",
"/dev/**",
"/var/**",
]
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: flaskvirtualservice
spec:
hosts:
- "flask.example.com" # destination hosts to which traffic is being sent. The hosts field applies to both HTTP and TCP services
gateways:
- flask-gateway
http:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: flaskvirtualservice
spec:
hosts:
- "flask.example.com" # destination hosts to which traffic is being sent. The hosts field applies to both HTTP and TCP services
gateways:
- flask-gateway
http:
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: flask-gateway
spec:
selector:
istio: ingressgateway # use Istio default gateway implementation
servers:
- port:
number: 80
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
cat <<EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
EOF
sudo apt-get -y update
sudo apt-get install -y kubelet kubeadm kubectl
sudo kubeadm config images pull
kubeadm init --pod-network-cidr=192.168.0.0/16
- stage: TERRAFORM_DESTROY
condition: and(eq('${{ parameters.actionToPerform }}', 'Destroy'), eq(variables.isMain, true))
displayName: TERRAFORM_DESTROY
jobs:
- deployment: Remove_VNET
displayName: Destroy Using Terraform
timeoutInMinutes: 30
environment: '${{ parameters.envName }}'
strategy:
runOnce:
RESOURCE_GROUP_NAME=rg-terraform
STORAGE_ACCOUNT_NAME=tf-poc
CONTAINER_NAME=terraform
# Create resource group
az group create --name $RESOURCE_GROUP_NAME --location eastus
# Create storage account
az storage account create --resource-group $RESOURCE_GROUP_NAME --name $STORAGE_ACCOUNT_NAME --sku Standard_LRS --encryption-services blob
stages:
- stage: TERRAFORM_RUN
condition: and(eq('${{ parameters.actionToPerform }}', 'Deploy'), eq(variables.isMain, true))
displayName: TERRAFORM_RUN
jobs:
- deployment: VNET_Deployment
displayName: VNET Deployment Using Terraform
timeoutInMinutes: 30
environment: '${{ parameters.envName }}'