Skip to content

Watches for events in managed clusters and generates ClusterProfiles on the fly

License

Notifications You must be signed in to change notification settings

projectsveltos/event-manager

Repository files navigation

CI Go Report Card Slack License Twitter Follow

Sveltos

Please refere to sveltos documentation.

Event driven framework in action

Sveltos supports an event-driven add-on deployment oworkflow:

  1. define what an event is;
  2. select on which clusters;
  3. define which add-ons to deploy when event happens.

EventSource is the CRD introduced to define an event.

Sveltos supports custom events written in Lua.

Following EventSource instance define an event as a creation/deletion of a Service with label sveltos: fv.

apiVersion: lib.projectsveltos.io/v1beta1
kind: EventSource
metadata:
 name: sveltos-service
spec:
 collectResources: true
 group: ""
 version: "v1"
 kind: "Service"
 labelsFilters:
 - key: sveltos
   operation: Equal
   value: fv

Sveltos supports custom events written in Lua. Following EventSource instance again defines an Event as the creation/deletion of a Service with label sveltos: fv but using a Lua script.

apiVersion: lib.projectsveltos.io/v1beta1
kind: EventSource
metadata:
 name: sveltos-service
spec:
 collectResources: true
 group: ""
 version: "v1"
 kind: "Service"
 script: |
  function evaluate()
    hs = {}
    hs.matching = false
    hs.message = ""
    if obj.metadata.labels ~= nil then
      for key, value in pairs(obj.metadata.labels) do
        if key == "sveltos" then
          if value == "fv" then
            hs.matching = true
          end
        end
      end
    end
    return hs
  end

EventTrigger is the CRD introduced to define what add-ons to deploy when an event happens.

Sveltos Event Driven Framework

Event manager is a Sveltos micro service in charge of deploying add-ons when certain events happen in managed clusters.

Contributing

❤️ Your contributions are always welcome! If you want to contribute, have questions, noticed any bug or want to get the latest project news, you can connect with us in the following ways:

  1. Open a bug/feature enhancement on github contributions welcome
  2. Chat with us on the Slack in the #projectsveltos channel Slack
  3. Contact Us

License

Copyright 2022.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.