Skip to content

Commit

Permalink
[artemiscloud#557] Add expose mode
Browse files Browse the repository at this point in the history
The expose mode affects how the internal services for acceptors, connectors and
console are exposed. Currently the supported modes are `route` and `ingress`.
Default is `route` on OpenShift and `ingress` on Kubernetes.
* `route` mode uses OpenShift Routes to expose the internal service.
* `ingress` mode uses Kubernetes Nginx Ingress to expose the internal service
  with TLS passthrough.
  • Loading branch information
brusdev committed Feb 16, 2024
1 parent ee789cb commit 74a3636
Show file tree
Hide file tree
Showing 11 changed files with 468 additions and 27 deletions.
31 changes: 27 additions & 4 deletions api/v1beta1/activemqartemis_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,17 @@ type StorageType struct {
StorageClassName string `json:"storageClassName,omitempty"`
}

// +kubebuilder:validation:Enum=ingress;route
type ExposeMode string

var ExposeModes = struct {
Ingress ExposeMode
Route ExposeMode
}{
Ingress: "ingress",
Route: "route",
}

type AcceptorType struct {
// The acceptor name
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Name",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"}
Expand Down Expand Up @@ -488,6 +499,9 @@ type AcceptorType struct {
// Whether or not to expose this acceptor
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Expose",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
Expose bool `json:"expose,omitempty"`
// Mode to expose the acceptor. Currently the supported modes are `route` and `ingress`. Default is `route` on OpenShift and `ingress` on Kubernetes. \n\n* `route` mode uses OpenShift Routes to expose the acceptor.\n* `ingress` mode uses Kubernetes Nginx Ingress to expose the acceptor with TLS passthrough.\n"
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Expose Mode",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"}
ExposeMode *ExposeMode `json:"exposeMode,omitempty"`
// To indicate which kind of routing type to use.
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Anycast Prefix",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"}
AnycastPrefix string `json:"anycastPrefix,omitempty"`
Expand Down Expand Up @@ -566,6 +580,9 @@ type ConnectorType struct {
// Whether or not to expose this connector
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Expose",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
Expose bool `json:"expose,omitempty"`
// Mode to expose the connector. Currently the supported modes are `route` and `ingress`. Default is `route` on OpenShift and `ingress` on Kubernetes. \n\n* `route` mode uses OpenShift Routes to expose the connector.\n* `ingress` mode uses Kubernetes Nginx Ingress to expose the connector with TLS passthrough.\n"
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Expose Mode",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"}
ExposeMode *ExposeMode `json:"exposeMode,omitempty"`
// Provider used for the keystore; "SUN", "SunJCE", etc. Default is null
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="KeyStore Provider",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"}
KeyStoreProvider string `json:"keyStoreProvider,omitempty"`
Expand All @@ -587,6 +604,9 @@ type ConsoleType struct {
// Whether or not to expose this port
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Expose",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
Expose bool `json:"expose,omitempty"`
// Mode to expose the console. Currently the supported modes are `route` and `ingress`. Default is `route` on OpenShift and `ingress` on Kubernetes. \n\n* `route` mode uses OpenShift Routes to expose the console.\n* `ingress` mode uses Kubernetes Nginx Ingress to expose the console with TLS passthrough.\n"
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Expose Mode",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"}
ExposeMode *ExposeMode `json:"exposeMode,omitempty"`
// Whether or not to enable SSL on this port
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="SSL Enabled",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
SSLEnabled bool `json:"sslEnabled,omitempty"`
Expand Down Expand Up @@ -729,10 +749,13 @@ const (
ValidConditionMissingResourcesReason = "MissingDependentResources"
ValidConditionInvalidVersionReason = "SpecVersionInvalid"

ValidConditionPDBNonNilSelectorReason = "PodDisruptionBudgetNonNilSelector"
ValidConditionFailedReservedLabelReason = "ReservedLabelReference"
ValidConditionFailedExtraMountReason = "InvalidExtraMount"
ValidConditionFailedDuplicateAcceptorPort = "DuplicateAcceptorPort"
ValidConditionPDBNonNilSelectorReason = "PodDisruptionBudgetNonNilSelector"
ValidConditionFailedReservedLabelReason = "ReservedLabelReference"
ValidConditionFailedExtraMountReason = "InvalidExtraMount"
ValidConditionFailedDuplicateAcceptorPort = "DuplicateAcceptorPort"
ValidConditionFailedAcceptorWithInvalidExposeMode = "AcceptorWithInvalidExposeMode"
ValidConditionFailedConnectorWithInvalidExposeMode = "ConnectorWithInvalidExposeMode"
ValidConditionFailedConsoleWithInvalidExposeMode = "ConsoelWithInvalidExposeMode"

ReadyConditionType = "Ready"
ReadyConditionReason = "ResourceReady"
Expand Down
21 changes: 19 additions & 2 deletions api/v1beta1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,15 @@ spec:
path: acceptors[0].expose
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: Mode to expose the acceptor. Currently the supported modes are
`route` and `ingress`. Default is `route` on OpenShift and `ingress` on
Kubernetes. \n\n* `route` mode uses OpenShift Routes to expose the acceptor.\n*
`ingress` mode uses Kubernetes Nginx Ingress to expose the acceptor with
TLS passthrough.\n"
displayName: Expose Mode
path: acceptors[0].exposeMode
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:text
- description: 'Host for Ingress and Route resources of the acceptor. It supports
the following variables: $(CR_NAME), $(CR_NAMESPACE), $(BROKER_ORDINAL),
$(ITEM_NAME), $(RES_NAME) and $(INGRESS_DOMAIN). Default is $(CR_NAME)-$(ITEM_NAME)-$(BROKER_ORDINAL)-svc-$(RES_TYPE).$(INGRESS_DOMAIN)'
Expand Down Expand Up @@ -1033,6 +1042,15 @@ spec:
path: connectors[0].expose
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: Mode to expose the connector. Currently the supported modes are
`route` and `ingress`. Default is `route` on OpenShift and `ingress` on
Kubernetes. \n\n* `route` mode uses OpenShift Routes to expose the connector.\n*
`ingress` mode uses Kubernetes Nginx Ingress to expose the connector with
TLS passthrough.\n"
displayName: Expose Mode
path: connectors[0].exposeMode
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:text
- description: Hostname or IP to connect to
displayName: Host
path: connectors[0].host
Expand Down Expand Up @@ -1127,6 +1145,15 @@ spec:
path: console.expose
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: Mode to expose the console. Currently the supported modes are
`route` and `ingress`. Default is `route` on OpenShift and `ingress` on
Kubernetes. \n\n* `route` mode uses OpenShift Routes to expose the console.\n*
`ingress` mode uses Kubernetes Nginx Ingress to expose the console with
TLS passthrough.\n"
displayName: Expose Mode
path: console.exposeMode
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:text
- description: 'Host for Ingress and Route resources of the acceptor. It supports
the following variables: $(CR_NAME), $(CR_NAMESPACE), $(BROKER_ORDINAL),
$(ITEM_NAME), $(RES_NAME) and $(INGRESS_DOMAIN). Default is $(CR_NAME)-$(ITEM_NAME)-$(BROKER_ORDINAL)-svc-$(RES_TYPE).$(INGRESS_DOMAIN)'
Expand Down
30 changes: 30 additions & 0 deletions bundle/manifests/broker.amq.io_activemqartemises.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ spec:
expose:
description: Whether or not to expose this acceptor
type: boolean
exposeMode:
description: Mode to expose the acceptor. Currently the supported
modes are `route` and `ingress`. Default is `route` on OpenShift
and `ingress` on Kubernetes. \n\n* `route` mode uses OpenShift
Routes to expose the acceptor.\n* `ingress` mode uses Kubernetes
Nginx Ingress to expose the acceptor with TLS passthrough.\n"
enum:
- ingress
- route
type: string
ingressHost:
description: 'Host for Ingress and Route resources of the acceptor.
It supports the following variables: $(CR_NAME), $(CR_NAMESPACE),
Expand Down Expand Up @@ -475,6 +485,16 @@ spec:
expose:
description: Whether or not to expose this connector
type: boolean
exposeMode:
description: Mode to expose the connector. Currently the supported
modes are `route` and `ingress`. Default is `route` on OpenShift
and `ingress` on Kubernetes. \n\n* `route` mode uses OpenShift
Routes to expose the connector.\n* `ingress` mode uses Kubernetes
Nginx Ingress to expose the connector with TLS passthrough.\n"
enum:
- ingress
- route
type: string
host:
description: Hostname or IP to connect to
type: string
Expand Down Expand Up @@ -547,6 +567,16 @@ spec:
expose:
description: Whether or not to expose this port
type: boolean
exposeMode:
description: Mode to expose the console. Currently the supported
modes are `route` and `ingress`. Default is `route` on OpenShift
and `ingress` on Kubernetes. \n\n* `route` mode uses OpenShift
Routes to expose the console.\n* `ingress` mode uses Kubernetes
Nginx Ingress to expose the console with TLS passthrough.\n"
enum:
- ingress
- route
type: string
ingressHost:
description: 'Host for Ingress and Route resources of the acceptor.
It supports the following variables: $(CR_NAME), $(CR_NAMESPACE),
Expand Down
30 changes: 30 additions & 0 deletions config/crd/bases/broker.amq.io_activemqartemises.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ spec:
expose:
description: Whether or not to expose this acceptor
type: boolean
exposeMode:
description: Mode to expose the acceptor. Currently the supported
modes are `route` and `ingress`. Default is `route` on OpenShift
and `ingress` on Kubernetes. \n\n* `route` mode uses OpenShift
Routes to expose the acceptor.\n* `ingress` mode uses Kubernetes
Nginx Ingress to expose the acceptor with TLS passthrough.\n"
enum:
- ingress
- route
type: string
ingressHost:
description: 'Host for Ingress and Route resources of the acceptor.
It supports the following variables: $(CR_NAME), $(CR_NAMESPACE),
Expand Down Expand Up @@ -476,6 +486,16 @@ spec:
expose:
description: Whether or not to expose this connector
type: boolean
exposeMode:
description: Mode to expose the connector. Currently the supported
modes are `route` and `ingress`. Default is `route` on OpenShift
and `ingress` on Kubernetes. \n\n* `route` mode uses OpenShift
Routes to expose the connector.\n* `ingress` mode uses Kubernetes
Nginx Ingress to expose the connector with TLS passthrough.\n"
enum:
- ingress
- route
type: string
host:
description: Hostname or IP to connect to
type: string
Expand Down Expand Up @@ -548,6 +568,16 @@ spec:
expose:
description: Whether or not to expose this port
type: boolean
exposeMode:
description: Mode to expose the console. Currently the supported
modes are `route` and `ingress`. Default is `route` on OpenShift
and `ingress` on Kubernetes. \n\n* `route` mode uses OpenShift
Routes to expose the console.\n* `ingress` mode uses Kubernetes
Nginx Ingress to expose the console with TLS passthrough.\n"
enum:
- ingress
- route
type: string
ingressHost:
description: 'Host for Ingress and Route resources of the acceptor.
It supports the following variables: $(CR_NAME), $(CR_NAMESPACE),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,15 @@ spec:
path: acceptors[0].expose
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: Mode to expose the acceptor. Currently the supported modes are
`route` and `ingress`. Default is `route` on OpenShift and `ingress` on
Kubernetes. \n\n* `route` mode uses OpenShift Routes to expose the acceptor.\n*
`ingress` mode uses Kubernetes Nginx Ingress to expose the acceptor with
TLS passthrough.\n"
displayName: Expose Mode
path: acceptors[0].exposeMode
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:text
- description: 'Host for Ingress and Route resources of the acceptor. It supports
the following variables: $(CR_NAME), $(CR_NAMESPACE), $(BROKER_ORDINAL),
$(ITEM_NAME), $(RES_NAME) and $(INGRESS_DOMAIN). Default is $(CR_NAME)-$(ITEM_NAME)-$(BROKER_ORDINAL)-svc-$(RES_TYPE).$(INGRESS_DOMAIN)'
Expand Down Expand Up @@ -807,6 +816,15 @@ spec:
path: connectors[0].expose
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: Mode to expose the connector. Currently the supported modes are
`route` and `ingress`. Default is `route` on OpenShift and `ingress` on
Kubernetes. \n\n* `route` mode uses OpenShift Routes to expose the connector.\n*
`ingress` mode uses Kubernetes Nginx Ingress to expose the connector with
TLS passthrough.\n"
displayName: Expose Mode
path: connectors[0].exposeMode
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:text
- description: Hostname or IP to connect to
displayName: Host
path: connectors[0].host
Expand Down Expand Up @@ -901,6 +919,15 @@ spec:
path: console.expose
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: Mode to expose the console. Currently the supported modes are
`route` and `ingress`. Default is `route` on OpenShift and `ingress` on
Kubernetes. \n\n* `route` mode uses OpenShift Routes to expose the console.\n*
`ingress` mode uses Kubernetes Nginx Ingress to expose the console with
TLS passthrough.\n"
displayName: Expose Mode
path: console.exposeMode
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:text
- description: 'Host for Ingress and Route resources of the acceptor. It supports
the following variables: $(CR_NAME), $(CR_NAMESPACE), $(BROKER_ORDINAL),
$(ITEM_NAME), $(RES_NAME) and $(INGRESS_DOMAIN). Default is $(CR_NAME)-$(ITEM_NAME)-$(BROKER_ORDINAL)-svc-$(RES_TYPE).$(INGRESS_DOMAIN)'
Expand Down

0 comments on commit 74a3636

Please sign in to comment.