Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions access_key.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export ARM_SUBSCRIPTION_ID=$(az account show --query 'id' -o tsv)
export ARM_ACCESS_KEY=$(az storage account keys list --resource-group rg-polinetwork --account-name polinetworksa --query '[0].value' -o tsv)
46 changes: 23 additions & 23 deletions argocd-applications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,29 @@ applications:
info:
- name: url
value: https://argoproj.github.io/
bot-mat:
name: bot-mat
namespace: argocd
project: default
source:
repoURL: https://github.com/poliNetworkOrg/polinetwork-cd
targetRevision: HEAD
path: bot-mat
directory:
recurse: true
destination:
server: https://kubernetes.default.svc
namespace: bot-mat
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=false
- Replace=true
info:
- name: url
value: https://argoproj.github.io/
# bot-mat:
# name: bot-mat
# namespace: argocd
# project: default
# source:
# repoURL: https://github.com/poliNetworkOrg/polinetwork-cd
# targetRevision: HEAD
# path: bot-mat
# directory:
# recurse: true
# destination:
# server: https://kubernetes.default.svc
# namespace: bot-mat
# syncPolicy:
# automated:
# prune: true
# selfHeal: true
# syncOptions:
# - CreateNamespace=false
# - Replace=true
# info:
# - name: url
# value: https://argoproj.github.io/
mariadb:
name: mariadb
namespace: argocd
Expand Down
4 changes: 2 additions & 2 deletions features.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
provider "azurerm" {
features {}
skip_provider_registration = true
use_oidc = true
resource_provider_registrations = "core"
use_oidc = true
}
29 changes: 15 additions & 14 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ locals {
}

module "aks" {
source = "./modules/aks/"
depends_on = [module.keyvault]
source = "./modules/aks/"

ca_tls_key = data.azurerm_key_vault_secret.ca_tls_key.value
ca_tls_crt = data.azurerm_key_vault_secret.ca_tls_crt.value
Expand All @@ -33,10 +34,10 @@ module "aks" {
}
]

location = azurerm_resource_group.rg.location
rg_name = azurerm_resource_group.rg.name
rg_location = azurerm_resource_group.rg.location
rg_name = azurerm_resource_group.rg.name

kubernetes_orchestrator_version = "1.26.3"
kubernetes_orchestrator_version = "1.29.13"

}

Expand All @@ -55,6 +56,15 @@ module "argo-cd" {
]
}

module "aule_bot" {
depends_on = [
module.mariadb
]

source = "./modules/bots-migration/"
bot_namespace = "bot-rooms"
}

module "cloudflare" {
depends_on = [
module.aks
Expand Down Expand Up @@ -127,22 +137,13 @@ module "bot_mat_migration" {
module.mariadb
]

source = "./modules/bots/"
source = "./modules/bots-migration/"

bot_namespace = "bot-mat"
bot_token = data.azurerm_key_vault_secret.prod_mat_token.value
bot_onMessage = "mat"
db_database = "polinetwork_materials"
db_host = local.mariadb_internal_ip
db_password = data.azurerm_key_vault_secret.prod_mat_db_password.value
db_user = data.azurerm_key_vault_secret.prod_mat_db_user.value
persistent_storage = true
persistent_storage_size_gi = "250"
persistent_storage_location = azurerm_resource_group.rg.location
persistent_storage_rg_name = azurerm_resource_group.rg.name

material_password = data.azurerm_key_vault_secret.dev_mat_config_password.value
material_root_dir = "/Repos/"
}

module "keyvault" {
Expand Down
9 changes: 4 additions & 5 deletions modules/aks/k8s.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
}

# tfsec:ignore:azure-container-limit-authorized-ips
resource "azurerm_kubernetes_cluster" "k8s" {

Check failure on line 5 in modules/aks/k8s.tf

View workflow job for this annotation

GitHub Actions / Terraform Unit Tests

CKV_AZURE_117: "Ensure that AKS uses disk encryption set"

Check failure on line 5 in modules/aks/k8s.tf

View workflow job for this annotation

GitHub Actions / Terraform Unit Tests

CKV_AZURE_226: "Ensure ephemeral disks are used for OS disks"

Check failure on line 5 in modules/aks/k8s.tf

View workflow job for this annotation

GitHub Actions / Terraform Unit Tests

CKV_AZURE_170: "Ensure that AKS use the Paid Sku for its SLA"

Check failure on line 5 in modules/aks/k8s.tf

View workflow job for this annotation

GitHub Actions / Terraform Unit Tests

CKV_AZURE_6: "Ensure AKS has an API Server Authorized IP Ranges enabled"

Check failure on line 5 in modules/aks/k8s.tf

View workflow job for this annotation

GitHub Actions / Terraform Unit Tests

CKV_AZURE_168: "Ensure Azure Kubernetes Cluster (AKS) nodes should use a minimum number of 50 pods."

Check failure on line 5 in modules/aks/k8s.tf

View workflow job for this annotation

GitHub Actions / Terraform Unit Tests

CKV_AZURE_171: "Ensure AKS cluster upgrade channel is chosen"

Check failure on line 5 in modules/aks/k8s.tf

View workflow job for this annotation

GitHub Actions / Terraform Unit Tests

CKV_AZURE_4: "Ensure AKS logging to Azure Monitoring is Configured"

Check failure on line 5 in modules/aks/k8s.tf

View workflow job for this annotation

GitHub Actions / Terraform Unit Tests

CKV_AZURE_115: "Ensure that AKS enables private clusters"

Check failure on line 5 in modules/aks/k8s.tf

View workflow job for this annotation

GitHub Actions / Terraform Unit Tests

CKV_AZURE_227: "Ensure that the AKS cluster encrypt temp disks, caches, and data flows between Compute and Storage resources"

Check failure on line 5 in modules/aks/k8s.tf

View workflow job for this annotation

GitHub Actions / Terraform Unit Tests

CKV_AZURE_232: "Ensure that only critical system pods run on system nodes"
location = "westeurope"
name = "aks-polinetwork"
resource_group_name = var.rg_name
dns_prefix = "aks-polinetwork"
location = var.rg_location
resource_group_name = var.rg_name
role_based_access_control_enabled = true
http_application_routing_enabled = false // replaced by az aks approuting enable -g <ResourceGroupName> -n <ClusterName>

Expand All @@ -15,7 +15,6 @@
}

azure_active_directory_role_based_access_control {
managed = true
azure_rbac_enabled = true
admin_group_object_ids = [
"57561933-3873-400d-be92-cdad68d57c1f",
Expand All @@ -37,7 +36,7 @@
os_disk_type = "Managed"
os_disk_size_gb = 30
orchestrator_version = var.kubernetes_orchestrator_version
enable_auto_scaling = true
auto_scaling_enabled = true
max_count = 1
min_count = 1
node_count = 1
Expand Down Expand Up @@ -68,7 +67,7 @@
mode = each.value.mode == null ? "User" : each.value.mode
tags = each.value.tags
orchestrator_version = var.kubernetes_orchestrator_version
enable_auto_scaling = each.value.enable_auto_scaling
auto_scaling_enabled = each.value.enable_auto_scaling
max_count = each.value.max_count
min_count = each.value.min_count
}
Expand Down
2 changes: 1 addition & 1 deletion modules/aks/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ terraform {
}
azurerm = {
source = "hashicorp/azurerm"
version = "3.63.0"
version = "=4.23.0"
}
helm = {
source = "hashicorp/helm"
Expand Down
2 changes: 1 addition & 1 deletion modules/aks/variables.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
variable "location" {
variable "rg_location" {
type = string
nullable = false
}
Expand Down
2 changes: 1 addition & 1 deletion modules/app/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.63.0"
version = "=4.23.0"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
2 changes: 1 addition & 1 deletion modules/argocd/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ terraform {
}
azurerm = {
source = "hashicorp/azurerm"
version = "3.63.0"
version = "=4.23.0"
}
helm = {
source = "hashicorp/helm"
Expand Down
62 changes: 62 additions & 0 deletions modules/bots-migration/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading