Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add path-based Ingress options to the ingress trait (1.x backport) #4090

Merged
merged 8 commits into from
Mar 6, 2023
40 changes: 40 additions & 0 deletions config/crd/bases/camel.apache.org_integrationplatforms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,13 @@ spec:
ingress:
description: The configuration of Ingress trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to the ingress. This can
be used to set controller specific annotations, e.g., when
using the NGINX Ingress controller: See https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/annotations.md'
type: object
auto:
description: To automatically add an ingress whenever the
integration uses an HTTP endpoint consumer.
Expand All @@ -816,6 +823,19 @@ spec:
host:
description: To configure the host exposed by the ingress.
type: string
path:
description: To configure the path exposed by the ingress
(default `/`).
type: string
pathType:
description: To configure the path type exposed by the ingress.
One of `Exact`, `Prefix`, `ImplementationSpecific` (default
to `Prefix`).
enum:
- Exact
- Prefix
- ImplementationSpecific
type: string
type: object
istio:
description: The configuration of Istio trait
Expand Down Expand Up @@ -2363,6 +2383,13 @@ spec:
ingress:
description: The configuration of Ingress trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to the ingress. This can
be used to set controller specific annotations, e.g., when
using the NGINX Ingress controller: See https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/annotations.md'
type: object
auto:
description: To automatically add an ingress whenever the
integration uses an HTTP endpoint consumer.
Expand All @@ -2379,6 +2406,19 @@ spec:
host:
description: To configure the host exposed by the ingress.
type: string
path:
description: To configure the path exposed by the ingress
(default `/`).
type: string
pathType:
description: To configure the path type exposed by the ingress.
One of `Exact`, `Prefix`, `ImplementationSpecific` (default
to `Prefix`).
enum:
- Exact
- Prefix
- ImplementationSpecific
type: string
type: object
istio:
description: The configuration of Istio trait
Expand Down
20 changes: 20 additions & 0 deletions config/crd/bases/camel.apache.org_integrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6577,6 +6577,13 @@ spec:
ingress:
description: The configuration of Ingress trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to the ingress. This can
be used to set controller specific annotations, e.g., when
using the NGINX Ingress controller: See https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/annotations.md'
type: object
auto:
description: To automatically add an ingress whenever the
integration uses an HTTP endpoint consumer.
Expand All @@ -6593,6 +6600,19 @@ spec:
host:
description: To configure the host exposed by the ingress.
type: string
path:
description: To configure the path exposed by the ingress
(default `/`).
type: string
pathType:
description: To configure the path type exposed by the ingress.
One of `Exact`, `Prefix`, `ImplementationSpecific` (default
to `Prefix`).
enum:
- Exact
- Prefix
- ImplementationSpecific
type: string
type: object
istio:
description: The configuration of Istio trait
Expand Down
20 changes: 20 additions & 0 deletions config/crd/bases/camel.apache.org_kameletbindings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6859,6 +6859,13 @@ spec:
ingress:
description: The configuration of Ingress trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to the ingress. This
can be used to set controller specific annotations,
e.g., when using the NGINX Ingress controller: See https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/annotations.md'
type: object
auto:
description: To automatically add an ingress whenever
the integration uses an HTTP endpoint consumer.
Expand All @@ -6875,6 +6882,19 @@ spec:
host:
description: To configure the host exposed by the ingress.
type: string
path:
description: To configure the path exposed by the ingress
(default `/`).
type: string
pathType:
description: To configure the path type exposed by the
ingress. One of `Exact`, `Prefix`, `ImplementationSpecific`
(default to `Prefix`).
enum:
- Exact
- Prefix
- ImplementationSpecific
type: string
type: object
istio:
description: The configuration of Istio trait
Expand Down
24 changes: 24 additions & 0 deletions docs/modules/ROOT/partials/apis/camel-k-crds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4504,13 +4504,37 @@ It's enabled by default whenever a Service is added to the integration (through



|`annotations` +
map[string]string
|


The annotations added to the ingress.
This can be used to set controller specific annotations, e.g., when using the NGINX Ingress controller:
See https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/annotations.md

|`host` +
string
|


To configure the host exposed by the ingress.

|`path` +
string
|


To configure the path exposed by the ingress (default `/`).

|`pathType` +
*https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#pathtype-v1-networking[Kubernetes networking/v1.PathType]*
|


To configure the path type exposed by the ingress.
One of `Exact`, `Prefix`, `ImplementationSpecific` (default to `Prefix`).

|`auto` +
bool
|
Expand Down
15 changes: 15 additions & 0 deletions docs/modules/traits/pages/ingress.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,25 @@ The following configuration options are available:
| bool
| Can be used to enable or disable a trait. All traits share this common property.

| ingress.annotations
| map[string]string
| The annotations added to the ingress.
This can be used to set controller specific annotations, e.g., when using the NGINX Ingress controller:
See https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/annotations.md

| ingress.host
| string
| To configure the host exposed by the ingress.

| ingress.path
| string
| To configure the path exposed by the ingress (default `/`).

| ingress.path-type
| k8s.io/api/networking/v1.PathType
| To configure the path type exposed by the ingress.
One of `Exact`, `Prefix`, `ImplementationSpecific` (default to `Prefix`).

| ingress.auto
| bool
| To automatically add an ingress whenever the integration uses an HTTP endpoint consumer.
Expand Down
40 changes: 40 additions & 0 deletions helm/camel-k/crds/crd-integration-platform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,13 @@ spec:
ingress:
description: The configuration of Ingress trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to the ingress. This can
be used to set controller specific annotations, e.g., when
using the NGINX Ingress controller: See https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/annotations.md'
type: object
auto:
description: To automatically add an ingress whenever the
integration uses an HTTP endpoint consumer.
Expand All @@ -816,6 +823,19 @@ spec:
host:
description: To configure the host exposed by the ingress.
type: string
path:
description: To configure the path exposed by the ingress
(default `/`).
type: string
pathType:
description: To configure the path type exposed by the ingress.
One of `Exact`, `Prefix`, `ImplementationSpecific` (default
to `Prefix`).
enum:
- Exact
- Prefix
- ImplementationSpecific
type: string
type: object
istio:
description: The configuration of Istio trait
Expand Down Expand Up @@ -2363,6 +2383,13 @@ spec:
ingress:
description: The configuration of Ingress trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to the ingress. This can
be used to set controller specific annotations, e.g., when
using the NGINX Ingress controller: See https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/annotations.md'
type: object
auto:
description: To automatically add an ingress whenever the
integration uses an HTTP endpoint consumer.
Expand All @@ -2379,6 +2406,19 @@ spec:
host:
description: To configure the host exposed by the ingress.
type: string
path:
description: To configure the path exposed by the ingress
(default `/`).
type: string
pathType:
description: To configure the path type exposed by the ingress.
One of `Exact`, `Prefix`, `ImplementationSpecific` (default
to `Prefix`).
enum:
- Exact
- Prefix
- ImplementationSpecific
type: string
type: object
istio:
description: The configuration of Istio trait
Expand Down
20 changes: 20 additions & 0 deletions helm/camel-k/crds/crd-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6577,6 +6577,13 @@ spec:
ingress:
description: The configuration of Ingress trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to the ingress. This can
be used to set controller specific annotations, e.g., when
using the NGINX Ingress controller: See https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/annotations.md'
type: object
auto:
description: To automatically add an ingress whenever the
integration uses an HTTP endpoint consumer.
Expand All @@ -6593,6 +6600,19 @@ spec:
host:
description: To configure the host exposed by the ingress.
type: string
path:
description: To configure the path exposed by the ingress
(default `/`).
type: string
pathType:
description: To configure the path type exposed by the ingress.
One of `Exact`, `Prefix`, `ImplementationSpecific` (default
to `Prefix`).
enum:
- Exact
- Prefix
- ImplementationSpecific
type: string
type: object
istio:
description: The configuration of Istio trait
Expand Down
20 changes: 20 additions & 0 deletions helm/camel-k/crds/crd-kamelet-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6859,6 +6859,13 @@ spec:
ingress:
description: The configuration of Ingress trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to the ingress. This
can be used to set controller specific annotations,
e.g., when using the NGINX Ingress controller: See https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/annotations.md'
type: object
auto:
description: To automatically add an ingress whenever
the integration uses an HTTP endpoint consumer.
Expand All @@ -6875,6 +6882,19 @@ spec:
host:
description: To configure the host exposed by the ingress.
type: string
path:
description: To configure the path exposed by the ingress
(default `/`).
type: string
pathType:
description: To configure the path type exposed by the
ingress. One of `Exact`, `Prefix`, `ImplementationSpecific`
(default to `Prefix`).
enum:
- Exact
- Prefix
- ImplementationSpecific
type: string
type: object
istio:
description: The configuration of Istio trait
Expand Down
12 changes: 12 additions & 0 deletions pkg/apis/camel/v1/trait/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.

package trait

import networkingv1 "k8s.io/api/networking/v1"

// The Ingress trait can be used to expose the service associated with the integration
// to the outside world with a Kubernetes Ingress.
//
Expand All @@ -25,8 +27,18 @@ package trait
// +camel-k:trait=ingress.
type IngressTrait struct {
Trait `property:",squash" json:",inline"`
// The annotations added to the ingress.
// This can be used to set controller specific annotations, e.g., when using the NGINX Ingress controller:
// See https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/annotations.md
Annotations map[string]string `property:"annotations" json:"annotations,omitempty"`
// To configure the host exposed by the ingress.
Host string `property:"host" json:"host,omitempty"`
// To configure the path exposed by the ingress (default `/`).
Path string `property:"path" json:"path,omitempty"`
// To configure the path type exposed by the ingress.
// One of `Exact`, `Prefix`, `ImplementationSpecific` (default to `Prefix`).
// +kubebuilder:validation:Enum=Exact;Prefix;ImplementationSpecific
PathType *networkingv1.PathType `property:"path-type" json:"pathType,omitempty"`
// To automatically add an ingress whenever the integration uses an HTTP endpoint consumer.
Auto *bool `property:"auto" json:"auto,omitempty"`
}
16 changes: 15 additions & 1 deletion pkg/apis/camel/v1/trait/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading