Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
261 changes: 261 additions & 0 deletions apis/bases/rabbitmq.openstack.org_rabbitmqfederations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,261 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.18.0
name: rabbitmqfederations.rabbitmq.openstack.org
spec:
group: rabbitmq.openstack.org
names:
categories:
- all
- rabbitmq
kind: RabbitMQFederation
listKind: RabbitMQFederationList
plural: rabbitmqfederations
shortNames:
- rmqfed
singular: rabbitmqfederation
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.rabbitmqClusterName
name: Cluster
type: string
- jsonPath: .status.upstreamName
name: Upstream
type: string
- jsonPath: .status.vhost
name: Vhost
type: string
- jsonPath: .status.conditions[0].status
name: Status
type: string
- jsonPath: .status.conditions[0].message
name: Message
type: string
name: v1beta1
schema:
openAPIV3Schema:
description: RabbitMQFederation is the Schema for the rabbitmqfederations
API
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: |-
RabbitMQFederationSpec defines the desired state of RabbitMQFederation
Supports two modes:
1. Same-namespace federation: specify UpstreamClusterName to federate with another RabbitMQ cluster in the same namespace
2. Cross-region federation: specify UpstreamSecretRef with AMQP URI(s) for remote upstream
properties:
ackMode:
default: on-confirm
description: |-
AckMode - acknowledgement mode for federated messages
- on-confirm: wait for publisher confirms (safest, default)
- on-publish: confirm immediately after publish (faster, may lose messages)
- no-ack: no acknowledgements (fastest, least safe)
enum:
- on-confirm
- on-publish
- no-ack
type: string
exchange:
description: Exchange - specific exchange to federate (if empty, federation
applies to all exchanges matching policy)
pattern: ^[-_.:A-Za-z0-9]+$
type: string
expires:
default: 1800000
description: |-
Expires - time in milliseconds that the upstream should remember about this node for (default: 1800000ms = 30min)
When connection is lost, messages will be queued for this duration
format: int32
minimum: 0
type: integer
maxHops:
default: 1
description: |-
MaxHops - maximum number of federation links a message can traverse (default: 1)
Prevents infinite loops in complex federation topologies
format: int32
minimum: 1
type: integer
messageTTL:
description: |-
MessageTTL - time to live for messages in the upstream queue (milliseconds)
0 means messages never expire
format: int32
minimum: 0
type: integer
policyPattern:
default: .*
description: 'PolicyPattern - regex pattern for matching exchanges/queues
to apply federation policy (default: ".*")'
type: string
prefetchCount:
default: 1000
description: 'PrefetchCount - maximum number of unacknowledged messages
the upstream can have (default: 1000)'
format: int32
minimum: 0
type: integer
priority:
default: 0
description: |-
Priority - priority of this upstream (higher values = higher priority, default: 0)
Used when multiple upstreams are available
format: int32
minimum: 0
type: integer
queue:
description: Queue - specific queue to federate (if empty, federation
applies to all queues matching policy)
pattern: ^[-_.:A-Za-z0-9]+$
type: string
queueType:
description: |-
QueueType - type of internal upstream queue for exchange federation
- classic: single replica queue (default)
- quorum: replicated queue for high availability
enum:
- classic
- quorum
type: string
rabbitmqClusterName:
description: RabbitmqClusterName - the name of the local RabbitMQ
cluster where federation will be configured
type: string
reconnectDelay:
default: 5
description: 'ReconnectDelay - time in seconds to wait before reconnecting
after connection failure (default: 5)'
format: int32
minimum: 0
type: integer
trustUserId:
description: |-
TrustUserId - whether to preserve user-id field across federation (default: false)
Should only be enabled for trusted upstreams
type: boolean
upstreamClusterName:
description: |-
UpstreamClusterName - name of upstream RabbitMQ cluster in the same namespace
Mutually exclusive with UpstreamSecretRef. Use this for same-namespace federation.
pattern: ^[-_.:A-Za-z0-9]+$
type: string
upstreamName:
description: UpstreamName - the name of the federation upstream in
RabbitMQ (must be unique per vhost)
pattern: ^[-_.:A-Za-z0-9]+$
type: string
upstreamSecretRef:
description: |-
UpstreamSecretRef - reference to secret containing AMQP URI(s) for remote upstream
Secret must contain key "uri" with one or more AMQP URIs (comma-separated for multiple)
Mutually exclusive with UpstreamClusterName. Use this for cross-region federation.
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
type: object
x-kubernetes-map-type: atomic
vhostRef:
description: VhostRef - reference to the RabbitMQVhost resource (defaults
to default vhost "/" if empty)
type: string
required:
- rabbitmqClusterName
- upstreamName
type: object
status:
description: RabbitMQFederationStatus defines the observed state of RabbitMQFederation
properties:
conditions:
description: Conditions
items:
description: Condition defines an observation of a API resource
operational state.
properties:
lastTransitionTime:
description: |-
Last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when
the API field changed is acceptable.
format: date-time
type: string
message:
description: A human readable message indicating details about
the transition.
type: string
reason:
description: The reason for the condition's last transition
in CamelCase.
type: string
severity:
description: |-
Severity provides a classification of Reason code, so the current situation is immediately
understandable and could act accordingly.
It is meant for situations where Status=False and it should be indicated if it is just
informational, warning (next reconciliation might fix it) or an error (e.g. DB create issue
and no actions to automatically resolve the issue can/should be done).
For conditions where Status=Unknown or Status=True the Severity should be SeverityNone.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
type: string
type:
description: Type of condition in CamelCase.
type: string
required:
- lastTransitionTime
- status
- type
type: object
type: array
observedGeneration:
description: ObservedGeneration - the most recent generation observed
for this resource
format: int64
type: integer
policyName:
description: PolicyName - name of the policy created for this federation
type: string
upstreamName:
description: UpstreamName - actual upstream name used in RabbitMQ
type: string
vhost:
description: Vhost - actual vhost name used in RabbitMQ
type: string
vhostRef:
description: VhostRef - reference to the RabbitMQVhost CR (for tracking)
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
7 changes: 7 additions & 0 deletions apis/rabbitmq/v1beta1/rabbitmq_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ type RabbitMqList struct {
Items []RabbitMq `json:"items"`
}

const (
// FederationUpstreamFinalizerPrefix - prefix for per-federation finalizers added to upstream RabbitMq clusters
// Full finalizer format: rmqfed.openstack.org/upstream-<federation-name>
// Prevents upstream cluster deletion while federation is active
FederationUpstreamFinalizerPrefix = "rmqfed.openstack.org/upstream-"
)

func init() {
SchemeBuilder.Register(&RabbitMq{}, &RabbitMqList{})
}
Expand Down
Loading