Repository: apache/camel-k
Pull request #2207 (2021-04-13 07:29:08)

feat(cmd): install resource requirements flag
<!-- Description -->

Adding a flag to allow setting operator Pod resources as specified in https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/

With this PR we can install the operator (both regular and OLM) specifing resources such as memory and CPU, ie:

```
kamel install --operator-resources limits.memory=256Mi --operator-resources limits.cpu=500m
```

<!--
Enter your extended release note in the below block. If the PR requires
additional action from users switching to the new release, include the string
"action required". If no release note is required, write "NONE". 

You can (optionally) mark this PR with labels "kind/bug" or "kind/feature" to make sure
the text is added to the right section of the release notes. 
-->

**Release Note**
```release-note
feat(cmd): install operator resource requirements option
```


squakez: cc @astefanutti you may have a look at this as it is similar to other installation requirements we introduced lately, thanks!

Patch:
diff --git a/pkg/apis/camel/v1/camelcatalog_types_support.go b/pkg/apis/camel/v1/camelcatalog_types_support.go
index 87fce768e..9c0ba615b 100644
--- a/pkg/apis/camel/v1/camelcatalog_types_support.go
+++ b/pkg/apis/camel/v1/camelcatalog_types_support.go
@@ -65,10 +65,8 @@ func NewCamelCatalogList() CamelCatalogList {
 // GetDependencyID returns a Camel K recognizable maven dependency for the artifact
 func (in *CamelArtifact) GetDependencyID() string {
 	switch {
-	case in.GroupID == "org.apache.camel" && strings.HasPrefix(in.ArtifactID, "camel-"):
-		return "camel:" + in.ArtifactID[6:]
 	case in.GroupID == "org.apache.camel.quarkus" && strings.HasPrefix(in.ArtifactID, "camel-quarkus-"):
-		return "camel-quarkus:" + in.ArtifactID[14:]
+		return "camel:" + in.ArtifactID[14:]
 	case in.Version == "":
 		return "mvn:" + in.GroupID + ":" + in.ArtifactID
 	default:
diff --git a/pkg/apis/camel/v1/integration_types_support.go b/pkg/apis/camel/v1/integration_types_support.go
index ec7334da2..53705c90b 100644
--- a/pkg/apis/camel/v1/integration_types_support.go
+++ b/pkg/apis/camel/v1/integration_types_support.go
@@ -116,8 +116,10 @@ func (in *IntegrationSpec) AddDependency(dependency string) {
 		in.Dependencies = make([]string, 0)
 	}
 	newDep := dependency
-	if strings.HasPrefix(newDep, "camel-quarkus") {
-		newDep = "camel-quarkus:" + strings.TrimPrefix(dependency, "camel-quarkus-")
+	if strings.HasPrefix(newDep, "camel-quarkus-") {
+		newDep = "camel:" + strings.TrimPrefix(dependency, "camel-quarkus-")
+	} else if strings.HasPrefix(newDep, "camel-quarkus:") {
+		newDep = "camel:" + strings.TrimPrefix(dependency, "camel-quarkus:")
 	} else if strings.HasPrefix(newDep, "camel-") {
 		newDep = "camel:" + strings.TrimPrefix(dependency, "camel-")
 	}
diff --git a/pkg/cmd/install.go b/pkg/cmd/install.go
index 1692c15e9..73c501bfd 100644
--- a/pkg/cmd/install.go
+++ b/pkg/cmd/install.go
@@ -127,8 +127,9 @@ func newCmdInstall(rootCmdOptions *RootCmdOptions) (*cobra.Command, *installCmdO
 	cmd.Flags().Int("monitoring-port", 8080, "The port of the metrics endpoint")
 
 	// Pod settings
-	cmd.Flags().StringArrayP("toleration", "", nil, "Add a Toleration to the operator Pod")
-	cmd.Flags().StringArrayP("node-selector", "", nil, "Add a NodeSelector to the operator Pod")
+	cmd.Flags().StringArray("toleration", nil, "Add a Toleration to the operator Pod")
+	cmd.Flags().StringArray("node-selector", nil, "Add a NodeSelector to the operator Pod")
+	cmd.Flags().StringArray("operator-resources", nil, "Define the resources requests and limits assigned to the operator Pod as <requestType.requestResource=value> (ie, limits.memory=256Mi)")
 
 	// save
 	cmd.Flags().Bool("save", false, "Save the install parameters into the default kamel configuration file (kamel-config.yaml)")
@@ -178,6 +179,7 @@ type installCmdOptions struct {
 	Tolerations             []string `mapstructure:"tolerations"`
 	NodeSelectors           []string `mapstructure:"node-selectors"`
 	HTTPProxySecret         string   `mapstructure:"http-proxy-secret"`
+	ResourcesRequirements   []string `mapstructure:"operator-resources"`
 
 	registry         v1.IntegrationPlatformRegistrySpec
 	registryAuth     registry.Auth
@@ -223,7 +225,8 @@ func (o *installCmdOptions) install(cobraCmd *cobra.Command, _ []string) error {
 		if installViaOLM {
 			fmt.Fprintln(cobraCmd.OutOrStdout(), "OLM is available in the cluster")
 			var installed bool
-			if installed, err = olm.Install(o.Context, olmClient, o.Namespace, o.Global, o.olmOptions, collection, o.Tolerations, o.NodeSelectors); err != nil {
+			if installed, err = olm.Install(o.Context, olmClient, o.Namespace, o.Global, o.olmOptions, collection,
+				o.Tolerations, o.NodeSelectors, o.ResourcesRequirements); err != nil {
 				return err
 			}
 			if !installed {
@@ -274,8 +277,9 @@ func (o *installCmdOptions) install(cobraCmd *cobra.Command, _ []string) error {
 					Enabled: o.Monitoring,
 					Port:    o.MonitoringPort,
 				},
-				Tolerations:   o.Tolerations,
-				NodeSelectors: o.NodeSelectors,
+				Tolerations:           o.Tolerations,
+				NodeSelectors:         o.NodeSelectors,
+				ResourcesRequirements: o.ResourcesRequirements,
 			}
 			err = install.OperatorOrCollect(o.Context, c, cfg, collection, o.Force)
 			if err != nil {
diff --git a/pkg/cmd/kit_create.go b/pkg/cmd/kit_create.go
index 0d26e1da9..63ab0eacb 100644
--- a/pkg/cmd/kit_create.go
+++ b/pkg/cmd/kit_create.go
@@ -138,7 +138,7 @@ func (command *kitCreateCommandOptions) run(_ *cobra.Command, args []string) err
 		case strings.HasPrefix(item, "file:"):
 			kit.Spec.Dependencies = append(kit.Spec.Dependencies, item)
 		case strings.HasPrefix(item, "camel-quarkus-"):
-			kit.Spec.Dependencies = append(kit.Spec.Dependencies, "camel-quarkus:"+strings.TrimPrefix(item, "camel-quarkus-"))
+			kit.Spec.Dependencies = append(kit.Spec.Dependencies, "camel:"+strings.TrimPrefix(item, "camel-quarkus-"))
 		case strings.HasPrefix(item, "camel-"):
 			kit.Spec.Dependencies = append(kit.Spec.Dependencies, "camel:"+strings.TrimPrefix(item, "camel-"))
 		}
diff --git a/pkg/install/operator.go b/pkg/install/operator.go
index 50d4e5b35..f8487b495 100644
--- a/pkg/install/operator.go
+++ b/pkg/install/operator.go
@@ -56,6 +56,7 @@ type OperatorConfiguration struct {
 	Monitoring            OperatorMonitoringConfiguration
 	Tolerations           []string
 	NodeSelectors         []string
+	ResourcesRequirements []string
 }
 
 // OperatorHealthConfiguration --
@@ -100,6 +101,20 @@ func OperatorOrCollect(ctx context.Context, c client.Client, cfg OperatorConfigu
 			}
 		}
 
+		if cfg.ResourcesRequirements != nil {
+			if d, ok := o.(*appsv1.Deployment); ok {
+				if d.Labels["camel.apache.org/component"] == "operator" {
+					resourceReq, err := kubernetes.NewResourceRequirements(cfg.ResourcesRequirements)
+					if err != nil {
+						fmt.Println("Warning: could not parse the configured resources requests!")
+					}
+					for i := 0; i < len(d.Spec.Template.Spec.Containers); i++ {
+						d.Spec.Template.Spec.Containers[i].Resources = resourceReq
+					}
+				}
+			}
+		}
+
 		if cfg.NodeSelectors != nil {
 			if d, ok := o.(*appsv1.Deployment); ok {
 				if d.Labels["camel.apache.org/component"] == "operator" {
diff --git a/pkg/trait/jolokia.go b/pkg/trait/jolokia.go
index f5fa0292a..6f4270059 100644
--- a/pkg/trait/jolokia.go
+++ b/pkg/trait/jolokia.go
@@ -90,7 +90,7 @@ func (t *jolokiaTrait) Apply(e *Environment) (err error) {
 		switch e.CamelCatalog.Runtime.Provider {
 		case v1.RuntimeProviderQuarkus:
 			util.StringSliceUniqueAdd(&e.Integration.Status.Dependencies, "mvn:org.apache.camel.quarkus:camel-quarkus-management")
-			util.StringSliceUniqueAdd(&e.Integration.Status.Dependencies, "camel-quarkus:jaxb")
+			util.StringSliceUniqueAdd(&e.Integration.Status.Dependencies, "camel:jaxb")
 		}
 
 		// TODO: We may want to make the Jolokia version configurable
diff --git a/pkg/util/camel/camel_dependencies.go b/pkg/util/camel/camel_dependencies.go
index d7718ffe2..411cb33c1 100644
--- a/pkg/util/camel/camel_dependencies.go
+++ b/pkg/util/camel/camel_dependencies.go
@@ -21,6 +21,7 @@ import (
 	"fmt"
 	"strings"
 
+	v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
 	"github.com/apache/camel-k/pkg/util/jitpack"
 	"github.com/apache/camel-k/pkg/util/maven"
 	"github.com/rs/xid"
@@ -51,13 +52,23 @@ func ManageIntegrationDependencies(
 				Scope:      "import",
 			})
 		case strings.HasPrefix(d, "camel:"):
-			artifactID := strings.TrimPrefix(d, "camel:")
+			if catalog != nil && catalog.Runtime.Provider == v1.RuntimeProviderQuarkus {
+				artifactID := strings.TrimPrefix(d, "camel:")
 
-			if !strings.HasPrefix(artifactID, "camel-") {
-				artifactID = "camel-" + artifactID
-			}
+				if !strings.HasPrefix(artifactID, "camel-") {
+					artifactID = "camel-quarkus-" + artifactID
+				}
+
+				project.AddDependencyGAV("org.apache.camel.quarkus", artifactID, "")
+			} else {
+				artifactID := strings.TrimPrefix(d, "camel:")
 
-			project.AddDependencyGAV("org.apache.camel", artifactID, "")
+				if !strings.HasPrefix(artifactID, "camel-") {
+					artifactID = "camel-" + artifactID
+				}
+
+				project.AddDependencyGAV("org.apache.camel", artifactID, "")
+			}
 		case strings.HasPrefix(d, "camel-k:"):
 			artifactID := strings.TrimPrefix(d, "camel-k:")
 
diff --git a/pkg/util/camel/camel_util.go b/pkg/util/camel/camel_util.go
index 055eefe2b..355ae4428 100644
--- a/pkg/util/camel/camel_util.go
+++ b/pkg/util/camel/camel_util.go
@@ -90,7 +90,7 @@ func newCatalogVersionCollection(catalogs []v1.CamelCatalog) CatalogVersionColle
 
 func getDependency(artifact v1.CamelArtifact, runtimeProvider v1.RuntimeProvider) string {
 	if runtimeProvider == v1.RuntimeProviderQuarkus {
-		return strings.Replace(artifact.ArtifactID, "camel-quarkus-", "camel-quarkus:", 1)
+		return strings.Replace(artifact.ArtifactID, "camel-quarkus-", "camel:", 1)
 	}
 	return strings.Replace(artifact.ArtifactID, "camel-", "camel:", 1)
 }
diff --git a/pkg/util/kubernetes/factory.go b/pkg/util/kubernetes/factory.go
index 956627c1e..862af695e 100644
--- a/pkg/util/kubernetes/factory.go
+++ b/pkg/util/kubernetes/factory.go
@@ -23,10 +23,12 @@ import (
 	"strconv"
 
 	corev1 "k8s.io/api/core/v1"
+	"k8s.io/apimachinery/pkg/api/resource"
 )
 
 var validTaintRegexp = regexp.MustCompile(`^([\w\/_\-\.]+)(=)?([\w_\-\.]+)?:(NoSchedule|NoExecute|PreferNoSchedule):?(\d*)?$`)
 var validNodeSelectorRegexp = regexp.MustCompile(`^([\w\/_\-\.]+)=([\w_\-\.]+)$`)
+var validResourceRequirementsRegexp = regexp.MustCompile(`^(requests|limits)\.(memory|cpu)=([\w\.]+)$`)
 
 // NewTolerations build an array of Tolerations from an array of string
 func NewTolerations(taints []string) ([]corev1.Toleration, error) {
@@ -75,3 +77,38 @@ func NewNodeSelectors(nsArray []string) (map[string]string, error) {
 	}
 	return nodeSelectors, nil
 }
+
+// NewResourceRequirements will build a CPU and memory requirements from an array of requests
+// matching <requestType.requestResource=value> (ie, limits.memory=256Mi)
+func NewResourceRequirements(reqs []string) (corev1.ResourceRequirements, error) {
+	resReq := corev1.ResourceRequirements{
+		Requests: corev1.ResourceList{},
+		Limits:   corev1.ResourceList{},
+	}
+
+	for _, s := range reqs {
+		if !validResourceRequirementsRegexp.MatchString(s) {
+			return resReq, fmt.Errorf("could not match resource requirement %v", s)
+		}
+
+		resGroups := validResourceRequirementsRegexp.FindStringSubmatch(s)
+
+		reqType := resGroups[1]
+		reqRes := resGroups[2]
+		reqQuantity, err := resource.ParseQuantity(resGroups[3])
+		if err != nil {
+			return resReq, err
+		}
+		switch reqType {
+		case "requests":
+			resReq.Requests[corev1.ResourceName(reqRes)] = reqQuantity
+		case "limits":
+			resReq.Limits[corev1.ResourceName(reqRes)] = reqQuantity
+		default:
+			return resReq, fmt.Errorf("unknown resource requirements %v", reqType)
+		}
+
+	}
+
+	return resReq, nil
+}
diff --git a/pkg/util/olm/operator.go b/pkg/util/olm/operator.go
index bb9ce2af8..2bba10706 100644
--- a/pkg/util/olm/operator.go
+++ b/pkg/util/olm/operator.go
@@ -138,7 +138,8 @@ func HasPermissionToInstall(ctx context.Context, client client.Client, namespace
 }
 
 // Install creates a subscription for the OLM package
-func Install(ctx context.Context, client client.Client, namespace string, global bool, options Options, collection *kubernetes.Collection, tolerations []string, nodeSelectors []string) (bool, error) {
+func Install(ctx context.Context, client client.Client, namespace string, global bool, options Options, collection *kubernetes.Collection,
+	tolerations []string, nodeSelectors []string, resourcesRequirements []string) (bool, error) {
 	options = fillDefaults(options)
 	if installed, err := IsOperatorInstalled(ctx, client, namespace, global, options); err != nil {
 		return false, err
@@ -175,6 +176,10 @@ func Install(ctx context.Context, client client.Client, namespace string, global
 	if err != nil {
 		return false, errors.Wrap(err, fmt.Sprintf("could not set node selectors"))
 	}
+	err = maybeSetResourcesRequirements(&sub, resourcesRequirements)
+	if err != nil {
+		return false, errors.Wrap(err, fmt.Sprintf("could not set resources requirements"))
+	}
 
 	if collection != nil {
 		collection.Add(&sub)
@@ -231,6 +236,17 @@ func maybeSetNodeSelectors(sub *operatorsv1alpha1.Subscription, nsArray []string
 	return nil
 }
 
+func maybeSetResourcesRequirements(sub *operatorsv1alpha1.Subscription, reqArray []string) error {
+	if reqArray != nil {
+		resourcesReq, err := kubernetes.NewResourceRequirements(reqArray)
+		if err != nil {
+			return err
+		}
+		sub.Spec.Config.Resources = resourcesReq
+	}
+	return nil
+}
+
 // Uninstall removes CSV and subscription from the namespace
 func Uninstall(ctx context.Context, client client.Client, namespace string, global bool, options Options) error {
 	sub, err := findSubscription(ctx, client, namespace, global, options)
diff --git a/pkg/util/source/inspector.go b/pkg/util/source/inspector.go
index 3933a6182..ff9471e55 100644
--- a/pkg/util/source/inspector.go
+++ b/pkg/util/source/inspector.go
@@ -286,11 +286,6 @@ func (i *baseInspector) discoverDependencies(source v1.SourceSpec, meta *Metadat
 }
 
 func (i *baseInspector) addDependency(dependency string, meta *Metadata) {
-	if i.catalog.Runtime.Provider == v1.RuntimeProviderQuarkus {
-		if strings.HasPrefix(dependency, "camel:") {
-			dependency = "camel-quarkus:" + strings.TrimPrefix(dependency, "camel:")
-		}
-	}
 	meta.Dependencies.Add(dependency)
 }
 


Test patch:
diff --git a/pkg/metadata/metadata_capabilities_test.go b/pkg/metadata/metadata_capabilities_test.go
index 2d9d6ceed..349e4850e 100644
--- a/pkg/metadata/metadata_capabilities_test.go
+++ b/pkg/metadata/metadata_capabilities_test.go
@@ -43,8 +43,8 @@ func TestPlatformHttpCapabilities(t *testing.T) {
 	assert.ElementsMatch(
 		t,
 		[]string{
-			"camel-quarkus:platform-http",
-			"camel-quarkus:log",
+			"camel:platform-http",
+			"camel:log",
 		},
 		meta.Dependencies.List())
 
diff --git a/pkg/metadata/metadata_dependencies_test.go b/pkg/metadata/metadata_dependencies_test.go
index 03dfe65d4..bc4a197b4 100644
--- a/pkg/metadata/metadata_dependencies_test.go
+++ b/pkg/metadata/metadata_dependencies_test.go
@@ -51,12 +51,12 @@ func TestDependenciesJavaSource(t *testing.T) {
 	assert.ElementsMatch(
 		t,
 		[]string{
-			"camel-quarkus:activemq",
-			"camel-quarkus:amqp",
-			"camel-quarkus:log",
-			"camel-quarkus:telegram",
-			"camel-quarkus:timer",
-			"camel-quarkus:twitter",
+			"camel:activemq",
+			"camel:amqp",
+			"camel:log",
+			"camel:telegram",
+			"camel:timer",
+			"camel:twitter",
 		},
 		meta.Dependencies.List())
 }
@@ -85,11 +85,11 @@ func TestDependenciesJavaScript(t *testing.T) {
 	assert.ElementsMatch(
 		t,
 		[]string{
-			"camel-quarkus:activemq",
-			"camel-quarkus:amqp",
-			"camel-quarkus:log",
-			"camel-quarkus:telegram",
-			"camel-quarkus:timer",
+			"camel:activemq",
+			"camel:amqp",
+			"camel:log",
+			"camel:telegram",
+			"camel:timer",
 		},
 		meta.Dependencies.List())
 }
@@ -120,12 +120,12 @@ func TestDependenciesGroovy(t *testing.T) {
 	assert.ElementsMatch(
 		t,
 		[]string{
-			"camel-quarkus:activemq",
-			"camel-quarkus:amqp",
-			"camel-quarkus:log",
-			"camel-quarkus:telegram",
-			"camel-quarkus:timer",
-			"camel-quarkus:twitter",
+			"camel:activemq",
+			"camel:amqp",
+			"camel:log",
+			"camel:telegram",
+			"camel:timer",
+			"camel:twitter",
 		},
 		meta.Dependencies.List())
 }
@@ -150,10 +150,10 @@ func TestDependencies(t *testing.T) {
 
 	assert.ElementsMatch(t,
 		[]string{
-			"camel-quarkus:http",
-			"camel-quarkus:log",
-			"camel-quarkus:mock",
-			"camel-quarkus:twitter",
+			"camel:http",
+			"camel:log",
+			"camel:mock",
+			"camel:twitter",
 		},
 		meta.Dependencies.List())
 }
@@ -183,12 +183,12 @@ func TestDependenciesQuarkus(t *testing.T) {
 
 	assert.ElementsMatch(t,
 		[]string{
-			"camel-quarkus:http",
-			"camel-quarkus:log",
-			"camel-quarkus:mock",
-			"camel-quarkus:timer",
-			"camel-quarkus:twitter",
-			"camel-quarkus:direct",
+			"camel:http",
+			"camel:log",
+			"camel:mock",
+			"camel:timer",
+			"camel:twitter",
+			"camel:direct",
 		},
 		meta.Dependencies.List())
 
@@ -214,9 +214,9 @@ func TestJacksonDependency(t *testing.T) {
 	assert.ElementsMatch(
 		t,
 		[]string{
-			"camel-quarkus:http",
-			"camel-quarkus:jackson",
-			"camel-quarkus:log",
+			"camel:http",
+			"camel:jackson",
+			"camel:log",
 		},
 		meta.Dependencies.List())
 }
@@ -242,9 +242,9 @@ func TestJacksonImplicitDependency(t *testing.T) {
 	assert.ElementsMatch(
 		t,
 		[]string{
-			"camel-quarkus:http",
-			"camel-quarkus:jackson",
-			"camel-quarkus:log",
+			"camel:http",
+			"camel:jackson",
+			"camel:log",
 		},
 		meta.Dependencies.List())
 }
@@ -275,14 +275,14 @@ func TestLanguageDependencies(t *testing.T) {
 	assert.ElementsMatch(
 		t,
 		[]string{
-			"camel-quarkus:direct",
-			"camel-quarkus:mvel",
-			"camel-quarkus:ognl",
-			"camel-quarkus:xpath",
-			"camel-quarkus:jsonpath",
-			"camel-quarkus:groovy",
-			"camel-quarkus:saxon",
-			"camel-quarkus:xml-jaxp",
+			"camel:direct",
+			"camel:mvel",
+			"camel:ognl",
+			"camel:xpath",
+			"camel:jsonpath",
+			"camel:groovy",
+			"camel:saxon",
+			"camel:xml-jaxp",
 		},
 		meta.Dependencies.List())
 }
@@ -309,10 +309,10 @@ func TestLanguageDependenciesTransformExpression(t *testing.T) {
 	assert.ElementsMatch(
 		t,
 		[]string{
-			"camel-quarkus:direct",
-			"camel-quarkus:ognl",
-			"camel-quarkus:xpath",
-			"camel-quarkus:jsonpath",
+			"camel:direct",
+			"camel:ognl",
+			"camel:xpath",
+			"camel:jsonpath",
 		},
 		meta.Dependencies.List())
 }
@@ -339,8 +339,8 @@ func TestCircuitBreakerDependency(t *testing.T) {
 
 	assert.ElementsMatch(t,
 		[]string{
-			"camel-quarkus:http",
-			"camel-quarkus:log",
+			"camel:http",
+			"camel:log",
 		},
 		meta.Dependencies.List())
 
@@ -370,9 +370,9 @@ func TestRestDependency(t *testing.T) {
 	assert.ElementsMatch(
 		t,
 		[]string{
-			"camel-quarkus:http",
-			"camel-quarkus:direct",
-			"camel-quarkus:log",
+			"camel:http",
+			"camel:direct",
+			"camel:log",
 			"mvn:org.apache.camel.quarkus:camel-quarkus-rest",
 			"mvn:org.apache.camel.quarkus:camel-quarkus-platform-http",
 		},
@@ -401,9 +401,9 @@ func TestRestWithPathDependency(t *testing.T) {
 
 	assert.ElementsMatch(
 		t, []string{
-			"camel-quarkus:http",
-			"camel-quarkus:direct",
-			"camel-quarkus:log",
+			"camel:http",
+			"camel:direct",
+			"camel:log",
 			"mvn:org.apache.camel.quarkus:camel-quarkus-rest",
 			"mvn:org.apache.camel.quarkus:camel-quarkus-platform-http",
 		},
@@ -431,8 +431,8 @@ func TestRestConfigurationDependency(t *testing.T) {
 
 	assert.ElementsMatch(
 		t, []string{
-			"camel-quarkus:http",
-			"camel-quarkus:log",
+			"camel:http",
+			"camel:log",
 			"mvn:org.apache.camel.quarkus:camel-quarkus-rest",
 			"mvn:org.apache.camel.quarkus:camel-quarkus-platform-http",
 		},
@@ -461,8 +461,8 @@ func TestRestClosureDependencyGroovy(t *testing.T) {
 	assert.ElementsMatch(
 		t,
 		[]string{
-			"camel-quarkus:http",
-			"camel-quarkus:log",
+			"camel:http",
+			"camel:log",
 			"mvn:org.apache.camel.quarkus:camel-quarkus-rest",
 			"mvn:org.apache.camel.quarkus:camel-quarkus-platform-http",
 		},
@@ -491,8 +491,8 @@ func TestRestClosureDependencyKotlin(t *testing.T) {
 	assert.ElementsMatch(
 		t,
 		[]string{
-			"camel-quarkus:http",
-			"camel-quarkus:log",
+			"camel:http",
+			"camel:log",
 			"mvn:org.apache.camel.quarkus:camel-quarkus-rest",
 			"mvn:org.apache.camel.quarkus:camel-quarkus-platform-http",
 		},
@@ -525,9 +525,9 @@ func TestXMLCircuitBreakerDependency(t *testing.T) {
 	assert.ElementsMatch(
 		t,
 		[]string{
-			"camel-quarkus:direct",
-			"camel-quarkus:kafka",
-			"camel-quarkus:log",
+			"camel:direct",
+			"camel:kafka",
+			"camel:log",
 		},
 		meta.Dependencies.List())
 
@@ -564,8 +564,8 @@ func TestXMLRestDependency(t *testing.T) {
 	assert.ElementsMatch(
 		t,
 		[]string{
-			"camel-quarkus:direct",
-			"camel-quarkus:mock",
+			"camel:direct",
+			"camel:mock",
 		},
 		meta.Dependencies.List())
 
@@ -620,15 +620,15 @@ func TestXMLLanguageDependencies(t *testing.T) {
 	assert.ElementsMatch(
 		t,
 		[]string{
-			"camel-quarkus:core",
-			"camel-quarkus:direct",
-			"camel-quarkus:mvel",
-			"camel-quarkus:ognl",
-			"camel-quarkus:xpath",
-			"camel-quarkus:xml-jaxp",
-			"camel-quarkus:jsonpath",
-			"camel-quarkus:saxon",
-			"camel-quarkus:groovy",
+			"camel:core",
+			"camel:direct",
+			"camel:mvel",
+			"camel:ognl",
+			"camel:xpath",
+			"camel:xml-jaxp",
+			"camel:jsonpath",
+			"camel:saxon",
+			"camel:groovy",
 		},
 		meta.Dependencies.List())
 }
@@ -690,8 +690,8 @@ func TestYAMLRestDependency(t *testing.T) {
 	assert.ElementsMatch(
 		t,
 		[]string{
-			"camel-quarkus:direct",
-			"camel-quarkus:log",
+			"camel:direct",
+			"camel:log",
 		},
 		meta.Dependencies.List())
 
@@ -716,7 +716,7 @@ func TestYAMLCircuitBreakerDependency(t *testing.T) {
 	assert.ElementsMatch(
 		t,
 		[]string{
-			"camel-quarkus:direct",
+			"camel:direct",
 		},
 		meta.Dependencies.List())
 	assert.True(t, meta.RequiredCapabilities.Has(v1.CapabilityCircuitBreaker))
@@ -739,14 +739,14 @@ func TestYAMLLanguageDependencies(t *testing.T) {
 	assert.ElementsMatch(
 		t,
 		[]string{
-			"camel-quarkus:core",
-			"camel-quarkus:direct",
-			"camel-quarkus:ognl",
-			"camel-quarkus:xpath",
-			"camel-quarkus:jsonpath",
-			"camel-quarkus:groovy",
-			"camel-quarkus:saxon",
-			"camel-quarkus:xml-jaxp",
+			"camel:core",
+			"camel:direct",
+			"camel:ognl",
+			"camel:xpath",
+			"camel:jsonpath",
+			"camel:groovy",
+			"camel:saxon",
+			"camel:xml-jaxp",
 		},
 		meta.Dependencies.List())
 }
diff --git a/pkg/trait/cron_test.go b/pkg/trait/cron_test.go
index f445cc3cb..0c8353a83 100644
--- a/pkg/trait/cron_test.go
+++ b/pkg/trait/cron_test.go
@@ -361,7 +361,7 @@ func TestCronDepsFallback(t *testing.T) {
 	assert.NotNil(t, ct)
 	assert.NotNil(t, ct.Fallback)
 	assert.True(t, util.StringSliceExists(environment.Integration.Status.Capabilities, v1.CapabilityCron))
-	assert.Contains(t, environment.Integration.Status.Dependencies, "camel-quarkus:quartz")
+	assert.Contains(t, environment.Integration.Status.Dependencies, "camel:quartz")
 	assert.Contains(t, environment.Integration.Status.Dependencies, "mvn:org.apache.camel.k:camel-k-cron")
 }
 
diff --git a/pkg/trait/dependencies_test.go b/pkg/trait/dependencies_test.go
index 8f8b0ac65..5a575c079 100644
--- a/pkg/trait/dependencies_test.go
+++ b/pkg/trait/dependencies_test.go
@@ -83,8 +83,8 @@ func TestIntegrationDefaultDeps(t *testing.T) {
 	assert.ElementsMatch(
 		t,
 		[]string{
-			"camel-quarkus:direct",
-			"camel-quarkus:log",
+			"camel:direct",
+			"camel:log",
 			"mvn:org.apache.camel.quarkus:camel-quarkus-java-joor-dsl",
 			"mvn:org.apache.camel.k:camel-k-runtime"},
 		e.Integration.Status.Dependencies,
@@ -129,8 +129,8 @@ func TestIntegrationCustomDeps(t *testing.T) {
 	assert.Nil(t, err)
 	assert.ElementsMatch(t,
 		[]string{
-			"camel-quarkus:direct",
-			"camel-quarkus:log",
+			"camel:direct",
+			"camel:log",
 			"camel:netty-http",
 			"org.foo:bar",
 			"mvn:org.apache.camel.quarkus:camel-quarkus-java-joor-dsl",
@@ -187,8 +187,8 @@ func TestIntegrationAutoGeneratedDeps(t *testing.T) {
 	assert.ElementsMatch(
 		t,
 		[]string{
-			"camel-quarkus:direct",
-			"camel-quarkus:log",
+			"camel:direct",
+			"camel:log",
 			"mvn:org.apache.camel.quarkus:camel-quarkus-rest",
 			"mvn:org.apache.camel.quarkus:camel-quarkus-java-joor-dsl",
 			"mvn:org.apache.camel.quarkus:camel-quarkus-xml-io-dsl",
@@ -236,8 +236,8 @@ func TestIntegrationCustomLoader(t *testing.T) {
 	assert.Nil(t, err)
 	assert.ElementsMatch(t,
 		[]string{
-			"camel-quarkus:direct",
-			"camel-quarkus:log",
+			"camel:direct",
+			"camel:log",
 			"mvn:org.apache.camel.k:camel-k-loader-yaml",
 			"mvn:org.apache.camel.k:camel-k-runtime"},
 		e.Integration.Status.Dependencies,
diff --git a/pkg/util/kubernetes/factory_test.go b/pkg/util/kubernetes/factory_test.go
index 1bda9f343..a92695f86 100644
--- a/pkg/util/kubernetes/factory_test.go
+++ b/pkg/util/kubernetes/factory_test.go
@@ -18,10 +18,12 @@ limitations under the License.
 package kubernetes
 
 import (
+	"strings"
 	"testing"
 
 	"github.com/stretchr/testify/assert"
 	v1 "k8s.io/api/core/v1"
+	"k8s.io/apimachinery/pkg/api/resource"
 )
 
 func TestValidTolerations(t *testing.T) {
@@ -134,3 +136,37 @@ func TestValueNodeSelectors(t *testing.T) {
 	assert.Equal(t, "value", nodeSelectors["key"])
 	assert.Equal(t, "worker0", nodeSelectors["kubernetes.io/hostname"])
 }
+
+func TestAllResourceRequirements(t *testing.T) {
+	resReq := "limits.memory=256Mi,requests.memory=128Mi,limits.cpu=1000m,requests.cpu=500m"
+	resourceRequirements, err := NewResourceRequirements(strings.Split(resReq, ","))
+	assert.Nil(t, err)
+
+	assert.Equal(t, resource.MustParse("256Mi"), *resourceRequirements.Limits.Memory())
+	assert.Equal(t, resource.MustParse("128Mi"), *resourceRequirements.Requests.Memory())
+	assert.Equal(t, resource.MustParse("1000m"), *resourceRequirements.Limits.Cpu())
+	assert.Equal(t, resource.MustParse("500m"), *resourceRequirements.Requests.Cpu())
+}
+
+func TestSomeResourceRequirements(t *testing.T) {
+	resReq := "limits.memory=128Mi,requests.cpu=500m"
+	resourceRequirements, err := NewResourceRequirements(strings.Split(resReq, ","))
+	assert.Nil(t, err)
+
+	assert.Equal(t, resource.MustParse("128Mi"), *resourceRequirements.Limits.Memory())
+	assert.Equal(t, true, resourceRequirements.Requests.Memory().IsZero())
+	assert.Equal(t, true, resourceRequirements.Limits.Cpu().IsZero())
+	assert.Equal(t, resource.MustParse("500m"), *resourceRequirements.Requests.Cpu())
+}
+
+func TestErrorResourceRequirements(t *testing.T) {
+	resReq := "limits.memory=expectSomeError!"
+	_, err := NewResourceRequirements(strings.Split(resReq, ","))
+	assert.NotNil(t, err)
+}
+
+func TestMissingResourceRequirements(t *testing.T) {
+	resReq := ""
+	_, err := NewResourceRequirements(strings.Split(resReq, ","))
+	assert.NotNil(t, err)
+}
diff --git a/pkg/util/source/inspector_yaml_test.go b/pkg/util/source/inspector_yaml_test.go
index f866f6ffd..49cf415a8 100644
--- a/pkg/util/source/inspector_yaml_test.go
+++ b/pkg/util/source/inspector_yaml_test.go
@@ -192,7 +192,7 @@ func TestYAMLRestDSL(t *testing.T) {
 			err := inspector.Extract(code, &meta)
 			assert.Nil(t, err)
 			assert.True(t, meta.RequiredCapabilities.Has(v1.CapabilityRest))
-			assert.True(t, meta.Dependencies.Has("camel-quarkus:log"))
+			assert.True(t, meta.Dependencies.Has("camel:log"))
 			assert.True(t, meta.ExposesHTTPServices)
 		})
 	}
@@ -239,19 +239,19 @@ func TestYAMLJson(t *testing.T) {
 	}{
 		{
 			source:     YAMLJSONMarshal,
-			dependency: "camel-quarkus:jackson",
+			dependency: "camel:jackson",
 		},
 		{
 			source:     YAMLJSONUnmarshal,
-			dependency: "camel-quarkus:jackson",
+			dependency: "camel:jackson",
 		},
 		{
 			source:     YAMLJSONGsonMarshal,
-			dependency: "camel-quarkus:gson",
+			dependency: "camel:gson",
 		},
 		{
 			source:     YAMLJSONUnknownMarshal,
-			dependency: "camel-quarkus:timer",
+			dependency: "camel:timer",
 		},
 	}