Skip to content

Commit

Permalink
45 terragrunt retry not working with apply all (#47)
Browse files Browse the repository at this point in the history
* Adds ignore dependency on terragrunt destroy

Signed-off-by: rich-ehrhardt <[email protected]>

* Adds conditions for terragrunt retry

Signed-off-by: rich-ehrhardt <[email protected]>

* Reduces parallelism and adds pause before proceeding

Signed-off-by: rich-ehrhardt <[email protected]>

* Updated gitops layer to latest

Signed-off-by: rich-ehrhardt <[email protected]>

* Updated dev tools layer to latest BOM

Signed-off-by: rich-ehrhardt <[email protected]>

* Reduced layer parallelism to improve reliability

Signed-off-by: rich-ehrhardt <[email protected]>

Signed-off-by: rich-ehrhardt <[email protected]>
  • Loading branch information
rich-ehrhardt authored Sep 6, 2022
1 parent bacd85b commit 5e6bf57
Show file tree
Hide file tree
Showing 17 changed files with 210 additions and 44 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## gitops_repo_host: The host for the git repository.
## gitops_repo_host: The host for the git repository. The git host used can be a GitHub, GitHub Enterprise, Gitlab, Bitbucket, Gitea or Azure DevOps server. If the host is null assumes in-cluster Gitea instance will be used.
#gitops_repo_host=""

## gitops_repo_org: The org/group where the git repository exists/will be provisioned.
## gitops_repo_org: The org/group where the git repository exists/will be provisioned. If the value is left blank then the username org will be used.
#gitops_repo_org=""

## gitops_repo_project: The project that will be used for the git repo. (Primarily used for Azure DevOps repos)
Expand Down
21 changes: 13 additions & 8 deletions 1-quickstart/200-openshift-gitops/bom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
modules:
- name: gitops-repo
alias: gitops_repo
version: v1.19.4
version: v1.21.0
- name: argocd-bootstrap
alias: argocd-bootstrap
version: v1.12.0
Expand All @@ -25,34 +25,39 @@ spec:
value: maximo
- name: gitops-cluster-config
alias: gitops-cluster-config
version: v1.0.0
version: v1.1.0
- name: gitops-console-link-job
alias: gitops-console-link-job
version: v1.4.6
- name: gitops-namespace
alias: toolkit_namespace
version: v1.11.2
version: v1.12.1
default: true
variables:
- name: name
value: toolkit
- name: ocp-login
alias: cluster
version: v1.3.1
version: v1.6.0
- name: olm
alias: olm
version: v1.3.2
- name: sealed-secret-cert
alias: sealed-secret-cert
version: v1.0.1
- name: util-clis
version: v1.16.9
variables:
- name: gitops_repo_host
type: string
description: The host for the git repository.
description: >-
The host for the git repository. The git host used can be a GitHub,
GitHub Enterprise, Gitlab, Bitbucket, Gitea or Azure DevOps server. If
the host is null assumes in-cluster Gitea instance will be used.
defaultValue: ''
- name: gitops_repo_org
type: string
description: The org/group where the git repository exists/will be provisioned.
description: >-
The org/group where the git repository exists/will be provisioned. If
the value is left blank then the username org will be used.
defaultValue: ''
- name: gitops_repo_project
type: string
Expand Down
1 change: 1 addition & 0 deletions 1-quickstart/200-openshift-gitops/dependencies.dot
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ digraph {
"gitops-console-link-job (gitops-console-link-job)" -> "gitops_repo (gitops-repo)"
"gitops-console-link-job (gitops-console-link-job)" -> "toolkit_namespace (gitops-namespace)"
"gitops-console-link-job (gitops-console-link-job)"
"util-clis (util-clis)"
}
16 changes: 12 additions & 4 deletions 1-quickstart/200-openshift-gitops/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module "argocd-bootstrap" {
sealed_secret_private_key = module.sealed-secret-cert.private_key
}
module "cluster" {
source = "github.com/cloud-native-toolkit/terraform-ocp-login?ref=v1.3.1"
source = "github.com/cloud-native-toolkit/terraform-ocp-login?ref=v1.6.0"

ca_cert = var.cluster_ca_cert
ca_cert_file = var.cluster_ca_cert_file
Expand All @@ -30,9 +30,10 @@ module "cluster" {
tls_secret_name = var.cluster_tls_secret_name
}
module "gitops_repo" {
source = "github.com/cloud-native-toolkit/terraform-tools-gitops?ref=v1.19.4"
source = "github.com/cloud-native-toolkit/terraform-tools-gitops?ref=v1.21.0"

branch = var.gitops_repo_branch
debug = var.debug
gitea_host = var.gitops_repo_gitea_host
gitea_org = var.gitops_repo_gitea_org
gitea_token = var.gitops_repo_gitea_token
Expand All @@ -51,7 +52,7 @@ module "gitops_repo" {
username = var.gitops_repo_username
}
module "gitops-cluster-config" {
source = "github.com/cloud-native-toolkit/terraform-gitops-cluster-config?ref=v1.0.0"
source = "github.com/cloud-native-toolkit/terraform-gitops-cluster-config?ref=v1.1.0"

banner_background_color = var.gitops-cluster-config_banner_background_color
banner_text = var.gitops-cluster-config_banner_text
Expand Down Expand Up @@ -88,7 +89,7 @@ module "sealed-secret-cert" {
private_key_file = var.sealed-secret-cert_private_key_file
}
module "toolkit_namespace" {
source = "github.com/cloud-native-toolkit/terraform-gitops-namespace?ref=v1.11.2"
source = "github.com/cloud-native-toolkit/terraform-gitops-namespace?ref=v1.12.1"

argocd_namespace = var.toolkit_namespace_argocd_namespace
ci = var.toolkit_namespace_ci
Expand All @@ -98,3 +99,10 @@ module "toolkit_namespace" {
name = var.toolkit_namespace_name
server_name = module.gitops_repo.server_name
}
module "util-clis" {
source = "cloud-native-toolkit/clis/util"
version = "1.16.9"

bin_dir = var.util-clis_bin_dir
clis = var.util-clis_clis == null ? null : jsondecode(var.util-clis_clis)
}
6 changes: 6 additions & 0 deletions 1-quickstart/200-openshift-gitops/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

provider "gitops" {


bin_dir = module.util-clis.bin_dir
}
12 changes: 12 additions & 0 deletions 1-quickstart/200-openshift-gitops/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ locals {
mock_110 = local.dependencies.mock_110
}

// Reduce parallelism further for this layer
terraform {
before_hook "pause" {
commands = ["apply"]
execute = ["sleep","180"]
}
extra_arguments "reduced_parallelism" {
commands = get_terraform_commands_that_need_parallelism()
arguments = ["-parallelism=2"]
}
}

dependency "certificates" {
config_path = local.certificates_path
skip_outputs = false
Expand Down
31 changes: 23 additions & 8 deletions 1-quickstart/200-openshift-gitops/variables.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
variable "gitops_repo_host" {
type = string
description = "The host for the git repository."
description = "The host for the git repository. The git host used can be a GitHub, GitHub Enterprise, Gitlab, Bitbucket, Gitea or Azure DevOps server. If the host is null assumes in-cluster Gitea instance will be used."
default = ""
}
variable "gitops_repo_type" {
Expand All @@ -10,7 +10,7 @@ variable "gitops_repo_type" {
}
variable "gitops_repo_org" {
type = string
description = "The org/group where the git repository exists/will be provisioned."
description = "The org/group where the git repository exists/will be provisioned. If the value is left blank then the username org will be used."
default = ""
}
variable "gitops_repo_project" {
Expand All @@ -30,17 +30,17 @@ variable "gitops_repo_token" {
}
variable "gitops_repo_gitea_host" {
type = string
description = "The host for the git repository."
description = "The host for the default gitea repository."
default = ""
}
variable "gitops_repo_gitea_org" {
type = string
description = "The org/group where the git repository exists/will be provisioned."
description = "The org/group for the default gitea repository. If not provided, the value will default to the username org"
default = ""
}
variable "gitops_repo_gitea_username" {
type = string
description = "The username of the user with access to the repository"
description = "The username of the default gitea repository"
default = ""
}
variable "gitops_repo_gitea_token" {
Expand Down Expand Up @@ -77,6 +77,11 @@ variable "gitops_repo_strict" {
description = "Flag indicating that an error should be thrown if the repo already exists"
default = false
}
variable "debug" {
type = bool
description = "Flag indicating that debug loggging should be enabled"
default = false
}
variable "argocd-bootstrap_bootstrap_prefix" {
type = string
description = "The prefix used in ArgoCD to bootstrap the application"
Expand Down Expand Up @@ -161,17 +166,17 @@ variable "cluster_skip" {
}
variable "cluster_cluster_version" {
type = string
description = "The version of the cluster (passed through to the output)"
description = "[Deprecated] The version of the cluster (passed through to the output)"
default = ""
}
variable "cluster_ingress_subdomain" {
type = string
description = "The ingress subdomain of the cluster (passed through to the output)"
description = "[Deprecated] The ingress subdomain of the cluster (passed through to the output)"
default = ""
}
variable "cluster_tls_secret_name" {
type = string
description = "The name of the secret containing the tls certificates for the ingress subdomain (passed through to the output)"
description = "[Deprecated] The name of the secret containing the tls certificates for the ingress subdomain (passed through to the output)"
default = ""
}
variable "cluster_ca_cert" {
Expand Down Expand Up @@ -204,3 +209,13 @@ variable "sealed-secret-cert_private_key_file" {
description = "The file containin the private key that will be used to encrypt the sealed secrets. If not provided a new private key will be generated"
default = ""
}
variable "util-clis_bin_dir" {
type = string
description = "The directory where the clis should be downloaded. If not provided will default to ./bin"
default = ""
}
variable "util-clis_clis" {
type = string
description = "The list of clis that should be made available in the bin directory. Supported values are yq, jq, igc, helm, argocd, rosa, gh, glab, and kubeseal. (If not provided the list will default to yq, jq, and igc)"
default = "[\"yq\",\"jq\",\"igc\"]"
}
8 changes: 8 additions & 0 deletions 1-quickstart/200-openshift-gitops/version.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
required_providers {
gitops = {
source = "cloud-native-toolkit/gitops"
}

}
}
29 changes: 21 additions & 8 deletions 1-quickstart/220-dev-tools/bom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,54 @@ metadata:
displayName: OpenShift development tools
description: Provisions development tools in an OpenShift cluster
deployment-type/gitops: 'true'
vpn/required: 'true'
spec:
modules:
- name: gitops-artifactory
alias: gitops-artifactory
version: v1.2.1
version: v1.2.2
- name: gitops-dashboard
alias: gitops-dashboard
version: v1.6.2
version: v1.7.0
- name: gitops-namespace
alias: tools_namespace
version: v1.11.2
version: v1.12.1
default: true
variables:
- name: name
value: tools
- name: gitops-pact-broker
alias: gitops-pact-broker
version: v1.1.7
version: v1.2.0
- name: gitops-repo
alias: gitops_repo
version: v1.19.4
version: v1.21.0
- name: gitops-sonarqube
alias: gitops-sonarqube
version: v1.2.6
- name: gitops-swagger-editor
alias: gitops-swagger-editor
version: v0.1.0
- name: gitops-tekton-resources
alias: gitops-tekton-resources
version: v1.1.4
version: v2.1.0
- name: util-clis
version: v1.16.9
- name: gitops-buildah-unprivileged
version: v1.1.0
variables:
- name: gitops_repo_host
type: string
description: The host for the git repository.
description: >-
The host for the git repository. The git host used can be a GitHub,
GitHub Enterprise, Gitlab, Bitbucket, Gitea or Azure DevOps server. If
the host is null assumes in-cluster Gitea instance will be used.
defaultValue: ''
- name: gitops_repo_org
type: string
description: The org/group where the git repository exists/will be provisioned.
description: >-
The org/group where the git repository exists/will be provisioned. If
the value is left blank then the username org will be used.
defaultValue: ''
- name: gitops_repo_project
type: string
Expand Down
8 changes: 8 additions & 0 deletions 1-quickstart/220-dev-tools/dependencies.dot
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ digraph {
"gitops-sonarqube (gitops-sonarqube)" -> "gitops_repo (gitops-repo)"
"gitops-sonarqube (gitops-sonarqube)" -> "tools_namespace (gitops-namespace)"
"gitops-sonarqube (gitops-sonarqube)"
"gitops-swagger-editor (gitops-swagger-editor)" -> "gitops_repo (gitops-repo)"
"gitops-swagger-editor (gitops-swagger-editor)" -> "tools_namespace (gitops-namespace)"
"gitops-swagger-editor (gitops-swagger-editor)"
"gitops-tekton-resources (gitops-tekton-resources)" -> "gitops_repo (gitops-repo)"
"gitops-tekton-resources (gitops-tekton-resources)" -> "tools_namespace (gitops-namespace)"
"gitops-tekton-resources (gitops-tekton-resources)" -> "gitops-buildah-unprivileged (gitops-buildah-unprivileged)"
"gitops-tekton-resources (gitops-tekton-resources)"
"gitops-buildah-unprivileged (gitops-buildah-unprivileged)" -> "gitops_repo (gitops-repo)"
"gitops-buildah-unprivileged (gitops-buildah-unprivileged)" -> "tools_namespace (gitops-namespace)"
"gitops-buildah-unprivileged (gitops-buildah-unprivileged)"
"util-clis (util-clis)"
}
Loading

0 comments on commit 5e6bf57

Please sign in to comment.