controller

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// OwnedResources are always synced unless they're marked unmanaged
	OwnedResources = []schema.GroupVersionResource{
		v1alpha1.SchemeGroupVersion.WithResource(v1alpha1.SpiceDBClusterResourceName),
	}

	// ExternalResources are not synced unless they're marked as managed
	ExternalResources = []schema.GroupVersionResource{
		appsv1.SchemeGroupVersion.WithResource("deployments"),
		corev1.SchemeGroupVersion.WithResource("secrets"),
		corev1.SchemeGroupVersion.WithResource("serviceaccounts"),
		corev1.SchemeGroupVersion.WithResource("services"),
		corev1.SchemeGroupVersion.WithResource("pods"),
		batchv1.SchemeGroupVersion.WithResource("jobs"),
		rbacv1.SchemeGroupVersion.WithResource("roles"),
		rbacv1.SchemeGroupVersion.WithResource("rolebindings"),
	}

	ConfigFileResource schema.GroupVersionResource
)
View Source
var ClusterMetrics = &ctrlmetrics.ConditionStatusCollector[*v1alpha1.SpiceDBCluster]{
	ObjectCount: metrics.NewDesc(
		prometheus.BuildFQName("spicedb_operator", "clusters", "count"),
		"Gauge showing the number of clusters managed by this operator",
		nil, nil, metrics.ALPHA, "",
	),
	ObjectConditionCount: metrics.NewDesc(
		prometheus.BuildFQName("spicedb_operator", "clusters", "condition_count"),
		"Gauge showing the number of clusters with each type of condition",
		[]string{
			"condition",
		}, nil, metrics.ALPHA, "",
	),
	ObjectTimeInCondition: metrics.NewDesc(
		prometheus.BuildFQName("spicedb_operator", "clusters", "condition_time_seconds"),
		"Gauge showing the amount of time the cluster has spent in the current condition",
		[]string{
			"condition",
			"cluster",
		}, nil, metrics.ALPHA, "",
	),
	CollectorTime: metrics.NewDesc(
		prometheus.BuildFQName("spicedb_operator", "cluster_status_collector", "execution_seconds"),
		"Amount of time spent on the last run of the cluster status collector",
		nil, nil, metrics.ALPHA, "",
	),
	CollectorErrors: metrics.NewDesc(
		prometheus.BuildFQName("spicedb_operator", "cluster_status_collector", "errors_count"),
		"Number of errors encountered on the last run of the cluster status collector",
		nil, nil, metrics.ALPHA, "",
	),
}

Functions

This section is empty.

Types

type Controller

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

func NewController

func NewController(ctx context.Context, dclient dynamic.Interface, kclient kubernetes.Interface, configFilePath, staticClusterPath string) (*Controller, error)

func (*Controller) DebuggingHandler

func (c *Controller) DebuggingHandler() http.Handler

func (*Controller) HealthChecker

func (*Controller) InformerFor

func (*Controller) ListerFor

func (*Controller) Name

func (c *Controller) Name() string

func (*Controller) Start

func (c *Controller) Start(ctx context.Context, numThreads int)

type OperatorConfig

type OperatorConfig struct {
	ImageName   string `json:"imageName"`
	ImageTag    string `json:"imageTag"`
	ImageDigest string `json:"imageDigest"`
}

type SpiceDBClusterHandler

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

func (*SpiceDBClusterHandler) Handle

func (r *SpiceDBClusterHandler) Handle(ctx context.Context)

Handle inspects the current SpiceDBCluster object and ensures the desired state is persisted on the cluster.

func (*SpiceDBClusterHandler) Patch

func (*SpiceDBClusterHandler) PatchStatus

func (r *SpiceDBClusterHandler) PatchStatus(ctx context.Context, patch *v1alpha1.SpiceDBCluster) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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