siddhiprocess

package
v0.2.0-m1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2019 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SiddhiHome         string = "/home/siddhi_user/siddhi-runner/"
	SiddhiImage        string = "siddhiio/siddhi-runner-alpine:5.1.0-m1"
	SiddhiRunnerPath   string = "wso2/runner/"
	SiddhiCMExt        string = "-siddhi"
	SiddhiExt          string = ".siddhi"
	SiddhiFileRPath    string = "siddhi-files/"
	ContainerName      string = "siddhi-runner-runtime"
	DepConfigName      string = "deploymentconfig"
	DepConfMountPath   string = "tmp/configs/"
	DepConfParameter   string = "-Dconfig="
	AppConfParameter   string = "-Dapps="
	DepCMExt           string = "-depyml"
	Shell              string = "sh"
	RunnerRPath        string = "bin/runner.sh"
	HostName           string = "siddhi"
	OperatorName       string = "siddhi-operator"
	OperatorVersion    string = "0.2.0-m1"
	CRDName            string = "SiddhiProcess"
	ReadWriteOnce      string = "ReadWriteOnce"
	ReadOnlyMany       string = "ReadOnlyMany"
	ReadWriteMany      string = "ReadWriteMany"
	PVCExt             string = "-pvc"
	FilePersistentPath string = "wso2/runner/siddhi-app-persistence"
	ParserDomain       string = "http://siddhi-parser."
	ParserContext      string = ".svc.cluster.local:9090/siddhi-parser/parse"
	PVCSize            string = "1Gi"
	NATSAPIVersion     string = "nats.io/v1alpha2"
	STANAPIVersion     string = "streaming.nats.io/v1alpha1"
	NATSKind           string = "NatsCluster"
	STANKind           string = "NatsStreamingCluster"
	NATSExt            string = "-nats"
	STANExt            string = "-stan"
	NATSClusterName    string = "siddhi-nats"
	STANClusterName    string = "siddhi-stan"
	NATSDefaultURL     string = "nats://siddhi-nats:4222"
	NATSTCPHost        string = "siddhi-nats:4222"
	NATSMSType         string = "nats"
	TCP                string = "tcp"
	IngressTLS         string = ""
	AutoCreateIngress  bool   = false
	NATSSize           int    = 1
	NATSTimeout        int    = 5
	DefaultRTime       int    = 1
	DeploymentSize     int32  = 1
)

Default configurations stored as constants. Further these constants used by the Configurations() function.

View Source
const (
	StatePersistenceConf string = `` /* 210-byte string literal not displayed */

	StatePersistenceConfTest string = `` /* 200-byte string literal not displayed */

)

State persistence config is the different string constant used by the deployApp() function. This constant holds a YAML object which used to change the deployment.yaml file of the siddhi-runner image.

View Source
const (
	Push           string = "PUSH"
	Pull           string = "PULL"
	Failover       string = "failover"
	Default        string = "default"
	Distributed    string = "distributed"
	ProcessApp     string = "process"
	PassthroughApp string = "passthrough"
	OperatorCMName string = "siddhi-operator"
)

These are all other relevant constants that used by the operator. But these constants are not configuration varibles. That is why this has been seperated.

View Source
const (
	Int intstr.Type = iota
	String
)

Int - Type

Variables

ER recoder

View Source
var SPContainer map[string][]SiddhiApp

SPContainer holds siddhi apps

Functions

func Add

func Add(mgr manager.Manager) error

Add creates a new SiddhiProcess Controller and adds it to the Manager. The Manager will set fields on the Controller and Start it when the Manager is Started.

Types

type Configs added in v0.1.1

type Configs struct {
	SiddhiHome         string
	SiddhiImage        string
	SiddhiImageSecret  string
	SiddhiCMExt        string
	SiddhiExt          string
	SiddhiFileRPath    string
	SiddhiRunnerPath   string
	ContainerName      string
	DepConfigName      string
	DepConfMountPath   string
	DepConfParameter   string
	AppConfParameter   string
	DepCMExt           string
	Shell              string
	RunnerRPath        string
	HostName           string
	OperatorName       string
	OperatorVersion    string
	CRDName            string
	ReadWriteOnce      string
	ReadOnlyMany       string
	ReadWriteMany      string
	PVCExt             string
	FilePersistentPath string
	ParserDomain       string
	ParserContext      string
	PVCSize            string
	NATSAPIVersion     string
	STANAPIVersion     string
	NATSKind           string
	STANKind           string
	NATSExt            string
	STANExt            string
	NATSClusterName    string
	STANClusterName    string
	NATSDefaultURL     string
	NATSTCPHost        string
	NATSMSType         string
	TCP                string
	IngressTLS         string
	AutoCreateIngress  bool
	NATSSize           int
	NATSTimeout        int
	DefaultRTime       int
	DeploymentSize     int32
}

Configs is the struct definition of the object which used to bundle the all default configurations

type IntOrString

type IntOrString struct {
	Type   Type   `protobuf:"varint,1,opt,name=type,casttype=Type"`
	IntVal int32  `protobuf:"varint,2,opt,name=intVal"`
	StrVal string `protobuf:"bytes,3,opt,name=strVal"`
}

IntOrString - integer or string

type ReconcileSiddhiProcess

type ReconcileSiddhiProcess struct {
	// contains filtered or unexported fields
}

ReconcileSiddhiProcess reconciles a SiddhiProcess object

func (*ReconcileSiddhiProcess) Configurations

Configurations function returns the default config object. Here all the configs used as constants and budle together into a object and then returns that object. This object used to differenciate default configs from other variables.

func (*ReconcileSiddhiProcess) CreateConfigMap

func (rsp *ReconcileSiddhiProcess) CreateConfigMap(
	sp *siddhiv1alpha2.SiddhiProcess,
	configMapName string,
	data map[string]string,
) error

CreateConfigMap creates a k8s config map for given set of data. This function initialize the config map object, set the controller reference, and then creates the config map.

func (*ReconcileSiddhiProcess) CreateDeployment

func (rsp *ReconcileSiddhiProcess) CreateDeployment(
	sp *siddhiv1alpha2.SiddhiProcess,
	name string,
	namespace string,
	replicas int32,
	labels map[string]string,
	image string,
	containerName string,
	command []string,
	args []string,
	ports []corev1.ContainerPort,
	vms []corev1.VolumeMount,
	envs []corev1.EnvVar,
	sc corev1.SecurityContext,
	ipp corev1.PullPolicy,
	secrets []corev1.LocalObjectReference,
	volumes []corev1.Volume,
) (err error)

CreateDeployment creates a deployment for given set of configuration data

func (*ReconcileSiddhiProcess) CreateIngress

func (rsp *ReconcileSiddhiProcess) CreateIngress(
	sp *siddhiv1alpha2.SiddhiProcess,
	siddhiApp SiddhiApp,
	configs Configs,
) (err error)

CreateIngress creates a NGINX Ingress load balancer object called siddhi

func (*ReconcileSiddhiProcess) CreateNATS

func (rsp *ReconcileSiddhiProcess) CreateNATS(sp *siddhiv1alpha2.SiddhiProcess, configs Configs) error

CreateNATS function creates a NATS cluster and a NATS streaming cluster More about NATS cluster - https://github.com/nats-io/nats-operator More about NATS streaming cluster - https://github.com/nats-io/nats-streaming-operator

func (*ReconcileSiddhiProcess) CreatePVC

func (rsp *ReconcileSiddhiProcess) CreatePVC(sp *siddhiv1alpha2.SiddhiProcess, configs Configs, pvcName string) error

CreatePVC function creates a persistence volume claim for a K8s cluster

func (*ReconcileSiddhiProcess) CreateService

func (rsp *ReconcileSiddhiProcess) CreateService(
	sp *siddhiv1alpha2.SiddhiProcess,
	siddhiApp SiddhiApp,
	configs Configs,
) (err error)

CreateService returns a Service object for a deployment

func (*ReconcileSiddhiProcess) Reconcile

func (rsp *ReconcileSiddhiProcess) Reconcile(request reconcile.Request) (reconcile.Result, error)

Reconcile reads that state of the cluster for a SiddhiProcess object and makes changes based on the state read and what is in the SiddhiProcess.Spec

func (*ReconcileSiddhiProcess) UpdateIngress

func (rsp *ReconcileSiddhiProcess) UpdateIngress(
	sp *siddhiv1alpha2.SiddhiProcess,
	currentIngress *extensionsv1beta1.Ingress,
	siddhiApp SiddhiApp,
	configs Configs,
) (err error)

UpdateIngress updates the given ingress object

type SPConfig

type SPConfig struct {
	Location string `yaml:"location"`
}

SPConfig contains the state persistence configs

type SiddhiApp

type SiddhiApp struct {
	Name               string                 `json:"appName"`
	ContainerPorts     []corev1.ContainerPort `json:"containerPorts"`
	Apps               map[string]string      `json:"apps"`
	ServiceEnabled     bool                   `json:"serviceEnabled"`
	PersistenceEnabled bool                   `json:"persistenceEnabled"`
	Replicas           int32                  `json:"replicas"`
}

SiddhiApp contains details about the siddhi app which need in the K8s deployment

type SiddhiAppConfig

type SiddhiAppConfig struct {
	SiddhiApp               string                   `json:"siddhiApp"`
	SourceDeploymentConfigs []SourceDeploymentConfig `json:"sourceDeploymentConfigs"`
	PersistenceEnabled      bool                     `json:"persistenceEnabled"`
	Replicas                int32                    `json:"replicas"`
}

SiddhiAppConfig holds siddhi app and the relevant SourceList

type SiddhiConfig

type SiddhiConfig struct {
	StatePersistence StatePersistence `yaml:"state.persistence"`
}

SiddhiConfig contains the siddhi config block

type SiddhiParserRequest

type SiddhiParserRequest struct {
	SiddhiApps      []string                        `json:"siddhiApps"`
	PropertyMap     map[string]string               `json:"propertyMap"`
	MessagingSystem *siddhiv1alpha2.MessagingSystem `json:"messagingSystem,omitempty"`
}

SiddhiParserRequest is request struct of the siddhi-parser

type SourceDeploymentConfig

type SourceDeploymentConfig struct {
	ServiceProtocol string `json:"serviceProtocol"`
	Secured         bool   `json:"secured"`
	Port            int    `json:"port"`
	IsPulling       bool   `json:"isPulling"`
}

SourceDeploymentConfig hold deployment configs of a particular siddhi app

type StatePersistence

type StatePersistence struct {
	SPConfig SPConfig `yaml:"config"`
}

StatePersistence contains the StatePersistence config block

type Status

type Status int

Status of a Siddhi process

const (
	PENDING Status = iota
	READY
	RUNNING
	ERROR
	WARNING
	NORMAL
)

Type of status as list of integer constans

type TemplatedApp

type TemplatedApp struct {
	App         string            `json:"siddhiApp"`
	PropertyMap map[string]string `json:"propertyMap"`
}

TemplatedApp contains the templated siddhi app and relevant properties to pass into the parser service

type Type

type Type int

Type represents the stored type of IntOrString.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL