You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2019/11/23 10:37:01 UTC

[camel-k] branch master updated (ac324c1 -> 0abc44f)

This is an automated email from the ASF dual-hosted git repository.

nferraro pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git.


    from ac324c1  Fix rest example as camel-restlet has been removed
     new 6847b6e  Fix #1014: auto-generate documentation for traits from code
     new 04a24dc  Fix #1014: fix linter and missing documentation
     new 0abc44f  Fix #1014: remove staging repo

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 cmd/util/doc-gen/generators/generators.go          |  68 +++
 cmd/util/doc-gen/generators/traitdocgen.go         | 355 ++++++++++++++++
 cmd/util/doc-gen/main.go                           |  45 ++
 docs/modules/ROOT/nav.adoc                         |  27 +-
 docs/modules/ROOT/pages/traits.adoc                | 458 ---------------------
 docs/modules/ROOT/pages/traits/affinity.adoc       |  54 +++
 docs/modules/ROOT/pages/traits/builder.adoc        |  32 ++
 docs/modules/ROOT/pages/traits/camel.adoc          |  39 ++
 docs/modules/ROOT/pages/traits/classpath.adoc      |  31 ++
 docs/modules/ROOT/pages/traits/container.adoc      |  77 ++++
 docs/modules/ROOT/pages/traits/debug.adoc          |  32 ++
 docs/modules/ROOT/pages/traits/dependencies.adoc   |  32 ++
 docs/modules/ROOT/pages/traits/deployer.adoc       |  36 ++
 docs/modules/ROOT/pages/traits/deployment.adoc     |  32 ++
 docs/modules/ROOT/pages/traits/environment.adoc    |  36 ++
 docs/modules/ROOT/pages/traits/gc.adoc             |  33 ++
 docs/modules/ROOT/pages/traits/ingress.adoc        |  40 ++
 docs/modules/ROOT/pages/traits/istio.adoc          |  38 ++
 docs/modules/ROOT/pages/traits/jolokia.adoc        |  84 ++++
 .../modules/ROOT/pages/traits/knative-service.adoc |  72 ++++
 docs/modules/ROOT/pages/traits/knative.adoc        |  83 ++++
 docs/modules/ROOT/pages/traits/owner.adoc          |  40 ++
 docs/modules/ROOT/pages/traits/probes.adoc         |  81 ++++
 docs/modules/ROOT/pages/traits/prometheus.adoc     |  48 +++
 docs/modules/ROOT/pages/traits/quarkus.adoc        |  39 ++
 docs/modules/ROOT/pages/traits/rest-dsl.adoc       |  31 ++
 docs/modules/ROOT/pages/traits/route.adoc          |  73 ++++
 docs/modules/ROOT/pages/traits/service.adoc        |  36 ++
 docs/modules/ROOT/pages/traits/traits.adoc         |  60 +++
 go.mod                                             |   2 +
 go.sum                                             |   3 +
 .../camel/v1alpha1/integrationplatform_types.go    |   3 +-
 .../v1alpha1/integrationplatform_types_support.go  |   2 +-
 pkg/trait/affinity.go                              |  22 +-
 pkg/trait/builder.go                               |  10 +-
 pkg/trait/camel.go                                 |  14 +-
 pkg/trait/classpath.go                             |   8 +
 pkg/trait/container.go                             |  40 +-
 pkg/trait/debug.go                                 |   6 +
 pkg/trait/dependencies.go                          |   9 +
 pkg/trait/deployer.go                              |  12 +-
 pkg/trait/deployment.go                            |   9 +
 pkg/trait/environment.go                           |  12 +-
 pkg/trait/gc.go                                    |  18 +-
 pkg/trait/ingress.go                               |  12 +-
 pkg/trait/istio.go                                 |  10 +-
 pkg/trait/jolokia.go                               |  51 ++-
 pkg/trait/knative.go                               |  49 ++-
 pkg/trait/knative_service.go                       |  42 +-
 pkg/trait/owner.go                                 |  16 +-
 pkg/trait/probes.go                                |  43 +-
 pkg/trait/prometheus.go                            |  18 +-
 pkg/trait/quarkus.go                               |  11 +-
 pkg/trait/rest-dsl.go                              |   8 +
 pkg/trait/route.go                                 |  40 +-
 pkg/trait/service.go                               |   9 +-
 pkg/trait/trait_catalog.go                         |  11 +-
 pkg/trait/trait_test.go                            |  15 +-
 pkg/trait/trait_types.go                           |  11 +-
 pkg/trait/zz_generated_doc.go                      |   1 +
 script/Makefile                                    |   9 +-
 script/gen_client.sh                               |   2 +
 script/{images_push.sh => gen_doc.sh}              |  11 +-
 63 files changed, 2082 insertions(+), 569 deletions(-)
 create mode 100644 cmd/util/doc-gen/generators/generators.go
 create mode 100644 cmd/util/doc-gen/generators/traitdocgen.go
 create mode 100644 cmd/util/doc-gen/main.go
 delete mode 100644 docs/modules/ROOT/pages/traits.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/affinity.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/builder.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/camel.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/classpath.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/container.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/debug.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/dependencies.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/deployer.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/deployment.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/environment.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/gc.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/ingress.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/istio.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/jolokia.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/knative-service.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/knative.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/owner.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/probes.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/prometheus.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/quarkus.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/rest-dsl.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/route.adoc
 create mode 100755 docs/modules/ROOT/pages/traits/service.adoc
 create mode 100644 docs/modules/ROOT/pages/traits/traits.adoc
 create mode 100644 pkg/trait/zz_generated_doc.go
 copy script/{images_push.sh => gen_doc.sh} (86%)


[camel-k] 03/03: Fix #1014: remove staging repo

Posted by nf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nferraro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 0abc44fc82d1069c7571f6e96b77cba7274d732e
Author: Nicola Ferraro <ni...@gmail.com>
AuthorDate: Fri Nov 22 10:27:31 2019 +0100

    Fix #1014: remove staging repo
---
 script/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/script/Makefile b/script/Makefile
index 2d65894..60699d4 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -36,7 +36,7 @@ LINT_DEADLINE := 5m
 # Used to push pre-relase artifacts
 STAGING_IMAGE_NAME := docker.io/camelk/camel-k
 
-STAGING_RUNTIME_REPO := https://repository.apache.org/content/repositories/orgapachecamel-1162
+STAGING_RUNTIME_REPO :=
 
 # When packaging artifacts into the docker image, you can "copy" them from local maven
 # or "download" them from Apache Snapshots and Maven Central


[camel-k] 01/03: Fix #1014: auto-generate documentation for traits from code

Posted by nf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nferraro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 6847b6e6b0a2a58f29ce7ea695227f8bf0218053
Author: Nicola Ferraro <ni...@gmail.com>
AuthorDate: Thu Nov 21 15:18:18 2019 +0100

    Fix #1014: auto-generate documentation for traits from code
---
 cmd/util/doc-gen/generators/generators.go          |  68 +++
 cmd/util/doc-gen/generators/traitdocgen.go         | 357 ++++++++++++++++
 cmd/util/doc-gen/main.go                           |  45 ++
 docs/modules/ROOT/nav.adoc                         |  26 +-
 docs/modules/ROOT/pages/traits.adoc                | 458 ---------------------
 docs/modules/ROOT/pages/traits/builder.adoc        |  32 ++
 docs/modules/ROOT/pages/traits/camel.adoc          |  39 ++
 docs/modules/ROOT/pages/traits/classpath.adoc      |  31 ++
 docs/modules/ROOT/pages/traits/container.adoc      |  77 ++++
 docs/modules/ROOT/pages/traits/debug.adoc          |  32 ++
 docs/modules/ROOT/pages/traits/dependencies.adoc   |  32 ++
 docs/modules/ROOT/pages/traits/deployer.adoc       |  36 ++
 docs/modules/ROOT/pages/traits/deployment.adoc     |  32 ++
 docs/modules/ROOT/pages/traits/environment.adoc    |  36 ++
 docs/modules/ROOT/pages/traits/gc.adoc             |  33 ++
 docs/modules/ROOT/pages/traits/ingress.adoc        |  40 ++
 docs/modules/ROOT/pages/traits/istio.adoc          |  38 ++
 docs/modules/ROOT/pages/traits/jolokia.adoc        |  84 ++++
 .../modules/ROOT/pages/traits/knative-service.adoc |  72 ++++
 docs/modules/ROOT/pages/traits/knative.adoc        |  83 ++++
 docs/modules/ROOT/pages/traits/owner.adoc          |  40 ++
 docs/modules/ROOT/pages/traits/probes.adoc         |  81 ++++
 docs/modules/ROOT/pages/traits/prometheus.adoc     |  48 +++
 docs/modules/ROOT/pages/traits/quarkus.adoc        |  39 ++
 docs/modules/ROOT/pages/traits/rest-dsl.adoc       |  31 ++
 docs/modules/ROOT/pages/traits/route.adoc          |  73 ++++
 docs/modules/ROOT/pages/traits/service.adoc        |  36 ++
 docs/modules/ROOT/pages/traits/traits.adoc         |  59 +++
 go.mod                                             |   2 +
 go.sum                                             |   3 +
 .../camel/v1alpha1/integrationplatform_types.go    |   3 +-
 .../v1alpha1/integrationplatform_types_support.go  |   2 +-
 pkg/trait/builder.go                               |  10 +-
 pkg/trait/camel.go                                 |  10 +
 pkg/trait/classpath.go                             |   8 +
 pkg/trait/container.go                             |  20 +
 pkg/trait/debug.go                                 |   6 +
 pkg/trait/dependencies.go                          |   9 +
 pkg/trait/deployer.go                              |  10 +
 pkg/trait/deployment.go                            |   9 +
 pkg/trait/environment.go                           |   9 +
 pkg/trait/gc.go                                    |  18 +-
 pkg/trait/ingress.go                               |   8 +
 pkg/trait/istio.go                                 |   6 +
 pkg/trait/jolokia.go                               |  29 +-
 pkg/trait/knative.go                               |  27 ++
 pkg/trait/knative_service.go                       |  28 ++
 pkg/trait/owner.go                                 |  15 +-
 pkg/trait/probes.go                                |  17 +-
 pkg/trait/prometheus.go                            |  14 +-
 pkg/trait/quarkus.go                               |  11 +-
 pkg/trait/rest-dsl.go                              |   8 +
 pkg/trait/route.go                                 |  26 ++
 pkg/trait/service.go                               |   7 +
 pkg/trait/trait_catalog.go                         |  11 +-
 pkg/trait/trait_test.go                            |  15 +-
 pkg/trait/trait_types.go                           |   9 +
 pkg/trait/zz_doc_gen.go                            |   1 +
 script/Makefile                                    |   7 +-
 script/gen_client.sh                               |   2 +
 script/gen_doc.sh                                  |  24 ++
 61 files changed, 1958 insertions(+), 484 deletions(-)

diff --git a/cmd/util/doc-gen/generators/generators.go b/cmd/util/doc-gen/generators/generators.go
new file mode 100644
index 0000000..84a898b
--- /dev/null
+++ b/cmd/util/doc-gen/generators/generators.go
@@ -0,0 +1,68 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package generators
+
+import (
+	"path/filepath"
+	"strings"
+
+	"k8s.io/gengo/args"
+	"k8s.io/gengo/generator"
+	"k8s.io/gengo/namer"
+)
+
+// CustomArgs --
+type CustomArgs struct {
+	DocDir    string
+	TraitPath string
+	NavPath   string
+	ListPath  string
+}
+
+// NameSystems returns the name system used by the generators in this package.
+func NameSystems() namer.NameSystems {
+	return namer.NameSystems{
+		"default": namer.NewPublicNamer(0),
+	}
+}
+
+// DefaultNameSystem returns the default name system for ordering the types to be
+// processed by the generators in this package.
+func DefaultNameSystem() string {
+	return "default"
+}
+
+// Packages --
+func Packages(context *generator.Context, arguments *args.GeneratorArgs) (packages generator.Packages) {
+	for _, i := range context.Inputs {
+		pkg := context.Universe[i]
+		if pkg == nil {
+			continue
+		}
+
+		packages = append(packages, &generator.DefaultPackage{
+			PackageName: strings.Split(filepath.Base(pkg.Path), ".")[0],
+			PackagePath: pkg.Path,
+			GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) {
+				generators = append(generators, NewTraitDocGen(arguments))
+				return generators
+			},
+		})
+	}
+	return packages
+}
diff --git a/cmd/util/doc-gen/generators/traitdocgen.go b/cmd/util/doc-gen/generators/traitdocgen.go
new file mode 100644
index 0000000..ea9ae70
--- /dev/null
+++ b/cmd/util/doc-gen/generators/traitdocgen.go
@@ -0,0 +1,357 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package generators
+
+import (
+	"context"
+	"fmt"
+	"io"
+	"io/ioutil"
+	"os"
+	"path"
+	"reflect"
+	"regexp"
+	"sort"
+	"strings"
+
+	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"github.com/apache/camel-k/pkg/trait"
+	"k8s.io/gengo/args"
+	"k8s.io/gengo/generator"
+	"k8s.io/gengo/types"
+)
+
+const (
+	tagTrait = "+camel-k:trait"
+
+	adocCommonMarkerStart = "// Start of autogenerated code - DO NOT EDIT!"
+	adocCommonMarkerEnd = "// End of autogenerated code - DO NOT EDIT!"
+
+	adocDescriptionMarkerStart = adocCommonMarkerStart + " (description)"
+	adocDescriptionMarkerEnd   = adocCommonMarkerEnd + " (description)"
+
+	adocConfigurationMarkerStart = adocCommonMarkerStart + " (configuration)"
+	adocConfigurationMarkerEnd   = adocCommonMarkerEnd + " (configuration)"
+
+	adocNavMarkerStart = adocCommonMarkerStart + " (trait-nav)"
+	adocNavMarkerEnd   = adocCommonMarkerEnd + " (trait-nav)"
+
+	adocListMarkerStart = adocCommonMarkerStart + " (trait-list)"
+	adocListMarkerEnd   = adocCommonMarkerEnd + " (trait-list)"
+)
+
+var (
+	tagTraitID = regexp.MustCompile(fmt.Sprintf("%s=([a-z0-9-]+)", regexp.QuoteMeta(tagTrait)))
+)
+
+// traitDocGen produces documentation about traits
+type traitDocGen struct {
+	generator.DefaultGen
+	arguments           *args.GeneratorArgs
+	generatedTraitFiles []string
+}
+
+// NewTraitDocGen --
+func NewTraitDocGen(arguments *args.GeneratorArgs) generator.Generator {
+	return &traitDocGen{
+		DefaultGen: generator.DefaultGen{},
+		arguments:  arguments,
+	}
+}
+
+func (g *traitDocGen) Filename() string {
+	return "zz_doc_gen.go"
+}
+
+func (g *traitDocGen) Filter(context *generator.Context, t *types.Type) bool {
+	for _, c := range t.CommentLines {
+		if strings.Contains(c, tagTrait) {
+			return true
+		}
+	}
+	return false
+}
+
+func (g *traitDocGen) GenerateType(context *generator.Context, t *types.Type, out io.Writer) error {
+	docDir := g.arguments.CustomArgs.(*CustomArgs).DocDir
+	traitPath := g.arguments.CustomArgs.(*CustomArgs).TraitPath
+	traitID := getTraitID(t)
+	traitFile := traitID + ".adoc"
+	filename := path.Join(docDir, traitPath, traitFile)
+
+	g.generatedTraitFiles = append(g.generatedTraitFiles, traitFile)
+
+	file, content, err := readFile(filename)
+	if err != nil {
+		return err
+	}
+	defer file.Close()
+
+	writeTitle(t, traitID, &content)
+	writeDescription(t, traitID, &content)
+	writeFields(t, traitID, &content)
+
+	return writeFile(file, content)
+}
+
+func (g *traitDocGen) Finalize(c *generator.Context, w io.Writer) error {
+	if err := g.FinalizeNav(c); err != nil {
+		return err
+	}
+	return g.FinalizeList(c)
+}
+
+func (g *traitDocGen) FinalizeNav(*generator.Context) error {
+	docDir := g.arguments.CustomArgs.(*CustomArgs).DocDir
+	navPath := g.arguments.CustomArgs.(*CustomArgs).NavPath
+	filename := path.Join(docDir, navPath)
+
+	file, content, err := readFile(filename)
+	if err != nil {
+		return err
+	}
+	defer file.Close()
+
+	pre, post := split(content, adocNavMarkerStart, adocNavMarkerEnd)
+
+	content = append([]string(nil), pre...)
+	content = append(content, adocNavMarkerStart)
+	sort.Strings(g.generatedTraitFiles)
+	for _, t := range g.generatedTraitFiles {
+		name := traitNameFromFile(t)
+		content = append(content, "** xref:traits/"+t+"["+name+"]")
+	}
+	content = append(content, adocNavMarkerEnd)
+	content = append(content, post...)
+
+	return writeFile(file, content)
+}
+
+func (g *traitDocGen) FinalizeList(*generator.Context) error {
+	docDir := g.arguments.CustomArgs.(*CustomArgs).DocDir
+	listPath := g.arguments.CustomArgs.(*CustomArgs).ListPath
+	filename := path.Join(docDir, listPath)
+
+	file, content, err := readFile(filename)
+	if err != nil {
+		return err
+	}
+	defer file.Close()
+
+	pre, post := split(content, adocListMarkerStart, adocListMarkerEnd)
+
+	content = append([]string(nil), pre...)
+	content = append(content, adocListMarkerStart)
+	sort.Strings(g.generatedTraitFiles)
+	for _, t := range g.generatedTraitFiles {
+		name := traitNameFromFile(t)
+		content = append(content, "* xref:traits/"+t+"["+name+" Trait]")
+	}
+	content = append(content, adocListMarkerEnd)
+	content = append(content, post...)
+
+	return writeFile(file, content)
+}
+
+func traitNameFromFile(file string) string {
+	name := strings.TrimSuffix(file, ".adoc")
+	name = strings.ReplaceAll(name, "trait", "")
+	name = strings.ReplaceAll(name, "-", " ")
+	name = strings.Trim(name, " ")
+	name = strings.Title(name)
+	return name
+}
+
+func writeTitle(t *types.Type, traitID string, content *[]string) {
+	res := append([]string(nil), *content...)
+	for _, s := range res {
+		if strings.HasPrefix(s, "= ") {
+			// Already has a title
+			return
+		}
+	}
+	res = append([]string{"= " + strings.Title(strings.ReplaceAll(traitID, "-", " ")) + " Trait"}, res...)
+	*content = res
+}
+
+func writeDescription(t *types.Type, traitID string, content *[]string) {
+	pre, post := split(*content, adocDescriptionMarkerStart, adocDescriptionMarkerEnd)
+	res := append([]string(nil), pre...)
+	res = append(res, adocDescriptionMarkerStart)
+	for _, l := range filterOutTagsAndComments(t.CommentLines) {
+		res = append(res, l)
+	}
+	profiles := strings.Join(determineProfiles(traitID), ", ")
+	res = append(res, "", fmt.Sprintf("This trait is available in the following profiles: **%s**.", profiles))
+	if isPlatformTrait(traitID) {
+		res = append(res, "", fmt.Sprintf("WARNING: The %s trait is a *platform trait*: disabling it may compromise the platform functionality.", traitID))
+	}
+	res = append(res, "", adocDescriptionMarkerEnd)
+	res = append(res, post...)
+	*content = res
+}
+
+func writeFields(t *types.Type, traitID string, content *[]string) {
+	pre, post := split(*content, adocConfigurationMarkerStart, adocConfigurationMarkerEnd)
+	res := append([]string(nil), pre...)
+	res = append(res, adocConfigurationMarkerStart, "== Configuration", "")
+	res = append(res, "Trait properties can be specified when running any integration with the CLI:")
+	res = append(res, "```")
+	res = append(res, fmt.Sprintf("kamel run --trait %s.[key]=[value] integration.groovy", traitID))
+	res = append(res, "```")
+	res = append(res, "The following configuration options are available:", "")
+	res = append(res, "[cols=\"2,1,5a\"]", "|===")
+	res = append(res, "|Property | Type | Description", "")
+	writeMembers(t, traitID, &res)
+	res = append(res, "|===", "", adocConfigurationMarkerEnd)
+	res = append(res, post...)
+	*content = res
+}
+
+func writeMembers(t *types.Type, traitID string, content *[]string) {
+	res := append([]string(nil), *content...)
+	for _, m := range t.Members {
+		prop := reflect.StructTag(m.Tags).Get("property")
+		if prop != "" {
+			if strings.Contains(prop, "squash") {
+				writeMembers(m.Type, traitID, &res)
+			} else {
+				res = append(res, "| "+traitID+"."+prop)
+				res = append(res, "| "+strings.TrimPrefix(m.Type.Name.Name, "*"))
+				first := true
+				for _, l := range filterOutTagsAndComments(m.CommentLines) {
+					if first {
+						res = append(res, "| "+l)
+						first = false
+					} else {
+						res = append(res, l)
+					}
+				}
+				res = append(res, "")
+			}
+		}
+	}
+	*content = res
+}
+
+func getTraitID(t *types.Type) string {
+	for _, s := range t.CommentLines {
+		if strings.Contains(s, tagTrait) {
+			matches := tagTraitID.FindStringSubmatch(s)
+			if len(matches) < 2 {
+				panic(fmt.Sprintf("unable to extract trait ID from tag line `%s`", s))
+			}
+			return matches[1]
+		}
+	}
+	panic(fmt.Sprintf("trait ID not found in type %s", t.Name.Name))
+}
+
+func filterOutTagsAndComments(comments []string) []string {
+	res := make([]string, 0, len(comments))
+	for _, l := range comments {
+		if !strings.HasPrefix(strings.TrimLeft(l, " \t"), "+") &&
+			!strings.HasPrefix(strings.TrimLeft(l, " \t"), "TODO:") {
+			res = append(res, l)
+		}
+	}
+	return res
+}
+
+func split(doc []string, startMarker, endMarker string) (pre []string, post []string) {
+	if len(doc) == 0 {
+		return nil, nil
+	}
+	idx := len(doc)
+	for i, s := range doc {
+		if s == startMarker {
+			idx = i
+			break
+		}
+	}
+	idy := len(doc)
+	for j, s := range doc {
+		if j > idx && s == endMarker {
+			idy = j
+			break
+		}
+	}
+	pre = doc[0:idx]
+	if idy < len(doc) {
+		post = doc[idy+1:]
+	}
+	return pre, post
+}
+
+func readFile(filename string) (file *os.File, content []string, err error) {
+	if file, err = os.OpenFile(filename, os.O_RDWR|os.O_CREATE, 0777); err != nil {
+		return file, content, err
+	}
+
+	bytes, err := ioutil.ReadFile(filename)
+	if err != nil {
+		return file, content, err
+	}
+	content = strings.Split(string(bytes), "\n")
+	return file, content, nil
+}
+
+func writeFile(file *os.File, content []string) error {
+	if err := file.Truncate(0); err != nil {
+		return err
+	}
+	max := 0
+	for i, line := range content {
+		if line != "" {
+			max = i
+		}
+	}
+	for i, line := range content {
+		if i <= max {
+			if _, err := file.WriteString(line + "\n"); err != nil {
+				return err
+			}
+		}
+	}
+	return nil
+}
+
+func isPlatformTrait(traitID string) bool {
+	ctx, cancel := context.WithCancel(context.Background())
+	defer cancel()
+
+	catalog := trait.NewCatalog(ctx, nil)
+	t := catalog.GetTrait(traitID)
+	return t.IsPlatformTrait()
+}
+
+func determineProfiles(traitID string) (profiles []string) {
+	ctx, cancel := context.WithCancel(context.Background())
+	defer cancel()
+
+	catalog := trait.NewCatalog(ctx, nil)
+	for _, p := range v1alpha1.AllTraitProfiles {
+		traits := catalog.TraitsForProfile(p)
+		for _, t := range traits {
+			if string(t.ID()) == traitID {
+				profiles = append(profiles, string(p))
+			}
+		}
+	}
+	return profiles
+}
diff --git a/cmd/util/doc-gen/main.go b/cmd/util/doc-gen/main.go
new file mode 100644
index 0000000..22ce5f3
--- /dev/null
+++ b/cmd/util/doc-gen/main.go
@@ -0,0 +1,45 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package main
+
+import (
+	"github.com/apache/camel-k/cmd/util/doc-gen/generators"
+	"github.com/spf13/pflag"
+	"k8s.io/gengo/args"
+)
+
+func main() {
+	arguments := args.Default()
+
+	// Custom args.
+	customArgs := &generators.CustomArgs{}
+	pflag.CommandLine.StringVar(&customArgs.DocDir, "doc-dir", "./docs", "Root of the document directory.")
+	pflag.CommandLine.StringVar(&customArgs.TraitPath, "traits-path", "modules/ROOT/pages/traits", "Path to the traits directory.")
+	pflag.CommandLine.StringVar(&customArgs.NavPath, "nav-path", "modules/ROOT/nav.adoc", "Path to the navigation file.")
+	pflag.CommandLine.StringVar(&customArgs.ListPath, "list-path", "modules/ROOT/pages/traits/traits.adoc", "Path to the trait list file.")
+	arguments.CustomArgs = customArgs
+
+	if err := arguments.Execute(
+		generators.NameSystems(),
+		generators.DefaultNameSystem(),
+		generators.Packages,
+	); err != nil {
+		panic(err)
+	}
+
+}
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index 42da5ef..24102da 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -10,6 +10,31 @@
 ** xref:configuration/logging.adoc[Logging]
 ** xref:configuration/dependencies.adoc[Dependencies]
 ** xref:configuration/configmap-secret.adoc[ConfigMap/Secret]
+* xref:traits/traits.adoc[Traits]
+// Start of autogenerated code - DO NOT EDIT! (trait-nav)
+** xref:traits/builder.adoc[Builder]
+** xref:traits/camel.adoc[Camel]
+** xref:traits/classpath.adoc[Classpath]
+** xref:traits/container.adoc[Container]
+** xref:traits/debug.adoc[Debug]
+** xref:traits/dependencies.adoc[Dependencies]
+** xref:traits/deployer.adoc[Deployer]
+** xref:traits/deployment.adoc[Deployment]
+** xref:traits/environment.adoc[Environment]
+** xref:traits/gc.adoc[Gc]
+** xref:traits/ingress.adoc[Ingress]
+** xref:traits/istio.adoc[Istio]
+** xref:traits/jolokia.adoc[Jolokia]
+** xref:traits/knative-service.adoc[Knative Service]
+** xref:traits/knative.adoc[Knative]
+** xref:traits/owner.adoc[Owner]
+** xref:traits/probes.adoc[Probes]
+** xref:traits/prometheus.adoc[Prometheus]
+** xref:traits/quarkus.adoc[Quarkus]
+** xref:traits/rest-dsl.adoc[Rest Dsl]
+** xref:traits/route.adoc[Route]
+** xref:traits/service.adoc[Service]
+// End of autogenerated code - DO NOT EDIT! (trait-nav)
 * xref:languages/languages.adoc[Languages]
 ** xref:languages/groovy.adoc[Groovy]
 ** xref:languages/kotlin.adoc[Kotlin]
@@ -18,6 +43,5 @@
 ** xref:languages/xml.adoc[XML]
 * xref:tutorials/tutorials.adoc[Tutorials]
 ** xref:tutorials/tekton/tekton.adoc[Tekton Pipelines]
-* xref:traits.adoc[Traits]
 * xref:uninstalling.adoc[Uninstalling]
 * xref:developers.adoc[Contributing to Camel K]
diff --git a/docs/modules/ROOT/pages/traits.adoc b/docs/modules/ROOT/pages/traits.adoc
deleted file mode 100644
index f5b4dd0..0000000
--- a/docs/modules/ROOT/pages/traits.adoc
+++ /dev/null
@@ -1,458 +0,0 @@
-[[traits]]
-= Traits
-
-Traits are high level named features of Camel K that can be enabled/disabled or configured to customize the
-behavior of the final integration.
-
-Camel K provide sensible defaults for all such traits, taking into account the details of the target platform where
-the integration is going to run into. However, it's possible for a **expert user** to configure them in
-order to obtain a different behavior.
-
-== Configuration
-
-Each trait has a unique ID that can be used to configure it using the command line tool.
-
-E.g. in order to disable the creation of a Service for a integration, a user can execute:
-
-```
-kamel run --trait service.enabled=false file.groovy
-```
-
-The flag `--trait` can be also abbreviated with `-t`.
-
-The `enabled` property is available on all traits and can be used to enable/disable them. All traits have their own
-internal logic to determine if they need to be enabled when the user does not activate them explicitly.
-
-All traits share also a `auto` property that can be used to enable/disable auto-configuration of the trait based on the
-environment. The auto-configuration mechanism is able to enable/disable the trait when the `enabled` property is not explicitly
-set by the user and also change the trait configuration. The `auto` property is enabled by default.
-
-NOTE: Some traits are applicable only to specific platforms (see "profiles" in the table).
-
-A trait may have additional properties that can be configured by the end user.
-
-E.g. the following command configures the container `port` that should be exposed by the service:
-
-```
-kamel run --trait service.enabled=true --trait container.service-port=8081 file.groovy
-```
-
-Or the equivalent command (assuming that the service trait is enabled by auto-detection):
-
-```
-kamel run -t container.service-port=8081 file.groovy
-```
-
-NOTE: Enabling a trait does not force the trait to be activated, especially if the trait specific preconditions do not hold.
-E.g. enabling the `route` trait while the `service` trait is disabled does not produce automatically a route, since a service is needed
-for the `route` trait to work.
-
-== Common Traits
-
-The following is a list of common traits that can be configured by the end users:
-
-[options="header",cols="1m,,3a"]
-|=======================
-| Trait      | Profiles 				| Description
-
-| dependencies
-| Kubernetes, OpenShift
-| Automatically adds dependencies required by the Camel routes by inspecting the user code.
-  +
-  +
-  It's enabled by default.
-
-| deployer
-| Kubernetes, OpenShift
-| Configure deployer behavior.
-  +
-  +
-  It's enabled by default.
-
-
-[cols="m,"]
-!===
-
-! deployer.kind
-! Allows to explicitly select the desired deployment kind between `deployment` or `knative-service` when creating the resources for running the integration.
-
-!===
-
-| deployment
-| Kubernetes, OpenShift
-| Creates a standard Kubernetes deployment for running the integration.
-  +
-  +
-  It's enabled by default on vanilla Kubernetes/Openshift profiles.
-
-| affinity
-| All
-| Allows to constrain which nodes the integration pod(s) are eligible to be scheduled on, based on labels on the node, or with inter-pod affinity and anti-affinity, based on labels on pods that are already running on the nodes.
-  +
-  +
-  It's disabled by default.
-
-[cols="m,"]
-!===
-
-! affinity.pod-affinity
-! Always co-locates multiple replicas of the integration in the same node (default `false`).
-
-! affinity.pod-affinity-labels
-! Defines a set of pods (namely those matching the label selector, relative to the given namespace) that the integration pod(s) should be co-located with.
-
-! affinity.pod-anti-affinity
-! Never co-locates multiple replicas of the integration in the same node (default `false`).
-
-! affinity.pod-anti-affinity-labels
-! Defines a set of pods (namely those matching the label selector, relative to the given namespace) that the integration pod(s) should not be co-located with.
-
-! affinity.node-affinity-labels
-! Defines a set of nodes the integration pod(s) are eligible to be scheduled on, based on labels on the node.
-
-!===
-
-Examples:
-
-* To schedule the integration pod(s) on a specific node using the https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#interlude-built-in-node-labels[built-in node label] `kubernetes.io/hostname`:
-[source,shell]
-$ kamel run -t affinity.node-affinity-labels="kubernetes.io/hostname in(node-66-50.hosted.k8s.tld)" ...
-
-* To schedule a single integration pod per node (using the `Exists` operator):
-[source,shell]
-$ kamel run -t affinity.pod-anti-affinity-labels="camel.apache.org/integration" ...
-
-* To co-locate the integration pod(s) with other integration pod(s):
-[source,shell]
-$ kamel run -t affinity.pod-affinity-labels="camel.apache.org/integration in(it1, it2)" ...
-
-The labels options follow the requirements from https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors[Label selectors]. They can be multi-valuated, then the requirements list is ANDed, e.g., to schedule a single integration pod per node AND not co-located with the Camel K operator pod(s):
-[source,shell]
-$ kamel run -t affinity.pod-anti-affinity-labels="camel.apache.org/integration" -t affinity.pod-anti-affinity-labels="camel.apache.org/component=operator" ...
-
-More information can be found in the official Kubernetes documentation about https://kubernetes.io/docs/concepts/configuration/assign-pod-node/[Assigning Pods to Nodes].
-
-| knative
-| Knative (Kubernetes, OpenShift)
-| Creates Knative resources to run the integration instead of the standard Kubernetes resources.
-  +
-  +
-  It's enabled by default when the Knative profile is active.
-
-[cols="m,"]
-!===
-
-! knative.channel-sources
-! Configures a (comma-separated) list of channels to which the Knative service must be subscribed (to receive cloudevents from a channel). May also contain Camel URIs instead of simple names.
-
-! knative.channel-sinks
-! Configures a (comma-separated) list of channels to which the Knative service publishes. May also contain Camel URIs instead of simple names.
-
-! knative.endpoint-sources
-! Configures a (comma-separated) list of endpoints the Knative service exposes (the name is). May also contain Camel URIs instead of simple names.
-
-! knative.endpoint-sinks
-! Configures a (comma-separated) list of endpoints the Knative consumes. May also contain Camel URIs instead of simple names.
-
-! knative.event-sources
-! Configures a (comma-separated) list of events that will trigger the Knative service (receiving cloudevents from the broker). May also contain Camel URIs instead of simple names.
-
-! knative.event-sinks
-! Configures a (comma-separated) list of event types that the service will produce. May also contain Camel URIs instead of simple names.
-
-! knative.filter-source-channels
-! Force the knative endpoint to filter messages based on the `ce-knativehistory` header (Knative experimental feature). It's enabled automatically when there are more than 2 source channels. It's optional (default to false) when there's a single source channel.
-
-!===
-
-| istio
-| All
-| Allows to configure outbound traffic for Istio.
-  +
-  +
-  It's disabled by default.
-
-[cols="m,"]
-!===
-
-! istio.allow
-! Configures a (comma-separated) list of CIDR subnets that should not be intercepted by the Istio proxy (`10.0.0.0/8,172.16.0.0/12,192.168.0.0/16` by default).
-
-! istio.inject
-! Forces the value for labels `sidecar.istio.io/inject`. By default the label is set to `true` on deployment and not set on Knative Service. 
-
-!===
-
-| service
-| All (Knative in deployment mode)
-| Exposes the integration with a Service resource so that it can be accessed by other applications (or integrations) in the same namespace.
-  +
-  +
-  It's enabled by default if the integration depends on a Camel component that can expose a HTTP endpoint.
-
-[cols="m,"]
-!===
-
-!===
-
-| route
-| OpenShift
-| Exposes the service associated with the integration to the outside world with a OpenShift Route.
-  +
-  +
-  It's enabled by default whenever a Service is added to the integration (through the `service` trait).
-
-[cols="m,"]
-!===
-
-! route.host
-! To configure the host exposed by the route.
-
-!===
-
-| ingress
-| Kubernetes
-| Exposes the service associated with the integration to the outside world with a Kubernetes Ingress.
-  +
-  +
-  It's enabled by default whenever a Service is added to the integration (through the `service` trait).
-
-[cols="m,"]
-!===
-
-! ingress.host
-! **Required**. To configure the host exposed by the ingress.
-
-!===
-
-| debug
-| All
-| Run the integration in debug mode (you can port-forward to port 5005 to connect)
-  +
-  +
-  It's disabled by default.
-
-| jolokia
-| Kubernetes, OpenShift
-| Activate and configures the Jolokia Java agent.
-  +
-  +
-  It's disabled by default.
-
-[cols="m,"]
-!===
-
-! jolokia.protocol
-! The protocol to use, either `http` or `https` (default `https` for OpenShift)
-
-! jolokia.host
-! The Host address to which the Jolokia agent should bind to. If `"\*"` or `"0.0.0.0"` is given, the servers binds to every network interface (default `"*"`).
-
-! jolokia.port
-! The Jolokia endpoint port (default `8778`).
-
-! jolokia.user
-! The user to be used for authentication
-
-! jolokia.password
-! The password used for authentication, applicable when the `user` option is set
-
-! jolokia.discovery-enabled
-! Listen for multicast requests (default `false`)
-
-! jolokia.use-ssl-client-authentication
-! Whether client certificates should be used for authentication (default `true` for OpenShift)
-
-! jolokia.ca-cert
-! The PEM encoded CA certification file path, used to verify client certificates, applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true` (default `/var/run/secrets/kubernetes.io/serviceaccount/ca.crt` for OpenShift).
-
-! jolokia.client-principal
-! The principal which must be given in a client certificate to allow access to the Jolokia endpoint, applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true` (default `clientPrincipal=cn=system:master-proxy` for OpenShift).
-
-! jolokia.extended-client-check
-! Mandate the client certificate contains a client flag in the extended key usage section, applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true` (default `true` for OpenShift).
-
-! jolokia.options
-! A comma-separated list of additional Jolokia options as defined in https://jolokia.org/reference/html/agents.html#agent-jvm-config[JVM agent configuration options], e.g.: `keystore=...,executor=...`
-
-!===
-
-| prometheus
-| Kubernetes, OpenShift
-| Exposes the integration with a `Service` and a `ServiceMonitor` resources so that the Prometheus endpoint can be scraped.
-
-WARNING: Creating the `ServiceMonitor` resource requires the https://github.com/coreos/prometheus-operator[Prometheus Operator] custom resource definition to be installed.
-You can set `service-monitor` to `false` for the Prometheus trait to work without the Prometheus operator.
-
-It's disabled by default.
-
-[cols="m,"]
-!===
-
-! prometheus.port
-! The Prometheus endpoint port (default `9778`).
-
-! prometheus.service-monitor
-! Whether a `ServiceMonitor` resource is created (default `true`).
-
-! prometheus.service-monitor-labels
-! The `ServiceMonitor` resource labels, applicable when `service-monitor` is `true`.
-
-!===
-
-| camel
-| All
-| Resolve Camel version
-  +
-  +
-  It's enabled by default.
-
-[cols="m,"]
-!===
-
-! camel.version
-! The camel version to use for the integration, it overrides the default version set in the Integration Platform
-
-!===
-
-| probes
-| Kubernetes, OpenShift
-| Configure Liveness and Readiness probes.
-  +
-  +
-  It's disabled by default.
-
-[cols="m,"]
-!===
-
-! probes.bind-host
-! Configures the host on which the probe is exposed (default `0.0.0.0`).
-
-! probes.bind-port
-! Configures the port on which the probe is exposed (default `8080`).
-
-! probes.path
-! Path to access on the probe ( default `/health`).
-
-! probes.liveness-initial-delay
-! Number of seconds after the container has started before liveness probes are initiated.
-! probes.liveness-timeout
-! Number of seconds after which the probe times out.
-! probes.liveness-period
-! How often to perform the probe.
-! probes.liveness-success-threshold
-! Minimum consecutive successes for the probe to be considered successful after having failed.
-! probes.liveness-failure-threshold
-! Minimum consecutive failures for the probe to be considered failed after having succeeded.
-
-! probes.readiness-initial-delay
-! Number of seconds after the container has started before liveness probes are initiated.
-! probes.readiness-timeout
-! Number of seconds after which the probe times out.
-! probes.readiness-period
-! How often to perform the probe.
-! probes.readiness-success-threshold
-! Minimum consecutive successes for the probe to be considered successful after having failed.
-! probes.readiness-failure-threshold
-! Minimum consecutive failures for the probe to be considered failed after having succeeded.
-
-!===
-
-| container
-| All
-| Configure integration contianer.
-  +
-  +
-  It's disabled by default.
-
-[cols="m,"]
-!===
-
-! container.request-cpu
-! The minimum amount of CPU required.
-
-! container.request-memory
-! The minimum amount of memory required.
-
-! container.limit-cpu
-! The maximum amount of CPU required.
-
-! container.limit-memory
-! The maximum amount of memory required.
-
-! container.service-port
-! To configure under which service port the container port is to be exposed (default `80`).
-
-! container.service-port-name
-! To configure under which service port name the container port is to be exposed (default `http`).
-
-! container.port
-! To configure a different port exposed by the container (default `8080`).
-
-! container.port-name
-! To configure a different port name for the port exposed by the container (default `http`).
-
-!===
-
-| quarkus
-| All
-| Activates the Quarkus runtime
-  +
-  +
-It's disabled by default.
-
-[cols="m,"]
-!===
-
-! quarkus.camel-quarkus-version
-! The Camel Quarkus version to use for the integration
-
-! quarkus.quarkus-version
-! The Quarkus version to use for the integration
-
-!===
-
-|=======================
-
-
-== Platform Traits (Advanced)
-
-There are also platform traits that **normally should not be configured** by the end user. So change them **only if you know what you're doing**.
-
-[options="header",cols="1m,2,3a"]
-|=======================
-| Trait      | Profiles 				| Description
-| owner
-| All
-| Ensures that all created resources belong to the integration being created (so they are deleted when the integration is deleted) and transfers annotations and labels on the integration onto these owned resources.
-  +
-  +
-  It's enabled by default.
-
-[cols="m,"]
-!===
-
-! owner.target-annotations
-! The annotations to be transferred (A comma-separated list of label keys)
-
-! owner.target-labels
-! The labels to be transferred (A comma-separated list of label keys)
-
-!===
-
-| gc
-| All
-| Garbage collect resources that are no longer necessary upon integration updates.
-  +
-  +
-  It's enabled by default.
-
-[cols="m,"]
-!===
-
-! gc.discovery-cache
-! Discovery client cache to be used, either `disabled`, `disk` or `memory` (default `memory`)
-
-!===
-
-|=======================
diff --git a/docs/modules/ROOT/pages/traits/builder.adoc b/docs/modules/ROOT/pages/traits/builder.adoc
new file mode 100755
index 0000000..5ca86b7
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/builder.adoc
@@ -0,0 +1,32 @@
+= Builder Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The builder trait is internally used to determine the best strategy to
+build and configure IntegrationKits.
+
+
+This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
+
+WARNING: The builder trait is a *platform trait*: disabling it may compromise the platform functionality.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait builder.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| builder.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/camel.adoc b/docs/modules/ROOT/pages/traits/camel.adoc
new file mode 100755
index 0000000..c3c48e9
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/camel.adoc
@@ -0,0 +1,39 @@
+= Camel Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The Camel trait can be used to configure versions of Apache Camel and related libraries.
+
+
+This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
+
+WARNING: The camel trait is a *platform trait*: disabling it may compromise the platform functionality.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait camel.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| camel.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+| camel.version
+| string
+| The camel version to use for the integration. It overrides the default version set in the Integration Platform.
+
+| camel.runtime-version
+| string
+| The camel-k-runtime version to use for the integration. It overrides the default version set in the Integration Platform.
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/classpath.adoc b/docs/modules/ROOT/pages/traits/classpath.adoc
new file mode 100755
index 0000000..9b5f516
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/classpath.adoc
@@ -0,0 +1,31 @@
+= Classpath Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The Classpath trait is used internally to configure the classpath of the final integration.
+
+
+This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
+
+WARNING: The classpath trait is a *platform trait*: disabling it may compromise the platform functionality.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait classpath.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| classpath.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/container.adoc b/docs/modules/ROOT/pages/traits/container.adoc
new file mode 100755
index 0000000..7b9fefb
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/container.adoc
@@ -0,0 +1,77 @@
+= Container Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The Container trait can be used to configure properties of the container where the integration will run.
+
+It also provides configuration for Services associated to the container.
+
+
+This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
+
+WARNING: The container trait is a *platform trait*: disabling it may compromise the platform functionality.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait container.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| container.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+| container.auto
+| bool
+| 
+
+| container.request-cpu
+| string
+| The minimum amount of CPU required.
+
+| container.request-memory
+| string
+| The minimum amount of memory required.
+
+| container.limit-cpu
+| string
+| The maximum amount of CPU required.
+
+| container.limit-memory
+| string
+| The maximum amount of memory required.
+
+| container.expose
+| bool
+| Can be used to enable/disable exposure via kubernetes Service.
+
+| container.port
+| int
+| To configure a different port exposed by the container (default `8080`).
+
+| container.port-name
+| string
+| To configure a different port name for the port exposed by the container (default `http`).
+
+| container.service-port
+| int
+| To configure under which service port the container port is to be exposed (default `80`).
+
+| container.service-port-name
+| string
+| To configure under which service port name the container port is to be exposed (default `http`).
+
+| container.name
+| string
+| The main container name. It's named `integration` by default.
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/debug.adoc b/docs/modules/ROOT/pages/traits/debug.adoc
new file mode 100755
index 0000000..1ac28e4
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/debug.adoc
@@ -0,0 +1,32 @@
+= Debug Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The Debug trait can be used to enable debugging on the integration container,
+so that a remote debugger can be attached.
+
+Enabling the trait will inject the `JAVA_DEBUG` environment variable into the integration container.
+
+
+This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait debug.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| debug.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/dependencies.adoc b/docs/modules/ROOT/pages/traits/dependencies.adoc
new file mode 100755
index 0000000..c1c94fb
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/dependencies.adoc
@@ -0,0 +1,32 @@
+= Dependencies Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The Dependencies trait is internally used to automatically add runtime dependencies based on the
+integration that the user wants to run.
+
+
+This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
+
+WARNING: The dependencies trait is a *platform trait*: disabling it may compromise the platform functionality.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait dependencies.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| dependencies.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/deployer.adoc b/docs/modules/ROOT/pages/traits/deployer.adoc
new file mode 100755
index 0000000..44976b6
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/deployer.adoc
@@ -0,0 +1,36 @@
+= Deployer Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The deployer trait can be used to explicitly select the kind of high level resource that
+will deploy the integration.
+
+
+This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
+
+WARNING: The deployer trait is a *platform trait*: disabling it may compromise the platform functionality.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait deployer.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| deployer.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+| deployer.kind
+| string
+| Allows to explicitly select the desired deployment kind between `deployment` or `knative-service` when creating the resources for running the integration.
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/deployment.adoc b/docs/modules/ROOT/pages/traits/deployment.adoc
new file mode 100755
index 0000000..3626683
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/deployment.adoc
@@ -0,0 +1,32 @@
+= Deployment Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The Deployment trait is responsible for generating the Kubernetes deployment that will make sure
+the integration will run in the cluster.
+
+
+This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
+
+WARNING: The deployment trait is a *platform trait*: disabling it may compromise the platform functionality.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait deployment.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| deployment.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/environment.adoc b/docs/modules/ROOT/pages/traits/environment.adoc
new file mode 100755
index 0000000..51c65b0
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/environment.adoc
@@ -0,0 +1,36 @@
+= Environment Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The environment trait is used internally to inject standard environment variables in the integration container,
+such as `NAMESPACE`, `POD_NAME`, `JAVA_MAIN_CLASS` and others.
+
+
+This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
+
+WARNING: The environment trait is a *platform trait*: disabling it may compromise the platform functionality.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait environment.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| environment.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+| environment.container-meta
+| bool
+| 
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/gc.adoc b/docs/modules/ROOT/pages/traits/gc.adoc
new file mode 100755
index 0000000..f4589bc
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/gc.adoc
@@ -0,0 +1,33 @@
+= Gc Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The GC Trait garbage-collects all resources that are no longer necessary upon integration updates.
+
+
+This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait gc.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| gc.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+| gc.discovery-cache
+| github.com/apache/camel-k/pkg/trait.discoveryCacheType
+| Discovery client cache to be used, either `disabled`, `disk` or `memory` (default `memory`)
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/ingress.adoc b/docs/modules/ROOT/pages/traits/ingress.adoc
new file mode 100755
index 0000000..08efa26
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/ingress.adoc
@@ -0,0 +1,40 @@
+= Ingress Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The Ingress trait can be used to expose the service associated with the integration
+to the outside world with a Kubernetes Ingress.
+
+It's enabled by default whenever a Service is added to the integration (through the `service` trait).
+
+
+This trait is available in the following profiles: **Kubernetes**.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait ingress.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| ingress.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+| ingress.host
+| string
+| **Required**. To configure the host exposed by the ingress.
+
+| ingress.auto
+| bool
+| To automatically add an ingress whenever the integration uses a HTTP endpoint consumer.
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/istio.adoc b/docs/modules/ROOT/pages/traits/istio.adoc
new file mode 100755
index 0000000..d431ab3
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/istio.adoc
@@ -0,0 +1,38 @@
+= Istio Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The Istio trait allows to configure properties related to the Istio service mesh,
+such as sidecar injection and outbound IP ranges.
+
+
+This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait istio.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| istio.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+| istio.allow
+| string
+| Configures a (comma-separated) list of CIDR subnets that should not be intercepted by the Istio proxy (`10.0.0.0/8,172.16.0.0/12,192.168.0.0/16` by default).
+
+| istio.inject
+| bool
+| Forces the value for labels `sidecar.istio.io/inject`. By default the label is set to `true` on deployment and not set on Knative Service.
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/jolokia.adoc b/docs/modules/ROOT/pages/traits/jolokia.adoc
new file mode 100755
index 0000000..0fa4314
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/jolokia.adoc
@@ -0,0 +1,84 @@
+= Jolokia Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The Jolokia trait activates and configures the Jolokia Java agent.
+
+See https://jolokia.org/reference/html/agents.html
+
+
+This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait jolokia.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| jolokia.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+| jolokia.ca-cert
+| string
+| The PEM encoded CA certification file path, used to verify client certificates,
+applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true`
+(default `/var/run/secrets/kubernetes.io/serviceaccount/ca.crt` for OpenShift).
+
+| jolokia.client-principal
+| string
+| The principal which must be given in a client certificate to allow access to the Jolokia endpoint,
+applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true`
+(default `clientPrincipal=cn=system:master-proxy` for OpenShift).
+
+| jolokia.discovery-enabled
+| bool
+| Listen for multicast requests (default `false`)
+
+| jolokia.extended-client-check
+| bool
+| Mandate the client certificate contains a client flag in the extended key usage section,
+applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true`
+(default `true` for OpenShift).
+
+| jolokia.host
+| string
+| The Host address to which the Jolokia agent should bind to. If `"\*"` or `"0.0.0.0"` is given,
+the servers binds to every network interface (default `"*"`).
+
+| jolokia.password
+| string
+| The password used for authentication, applicable when the `user` option is set.
+
+| jolokia.port
+| int
+| The Jolokia endpoint port (default `8778`).
+
+| jolokia.protocol
+| string
+| The protocol to use, either `http` or `https` (default `https` for OpenShift)
+
+| jolokia.user
+| string
+| The user to be used for authentication
+
+| jolokia.use-ssl-client-authentication
+| bool
+| Whether client certificates should be used for authentication (default `true` for OpenShift).
+
+| jolokia.options
+| string
+| A comma-separated list of additional Jolokia options as defined
+in https://jolokia.org/reference/html/agents.html#agent-jvm-config[JVM agent configuration options],
+e.g.: `keystore=...,executor=...`
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/knative-service.adoc b/docs/modules/ROOT/pages/traits/knative-service.adoc
new file mode 100755
index 0000000..bdfd2b2
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/knative-service.adoc
@@ -0,0 +1,72 @@
+= Knative Service Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The Knative Service trait allows to configure options when running the integration as Knative service instead of
+a standard Kubernetes Deployment.
+
+Running integrations as Knative Services adds auto-scaling (and scaling-to-zero) features, but those features
+are only meaningful when the routes use a HTTP endpoint consumer.
+
+
+This trait is available in the following profiles: **Knative**.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait knative-service.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| knative-service.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+| knative-service.autoscaling-class
+| string
+| Configures the Knative autoscaling class property (e.g. to set `hpa.autoscaling.knative.dev` or `kpa.autoscaling.knative.dev` autoscaling).
+
+Refer to the Knative documentation for more information.
+
+| knative-service.autoscaling-metric
+| string
+| Configures the Knative autoscaling metric property (e.g. to set `concurrency` based or `cpu` based autoscaling).
+
+Refer to the Knative documentation for more information.
+
+| knative-service.autoscaling-target
+| int
+| Sets the allowed concurrency level or CPU percentage (depending on the autoscaling metric) for each Pod.
+
+Refer to the Knative documentation for more information.
+
+| knative-service.min-scale
+| int
+| The minimum number of Pods that should be running at any time for the integration. It's **zero** by default, meaning that
+the integration is scaled down to zero when not used for a configured amount of time.
+
+Refer to the Knative documentation for more information.
+
+| knative-service.max-scale
+| int
+| An upper bound for the number of Pods that can be running in parallel for the integration.
+Knative has its own cap value that depends on the installation.
+
+Refer to the Knative documentation for more information.
+
+| knative-service.auto
+| bool
+| Automatically deploy the integration as Knative service when all conditions hold:
+
+* Integration is using the Knative profile
+* All routes are either starting from a HTTP based consumer or a passive consumer (e.g. `direct` is a passive consumer)
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/knative.adoc b/docs/modules/ROOT/pages/traits/knative.adoc
new file mode 100755
index 0000000..f3b44a7
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/knative.adoc
@@ -0,0 +1,83 @@
+= Knative Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The Knative trait automatically discovers addresses of Knative resources and inject them into the
+running integration.
+
+The full Knative configuration is injected in the CAMEL_KNATIVE_CONFIGURATION in JSON format.
+The Camel Knative component will then use the full configuration to configure the routes.
+
+The trait is enabled by default when the Knative profile is active.
+
+
+This trait is available in the following profiles: **Knative**.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait knative.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| knative.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+| knative.configuration
+| string
+| Can be used to inject a Knative complete configuration in JSON format.
+
+| knative.channel-sources
+| string
+| Comma-separated list of channels used as source of integration routes.
+Can contain simple channel names or full Camel URIs.
+
+| knative.channel-sinks
+| string
+| Comma-separated list of channels used as destination of integration routes.
+Can contain simple channel names or full Camel URIs.
+
+| knative.endpoint-sources
+| string
+| Comma-separated list of channels used as source of integration routes.
+
+| knative.endpoint-sinks
+| string
+| Comma-separated list of endpoints used as destination of integration routes.
+Can contain simple endpoint names or full Camel URIs.
+
+| knative.event-sources
+| string
+| Comma-separated list of event types that the integration will be subscribed to.
+Can contain simple event types or full Camel URIs (to use a specific broker different from "default").
+
+| knative.event-sinks
+| string
+| Comma-separated list of event types that the integration will produce.
+Can contain simple event types or full Camel URIs (to use a specific broker).
+
+| knative.filter-source-channels
+| bool
+| Enables filtering on events based on the header "ce-knativehistory". Since this is an experimental header
+that can be removed in a future version of Knative, filtering is enabled only when the integration is
+listening from more than 1 channel.
+
+| knative.knative-08-compat-mode
+| bool
+| The Knative 0.8 compatibility mode will check the installed version of Knative and
+use resource versions compatible with Knative 0.8 if found on the cluster.
+
+| knative.auto
+| bool
+| Enable automatic discovery of all trait properties.
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/owner.adoc b/docs/modules/ROOT/pages/traits/owner.adoc
new file mode 100755
index 0000000..98b518f
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/owner.adoc
@@ -0,0 +1,40 @@
+= Owner Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The Owner trait ensures that all created resources belong to the integration being created
+and transfers annotations and labels on the integration onto these owned resources.
+
+
+This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
+
+WARNING: The owner trait is a *platform trait*: disabling it may compromise the platform functionality.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait owner.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| owner.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+| owner.target-annotations
+| string
+| The annotations to be transferred (A comma-separated list of label keys)
+
+| owner.target-labels
+| string
+| The labels to be transferred (A comma-separated list of label keys)
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/probes.adoc b/docs/modules/ROOT/pages/traits/probes.adoc
new file mode 100755
index 0000000..80e050d
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/probes.adoc
@@ -0,0 +1,81 @@
+= Probes Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The Probes trait allows to configure Liveness and Readiness probes on the integration container.
+
+
+This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait probes.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| probes.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+| probes.bind-host
+| string
+| Configures the host on which the probe is exposed (default `0.0.0.0`).
+
+| probes.bind-port
+| int
+| Configures the port on which the probe is exposed (default `8080`).
+
+| probes.path
+| string
+| Path to access on the probe ( default `/health`).
+
+| probes.liveness-initial-delay
+| int32
+| Number of seconds after the container has started before liveness probes are initiated.
+
+| probes.liveness-timeout
+| int32
+| Number of seconds after which the probe times out. Applies to the liveness probe.
+
+| probes.liveness-period
+| int32
+| How often to perform the probe. Applies to the liveness probe.
+
+| probes.liveness-success-threshold
+| int32
+| Minimum consecutive successes for the probe to be considered successful after having failed. Applies to the liveness probe.
+
+| probes.liveness-failure-threshold
+| int32
+| Minimum consecutive failures for the probe to be considered failed after having succeeded. Applies to the liveness probe.
+
+| probes.readiness-initial-delay
+| int32
+| Number of seconds after the container has started before readiness probes are initiated.
+
+| probes.readiness-timeout
+| int32
+| Number of seconds after which the probe times out. Applies to the readiness probe.
+
+| probes.readiness-period
+| int32
+| How often to perform the probe. Applies to the readiness probe.
+
+| probes.readiness-success-threshold
+| int32
+| Minimum consecutive successes for the probe to be considered successful after having failed. Applies to the readiness probe.
+
+| probes.readiness-failure-threshold
+| int32
+| Minimum consecutive failures for the probe to be considered failed after having succeeded. Applies to the readiness probe.
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/prometheus.adoc b/docs/modules/ROOT/pages/traits/prometheus.adoc
new file mode 100755
index 0000000..f358769
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/prometheus.adoc
@@ -0,0 +1,48 @@
+= Prometheus Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The Prometheus trait exposes the integration with a `Service` and a `ServiceMonitor` resources
+so that the Prometheus endpoint can be scraped.
+
+WARNING: Creating the `ServiceMonitor` resource requires the https://github.com/coreos/prometheus-operator[Prometheus Operator]
+custom resource definition to be installed. You can set `service-monitor` to `false` for the Prometheus trait to work without
+the Prometheus operator.
+
+It's disabled by default.
+
+
+This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait prometheus.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| prometheus.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+| prometheus.port
+| int
+| The Prometheus endpoint port (default `9778`).
+
+| prometheus.service-monitor
+| bool
+| Whether a `ServiceMonitor` resource is created (default `true`).
+
+| prometheus.service-monitor-labels
+| string
+| The `ServiceMonitor` resource labels, applicable when `service-monitor` is `true`.
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/quarkus.adoc b/docs/modules/ROOT/pages/traits/quarkus.adoc
new file mode 100755
index 0000000..ffe20e1
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/quarkus.adoc
@@ -0,0 +1,39 @@
+= Quarkus Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The Quarkus trait activates the Quarkus runtime.
+
+It's disabled by default.
+
+
+This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait quarkus.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| quarkus.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+| quarkus.quarkus-version
+| string
+| The Quarkus version to use for the integration
+
+| quarkus.camel-quarkus-version
+| string
+| The Camel-Quarkus version to use for the integration
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/rest-dsl.adoc b/docs/modules/ROOT/pages/traits/rest-dsl.adoc
new file mode 100755
index 0000000..fad21da
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/rest-dsl.adoc
@@ -0,0 +1,31 @@
+= Rest Dsl Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The Rest DSL trait is internally used to allow creating integrations from a OpenAPI specs.
+
+
+This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
+
+WARNING: The rest-dsl trait is a *platform trait*: disabling it may compromise the platform functionality.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait rest-dsl.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| rest-dsl.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/route.adoc b/docs/modules/ROOT/pages/traits/route.adoc
new file mode 100755
index 0000000..a9a01e6
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/route.adoc
@@ -0,0 +1,73 @@
+= Route Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The Route trait can be used to configure the creation of OpenShift routes for the integration.
+
+
+This trait is available in the following profiles: **OpenShift**.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait route.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| route.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+| route.host
+| string
+| To configure the host exposed by the route.
+
+| route.tls-termination
+| string
+| The TLS termination type, like `edge`, `passthrough` or `reencrypt`.
+
+Refer to the OpenShift documentation for additional information.
+
+| route.tls-certificate
+| string
+| The TLS certificate contents.
+
+Refer to the OpenShift documentation for additional information.
+
+| route.tls-key
+| string
+| The TLS certificate key contents.
+
+Refer to the OpenShift documentation for additional information.
+
+| route.tls-ca-certificate
+| string
+| The TLS cert authority certificate contents.
+
+Refer to the OpenShift documentation for additional information.
+
+| route.tls-destination-ca-certificate
+| string
+| The destination CA certificate provides the contents of the ca certificate of the final destination.  When using reencrypt
+termination this file should be provided in order to have routers use it for health checks on the secure connection.
+If this field is not specified, the router may provide its own destination CA and perform hostname validation using
+the short service name (service.namespace.svc), which allows infrastructure generated certificates to automatically
+verify.
+
+Refer to the OpenShift documentation for additional information.
+
+| route.tls-insecure-edge-termination-policy
+| string
+| To configure how to deal with insecure traffic, e.g. `Allow`, `Disable` or `Redirect` traffic.
+
+Refer to the OpenShift documentation for additional information.
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/service.adoc b/docs/modules/ROOT/pages/traits/service.adoc
new file mode 100755
index 0000000..053b419
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/service.adoc
@@ -0,0 +1,36 @@
+= Service Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The Service trait exposes the integration with a Service resource so that it can be accessed by other applications
+(or integrations) in the same namespace.
+
+It's enabled by default if the integration depends on a Camel component that can expose a HTTP endpoint.
+
+
+This trait is available in the following profiles: **Kubernetes, OpenShift**.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait service.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| service.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+| service.auto
+| bool
+| To automatically detect from the code if a Service needs to be created.
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/traits.adoc b/docs/modules/ROOT/pages/traits/traits.adoc
new file mode 100644
index 0000000..4f35b00
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/traits.adoc
@@ -0,0 +1,59 @@
+[[traits]]
+= Traits
+
+Traits are high level named features of Camel K that can be enabled/disabled or configured to customize the
+behavior of the final integration.
+
+Camel K provide sensible defaults for all such traits, taking into account the details of the target platform where
+the integration is going to run into. However, it's possible for a **expert user** to configure them in
+order to obtain a different behavior.
+
+== Configuration
+
+Each trait has a unique ID that can be used to configure it using the command line tool.
+
+E.g. in order to disable the creation of a Service for a integration, a user can execute:
+
+```
+kamel run --trait service.enabled=false file.groovy
+```
+
+The flag `--trait` can be also abbreviated with `-t`.
+
+The `enabled` property is available on all traits and can be used to enable/disable them. All traits have their own
+internal logic to determine if they need to be enabled when the user does not activate them explicitly.
+
+Some traits share also a `auto` property that can be used to enable/disable auto-configuration of the trait based on the
+environment. The auto-configuration mechanism is able to enable/disable the trait when the `enabled` property is not explicitly
+set by the user and also change the trait configuration.
+
+NOTE: Some traits are applicable only to specific platforms (see the "profiles" in the trait description page).
+
+A trait may have additional properties that can be configured by the end user.
+
+See the trait description pages for more information on a specific trait:
+
+// Start of autogenerated code - DO NOT EDIT! (trait-list)
+* xref:traits/builder.adoc[Builder Trait]
+* xref:traits/camel.adoc[Camel Trait]
+* xref:traits/classpath.adoc[Classpath Trait]
+* xref:traits/container.adoc[Container Trait]
+* xref:traits/debug.adoc[Debug Trait]
+* xref:traits/dependencies.adoc[Dependencies Trait]
+* xref:traits/deployer.adoc[Deployer Trait]
+* xref:traits/deployment.adoc[Deployment Trait]
+* xref:traits/environment.adoc[Environment Trait]
+* xref:traits/gc.adoc[Gc Trait]
+* xref:traits/ingress.adoc[Ingress Trait]
+* xref:traits/istio.adoc[Istio Trait]
+* xref:traits/jolokia.adoc[Jolokia Trait]
+* xref:traits/knative-service.adoc[Knative Service Trait]
+* xref:traits/knative.adoc[Knative Trait]
+* xref:traits/owner.adoc[Owner Trait]
+* xref:traits/probes.adoc[Probes Trait]
+* xref:traits/prometheus.adoc[Prometheus Trait]
+* xref:traits/quarkus.adoc[Quarkus Trait]
+* xref:traits/rest-dsl.adoc[Rest Dsl Trait]
+* xref:traits/route.adoc[Route Trait]
+* xref:traits/service.adoc[Service Trait]
+// End of autogenerated code - DO NOT EDIT! (trait-list)
diff --git a/go.mod b/go.mod
index 8cbabce..ef5004b 100644
--- a/go.mod
+++ b/go.mod
@@ -21,6 +21,7 @@ require (
 	github.com/scylladb/go-set v1.0.2
 	github.com/sirupsen/logrus v1.4.2
 	github.com/spf13/cobra v0.0.5
+	github.com/spf13/pflag v1.0.3
 	github.com/stoewer/go-strcase v1.0.2
 	github.com/stretchr/testify v1.3.0
 	go.uber.org/multierr v1.1.0
@@ -28,6 +29,7 @@ require (
 	k8s.io/api v0.0.0
 	k8s.io/apimachinery v0.0.0
 	k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible
+	k8s.io/gengo v0.0.0-20191010091904-7fa3014cb28f
 	knative.dev/eventing v0.9.0
 	knative.dev/pkg v0.0.0-20191017202117-b5a8deb92e5c
 	knative.dev/serving v0.9.0
diff --git a/go.sum b/go.sum
index 3b69a14..57a28b7 100644
--- a/go.sum
+++ b/go.sum
@@ -222,6 +222,7 @@ github.com/golangplus/fmt v0.0.0-20150411045040-2a5d6d7d2995/go.mod h1:lJgMEyOkY
 github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA//k/eakGydO4jKRoRL2j92ZKSzTgj9tclaCrvXHk=
 github.com/google/btree v0.0.0-20160524151835-7d79101e329e/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
 github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
+github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=
 github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
 github.com/google/cadvisor v0.33.2-0.20190411163913-9db8c7dee20a/go.mod h1:1nql6U13uTHaLYB8rLS5x9IJc2qT6Xd/Tr1sTX6NE48=
 github.com/google/certificate-transparency-go v1.0.21/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg=
@@ -255,6 +256,7 @@ github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoA
 github.com/gregjones/httpcache v0.0.0-20170728041850-787624de3eb7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
 github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
 github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
+github.com/gregjones/httpcache v0.0.0-20190203031600-7a902570cb17 h1:prg2TTpTOcJF1jRWL2zSU1FQNgB0STAFNux8GK82y8k=
 github.com/gregjones/httpcache v0.0.0-20190203031600-7a902570cb17/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
 github.com/grpc-ecosystem/go-grpc-middleware v0.0.0-20190222133341-cfaf5686ec79/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
 github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
@@ -412,6 +414,7 @@ github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtP
 github.com/pelletier/go-toml v1.0.1/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
 github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
 github.com/petar/GoLLRB v0.0.0-20130427215148-53be0d36a84c/go.mod h1:HUpKUBZnpzkdx0kD/+Yfuft+uD3zHGtXF/XJB14TUr4=
+github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
 github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
 github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
diff --git a/pkg/apis/camel/v1alpha1/integrationplatform_types.go b/pkg/apis/camel/v1alpha1/integrationplatform_types.go
index e245458..ae9be5e 100644
--- a/pkg/apis/camel/v1alpha1/integrationplatform_types.go
+++ b/pkg/apis/camel/v1alpha1/integrationplatform_types.go
@@ -90,7 +90,8 @@ const (
 	TraitProfileKnative = "Knative"
 )
 
-var allTraitProfiles = []TraitProfile{TraitProfileOpenShift, TraitProfileKubernetes, TraitProfileKnative}
+// AllTraitProfiles contains all allowed profiles
+var AllTraitProfiles = []TraitProfile{TraitProfileKubernetes, TraitProfileKnative, TraitProfileOpenShift}
 
 // IntegrationPlatformBuildSpec contains platform related build information
 type IntegrationPlatformBuildSpec struct {
diff --git a/pkg/apis/camel/v1alpha1/integrationplatform_types_support.go b/pkg/apis/camel/v1alpha1/integrationplatform_types_support.go
index 5dda22e..1edbdbd 100644
--- a/pkg/apis/camel/v1alpha1/integrationplatform_types_support.go
+++ b/pkg/apis/camel/v1alpha1/integrationplatform_types_support.go
@@ -50,7 +50,7 @@ func NewIntegrationPlatform(namespace string, name string) IntegrationPlatform {
 
 // TraitProfileByName returns the trait profile corresponding to the given name (case insensitive)
 func TraitProfileByName(name string) TraitProfile {
-	for _, p := range allTraitProfiles {
+	for _, p := range AllTraitProfiles {
 		if strings.EqualFold(name, string(p)) {
 			return p
 		}
diff --git a/pkg/trait/builder.go b/pkg/trait/builder.go
index 0798afb..096fc07 100644
--- a/pkg/trait/builder.go
+++ b/pkg/trait/builder.go
@@ -26,7 +26,10 @@ import (
 	"github.com/apache/camel-k/pkg/platform"
 )
 
-// TODO: we should add a way to label a trait as platform so it cannot be disabled/removed
+// The builder trait is internally used to determine the best strategy to
+// build and configure IntegrationKits.
+//
+// +camel-k:trait=builder
 type builderTrait struct {
 	BaseTrait `property:",squash"`
 }
@@ -67,6 +70,11 @@ func (t *builderTrait) Apply(e *Environment) error {
 	return nil
 }
 
+// IsPlatformTrait overrides base class method
+func (t *builderTrait) IsPlatformTrait() bool {
+	return true
+}
+
 // InfluencesKit overrides base class method
 func (t *builderTrait) InfluencesKit() bool {
 	return true
diff --git a/pkg/trait/camel.go b/pkg/trait/camel.go
index 8c00d81..efcdcc1 100644
--- a/pkg/trait/camel.go
+++ b/pkg/trait/camel.go
@@ -29,9 +29,14 @@ import (
 	"github.com/apache/camel-k/pkg/util/camel"
 )
 
+// The Camel trait can be used to configure versions of Apache Camel and related libraries.
+//
+// +camel-k:trait=camel
 type camelTrait struct {
 	BaseTrait      `property:",squash"`
+	// The camel version to use for the integration. It overrides the default version set in the Integration Platform.
 	Version        string `property:"version"`
+	// The camel-k-runtime version to use for the integration. It overrides the default version set in the Integration Platform.
 	RuntimeVersion string `property:"runtime-version"`
 }
 
@@ -158,3 +163,8 @@ func (t *camelTrait) determineRuntimeVersion(e *Environment) string {
 	}
 	return e.Platform.Spec.Build.RuntimeVersion
 }
+
+// IsPlatformTrait overrides base class method
+func (t *camelTrait) IsPlatformTrait() bool {
+	return true
+}
diff --git a/pkg/trait/classpath.go b/pkg/trait/classpath.go
index b050e61..14814f0 100644
--- a/pkg/trait/classpath.go
+++ b/pkg/trait/classpath.go
@@ -31,6 +31,9 @@ import (
 	"github.com/apache/camel-k/pkg/util/envvar"
 )
 
+// The Classpath trait is used internally to configure the classpath of the final integration.
+//
+// +camel-k:trait=classpath
 type classpathTrait struct {
 	BaseTrait `property:",squash"`
 }
@@ -118,3 +121,8 @@ func (t *classpathTrait) Apply(e *Environment) error {
 
 	return nil
 }
+
+// IsPlatformTrait overrides base class method
+func (t *classpathTrait) IsPlatformTrait() bool {
+	return true
+}
diff --git a/pkg/trait/container.go b/pkg/trait/container.go
index 7ac4435..cbcadf8 100644
--- a/pkg/trait/container.go
+++ b/pkg/trait/container.go
@@ -35,19 +35,34 @@ const (
 	containerTraitID     = "container"
 )
 
+// The Container trait can be used to configure properties of the container where the integration will run.
+//
+// It also provides configuration for Services associated to the container.
+//
+// +camel-k:trait=container
 type containerTrait struct {
 	BaseTrait `property:",squash"`
 
 	Auto            *bool  `property:"auto"`
+	// The minimum amount of CPU required.
 	RequestCPU      string `property:"request-cpu"`
+	// The minimum amount of memory required.
 	RequestMemory   string `property:"request-memory"`
+	// The maximum amount of CPU required.
 	LimitCPU        string `property:"limit-cpu"`
+	// The maximum amount of memory required.
 	LimitMemory     string `property:"limit-memory"`
+	// Can be used to enable/disable exposure via kubernetes Service.
 	Expose          *bool  `property:"expose"`
+	// To configure a different port exposed by the container (default `8080`).
 	Port            int    `property:"port"`
+	// To configure a different port name for the port exposed by the container (default `http`).
 	PortName        string `property:"port-name"`
+	// To configure under which service port the container port is to be exposed (default `80`).
 	ServicePort     int    `property:"service-port"`
+	// To configure under which service port name the container port is to be exposed (default `http`).
 	ServicePortName string `property:"service-port-name"`
+	// The main container name. It's named `integration` by default.
 	Name            string `property:"name"`
 }
 
@@ -144,6 +159,11 @@ func (t *containerTrait) Apply(e *Environment) error {
 	return nil
 }
 
+// IsPlatformTrait overrides base class method
+func (t *containerTrait) IsPlatformTrait() bool {
+	return true
+}
+
 func (t *containerTrait) configureService(e *Environment) {
 	service := e.Resources.GetServiceForIntegration(e.Integration)
 	if service == nil {
diff --git a/pkg/trait/debug.go b/pkg/trait/debug.go
index 2491cbc..7dcc430 100644
--- a/pkg/trait/debug.go
+++ b/pkg/trait/debug.go
@@ -22,6 +22,12 @@ import (
 	"github.com/apache/camel-k/pkg/util/envvar"
 )
 
+// The Debug trait can be used to enable debugging on the integration container,
+// so that a remote debugger can be attached.
+//
+// Enabling the trait will inject the `JAVA_DEBUG` environment variable into the integration container.
+//
+// +camel-k:trait=debug
 type debugTrait struct {
 	BaseTrait `property:",squash"`
 }
diff --git a/pkg/trait/dependencies.go b/pkg/trait/dependencies.go
index 73e718e..1fb7fdc 100644
--- a/pkg/trait/dependencies.go
+++ b/pkg/trait/dependencies.go
@@ -26,6 +26,10 @@ import (
 	"github.com/apache/camel-k/pkg/util"
 )
 
+// The Dependencies trait is internally used to automatically add runtime dependencies based on the
+// integration that the user wants to run.
+//
+// +camel-k:trait=dependencies
 type dependenciesTrait struct {
 	BaseTrait `property:",squash"`
 }
@@ -70,6 +74,11 @@ func (t *dependenciesTrait) Apply(e *Environment) error {
 	return nil
 }
 
+// IsPlatformTrait overrides base class method
+func (t *dependenciesTrait) IsPlatformTrait() bool {
+	return true
+}
+
 func addDefaultRuntimeDependencies(e *Environment) {
 	dependencies := &e.Integration.Status.Dependencies
 
diff --git a/pkg/trait/deployer.go b/pkg/trait/deployer.go
index 58ee803..cbe45ff 100644
--- a/pkg/trait/deployer.go
+++ b/pkg/trait/deployer.go
@@ -17,8 +17,13 @@ limitations under the License.
 
 package trait
 
+// The deployer trait can be used to explicitly select the kind of high level resource that
+// will deploy the integration.
+//
+// +camel-k:trait=deployer
 type deployerTrait struct {
 	BaseTrait `property:",squash"`
+	// Allows to explicitly select the desired deployment kind between `deployment` or `knative-service` when creating the resources for running the integration.
 	Kind      string `property:"kind"`
 }
 
@@ -35,3 +40,8 @@ func (t *deployerTrait) Configure(e *Environment) (bool, error) {
 func (t *deployerTrait) Apply(e *Environment) error {
 	return nil
 }
+
+// IsPlatformTrait overrides base class method
+func (t *deployerTrait) IsPlatformTrait() bool {
+	return true
+}
diff --git a/pkg/trait/deployment.go b/pkg/trait/deployment.go
index 3df8e39..daf3f09 100644
--- a/pkg/trait/deployment.go
+++ b/pkg/trait/deployment.go
@@ -29,6 +29,10 @@ import (
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 )
 
+// The Deployment trait is responsible for generating the Kubernetes deployment that will make sure
+// the integration will run in the cluster.
+//
+// +camel-k:trait=deployment
 type deploymentTrait struct {
 	BaseTrait `property:",squash"`
 	deployer  deployerTrait
@@ -146,6 +150,11 @@ func (t *deploymentTrait) Apply(e *Environment) error {
 	return nil
 }
 
+// IsPlatformTrait overrides base class method
+func (t *deploymentTrait) IsPlatformTrait() bool {
+	return true
+}
+
 // **********************************
 //
 // Deployment
diff --git a/pkg/trait/environment.go b/pkg/trait/environment.go
index fb73bcf..978621f 100644
--- a/pkg/trait/environment.go
+++ b/pkg/trait/environment.go
@@ -23,6 +23,10 @@ import (
 	"github.com/apache/camel-k/pkg/util/envvar"
 )
 
+// The environment trait is used internally to inject standard environment variables in the integration container,
+// such as `NAMESPACE`, `POD_NAME`, `JAVA_MAIN_CLASS` and others.
+//
+// +camel-k:trait=environment
 type environmentTrait struct {
 	BaseTrait     `property:",squash"`
 	ContainerMeta bool `property:"container-meta"`
@@ -73,3 +77,8 @@ func (t *environmentTrait) Apply(e *Environment) error {
 
 	return nil
 }
+
+// IsPlatformTrait overrides base class method
+func (t *environmentTrait) IsPlatformTrait() bool {
+	return true
+}
diff --git a/pkg/trait/gc.go b/pkg/trait/gc.go
index 29824c0..cdceca3 100644
--- a/pkg/trait/gc.go
+++ b/pkg/trait/gc.go
@@ -46,7 +46,7 @@ var (
 	toFileName                  = regexp.MustCompile(`[^(\w/\.)]`)
 	diskCachedDiscoveryClient   discovery.CachedDiscoveryInterface
 	memoryCachedDiscoveryClient discovery.CachedDiscoveryInterface
-	DiscoveryClientLock         sync.Mutex
+	discoveryClientLock         sync.Mutex
 )
 
 type discoveryCacheType string
@@ -57,8 +57,12 @@ const (
 	memoryDiscoveryCache   discoveryCacheType = "memory"
 )
 
+// The GC Trait garbage-collects all resources that are no longer necessary upon integration updates.
+//
+// +camel-k:trait=gc
 type garbageCollectorTrait struct {
-	BaseTrait      `property:",squash"`
+	BaseTrait `property:",squash"`
+	// Discovery client cache to be used, either `disabled`, `disk` or `memory` (default `memory`)
 	DiscoveryCache *discoveryCacheType `property:"discovery-cache"`
 }
 
@@ -79,9 +83,9 @@ func (t *garbageCollectorTrait) Configure(e *Environment) (bool, error) {
 	}
 
 	return e.IntegrationInPhase(
-			v1alpha1.IntegrationPhaseInitialization,
-			v1alpha1.IntegrationPhaseDeploying,
-			v1alpha1.IntegrationPhaseRunning),
+		v1alpha1.IntegrationPhaseInitialization,
+		v1alpha1.IntegrationPhaseDeploying,
+		v1alpha1.IntegrationPhaseRunning),
 		nil
 }
 
@@ -243,8 +247,8 @@ func (p supportsDeleteVerbOnly) Match(groupVersion string, r *metav1.APIResource
 }
 
 func (t *garbageCollectorTrait) discoveryClient(e *Environment) (discovery.DiscoveryInterface, error) {
-	DiscoveryClientLock.Lock()
-	defer DiscoveryClientLock.Unlock()
+	discoveryClientLock.Lock()
+	defer discoveryClientLock.Unlock()
 
 	switch *t.DiscoveryCache {
 	case diskDiscoveryCache:
diff --git a/pkg/trait/ingress.go b/pkg/trait/ingress.go
index 8a6d68c..fe9cc52 100644
--- a/pkg/trait/ingress.go
+++ b/pkg/trait/ingress.go
@@ -30,9 +30,17 @@ import (
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
 
+// The Ingress trait can be used to expose the service associated with the integration
+// to the outside world with a Kubernetes Ingress.
+//
+// It's enabled by default whenever a Service is added to the integration (through the `service` trait).
+//
+// +camel-k:trait=ingress
 type ingressTrait struct {
 	BaseTrait `property:",squash"`
+	// **Required**. To configure the host exposed by the ingress.
 	Host      string `property:"host"`
+	// To automatically add an ingress whenever the integration uses a HTTP endpoint consumer.
 	Auto      *bool  `property:"auto"`
 }
 
diff --git a/pkg/trait/istio.go b/pkg/trait/istio.go
index fb88316..0c4d62f 100644
--- a/pkg/trait/istio.go
+++ b/pkg/trait/istio.go
@@ -25,9 +25,15 @@ import (
 	servingv1 "knative.dev/serving/pkg/apis/serving/v1"
 )
 
+// The Istio trait allows to configure properties related to the Istio service mesh,
+// such as sidecar injection and outbound IP ranges.
+//
+// +camel-k:trait=istio
 type istioTrait struct {
 	BaseTrait `property:",squash"`
+	// Configures a (comma-separated) list of CIDR subnets that should not be intercepted by the Istio proxy (`10.0.0.0/8,172.16.0.0/12,192.168.0.0/16` by default).
 	Allow     string `property:"allow"`
+	// Forces the value for labels `sidecar.istio.io/inject`. By default the label is set to `true` on deployment and not set on Knative Service.
 	Inject    *bool  `property:"inject"`
 }
 
diff --git a/pkg/trait/jolokia.go b/pkg/trait/jolokia.go
index 37721ba..b05c199 100644
--- a/pkg/trait/jolokia.go
+++ b/pkg/trait/jolokia.go
@@ -28,23 +28,44 @@ import (
 	corev1 "k8s.io/api/core/v1"
 )
 
+// The Jolokia trait activates and configures the Jolokia Java agent.
+//
+// See https://jolokia.org/reference/html/agents.html
+//
+// +camel-k:trait=jolokia
 type jolokiaTrait struct {
 	BaseTrait `property:",squash"`
-
-	// Jolokia JVM agent configuration
-	// See https://jolokia.org/reference/html/agents.html
+	// The PEM encoded CA certification file path, used to verify client certificates,
+	// applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true`
+	// (default `/var/run/secrets/kubernetes.io/serviceaccount/ca.crt` for OpenShift).
 	CaCert                     *string `property:"ca-cert"`
+	// The principal which must be given in a client certificate to allow access to the Jolokia endpoint,
+	// applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true`
+	// (default `clientPrincipal=cn=system:master-proxy` for OpenShift).
 	ClientPrincipal            *string `property:"client-principal"`
+	// Listen for multicast requests (default `false`)
 	DiscoveryEnabled           *bool   `property:"discovery-enabled"`
+	// Mandate the client certificate contains a client flag in the extended key usage section,
+	// applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true`
+	// (default `true` for OpenShift).
 	ExtendedClientCheck        *bool   `property:"extended-client-check"`
+	// The Host address to which the Jolokia agent should bind to. If `"\*"` or `"0.0.0.0"` is given,
+	// the servers binds to every network interface (default `"*"`).
 	Host                       *string `property:"host"`
+	// The password used for authentication, applicable when the `user` option is set.
 	Password                   *string `property:"password"`
+	// The Jolokia endpoint port (default `8778`).
 	Port                       int     `property:"port"`
+	// The protocol to use, either `http` or `https` (default `https` for OpenShift)
 	Protocol                   *string `property:"protocol"`
+	// The user to be used for authentication
 	User                       *string `property:"user"`
+	// Whether client certificates should be used for authentication (default `true` for OpenShift).
 	UseSslClientAuthentication *bool   `property:"use-ssl-client-authentication"`
 
-	// Extra configuration options
+	// A comma-separated list of additional Jolokia options as defined
+	// in https://jolokia.org/reference/html/agents.html#agent-jvm-config[JVM agent configuration options],
+	// e.g.: `keystore=...,executor=...`
 	Options *string `property:"options"`
 }
 
diff --git a/pkg/trait/knative.go b/pkg/trait/knative.go
index 3fec66a..fd3387e 100644
--- a/pkg/trait/knative.go
+++ b/pkg/trait/knative.go
@@ -37,17 +37,44 @@ import (
 	k8sclient "sigs.k8s.io/controller-runtime/pkg/client"
 )
 
+// The Knative trait automatically discovers addresses of Knative resources and inject them into the
+// running integration.
+//
+// The full Knative configuration is injected in the CAMEL_KNATIVE_CONFIGURATION in JSON format.
+// The Camel Knative component will then use the full configuration to configure the routes.
+//
+// The trait is enabled by default when the Knative profile is active.
+//
+// +camel-k:trait=knative
 type knativeTrait struct {
 	BaseTrait            `property:",squash"`
+	// Can be used to inject a Knative complete configuration in JSON format.
 	Configuration        string `property:"configuration"`
+	// Comma-separated list of channels used as source of integration routes.
+	// Can contain simple channel names or full Camel URIs.
 	ChannelSources       string `property:"channel-sources"`
+	// Comma-separated list of channels used as destination of integration routes.
+	// Can contain simple channel names or full Camel URIs.
 	ChannelSinks         string `property:"channel-sinks"`
+	// Comma-separated list of channels used as source of integration routes.
 	EndpointSources      string `property:"endpoint-sources"`
+	// Comma-separated list of endpoints used as destination of integration routes.
+	// Can contain simple endpoint names or full Camel URIs.
 	EndpointSinks        string `property:"endpoint-sinks"`
+	// Comma-separated list of event types that the integration will be subscribed to.
+	// Can contain simple event types or full Camel URIs (to use a specific broker different from "default").
 	EventSources         string `property:"event-sources"`
+	// Comma-separated list of event types that the integration will produce.
+	// Can contain simple event types or full Camel URIs (to use a specific broker).
 	EventSinks           string `property:"event-sinks"`
+	// Enables filtering on events based on the header "ce-knativehistory". Since this is an experimental header
+	// that can be removed in a future version of Knative, filtering is enabled only when the integration is
+	// listening from more than 1 channel.
 	FilterSourceChannels *bool  `property:"filter-source-channels"`
+	// The Knative 0.8 compatibility mode will check the installed version of Knative and
+	// use resource versions compatible with Knative 0.8 if found on the cluster.
 	Knative08CompatMode  *bool  `property:"knative-08-compat-mode"`
+	// Enable automatic discovery of all trait properties.
 	Auto                 *bool  `property:"auto"`
 }
 
diff --git a/pkg/trait/knative_service.go b/pkg/trait/knative_service.go
index 7a68ccb..b1c15b1 100644
--- a/pkg/trait/knative_service.go
+++ b/pkg/trait/knative_service.go
@@ -42,13 +42,41 @@ const (
 	knativeServingMaxScaleAnnotation = "autoscaling.knative.dev/maxScale"
 )
 
+// The Knative Service trait allows to configure options when running the integration as Knative service instead of
+// a standard Kubernetes Deployment.
+//
+// Running integrations as Knative Services adds auto-scaling (and scaling-to-zero) features, but those features
+// are only meaningful when the routes use a HTTP endpoint consumer.
+//
+// +camel-k:trait=knative-service
 type knativeServiceTrait struct {
 	BaseTrait `property:",squash"`
+	// Configures the Knative autoscaling class property (e.g. to set `hpa.autoscaling.knative.dev` or `kpa.autoscaling.knative.dev` autoscaling).
+	//
+	// Refer to the Knative documentation for more information.
 	Class     string `property:"autoscaling-class"`
+	// Configures the Knative autoscaling metric property (e.g. to set `concurrency` based or `cpu` based autoscaling).
+	//
+	// Refer to the Knative documentation for more information.
 	Metric    string `property:"autoscaling-metric"`
+	// Sets the allowed concurrency level or CPU percentage (depending on the autoscaling metric) for each Pod.
+	//
+	// Refer to the Knative documentation for more information.
 	Target    *int   `property:"autoscaling-target"`
+	// The minimum number of Pods that should be running at any time for the integration. It's **zero** by default, meaning that
+	// the integration is scaled down to zero when not used for a configured amount of time.
+	//
+	// Refer to the Knative documentation for more information.
 	MinScale  *int   `property:"min-scale"`
+	// An upper bound for the number of Pods that can be running in parallel for the integration.
+	// Knative has its own cap value that depends on the installation.
+	//
+	// Refer to the Knative documentation for more information.
 	MaxScale  *int   `property:"max-scale"`
+	// Automatically deploy the integration as Knative service when all conditions hold:
+	//
+	// * Integration is using the Knative profile
+	// * All routes are either starting from a HTTP based consumer or a passive consumer (e.g. `direct` is a passive consumer)
 	Auto      *bool  `property:"auto"`
 	deployer  deployerTrait
 }
diff --git a/pkg/trait/owner.go b/pkg/trait/owner.go
index bef7ab4..3dfe374 100644
--- a/pkg/trait/owner.go
+++ b/pkg/trait/owner.go
@@ -27,12 +27,15 @@ import (
 	serving "knative.dev/serving/pkg/apis/serving/v1beta1"
 )
 
-// ownerTrait ensures that all created resources belong to the integration being created
-// and transfers annotations and labels on the integration onto these owned resources being created
+// The Owner trait ensures that all created resources belong to the integration being created
+// and transfers annotations and labels on the integration onto these owned resources.
+//
+// +camel-k:trait=owner
 type ownerTrait struct {
 	BaseTrait `property:",squash"`
-
+	// The annotations to be transferred (A comma-separated list of label keys)
 	TargetAnnotations string `property:"target-annotations"`
+	// The labels to be transferred (A comma-separated list of label keys)
 	TargetLabels      string `property:"target-labels"`
 }
 
@@ -104,6 +107,12 @@ func (t *ownerTrait) Apply(e *Environment) error {
 	return nil
 }
 
+// IsPlatformTrait overrides base class method
+func (t *ownerTrait) IsPlatformTrait() bool {
+	return true
+}
+
+
 func (t *ownerTrait) propagateLabelAndAnnotations(res metav1.Object, targetLabels map[string]string, targetAnnotations map[string]string) {
 	// Transfer annotations
 	annotations := res.GetAnnotations()
diff --git a/pkg/trait/probes.go b/pkg/trait/probes.go
index 1155a2e..073ec01 100644
--- a/pkg/trait/probes.go
+++ b/pkg/trait/probes.go
@@ -29,21 +29,36 @@ import (
 	corev1 "k8s.io/api/core/v1"
 )
 
+// The Probes trait allows to configure Liveness and Readiness probes on the integration container.
+//
+// +camel-k:trait=probes
 type probesTrait struct {
 	BaseTrait `property:",squash"`
-
+	// Configures the host on which the probe is exposed (default `0.0.0.0`).
 	BindHost                  string `property:"bind-host"`
+	// Configures the port on which the probe is exposed (default `8080`).
 	BindPort                  int    `property:"bind-port"`
+	// Path to access on the probe ( default `/health`).
 	Path                      string `property:"path"`
+	// Number of seconds after the container has started before liveness probes are initiated.
 	LivenessInitialDelay      int32  `property:"liveness-initial-delay"`
+	// Number of seconds after which the probe times out. Applies to the liveness probe.
 	LivenessTimeout           int32  `property:"liveness-timeout"`
+	// How often to perform the probe. Applies to the liveness probe.
 	LivenessPeriod            int32  `property:"liveness-period"`
+	// Minimum consecutive successes for the probe to be considered successful after having failed. Applies to the liveness probe.
 	LivenessSuccessThreshold  int32  `property:"liveness-success-threshold"`
+	// Minimum consecutive failures for the probe to be considered failed after having succeeded. Applies to the liveness probe.
 	LivenessFailureThreshold  int32  `property:"liveness-failure-threshold"`
+	// Number of seconds after the container has started before readiness probes are initiated.
 	ReadinessInitialDelay     int32  `property:"readiness-initial-delay"`
+	// Number of seconds after which the probe times out. Applies to the readiness probe.
 	ReadinessTimeout          int32  `property:"readiness-timeout"`
+	// How often to perform the probe. Applies to the readiness probe.
 	ReadinessPeriod           int32  `property:"readiness-period"`
+	// Minimum consecutive successes for the probe to be considered successful after having failed. Applies to the readiness probe.
 	ReadinessSuccessThreshold int32  `property:"readiness-success-threshold"`
+	// Minimum consecutive failures for the probe to be considered failed after having succeeded. Applies to the readiness probe.
 	ReadinessFailureThreshold int32  `property:"readiness-failure-threshold"`
 }
 
diff --git a/pkg/trait/prometheus.go b/pkg/trait/prometheus.go
index b5dd77d..e683f7f 100644
--- a/pkg/trait/prometheus.go
+++ b/pkg/trait/prometheus.go
@@ -31,11 +31,23 @@ import (
 	monitoringv1 "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1"
 )
 
+// The Prometheus trait exposes the integration with a `Service` and a `ServiceMonitor` resources
+// so that the Prometheus endpoint can be scraped.
+//
+// WARNING: Creating the `ServiceMonitor` resource requires the https://github.com/coreos/prometheus-operator[Prometheus Operator]
+// custom resource definition to be installed. You can set `service-monitor` to `false` for the Prometheus trait to work without
+// the Prometheus operator.
+//
+// It's disabled by default.
+//
+// +camel-k:trait=prometheus
 type prometheusTrait struct {
 	BaseTrait `property:",squash"`
-
+	// The Prometheus endpoint port (default `9778`).
 	Port                 int    `property:"port"`
+	// Whether a `ServiceMonitor` resource is created (default `true`).
 	ServiceMonitor       bool   `property:"service-monitor"`
+	// The `ServiceMonitor` resource labels, applicable when `service-monitor` is `true`.
 	ServiceMonitorLabels string `property:"service-monitor-labels"`
 }
 
diff --git a/pkg/trait/quarkus.go b/pkg/trait/quarkus.go
index 1ebdecd..8cbb165 100644
--- a/pkg/trait/quarkus.go
+++ b/pkg/trait/quarkus.go
@@ -35,9 +35,16 @@ import (
 	"github.com/apache/camel-k/pkg/util/maven"
 )
 
+// The Quarkus trait activates the Quarkus runtime.
+//
+// It's disabled by default.
+//
+// +camel-k:trait=quarkus
 type quarkusTrait struct {
-	BaseTrait           `property:",squash"`
-	QuarkusVersion      string `property:"quarkus-version"`
+	BaseTrait `property:",squash"`
+	// The Quarkus version to use for the integration
+	QuarkusVersion string `property:"quarkus-version"`
+	// The Camel-Quarkus version to use for the integration
 	CamelQuarkusVersion string `property:"camel-quarkus-version"`
 }
 
diff --git a/pkg/trait/rest-dsl.go b/pkg/trait/rest-dsl.go
index 317873a..78235c2 100644
--- a/pkg/trait/rest-dsl.go
+++ b/pkg/trait/rest-dsl.go
@@ -37,6 +37,9 @@ import (
 	"github.com/apache/camel-k/pkg/util/maven"
 )
 
+// The Rest DSL trait is internally used to allow creating integrations from a OpenAPI specs.
+//
+// +camel-k:trait=rest-dsl
 type restDslTrait struct {
 	BaseTrait `property:",squash"`
 }
@@ -205,6 +208,11 @@ func (t *restDslTrait) Apply(e *Environment) error {
 	return nil
 }
 
+// IsPlatformTrait overrides base class method
+func (t *restDslTrait) IsPlatformTrait() bool {
+	return true
+}
+
 func (t *restDslTrait) generateMavenProject(e *Environment) (maven.Project, error) {
 	if e.CamelCatalog == nil {
 		return maven.Project{}, errors.New("unknown camel catalog")
diff --git a/pkg/trait/route.go b/pkg/trait/route.go
index f761a48..403e48d 100644
--- a/pkg/trait/route.go
+++ b/pkg/trait/route.go
@@ -29,14 +29,40 @@ import (
 	"k8s.io/apimachinery/pkg/util/intstr"
 )
 
+// The Route trait can be used to configure the creation of OpenShift routes for the integration.
+//
+// +camel-k:trait=route
 type routeTrait struct {
 	BaseTrait                        `property:",squash"`
+	// To configure the host exposed by the route.
 	Host                             string `property:"host"`
+	// The TLS termination type, like `edge`, `passthrough` or `reencrypt`.
+	//
+	// Refer to the OpenShift documentation for additional information.
 	TLSTermination                   string `property:"tls-termination"`
+	// The TLS certificate contents.
+	//
+	// Refer to the OpenShift documentation for additional information.
 	TLSCertificate                   string `property:"tls-certificate"`
+	// The TLS certificate key contents.
+	//
+	// Refer to the OpenShift documentation for additional information.
 	TLSKey                           string `property:"tls-key"`
+	// The TLS cert authority certificate contents.
+	//
+	// Refer to the OpenShift documentation for additional information.
 	TLSCACertificate                 string `property:"tls-ca-certificate"`
+	// The destination CA certificate provides the contents of the ca certificate of the final destination.  When using reencrypt
+	// termination this file should be provided in order to have routers use it for health checks on the secure connection.
+	// If this field is not specified, the router may provide its own destination CA and perform hostname validation using
+	// the short service name (service.namespace.svc), which allows infrastructure generated certificates to automatically
+	// verify.
+	//
+	// Refer to the OpenShift documentation for additional information.
 	TLSDestinationCACertificate      string `property:"tls-destination-ca-certificate"`
+	// To configure how to deal with insecure traffic, e.g. `Allow`, `Disable` or `Redirect` traffic.
+	//
+	// Refer to the OpenShift documentation for additional information.
 	TLSInsecureEdgeTerminationPolicy string `property:"tls-insecure-edge-termination-policy"`
 
 	service *corev1.Service
diff --git a/pkg/trait/service.go b/pkg/trait/service.go
index 3efb446..d199331 100644
--- a/pkg/trait/service.go
+++ b/pkg/trait/service.go
@@ -25,8 +25,15 @@ import (
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
 
+// The Service trait exposes the integration with a Service resource so that it can be accessed by other applications
+// (or integrations) in the same namespace.
+//
+// It's enabled by default if the integration depends on a Camel component that can expose a HTTP endpoint.
+//
+// +camel-k:trait=service
 type serviceTrait struct {
 	BaseTrait `property:",squash"`
+	// To automatically detect from the code if a Service needs to be created.
 	Auto      *bool `property:"auto"`
 }
 
diff --git a/pkg/trait/trait_catalog.go b/pkg/trait/trait_catalog.go
index 96b6862..ee7f698 100644
--- a/pkg/trait/trait_catalog.go
+++ b/pkg/trait/trait_catalog.go
@@ -127,7 +127,16 @@ func (c *Catalog) allTraits() []Trait {
 // Traits may depend on the result of previously executed ones,
 // so care must be taken while changing the lists order.
 func (c *Catalog) traitsFor(environment *Environment) []Trait {
-	switch environment.DetermineProfile() {
+	profile := environment.DetermineProfile()
+	return c.TraitsForProfile(profile)
+}
+
+// TraitsForProfile returns all traits associated with a given profile.
+//
+// Traits may depend on the result of previously executed ones,
+// so care must be taken while changing the lists order.
+func (c *Catalog) TraitsForProfile(profile v1alpha1.TraitProfile) []Trait {
+	switch profile {
 	case v1alpha1.TraitProfileOpenShift:
 		return []Trait{
 			c.tCamel,
diff --git a/pkg/trait/trait_test.go b/pkg/trait/trait_test.go
index c63bb86..be128f9 100644
--- a/pkg/trait/trait_test.go
+++ b/pkg/trait/trait_test.go
@@ -361,7 +361,7 @@ func TestConfigureVolumesAndMounts(t *testing.T) {
 	assert.Equal(t, "/foo/bar", m.MountPath)
 }
 
-func TestOnlySomeKitsInfluenceBuild(t *testing.T) {
+func TestOnlySomeTraitsInfluenceBuild(t *testing.T) {
 	c := NewTraitTestCatalog()
 	buildTraits := []string{"builder", "quarkus"}
 
@@ -374,6 +374,19 @@ func TestOnlySomeKitsInfluenceBuild(t *testing.T) {
 	}
 }
 
+func TestOnlySomeTraitsArePlatform(t *testing.T) {
+	c := NewTraitTestCatalog()
+	platformTraits := []string{"builder", "camel", "classpath", "container", "dependencies", "deployer", "deployment", "environment", "rest-dsl", "owner"}
+
+	for _, trait := range c.allTraits() {
+		if trait.IsPlatformTrait() {
+			assert.Contains(t, platformTraits, string(trait.ID()))
+		} else {
+			assert.NotContains(t, platformTraits, trait.ID())
+		}
+	}
+}
+
 func findVolume(vols []corev1.Volume, condition func(corev1.Volume) bool) *corev1.Volume {
 	for _, v := range vols {
 		v := v
diff --git a/pkg/trait/trait_types.go b/pkg/trait/trait_types.go
index e7b6201..8c41344 100644
--- a/pkg/trait/trait_types.go
+++ b/pkg/trait/trait_types.go
@@ -69,6 +69,9 @@ type Trait interface {
 
 	// InfluencesKit determines if the trait has any influence on Integration Kits
 	InfluencesKit() bool
+
+	// IsPlatformTrait marks all fundamental traits that allow the platform to work
+	IsPlatformTrait() bool
 }
 
 /* Base trait */
@@ -83,6 +86,7 @@ func newBaseTrait(id string) BaseTrait {
 // BaseTrait is the root trait with noop implementations for hooks
 type BaseTrait struct {
 	id      ID
+	// Can be used to enable or disable a trait. All traits share this common property.
 	Enabled *bool `property:"enabled"`
 	client  client.Client
 	ctx     context.Context
@@ -109,6 +113,11 @@ func (trait *BaseTrait) InfluencesKit() bool {
 	return false
 }
 
+// IsPlatformTrait marks all fundamental traits that allow the platform to work.
+func (trait *BaseTrait) IsPlatformTrait() bool {
+	return false
+}
+
 /* Environment */
 
 // A Environment provides the context where the trait is executed
diff --git a/pkg/trait/zz_doc_gen.go b/pkg/trait/zz_doc_gen.go
new file mode 100644
index 0000000..8bb8d44
--- /dev/null
+++ b/pkg/trait/zz_doc_gen.go
@@ -0,0 +1 @@
+package trait
diff --git a/script/Makefile b/script/Makefile
index c94fbf6..2d65894 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -121,11 +121,14 @@ codegen:
 	@echo "" >> $(VERSIONFILE)
 	gofmt -w pkg/util/defaults/defaults.go
 
-generate: generate-deepcopy generate-client
+generate: generate-deepcopy generate-client generate-doc
 
 generate-client:
 	./script/gen_client.sh
 
+generate-doc:
+	./script/gen_doc.sh
+
 generate-deepcopy:
 	operator-sdk generate k8s
 
@@ -234,4 +237,4 @@ install-minikube:
 release-notes:
 	./script/gen_release_notes.sh $(LAST_RELEASED_VERSION) $(VERSION)
 
-.PHONY: build build-kamel build-resources build-olm unsnapshot-olm dep codegen images images-dec images-push images-push-staging test check test-integration clean release cross-compile package-examples set-version git-tag release-notes check-licenses generate-deepcopy generate-client
+.PHONY: build build-kamel build-resources build-olm unsnapshot-olm dep codegen images images-dec images-push images-push-staging test check test-integration clean release cross-compile package-examples set-version git-tag release-notes check-licenses generate-deepcopy generate-client generate-doc
diff --git a/script/gen_client.sh b/script/gen_client.sh
index fb16528..2cbc60c 100755
--- a/script/gen_client.sh
+++ b/script/gen_client.sh
@@ -21,6 +21,8 @@ rootdir=$location/..
 unset GOPATH
 GO111MODULE=on
 
+echo "Generating Go client code..."
+
 go run k8s.io/code-generator/cmd/client-gen \
 	--input=camel/v1alpha1 \
 	--go-header-file=$rootdir/script/headers/default.txt \
diff --git a/script/gen_doc.sh b/script/gen_doc.sh
new file mode 100755
index 0000000..01c905a
--- /dev/null
+++ b/script/gen_doc.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+location=$(dirname $0)
+rootdir=$location/..
+
+echo "Generating traits documentation..."
+
+cd $rootdir
+go run ./cmd/util/doc-gen --input-dirs ./pkg/trait


[camel-k] 02/03: Fix #1014: fix linter and missing documentation

Posted by nf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nferraro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 04a24dc6c1685d06c63f3ecc322c1e28ca0e8d3c
Author: Nicola Ferraro <ni...@gmail.com>
AuthorDate: Thu Nov 21 15:46:19 2019 +0100

    Fix #1014: fix linter and missing documentation
---
 cmd/util/doc-gen/generators/traitdocgen.go       | 12 +++---
 docs/modules/ROOT/nav.adoc                       |  1 +
 docs/modules/ROOT/pages/traits/affinity.adoc     | 54 ++++++++++++++++++++++++
 docs/modules/ROOT/pages/traits/traits.adoc       |  1 +
 pkg/trait/affinity.go                            | 22 +++++++---
 pkg/trait/camel.go                               |  4 +-
 pkg/trait/container.go                           | 20 ++++-----
 pkg/trait/deployer.go                            |  2 +-
 pkg/trait/environment.go                         |  3 +-
 pkg/trait/ingress.go                             |  4 +-
 pkg/trait/istio.go                               |  4 +-
 pkg/trait/jolokia.go                             | 20 ++++-----
 pkg/trait/knative.go                             | 22 +++++-----
 pkg/trait/knative_service.go                     | 14 +++---
 pkg/trait/owner.go                               |  3 +-
 pkg/trait/probes.go                              | 26 ++++++------
 pkg/trait/prometheus.go                          |  4 +-
 pkg/trait/route.go                               | 14 +++---
 pkg/trait/service.go                             |  2 +-
 pkg/trait/trait_types.go                         |  2 +-
 pkg/trait/{zz_doc_gen.go => zz_generated_doc.go} |  0
 21 files changed, 150 insertions(+), 84 deletions(-)

diff --git a/cmd/util/doc-gen/generators/traitdocgen.go b/cmd/util/doc-gen/generators/traitdocgen.go
index ea9ae70..c113dd7 100644
--- a/cmd/util/doc-gen/generators/traitdocgen.go
+++ b/cmd/util/doc-gen/generators/traitdocgen.go
@@ -40,7 +40,7 @@ const (
 	tagTrait = "+camel-k:trait"
 
 	adocCommonMarkerStart = "// Start of autogenerated code - DO NOT EDIT!"
-	adocCommonMarkerEnd = "// End of autogenerated code - DO NOT EDIT!"
+	adocCommonMarkerEnd   = "// End of autogenerated code - DO NOT EDIT!"
 
 	adocDescriptionMarkerStart = adocCommonMarkerStart + " (description)"
 	adocDescriptionMarkerEnd   = adocCommonMarkerEnd + " (description)"
@@ -75,7 +75,7 @@ func NewTraitDocGen(arguments *args.GeneratorArgs) generator.Generator {
 }
 
 func (g *traitDocGen) Filename() string {
-	return "zz_doc_gen.go"
+	return "zz_generated_doc.go"
 }
 
 func (g *traitDocGen) Filter(context *generator.Context, t *types.Type) bool {
@@ -102,7 +102,7 @@ func (g *traitDocGen) GenerateType(context *generator.Context, t *types.Type, ou
 	}
 	defer file.Close()
 
-	writeTitle(t, traitID, &content)
+	writeTitle(traitID, &content)
 	writeDescription(t, traitID, &content)
 	writeFields(t, traitID, &content)
 
@@ -177,7 +177,7 @@ func traitNameFromFile(file string) string {
 	return name
 }
 
-func writeTitle(t *types.Type, traitID string, content *[]string) {
+func writeTitle(traitID string, content *[]string) {
 	res := append([]string(nil), *content...)
 	for _, s := range res {
 		if strings.HasPrefix(s, "= ") {
@@ -193,9 +193,7 @@ func writeDescription(t *types.Type, traitID string, content *[]string) {
 	pre, post := split(*content, adocDescriptionMarkerStart, adocDescriptionMarkerEnd)
 	res := append([]string(nil), pre...)
 	res = append(res, adocDescriptionMarkerStart)
-	for _, l := range filterOutTagsAndComments(t.CommentLines) {
-		res = append(res, l)
-	}
+	res = append(res, filterOutTagsAndComments(t.CommentLines)...)
 	profiles := strings.Join(determineProfiles(traitID), ", ")
 	res = append(res, "", fmt.Sprintf("This trait is available in the following profiles: **%s**.", profiles))
 	if isPlatformTrait(traitID) {
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index 24102da..6bc6965 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -12,6 +12,7 @@
 ** xref:configuration/configmap-secret.adoc[ConfigMap/Secret]
 * xref:traits/traits.adoc[Traits]
 // Start of autogenerated code - DO NOT EDIT! (trait-nav)
+** xref:traits/affinity.adoc[Affinity]
 ** xref:traits/builder.adoc[Builder]
 ** xref:traits/camel.adoc[Camel]
 ** xref:traits/classpath.adoc[Classpath]
diff --git a/docs/modules/ROOT/pages/traits/affinity.adoc b/docs/modules/ROOT/pages/traits/affinity.adoc
new file mode 100755
index 0000000..def4a7b
--- /dev/null
+++ b/docs/modules/ROOT/pages/traits/affinity.adoc
@@ -0,0 +1,54 @@
+= Affinity Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+Allows to constrain which nodes the integration pod(s) are eligible to be scheduled on, based on labels on the node,
+or with inter-pod affinity and anti-affinity, based on labels on pods that are already running on the nodes.
+
+It’s disabled by default.
+
+
+This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait affinity.[key]=[value] integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| affinity.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common property.
+
+| affinity.pod-affinity
+| bool
+| Always co-locates multiple replicas of the integration in the same node (default *false*).
+
+| affinity.pod-anti-affinity
+| bool
+| Never co-locates multiple replicas of the integration in the same node (default *false*).
+
+| affinity.node-affinity-labels
+| string
+| Defines a set of nodes the integration pod(s) are eligible to be scheduled on, based on labels on the node.
+
+| affinity.pod-affinity-labels
+| string
+| Defines a set of pods (namely those matching the label selector, relative to the given namespace) that the
+integration pod(s) should be co-located with.
+
+| affinity.pod-anti-affinity-labels
+| string
+| Defines a set of pods (namely those matching the label selector, relative to the given namespace) that the
+integration pod(s) should not be co-located with.
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/docs/modules/ROOT/pages/traits/traits.adoc b/docs/modules/ROOT/pages/traits/traits.adoc
index 4f35b00..ce8e90b 100644
--- a/docs/modules/ROOT/pages/traits/traits.adoc
+++ b/docs/modules/ROOT/pages/traits/traits.adoc
@@ -34,6 +34,7 @@ A trait may have additional properties that can be configured by the end user.
 See the trait description pages for more information on a specific trait:
 
 // Start of autogenerated code - DO NOT EDIT! (trait-list)
+* xref:traits/affinity.adoc[Affinity Trait]
 * xref:traits/builder.adoc[Builder Trait]
 * xref:traits/camel.adoc[Camel Trait]
 * xref:traits/classpath.adoc[Classpath Trait]
diff --git a/pkg/trait/affinity.go b/pkg/trait/affinity.go
index df70859..c285c6e 100644
--- a/pkg/trait/affinity.go
+++ b/pkg/trait/affinity.go
@@ -29,13 +29,25 @@ import (
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 )
 
+// Allows to constrain which nodes the integration pod(s) are eligible to be scheduled on, based on labels on the node,
+// or with inter-pod affinity and anti-affinity, based on labels on pods that are already running on the nodes.
+//
+//It’s disabled by default.
+//
+// +camel-k:trait=affinity
 type affinityTrait struct {
 	BaseTrait `property:",squash"`
-
-	PodAffinity           bool   `property:"pod-affinity"`
-	PodAntiAffinity       bool   `property:"pod-anti-affinity"`
-	NodeAffinityLabels    string `property:"node-affinity-labels"`
-	PodAffinityLabels     string `property:"pod-affinity-labels"`
+	// Always co-locates multiple replicas of the integration in the same node (default *false*).
+	PodAffinity bool `property:"pod-affinity"`
+	// Never co-locates multiple replicas of the integration in the same node (default *false*).
+	PodAntiAffinity bool `property:"pod-anti-affinity"`
+	// Defines a set of nodes the integration pod(s) are eligible to be scheduled on, based on labels on the node.
+	NodeAffinityLabels string `property:"node-affinity-labels"`
+	// Defines a set of pods (namely those matching the label selector, relative to the given namespace) that the
+	// integration pod(s) should be co-located with.
+	PodAffinityLabels string `property:"pod-affinity-labels"`
+	// Defines a set of pods (namely those matching the label selector, relative to the given namespace) that the
+	// integration pod(s) should not be co-located with.
 	PodAntiAffinityLabels string `property:"pod-anti-affinity-labels"`
 }
 
diff --git a/pkg/trait/camel.go b/pkg/trait/camel.go
index efcdcc1..ca59d11 100644
--- a/pkg/trait/camel.go
+++ b/pkg/trait/camel.go
@@ -33,9 +33,9 @@ import (
 //
 // +camel-k:trait=camel
 type camelTrait struct {
-	BaseTrait      `property:",squash"`
+	BaseTrait `property:",squash"`
 	// The camel version to use for the integration. It overrides the default version set in the Integration Platform.
-	Version        string `property:"version"`
+	Version string `property:"version"`
 	// The camel-k-runtime version to use for the integration. It overrides the default version set in the Integration Platform.
 	RuntimeVersion string `property:"runtime-version"`
 }
diff --git a/pkg/trait/container.go b/pkg/trait/container.go
index cbcadf8..c37775c 100644
--- a/pkg/trait/container.go
+++ b/pkg/trait/container.go
@@ -43,27 +43,27 @@ const (
 type containerTrait struct {
 	BaseTrait `property:",squash"`
 
-	Auto            *bool  `property:"auto"`
+	Auto *bool `property:"auto"`
 	// The minimum amount of CPU required.
-	RequestCPU      string `property:"request-cpu"`
+	RequestCPU string `property:"request-cpu"`
 	// The minimum amount of memory required.
-	RequestMemory   string `property:"request-memory"`
+	RequestMemory string `property:"request-memory"`
 	// The maximum amount of CPU required.
-	LimitCPU        string `property:"limit-cpu"`
+	LimitCPU string `property:"limit-cpu"`
 	// The maximum amount of memory required.
-	LimitMemory     string `property:"limit-memory"`
+	LimitMemory string `property:"limit-memory"`
 	// Can be used to enable/disable exposure via kubernetes Service.
-	Expose          *bool  `property:"expose"`
+	Expose *bool `property:"expose"`
 	// To configure a different port exposed by the container (default `8080`).
-	Port            int    `property:"port"`
+	Port int `property:"port"`
 	// To configure a different port name for the port exposed by the container (default `http`).
-	PortName        string `property:"port-name"`
+	PortName string `property:"port-name"`
 	// To configure under which service port the container port is to be exposed (default `80`).
-	ServicePort     int    `property:"service-port"`
+	ServicePort int `property:"service-port"`
 	// To configure under which service port name the container port is to be exposed (default `http`).
 	ServicePortName string `property:"service-port-name"`
 	// The main container name. It's named `integration` by default.
-	Name            string `property:"name"`
+	Name string `property:"name"`
 }
 
 func newContainerTrait() *containerTrait {
diff --git a/pkg/trait/deployer.go b/pkg/trait/deployer.go
index cbe45ff..b5a8beb 100644
--- a/pkg/trait/deployer.go
+++ b/pkg/trait/deployer.go
@@ -24,7 +24,7 @@ package trait
 type deployerTrait struct {
 	BaseTrait `property:",squash"`
 	// Allows to explicitly select the desired deployment kind between `deployment` or `knative-service` when creating the resources for running the integration.
-	Kind      string `property:"kind"`
+	Kind string `property:"kind"`
 }
 
 func newDeployerTrait() *deployerTrait {
diff --git a/pkg/trait/environment.go b/pkg/trait/environment.go
index 978621f..137b3ff 100644
--- a/pkg/trait/environment.go
+++ b/pkg/trait/environment.go
@@ -45,7 +45,8 @@ const (
 
 func newEnvironmentTrait() *environmentTrait {
 	return &environmentTrait{
-		BaseTrait:     newBaseTrait("environment"),
+		BaseTrait: newBaseTrait("environment"),
+		// Enable injection of NAMESPACE and POD_NAME environment variables.
 		ContainerMeta: true,
 	}
 }
diff --git a/pkg/trait/ingress.go b/pkg/trait/ingress.go
index fe9cc52..0b99cdd 100644
--- a/pkg/trait/ingress.go
+++ b/pkg/trait/ingress.go
@@ -39,9 +39,9 @@ import (
 type ingressTrait struct {
 	BaseTrait `property:",squash"`
 	// **Required**. To configure the host exposed by the ingress.
-	Host      string `property:"host"`
+	Host string `property:"host"`
 	// To automatically add an ingress whenever the integration uses a HTTP endpoint consumer.
-	Auto      *bool  `property:"auto"`
+	Auto *bool `property:"auto"`
 }
 
 func newIngressTrait() *ingressTrait {
diff --git a/pkg/trait/istio.go b/pkg/trait/istio.go
index 0c4d62f..abe3f81 100644
--- a/pkg/trait/istio.go
+++ b/pkg/trait/istio.go
@@ -32,9 +32,9 @@ import (
 type istioTrait struct {
 	BaseTrait `property:",squash"`
 	// Configures a (comma-separated) list of CIDR subnets that should not be intercepted by the Istio proxy (`10.0.0.0/8,172.16.0.0/12,192.168.0.0/16` by default).
-	Allow     string `property:"allow"`
+	Allow string `property:"allow"`
 	// Forces the value for labels `sidecar.istio.io/inject`. By default the label is set to `true` on deployment and not set on Knative Service.
-	Inject    *bool  `property:"inject"`
+	Inject *bool `property:"inject"`
 }
 
 const (
diff --git a/pkg/trait/jolokia.go b/pkg/trait/jolokia.go
index b05c199..90c590d 100644
--- a/pkg/trait/jolokia.go
+++ b/pkg/trait/jolokia.go
@@ -38,30 +38,30 @@ type jolokiaTrait struct {
 	// The PEM encoded CA certification file path, used to verify client certificates,
 	// applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true`
 	// (default `/var/run/secrets/kubernetes.io/serviceaccount/ca.crt` for OpenShift).
-	CaCert                     *string `property:"ca-cert"`
+	CaCert *string `property:"ca-cert"`
 	// The principal which must be given in a client certificate to allow access to the Jolokia endpoint,
 	// applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true`
 	// (default `clientPrincipal=cn=system:master-proxy` for OpenShift).
-	ClientPrincipal            *string `property:"client-principal"`
+	ClientPrincipal *string `property:"client-principal"`
 	// Listen for multicast requests (default `false`)
-	DiscoveryEnabled           *bool   `property:"discovery-enabled"`
+	DiscoveryEnabled *bool `property:"discovery-enabled"`
 	// Mandate the client certificate contains a client flag in the extended key usage section,
 	// applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true`
 	// (default `true` for OpenShift).
-	ExtendedClientCheck        *bool   `property:"extended-client-check"`
+	ExtendedClientCheck *bool `property:"extended-client-check"`
 	// The Host address to which the Jolokia agent should bind to. If `"\*"` or `"0.0.0.0"` is given,
 	// the servers binds to every network interface (default `"*"`).
-	Host                       *string `property:"host"`
+	Host *string `property:"host"`
 	// The password used for authentication, applicable when the `user` option is set.
-	Password                   *string `property:"password"`
+	Password *string `property:"password"`
 	// The Jolokia endpoint port (default `8778`).
-	Port                       int     `property:"port"`
+	Port int `property:"port"`
 	// The protocol to use, either `http` or `https` (default `https` for OpenShift)
-	Protocol                   *string `property:"protocol"`
+	Protocol *string `property:"protocol"`
 	// The user to be used for authentication
-	User                       *string `property:"user"`
+	User *string `property:"user"`
 	// Whether client certificates should be used for authentication (default `true` for OpenShift).
-	UseSslClientAuthentication *bool   `property:"use-ssl-client-authentication"`
+	UseSslClientAuthentication *bool `property:"use-ssl-client-authentication"`
 
 	// A comma-separated list of additional Jolokia options as defined
 	// in https://jolokia.org/reference/html/agents.html#agent-jvm-config[JVM agent configuration options],
diff --git a/pkg/trait/knative.go b/pkg/trait/knative.go
index fd3387e..368d6f8 100644
--- a/pkg/trait/knative.go
+++ b/pkg/trait/knative.go
@@ -47,35 +47,35 @@ import (
 //
 // +camel-k:trait=knative
 type knativeTrait struct {
-	BaseTrait            `property:",squash"`
+	BaseTrait `property:",squash"`
 	// Can be used to inject a Knative complete configuration in JSON format.
-	Configuration        string `property:"configuration"`
+	Configuration string `property:"configuration"`
 	// Comma-separated list of channels used as source of integration routes.
 	// Can contain simple channel names or full Camel URIs.
-	ChannelSources       string `property:"channel-sources"`
+	ChannelSources string `property:"channel-sources"`
 	// Comma-separated list of channels used as destination of integration routes.
 	// Can contain simple channel names or full Camel URIs.
-	ChannelSinks         string `property:"channel-sinks"`
+	ChannelSinks string `property:"channel-sinks"`
 	// Comma-separated list of channels used as source of integration routes.
-	EndpointSources      string `property:"endpoint-sources"`
+	EndpointSources string `property:"endpoint-sources"`
 	// Comma-separated list of endpoints used as destination of integration routes.
 	// Can contain simple endpoint names or full Camel URIs.
-	EndpointSinks        string `property:"endpoint-sinks"`
+	EndpointSinks string `property:"endpoint-sinks"`
 	// Comma-separated list of event types that the integration will be subscribed to.
 	// Can contain simple event types or full Camel URIs (to use a specific broker different from "default").
-	EventSources         string `property:"event-sources"`
+	EventSources string `property:"event-sources"`
 	// Comma-separated list of event types that the integration will produce.
 	// Can contain simple event types or full Camel URIs (to use a specific broker).
-	EventSinks           string `property:"event-sinks"`
+	EventSinks string `property:"event-sinks"`
 	// Enables filtering on events based on the header "ce-knativehistory". Since this is an experimental header
 	// that can be removed in a future version of Knative, filtering is enabled only when the integration is
 	// listening from more than 1 channel.
-	FilterSourceChannels *bool  `property:"filter-source-channels"`
+	FilterSourceChannels *bool `property:"filter-source-channels"`
 	// The Knative 0.8 compatibility mode will check the installed version of Knative and
 	// use resource versions compatible with Knative 0.8 if found on the cluster.
-	Knative08CompatMode  *bool  `property:"knative-08-compat-mode"`
+	Knative08CompatMode *bool `property:"knative-08-compat-mode"`
 	// Enable automatic discovery of all trait properties.
-	Auto                 *bool  `property:"auto"`
+	Auto *bool `property:"auto"`
 }
 
 const (
diff --git a/pkg/trait/knative_service.go b/pkg/trait/knative_service.go
index b1c15b1..9fa8089 100644
--- a/pkg/trait/knative_service.go
+++ b/pkg/trait/knative_service.go
@@ -54,31 +54,31 @@ type knativeServiceTrait struct {
 	// Configures the Knative autoscaling class property (e.g. to set `hpa.autoscaling.knative.dev` or `kpa.autoscaling.knative.dev` autoscaling).
 	//
 	// Refer to the Knative documentation for more information.
-	Class     string `property:"autoscaling-class"`
+	Class string `property:"autoscaling-class"`
 	// Configures the Knative autoscaling metric property (e.g. to set `concurrency` based or `cpu` based autoscaling).
 	//
 	// Refer to the Knative documentation for more information.
-	Metric    string `property:"autoscaling-metric"`
+	Metric string `property:"autoscaling-metric"`
 	// Sets the allowed concurrency level or CPU percentage (depending on the autoscaling metric) for each Pod.
 	//
 	// Refer to the Knative documentation for more information.
-	Target    *int   `property:"autoscaling-target"`
+	Target *int `property:"autoscaling-target"`
 	// The minimum number of Pods that should be running at any time for the integration. It's **zero** by default, meaning that
 	// the integration is scaled down to zero when not used for a configured amount of time.
 	//
 	// Refer to the Knative documentation for more information.
-	MinScale  *int   `property:"min-scale"`
+	MinScale *int `property:"min-scale"`
 	// An upper bound for the number of Pods that can be running in parallel for the integration.
 	// Knative has its own cap value that depends on the installation.
 	//
 	// Refer to the Knative documentation for more information.
-	MaxScale  *int   `property:"max-scale"`
+	MaxScale *int `property:"max-scale"`
 	// Automatically deploy the integration as Knative service when all conditions hold:
 	//
 	// * Integration is using the Knative profile
 	// * All routes are either starting from a HTTP based consumer or a passive consumer (e.g. `direct` is a passive consumer)
-	Auto      *bool  `property:"auto"`
-	deployer  deployerTrait
+	Auto     *bool `property:"auto"`
+	deployer deployerTrait
 }
 
 func newKnativeServiceTrait() *knativeServiceTrait {
diff --git a/pkg/trait/owner.go b/pkg/trait/owner.go
index 3dfe374..37c7d64 100644
--- a/pkg/trait/owner.go
+++ b/pkg/trait/owner.go
@@ -36,7 +36,7 @@ type ownerTrait struct {
 	// The annotations to be transferred (A comma-separated list of label keys)
 	TargetAnnotations string `property:"target-annotations"`
 	// The labels to be transferred (A comma-separated list of label keys)
-	TargetLabels      string `property:"target-labels"`
+	TargetLabels string `property:"target-labels"`
 }
 
 func newOwnerTrait() *ownerTrait {
@@ -112,7 +112,6 @@ func (t *ownerTrait) IsPlatformTrait() bool {
 	return true
 }
 
-
 func (t *ownerTrait) propagateLabelAndAnnotations(res metav1.Object, targetLabels map[string]string, targetAnnotations map[string]string) {
 	// Transfer annotations
 	annotations := res.GetAnnotations()
diff --git a/pkg/trait/probes.go b/pkg/trait/probes.go
index 073ec01..5731d6f 100644
--- a/pkg/trait/probes.go
+++ b/pkg/trait/probes.go
@@ -35,31 +35,31 @@ import (
 type probesTrait struct {
 	BaseTrait `property:",squash"`
 	// Configures the host on which the probe is exposed (default `0.0.0.0`).
-	BindHost                  string `property:"bind-host"`
+	BindHost string `property:"bind-host"`
 	// Configures the port on which the probe is exposed (default `8080`).
-	BindPort                  int    `property:"bind-port"`
+	BindPort int `property:"bind-port"`
 	// Path to access on the probe ( default `/health`).
-	Path                      string `property:"path"`
+	Path string `property:"path"`
 	// Number of seconds after the container has started before liveness probes are initiated.
-	LivenessInitialDelay      int32  `property:"liveness-initial-delay"`
+	LivenessInitialDelay int32 `property:"liveness-initial-delay"`
 	// Number of seconds after which the probe times out. Applies to the liveness probe.
-	LivenessTimeout           int32  `property:"liveness-timeout"`
+	LivenessTimeout int32 `property:"liveness-timeout"`
 	// How often to perform the probe. Applies to the liveness probe.
-	LivenessPeriod            int32  `property:"liveness-period"`
+	LivenessPeriod int32 `property:"liveness-period"`
 	// Minimum consecutive successes for the probe to be considered successful after having failed. Applies to the liveness probe.
-	LivenessSuccessThreshold  int32  `property:"liveness-success-threshold"`
+	LivenessSuccessThreshold int32 `property:"liveness-success-threshold"`
 	// Minimum consecutive failures for the probe to be considered failed after having succeeded. Applies to the liveness probe.
-	LivenessFailureThreshold  int32  `property:"liveness-failure-threshold"`
+	LivenessFailureThreshold int32 `property:"liveness-failure-threshold"`
 	// Number of seconds after the container has started before readiness probes are initiated.
-	ReadinessInitialDelay     int32  `property:"readiness-initial-delay"`
+	ReadinessInitialDelay int32 `property:"readiness-initial-delay"`
 	// Number of seconds after which the probe times out. Applies to the readiness probe.
-	ReadinessTimeout          int32  `property:"readiness-timeout"`
+	ReadinessTimeout int32 `property:"readiness-timeout"`
 	// How often to perform the probe. Applies to the readiness probe.
-	ReadinessPeriod           int32  `property:"readiness-period"`
+	ReadinessPeriod int32 `property:"readiness-period"`
 	// Minimum consecutive successes for the probe to be considered successful after having failed. Applies to the readiness probe.
-	ReadinessSuccessThreshold int32  `property:"readiness-success-threshold"`
+	ReadinessSuccessThreshold int32 `property:"readiness-success-threshold"`
 	// Minimum consecutive failures for the probe to be considered failed after having succeeded. Applies to the readiness probe.
-	ReadinessFailureThreshold int32  `property:"readiness-failure-threshold"`
+	ReadinessFailureThreshold int32 `property:"readiness-failure-threshold"`
 }
 
 func newProbesTrait() *probesTrait {
diff --git a/pkg/trait/prometheus.go b/pkg/trait/prometheus.go
index e683f7f..84a8a73 100644
--- a/pkg/trait/prometheus.go
+++ b/pkg/trait/prometheus.go
@@ -44,9 +44,9 @@ import (
 type prometheusTrait struct {
 	BaseTrait `property:",squash"`
 	// The Prometheus endpoint port (default `9778`).
-	Port                 int    `property:"port"`
+	Port int `property:"port"`
 	// Whether a `ServiceMonitor` resource is created (default `true`).
-	ServiceMonitor       bool   `property:"service-monitor"`
+	ServiceMonitor bool `property:"service-monitor"`
 	// The `ServiceMonitor` resource labels, applicable when `service-monitor` is `true`.
 	ServiceMonitorLabels string `property:"service-monitor-labels"`
 }
diff --git a/pkg/trait/route.go b/pkg/trait/route.go
index 403e48d..adc8c37 100644
--- a/pkg/trait/route.go
+++ b/pkg/trait/route.go
@@ -33,25 +33,25 @@ import (
 //
 // +camel-k:trait=route
 type routeTrait struct {
-	BaseTrait                        `property:",squash"`
+	BaseTrait `property:",squash"`
 	// To configure the host exposed by the route.
-	Host                             string `property:"host"`
+	Host string `property:"host"`
 	// The TLS termination type, like `edge`, `passthrough` or `reencrypt`.
 	//
 	// Refer to the OpenShift documentation for additional information.
-	TLSTermination                   string `property:"tls-termination"`
+	TLSTermination string `property:"tls-termination"`
 	// The TLS certificate contents.
 	//
 	// Refer to the OpenShift documentation for additional information.
-	TLSCertificate                   string `property:"tls-certificate"`
+	TLSCertificate string `property:"tls-certificate"`
 	// The TLS certificate key contents.
 	//
 	// Refer to the OpenShift documentation for additional information.
-	TLSKey                           string `property:"tls-key"`
+	TLSKey string `property:"tls-key"`
 	// The TLS cert authority certificate contents.
 	//
 	// Refer to the OpenShift documentation for additional information.
-	TLSCACertificate                 string `property:"tls-ca-certificate"`
+	TLSCACertificate string `property:"tls-ca-certificate"`
 	// The destination CA certificate provides the contents of the ca certificate of the final destination.  When using reencrypt
 	// termination this file should be provided in order to have routers use it for health checks on the secure connection.
 	// If this field is not specified, the router may provide its own destination CA and perform hostname validation using
@@ -59,7 +59,7 @@ type routeTrait struct {
 	// verify.
 	//
 	// Refer to the OpenShift documentation for additional information.
-	TLSDestinationCACertificate      string `property:"tls-destination-ca-certificate"`
+	TLSDestinationCACertificate string `property:"tls-destination-ca-certificate"`
 	// To configure how to deal with insecure traffic, e.g. `Allow`, `Disable` or `Redirect` traffic.
 	//
 	// Refer to the OpenShift documentation for additional information.
diff --git a/pkg/trait/service.go b/pkg/trait/service.go
index d199331..e58ff68 100644
--- a/pkg/trait/service.go
+++ b/pkg/trait/service.go
@@ -34,7 +34,7 @@ import (
 type serviceTrait struct {
 	BaseTrait `property:",squash"`
 	// To automatically detect from the code if a Service needs to be created.
-	Auto      *bool `property:"auto"`
+	Auto *bool `property:"auto"`
 }
 
 const (
diff --git a/pkg/trait/trait_types.go b/pkg/trait/trait_types.go
index 8c41344..d20738a 100644
--- a/pkg/trait/trait_types.go
+++ b/pkg/trait/trait_types.go
@@ -85,7 +85,7 @@ func newBaseTrait(id string) BaseTrait {
 
 // BaseTrait is the root trait with noop implementations for hooks
 type BaseTrait struct {
-	id      ID
+	id ID
 	// Can be used to enable or disable a trait. All traits share this common property.
 	Enabled *bool `property:"enabled"`
 	client  client.Client
diff --git a/pkg/trait/zz_doc_gen.go b/pkg/trait/zz_generated_doc.go
similarity index 100%
rename from pkg/trait/zz_doc_gen.go
rename to pkg/trait/zz_generated_doc.go