Commit 8dec8c8f authored by harshit aggarwal's avatar harshit aggarwal Committed by MANISH KUMAR
Browse files

Airflow Multipartition - Adding Feature Flag for Airflow DP deploy

parent 19be7224
......@@ -18,7 +18,6 @@ parameters:
terraformWorkspacePrefix: ''
environmentName: ''
steps:
- task: DownloadSecureFile@1
name: 'aksPublicAgentKeySecureDownload' # The name with which to reference the secure file's path on the agent.
......@@ -57,6 +56,7 @@ steps:
TF_VAR_principal_objectId: $(TF_VAR_principal_objectId)
TF_VAR_gitops_path: $(TF_VAR_gitops_path)
TF_VAR_override_file: $(System.DefaultWorkingDirectory)/${{ parameters.terraformVariableFile }}
TF_VAR_deploy_dp_airflow: $(TF_VAR_deploy_dp_airflow)
TF_VAR_istio_int_load_balancer_ip: $(TF_VAR_istio_int_load_balancer_ip)
TF_VAR_aks_dns_host: $(TF_VAR_aks_dns_host)
......@@ -69,6 +69,10 @@ steps:
set -euo pipefail
set -o nounset
if [ $TF_VAR_deploy_dp_airflow != "true" ] && [ $TF_VAR_deploy_dp_airflow != "false" ]; then
export TF_VAR_deploy_dp_airflow=false
fi
function terraformVersionCheck() {
if [[ $(which terraform) && $(terraform --version | head -n1 | cut -d" " -f2 | cut -c 2\-) == $TF_VERSION ]]; then
echo "Terraform version check completed"
......
......@@ -74,23 +74,23 @@ provider "azurerm" {
}
provider "kubernetes" {
host = var.feature_flag.deploy_dp_airflow ? module.airflow.0.kube_config_block.0.host : ""
username = var.feature_flag.deploy_dp_airflow ? module.airflow.0.kube_config_block.0.username : ""
password = var.feature_flag.deploy_dp_airflow ? module.airflow.0.kube_config_block.0.password : ""
client_certificate = var.feature_flag.deploy_dp_airflow ? base64decode(module.airflow.0.kube_config_block.0.client_certificate) : ""
client_key = var.feature_flag.deploy_dp_airflow ? base64decode(module.airflow.0.kube_config_block.0.client_key) : ""
cluster_ca_certificate = var.feature_flag.deploy_dp_airflow ? base64decode(module.airflow.0.kube_config_block.0.cluster_ca_certificate) : ""
host = var.deploy_dp_airflow ? module.airflow.0.kube_config_block.0.host : ""
username = var.deploy_dp_airflow ? module.airflow.0.kube_config_block.0.username : ""
password = var.deploy_dp_airflow ? module.airflow.0.kube_config_block.0.password : ""
client_certificate = var.deploy_dp_airflow ? base64decode(module.airflow.0.kube_config_block.0.client_certificate) : ""
client_key = var.deploy_dp_airflow ? base64decode(module.airflow.0.kube_config_block.0.client_key) : ""
cluster_ca_certificate = var.deploy_dp_airflow ? base64decode(module.airflow.0.kube_config_block.0.cluster_ca_certificate) : ""
}
// Hook-up helm Provider for Terraform
provider "helm" {
kubernetes {
host = var.feature_flag.deploy_dp_airflow ? module.airflow.0.kube_config_block.0.host : ""
username = var.feature_flag.deploy_dp_airflow ? module.airflow.0.kube_config_block.0.username : ""
password = var.feature_flag.deploy_dp_airflow ? module.airflow.0.kube_config_block.0.password : ""
client_certificate = var.feature_flag.deploy_dp_airflow ? base64decode(module.airflow.0.kube_config_block.0.client_certificate) : ""
client_key = var.feature_flag.deploy_dp_airflow ? base64decode(module.airflow.0.kube_config_block.0.client_key) : ""
cluster_ca_certificate = var.feature_flag.deploy_dp_airflow ? base64decode(module.airflow.0.kube_config_block.0.cluster_ca_certificate) : ""
host = var.deploy_dp_airflow ? module.airflow.0.kube_config_block.0.host : ""
username = var.deploy_dp_airflow ? module.airflow.0.kube_config_block.0.username : ""
password = var.deploy_dp_airflow ? module.airflow.0.kube_config_block.0.password : ""
client_certificate = var.deploy_dp_airflow ? base64decode(module.airflow.0.kube_config_block.0.client_certificate) : ""
client_key = var.deploy_dp_airflow ? base64decode(module.airflow.0.kube_config_block.0.client_key) : ""
cluster_ca_certificate = var.deploy_dp_airflow ? base64decode(module.airflow.0.kube_config_block.0.cluster_ca_certificate) : ""
}
}
......@@ -197,7 +197,7 @@ module "storage_account" {
name = local.storage_name
resource_group_name = azurerm_resource_group.main.name
container_names = var.feature_flag.deploy_dp_airflow ? concat(var.storage_containers, var.storage_containers_dp_airflow) : var.storage_containers
container_names = var.deploy_dp_airflow ? concat(var.storage_containers, var.storage_containers_dp_airflow) : var.storage_containers
kind = "StorageV2"
replication_type = var.storage_replication_type
......@@ -466,7 +466,7 @@ resource "azurerm_management_lock" "ingest_sa_lock" {
module "airflow" {
source = "./airflow"
count = var.feature_flag.deploy_dp_airflow ? 1 : 0
count = var.deploy_dp_airflow ? 1 : 0
central_resources_workspace_name = var.central_resources_workspace_name
......
......@@ -200,15 +200,19 @@ variable "ssh_public_key_file" {
variable "feature_flag" {
description = "(Optional) A toggle for incubator features"
type = object({
deploy_dp_airflow = bool
storage_mgmt_policy_enabled = bool
})
default = {
deploy_dp_airflow = false
storage_mgmt_policy_enabled = false
}
}
variable "deploy_dp_airflow" {
description = "Flag to deploy Airflow Infrastructure in Data Partition Resource Group"
type = bool
default = false
}
variable "service_resources_workspace_name" {
description = "(Required) The workspace name for the service_resources repository terraform environment / template to reference for this template."
type = string
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment