fix
This commit is contained in:
@@ -6,6 +6,26 @@ metadata:
|
|||||||
name: woodpecker
|
name: woodpecker
|
||||||
description: null
|
description: null
|
||||||
options:
|
options:
|
||||||
|
storage-agent:
|
||||||
|
default:
|
||||||
|
size: 10Gi
|
||||||
|
storageClass: ''
|
||||||
|
writeMany: 'false'
|
||||||
|
examples:
|
||||||
|
- size: 10Gi
|
||||||
|
storageClass: ''
|
||||||
|
writeMany: 'false'
|
||||||
|
properties:
|
||||||
|
size:
|
||||||
|
default: 10Gi
|
||||||
|
type: string
|
||||||
|
storageClass:
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
writeMany:
|
||||||
|
default: 'false'
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
images:
|
images:
|
||||||
default:
|
default:
|
||||||
agent:
|
agent:
|
||||||
@@ -103,41 +123,16 @@ options:
|
|||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
storage-agent:
|
|
||||||
default:
|
|
||||||
size: 10Gi
|
|
||||||
storageClass: ''
|
|
||||||
writeMany: 'false'
|
|
||||||
examples:
|
|
||||||
- size: 10Gi
|
|
||||||
storageClass: ''
|
|
||||||
writeMany: 'false'
|
|
||||||
properties:
|
|
||||||
size:
|
|
||||||
default: 10Gi
|
|
||||||
type: string
|
|
||||||
storageClass:
|
|
||||||
default: ''
|
|
||||||
type: string
|
|
||||||
writeMany:
|
|
||||||
default: 'false'
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
ingress-class:
|
|
||||||
default: traefik
|
|
||||||
examples:
|
|
||||||
- traefik
|
|
||||||
type: string
|
|
||||||
domain:
|
|
||||||
default: your-company
|
|
||||||
examples:
|
|
||||||
- your-company
|
|
||||||
type: string
|
|
||||||
sub-domain:
|
sub-domain:
|
||||||
default: ci
|
default: ci
|
||||||
examples:
|
examples:
|
||||||
- ci
|
- ci
|
||||||
type: string
|
type: string
|
||||||
|
ingress-class:
|
||||||
|
default: traefik
|
||||||
|
examples:
|
||||||
|
- traefik
|
||||||
|
type: string
|
||||||
storage-server:
|
storage-server:
|
||||||
default:
|
default:
|
||||||
accessMode: ReadWriteOnce
|
accessMode: ReadWriteOnce
|
||||||
@@ -157,15 +152,20 @@ options:
|
|||||||
default: 10Gi
|
default: 10Gi
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
|
issuer:
|
||||||
|
default: letsencrypt-prod
|
||||||
|
examples:
|
||||||
|
- letsencrypt-prod
|
||||||
|
type: string
|
||||||
domain-name:
|
domain-name:
|
||||||
default: your_company.com
|
default: your_company.com
|
||||||
examples:
|
examples:
|
||||||
- your_company.com
|
- your_company.com
|
||||||
type: string
|
type: string
|
||||||
issuer:
|
domain:
|
||||||
default: letsencrypt-prod
|
default: your-company
|
||||||
examples:
|
examples:
|
||||||
- letsencrypt-prod
|
- your-company
|
||||||
type: string
|
type: string
|
||||||
dependencies: []
|
dependencies: []
|
||||||
providers:
|
providers:
|
||||||
|
|||||||
75
apps/woodpecker/ingress.tf
Normal file
75
apps/woodpecker/ingress.tf
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
locals {
|
||||||
|
dns-names = ["${var.sub-domain}.${var.domain-name}"]
|
||||||
|
middlewares = ["${var.instance}-https"]
|
||||||
|
service = {
|
||||||
|
"name" = "${var.component}-server"
|
||||||
|
"port" = {
|
||||||
|
"number" = 80
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rules = [ for v in local.dns-names : {
|
||||||
|
"host" = "${v}"
|
||||||
|
"http" = {
|
||||||
|
"paths" = [{
|
||||||
|
"backend" = {
|
||||||
|
"service" = local.service
|
||||||
|
}
|
||||||
|
"path" = "/"
|
||||||
|
"pathType" = "Prefix"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "kubectl_manifest" "prj_certificate" {
|
||||||
|
yaml_body = <<-EOF
|
||||||
|
apiVersion: "cert-manager.io/v1"
|
||||||
|
kind: "Certificate"
|
||||||
|
metadata:
|
||||||
|
name: "${var.instance}"
|
||||||
|
namespace: "${var.namespace}"
|
||||||
|
labels: ${jsonencode(local.common-labels)}
|
||||||
|
spec:
|
||||||
|
secretName: "${var.instance}-cert"
|
||||||
|
dnsNames: ${jsonencode(local.dns-names)}
|
||||||
|
issuerRef:
|
||||||
|
name: "${var.issuer}"
|
||||||
|
kind: "ClusterIssuer"
|
||||||
|
group: "cert-manager.io"
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "kubectl_manifest" "prj_https_redirect" {
|
||||||
|
yaml_body = <<-EOF
|
||||||
|
apiVersion: "traefik.containo.us/v1alpha1"
|
||||||
|
kind: "Middleware"
|
||||||
|
metadata:
|
||||||
|
name: "${var.instance}-https"
|
||||||
|
namespace: "${var.namespace}"
|
||||||
|
labels: ${jsonencode(local.common-labels)}
|
||||||
|
spec:
|
||||||
|
redirectScheme:
|
||||||
|
scheme: "https"
|
||||||
|
permanent: true
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "kubectl_manifest" "prj_ingress" {
|
||||||
|
force_conflicts = true
|
||||||
|
yaml_body = <<-EOF
|
||||||
|
apiVersion: "networking.k8s.io/v1"
|
||||||
|
kind: "Ingress"
|
||||||
|
metadata:
|
||||||
|
name: "${var.instance}"
|
||||||
|
namespace: "${var.namespace}"
|
||||||
|
labels: ${jsonencode(local.common-labels)}
|
||||||
|
annotations:
|
||||||
|
"traefik.ingress.kubernetes.io/router.middlewares": "${join(",", [for m in local.middlewares : format("%s-%s@kubernetescrd", var.namespace, m)])}"
|
||||||
|
spec:
|
||||||
|
ingressClassName: "${var.ingress-class}"
|
||||||
|
rules: ${jsonencode(local.rules)}
|
||||||
|
tls:
|
||||||
|
- hosts: ${jsonencode(local.dns-names)}
|
||||||
|
secretName: "${var.instance}-cert"
|
||||||
|
EOF
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user