From Fedora Project Wiki

(Created page with "= edora Messaging Publisher Operator Proposal = '''STATE:''' DRAFT == Abstract == A proposal for sending messages to fedora-messages from kubernetes using an operator and a...")
 
Line 1: Line 1:
= edora Messaging Publisher Operator Proposal =
= Fedora Messaging Publisher Operator Proposal =


'''STATE:''' DRAFT
'''STATE:''' DRAFT

Revision as of 14:05, 15 June 2021

Fedora Messaging Publisher Operator Proposal

STATE: DRAFT

Abstract

A proposal for sending messages to fedora-messages from kubernetes using an operator and a custom resource.

Authors

Leonardo Rossetti

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
   data: hello there # whatever message data needs to be sent
   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
   data: hello there # whatever message data needs to be sent
   topic: org.fedora.prod.something
   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.