From 799bcf9cefd815ceb64b084efb7f165b763d382d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E5=85=83?= Date: Fri, 4 Dec 2020 17:27:41 +0800 Subject: [PATCH] add some detail for route design --- design/vela-core/route.md | 29 +++++++++++++++++-- .../applicationconfiguration.go | 4 +-- .../applicationconfiguration/apply.go | 1 - 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/design/vela-core/route.md b/design/vela-core/route.md index f82c5162a..e0ad14aaa 100644 --- a/design/vela-core/route.md +++ b/design/vela-core/route.md @@ -94,9 +94,34 @@ It's required and will be used to generate mTLS secrets. Route Trait designed to be compatible with different ingress controller implementations, the `provider` field will allow you to give a specified ingress controller type. Currently, only nginx-ingress is supported. -The `tls` field allow you to specify a TLS for this route with an IssuerName, the IssuerName pointing to an Issuer Object +The `tls` field allow you to specify a TLS for this route with an IssuerName, the IssuerName pointing to an [Issuer Object](https://cert-manager.io/docs/concepts/issuer/) created by cert-manager. Cert-manager and ingress controller will handle certificate creation and binding. -If not specified, mTLS was disabled and you can only visit by http. + +Currently, vela-cli will create an Issuer Object automatically by using the email defined in `vela init` workflow. + +```yaml +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + name: oam-env- + namespace: +spec: + acme: + # Email address used for ACME registration + email: + # The ACME server URL + server: https://acme-v02.api.letsencrypt.org/directory + # Name of a secret used to store the ACME account private key, the key will be automatically created by cert-manager + privateKeySecretRef: + name: oam-env-.key + # Enable the HTTP-01 challenge provider, there are many other solvers besides http01. + solvers: + - http01: + ingress: + class: nginx +``` + +If `tls` field in route trait not specified, mTLS will be disabled by default. You can also manually configure ingress later. If no rule specified, route trait will create one rule automatically and match with the port. diff --git a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/applicationconfiguration.go b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/applicationconfiguration.go index 9f8557c2e..2477442c2 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/applicationconfiguration.go +++ b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/applicationconfiguration.go @@ -40,12 +40,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2" - + core "github.com/oam-dev/kubevela/pkg/controller/core.oam.dev" "github.com/oam-dev/kubevela/pkg/oam" "github.com/oam-dev/kubevela/pkg/oam/discoverymapper" "github.com/oam-dev/kubevela/pkg/oam/util" - - core "github.com/oam-dev/kubevela/pkg/controller/core.oam.dev" ) const ( diff --git a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/apply.go b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/apply.go index 81f763866..85e54703c 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/apply.go +++ b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/apply.go @@ -30,7 +30,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2" - "github.com/oam-dev/kubevela/pkg/oam/discoverymapper" "github.com/oam-dev/kubevela/pkg/oam/util" )