Skip to content

Commit e89d794

Browse files
authored
Merge pull request #149 from EventTriangle/AZ400-331
AZ400-331. Implement Prometheus and Grafana monitoring for Event Triangle
2 parents 391414f + 6fc2a30 commit e89d794

File tree

45 files changed

+262
-191
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+262
-191
lines changed

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
* text=auto eol=lf
22
*.html linguist-detectable=false
33
*.cshtml linguist-detectable=false
4-
*.htm linguist-detectable=false
4+
*.htm linguist-detectable=false
5+
*.razor linguist-detectable=false

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@ and this project adheres to [Semantic Versioning v2.0.0](https://semver.org/spec
2626
- Configure CD with AKS and HELM
2727
- Helm deploy powershell script
2828
- Move ingress and certificates to HELM chart
29+
- Install Prometheus Grafana Alert manager using HELM
30+
- Configure ingress for Prometheus Grafana Alert manager
31+
- Fix encoding
32+
- Merge plan and plan-destroy terraform pipelines

EventTriangleAPI.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.0.31903.59

build/templates/helm-deploy-jobs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
parameters:
1+
parameters:
22
- name: chartName
33
type: string
44

build/templates/terraform-apply-stages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ stages:
102102
-backend-config="storage_account_name=$env:TF_STATE_BLOB_ACCOUNT_NAME" `
103103
-backend-config="container_name=$env:TF_STATE_BLOB_CONTAINER_NAME" `
104104
-backend-config="key=$env:TF_STATE_BLOB_FILE" `
105-
-backend-config="sas_token=$env:TF_STATE_BLOB_SAS_TOKEN"
105+
-backend-config="sas_token=$env:TF_STATE_BLOB_SAS_TOKEN" -reconfigure -upgrade
106106
displayName: 'Terraform Init'
107107
workingDirectory: ${{ parameters.workingDirectory }}
108108
env:

build/templates/terraform-plan-destroy-stages.yml

Lines changed: 0 additions & 125 deletions
This file was deleted.

build/templates/terraform-plan-stages.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ parameters:
5454
displayName: 'Azure Tenant Id'
5555
type: string
5656

57+
- name: destroy
58+
displayName: 'Should destroy infrastructure'
59+
type: boolean
60+
5761
stages:
5862
- stage: ${{ parameters.stageName }}
5963
displayName: ${{ parameters.stageName }}
@@ -93,7 +97,7 @@ stages:
9397
-backend-config="storage_account_name=$env:TF_STATE_BLOB_ACCOUNT_NAME" `
9498
-backend-config="container_name=$env:TF_STATE_BLOB_CONTAINER_NAME" `
9599
-backend-config="key=$env:TF_STATE_BLOB_FILE" `
96-
-backend-config="sas_token=$env:TF_STATE_BLOB_SAS_TOKEN"
100+
-backend-config="sas_token=$env:TF_STATE_BLOB_SAS_TOKEN" -reconfigure -upgrade
97101
displayName: 'Terraform Init'
98102
workingDirectory: ${{ parameters.workingDirectory }}
99103
env:
@@ -102,15 +106,27 @@ stages:
102106
TF_STATE_BLOB_FILE: ${{ parameters.stateFile }}
103107
TF_STATE_BLOB_SAS_TOKEN: ${{ parameters.sasToken }}
104108
105-
- powershell: |
106-
terraform plan -var "prefix=${{ parameters.prefix }}" -out main.tfplan
107-
displayName: 'Terraform Plan'
108-
workingDirectory: ${{ parameters.workingDirectory }}
109-
env:
110-
ARM_SUBSCRIPTION_ID: ${{ parameters.subscriptionId }}
111-
ARM_CLIENT_ID: ${{ parameters.clientId }}
112-
ARM_CLIENT_SECRET: ${{ parameters.clientSecret }}
113-
ARM_TENANT_ID: ${{ parameters.tenantId }}
109+
- ${{ if eq(parameters.destroy, false) }}:
110+
- powershell: |
111+
terraform plan -var "prefix=${{ parameters.prefix }}" -out main.tfplan
112+
displayName: 'Terraform Plan'
113+
workingDirectory: ${{ parameters.workingDirectory }}
114+
env:
115+
ARM_SUBSCRIPTION_ID: ${{ parameters.subscriptionId }}
116+
ARM_CLIENT_ID: ${{ parameters.clientId }}
117+
ARM_CLIENT_SECRET: ${{ parameters.clientSecret }}
118+
ARM_TENANT_ID: ${{ parameters.tenantId }}
119+
120+
- ${{ if eq(parameters.destroy, true) }}:
121+
- powershell: |
122+
terraform plan -destroy -var "prefix=${{ parameters.prefix }}" -out main.tfplan
123+
displayName: 'Terraform Plan'
124+
workingDirectory: ${{ parameters.workingDirectory }}
125+
env:
126+
ARM_SUBSCRIPTION_ID: ${{ parameters.subscriptionId }}
127+
ARM_CLIENT_ID: ${{ parameters.clientId }}
128+
ARM_CLIENT_SECRET: ${{ parameters.clientSecret }}
129+
ARM_TENANT_ID: ${{ parameters.tenantId }}
114130
115131
- powershell: |
116132
cp main.tfplan $(Build.ArtifactStagingDirectory)

build/terraform-create-aks-cluster.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ stages:
4444
clientId: $(library-client-id)
4545
clientSecret: $(library-client-secret)
4646
tenantId: $(library-tenant-id)
47+
destroy: false
4748

4849
- template: templates/terraform-apply-stages.yml
4950
parameters:

build/terraform-destroy-aks-cluster.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ variables:
2424
value: "Terraform_Apply_Destroy_AKS_Cluster"
2525

2626
stages:
27-
- template: templates/terraform-plan-destroy-stages.yml
27+
- template: templates/terraform-plan-stages.yml
2828
parameters:
2929
stageName: ${{ variables.planStageName }}
3030
VmImage: windows-latest
@@ -39,6 +39,7 @@ stages:
3939
clientId: $(library-client-id)
4040
clientSecret: $(library-client-secret)
4141
tenantId: $(library-tenant-id)
42+
destroy: true
4243

4344
- template: templates/terraform-apply-stages.yml
4445
parameters:

cloudflare/Get-CloudflareDnsRecords.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
param (
1+
param (
22
[Parameter(Mandatory = $true)]
33
[string]$ApiToken,
44

0 commit comments

Comments
 (0)