Fedora Message Publisher Operator Proposal
STATE: DRAFT
Abstract
A proposal for sending messages to fedora-messages from kubernetes using an operator and a custom resource.
Authors
Motivation
Send messages to fedora-messaging by creating a simple custom resource in a Kubernetes cluster, no need to deal with certs integration details, just create a custom resource in Kubernetes and you are done.
Proposal
The operator will watch for a custom resource creation, such as FedoraMessage, and send a message to fedora messaging based on the resource definition.
The operator will create a new pod which will invoke the fedora-messaging CLI to send the message so it has an asynchronous nature.
It will update the resource status following the recommendations from this Kubernetes upstream docs: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties.
Resources
FedoraMessage
This resource defines a message that needs to be sent.
Resource Proposal:
apiVersion: apps.fedoraproject.org/v1alpha1
kind: FedoraMessage
metadata:
name: hello-world
spec:
env: prod # available options: stg, prod
message:
body: {encouragement: "You're doing great!"}
headers: {niceness: "very"}
topic: nice.message
authentication:
secret_ref:
name: fedora-messaging-certs # contains ca, cert and key
namespace: default # defaults to current resource namespace if not set
Updated Resource (once the message as been sent):
apiVersion: apps.fedoraproject.org/v1alpha1
kind: FedoraMessage
metadata:
name: hello-world
spec:
env: prod # available options: stg, prod
message:
body: {encouragement: "You're doing great!"}
headers: {niceness: "very"}
topic: nice.message
authentication:
secret_ref:
name: fedora-messaging-certs # contains ca, cert and key
namespace: default # defaults to current resource namespace if not set
status:
type: FedoraMessageSent
status: true
reason: Sent
message: "Message was sent successfully"
Copyright
This document has been placed in the public domain.
