k8s

package module
v0.0.0-...-ac01517 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

README

OpenSergo CRD adapter for Sentinel Go (POC version)

NOTE: The Kubernetes operator logic was embedded in the POC data-source. This is only for demo. Please refer to https://github.com/opensergo/opensergo-specification/issues/17 for the canonical way to integrate with OpenSergo SDK.

Generate boilerplate code and OpenSergo CRD YAML:

make generate && make manifests

Install OpenSergo CRDs with:

kubectl apply -f config/crd/bases

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRDType

type CRDType int32
const (
	FaultToleranceRuleCRDType CRDType = iota
	RateLimitStrategyCRDType
)

func (CRDType) String

func (c CRDType) String() string

type DataSource

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

func NewDataSource

func NewDataSource(namespace string, app string) (*DataSource, error)

NewDataSource creates a OpenSergo data-source with given Kubernetes namespace. All Controllers take effective only with matched namespace.

func (*DataSource) Close

func (k *DataSource) Close() error

Close exit the K8S DataSource

func (*DataSource) RegisterController

func (k *DataSource) RegisterController(crd CRDType) error

RegisterController registers given CRD type and CRD name. For each CRD type, it can be registered only once.

func (*DataSource) RegisterControllersAndStart

func (k *DataSource) RegisterControllersAndStart() error

func (*DataSource) Run

func (k *DataSource) Run() error

Run runs the k8s DataSource

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the OpenSergo fault-tolerance v1alpha1 CRD.
Package v1alpha1 contains API Schema definitions for the OpenSergo fault-tolerance v1alpha1 CRD.

Jump to

Keyboard shortcuts

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