-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9bb0b53
commit 32f2087
Showing
8 changed files
with
150 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
apiVersion: cert-manager.io/v1 | ||
kind: ClusterIssuer | ||
metadata: | ||
name: trust-manager-selfsigned-issuer | ||
spec: | ||
selfSigned: {} | ||
--- | ||
apiVersion: cert-manager.io/v1 | ||
kind: Certificate | ||
metadata: | ||
name: cluster-root-certificate | ||
namespace: ${namespace} | ||
spec: | ||
isCA: true | ||
commonName: cluster-root-certificate-ca | ||
secretName: cluster-root-certificate-ca-secret | ||
privateKey: | ||
algorithm: ECDSA | ||
size: 256 | ||
issuerRef: | ||
name: trust-manager-selfsigned-issuer | ||
kind: ClusterIssuer | ||
group: cert-manager.io | ||
--- | ||
apiVersion: cert-manager.io/v1 | ||
kind: ClusterIssuer | ||
metadata: | ||
name: default-cluster-ca-issuer | ||
spec: | ||
ca: | ||
secretName: cluster-root-certificate-ca-secret | ||
--- | ||
apiVersion: trust.cert-manager.io/v1alpha1 | ||
kind: Bundle | ||
metadata: | ||
name: in-cluster-trust-bundle | ||
spec: | ||
sources: | ||
- useDefaultCAs: true | ||
- secret: | ||
name: "cluster-root-certificate-ca-secret" | ||
key: "tls.crt" | ||
target: | ||
configMap: | ||
key: "trust-bundle.pem" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
resource "helm_release" "cert-manager" { | ||
namespace = var.namespace | ||
create_namespace = true | ||
name = "cert-manager" | ||
repository = "https://charts.jetstack.io" | ||
chart = "cert-manager" | ||
version = var.cert_manager_chart_version | ||
cleanup_on_fail = true | ||
|
||
# Helm chart deployment can sometimes take longer than the default 5 minutes | ||
timeout = var.timeout_seconds | ||
|
||
set { | ||
name = "installCRDs" | ||
value = "true" | ||
} | ||
} | ||
|
||
resource "helm_release" "trust-manager" { | ||
depends_on = [helm_release.cert-manager] | ||
|
||
namespace = var.namespace | ||
create_namespace = true | ||
name = "trust-manager" | ||
repository = "https://charts.jetstack.io" | ||
chart = "trust-manager" | ||
version = var.trust_manager_chart_version | ||
cleanup_on_fail = true | ||
|
||
# Helm chart deployment can sometimes take longer than the default 5 minutes | ||
timeout = var.timeout_seconds | ||
} | ||
|
||
resource "kubectl_manifest" "cert-manager-cluster-issuer" { | ||
depends_on = [helm_release.cert-manager, helm_release.trust-manager] | ||
|
||
force_new = true | ||
server_side_apply = true | ||
|
||
yaml_body = templatefile("${path.module}/cluster_issuer.tfpl.yaml", { | ||
namespace = var.namespace, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
terraform { | ||
required_providers { | ||
helm = { | ||
source = "hashicorp/helm" | ||
version = ">= 2.12.1" | ||
} | ||
kubectl = { | ||
source = "gavinbunney/kubectl" | ||
version = ">= 1.14.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
variable "compartment_ocid" {} | ||
variable "environment" { | ||
default = "prod" | ||
} | ||
variable "cluster_ocid" { | ||
type = string | ||
} | ||
|
||
variable "namespace" { | ||
description = "Namespace to install cert-manager chart into" | ||
type = string | ||
default = "cert-manager" | ||
} | ||
|
||
variable "cert_manager_chart_version" { | ||
description = "Version of argocd chart to install" | ||
type = string | ||
default = "1.14.4" # See https://artifacthub.io/packages/helm/argo/argo-cd for latest version(s) | ||
} | ||
|
||
variable "trust_manager_chart_version" { | ||
description = "Version of argocd chart to install" | ||
type = string | ||
default = "0.9.1" # See https://artifacthub.io/packages/helm/argo/argo-cd for latest version(s) | ||
} | ||
|
||
# Helm chart deployment can sometimes take longer than the default 5 minutes | ||
variable "timeout_seconds" { | ||
type = number | ||
description = "Helm chart deployment can sometimes take longer than the default 5 minutes. Set a custom timeout here." | ||
default = 800 # 10 minutes | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters