You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
105 lines
2.1 KiB
105 lines
2.1 KiB
3 years ago
|
terraform {
|
||
|
required_providers {
|
||
3 years ago
|
kubernetes = {
|
||
|
source = "hashicorp/kubernetes"
|
||
3 years ago
|
}
|
||
3 years ago
|
helm = {
|
||
|
source = "hashicorp/helm"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
provider "helm" {
|
||
|
kubernetes {
|
||
|
config_path = ".kube/config"
|
||
3 years ago
|
}
|
||
|
}
|
||
|
|
||
3 years ago
|
provider "kubernetes" {
|
||
|
config_path = ".kube/config"
|
||
3 years ago
|
}
|
||
|
|
||
3 years ago
|
resource "kubernetes_namespace" "cert_manager" {
|
||
|
metadata {
|
||
|
name = "cert-manager"
|
||
|
}
|
||
|
}
|
||
3 years ago
|
|
||
3 years ago
|
resource "helm_release" "cert_manager" {
|
||
3 years ago
|
name = "cert-manager"
|
||
|
repository = "https://charts.jetstack.io"
|
||
|
chart = "cert-manager"
|
||
|
version = "1.6.1"
|
||
|
namespace = kubernetes_namespace.cert_manager.metadata[0].name
|
||
3 years ago
|
|
||
|
set {
|
||
|
name = "installCRDs"
|
||
|
value = "true"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
resource "kubernetes_manifest" "letsencrypt_staging" {
|
||
|
manifest = {
|
||
|
apiVersion = "cert-manager.io/v1"
|
||
3 years ago
|
kind = "ClusterIssuer"
|
||
3 years ago
|
metadata = {
|
||
3 years ago
|
name = "letsencrypt-staging"
|
||
3 years ago
|
}
|
||
|
spec = {
|
||
|
acme = {
|
||
|
server = "https://acme-staging-v02.api.letsencrypt.org/directory"
|
||
3 years ago
|
email = var.letsencrypt_email
|
||
3 years ago
|
privateKeySecretRef = {
|
||
|
name = "letsencrypt-staging"
|
||
|
}
|
||
|
solvers = [
|
||
|
{
|
||
|
selector = {}
|
||
|
http01 = {
|
||
|
ingress = {
|
||
|
class = "nginx"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
resource "kubernetes_manifest" "letsencrypt_prod" {
|
||
|
manifest = {
|
||
|
apiVersion = "cert-manager.io/v1"
|
||
3 years ago
|
kind = "ClusterIssuer"
|
||
3 years ago
|
metadata = {
|
||
3 years ago
|
name = "letsencrypt-prod"
|
||
3 years ago
|
}
|
||
|
spec = {
|
||
|
acme = {
|
||
|
server = "https://acme-v02.api.letsencrypt.org/directory"
|
||
3 years ago
|
email = var.letsencrypt_email
|
||
3 years ago
|
privateKeySecretRef = {
|
||
|
name = "letsencrypt-prod"
|
||
|
}
|
||
|
solvers = [
|
||
|
{
|
||
|
selector = {}
|
||
|
http01 = {
|
||
|
ingress = {
|
||
|
class = "nginx"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
resource "helm_release" "ingress_nginx" {
|
||
3 years ago
|
name = "ingress-nginx"
|
||
|
repository = "https://kubernetes.github.io/ingress-nginx"
|
||
|
chart = "ingress-nginx"
|
||
|
version = "4.0.13"
|
||
3 years ago
|
}
|