manifests

package
v0.0.0-...-8c8647d Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// EnvRelatedImageLoki is the environment variable to fetch the Loki image pullspec.
	EnvRelatedImageLoki = "RELATED_IMAGE_LOKI"
	// EnvRelatedImageGateway is the environment variable to fetch the Gateway image pullspec.
	EnvRelatedImageGateway = "RELATED_IMAGE_GATEWAY"

	// DefaultContainerImage declares the default fallback for loki image.
	DefaultContainerImage = "docker.io/grafana/loki:2.2.1"

	// DefaultLokiStackGatewayImage declares the default image for lokiStack-gateway.
	DefaultLokiStackGatewayImage = "quay.io/observatorium/api:latest"

	// PrometheusCAFile declares the path for prometheus CA file for service monitors.
	PrometheusCAFile string = "/etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt"
	// BearerTokenFile declares the path for bearer token file for service monitors.
	BearerTokenFile string = "/var/run/secrets/kubernetes.io/serviceaccount/token"

	// LabelCompactorComponent is the label value for the compactor component
	LabelCompactorComponent string = "compactor"
	// LabelDistributorComponent is the label value for the distributor component
	LabelDistributorComponent string = "distributor"
	// LabelIngesterComponent is the label value for the ingester component
	LabelIngesterComponent string = "ingester"
	// LabelQuerierComponent is the label value for the querier component
	LabelQuerierComponent string = "querier"
	// LabelQueryFrontendComponent is the label value for the query frontend component
	LabelQueryFrontendComponent string = "query-frontend"
	// LabelIndexGatewayComponent is the label value for the lokiStack-index-gateway component
	LabelIndexGatewayComponent string = "index-gateway"
	// LabelGatewayComponent is the label value for the lokiStack-gateway component
	LabelGatewayComponent string = "lokistack-gateway"
)

Variables

This section is empty.

Functions

func ApplyDefaultSettings

func ApplyDefaultSettings(opts *Options) error

ApplyDefaultSettings manipulates the options to conform to build specifications

func ApplyGatewayDefaultOptions

func ApplyGatewayDefaultOptions(opts *Options) error

ApplyGatewayDefaultOptions applies defaults on the LokiStackSpec depending on selected tenant mode. Currently nothing is applied for modes static and dynamic. For mode openshift-logging the tenant spec is filled with defaults for authentication and authorization.

func BuildAll

func BuildAll(opts Options) ([]client.Object, error)

BuildAll builds all manifests required to run a Loki Stack

func BuildCompactor

func BuildCompactor(opts Options) ([]client.Object, error)

BuildCompactor builds the k8s objects required to run Loki Compactor.

func BuildDistributor

func BuildDistributor(opts Options) ([]client.Object, error)

BuildDistributor returns a list of k8s objects for Loki Distributor

func BuildGateway

func BuildGateway(opts Options) ([]client.Object, error)

BuildGateway returns a list of k8s objects for Loki Stack Gateway

func BuildIndexGateway

func BuildIndexGateway(opts Options) ([]client.Object, error)

BuildIndexGateway returns a list of k8s objects for Loki IndexGateway

func BuildIngester

func BuildIngester(opts Options) ([]client.Object, error)

BuildIngester builds the k8s objects required to run Loki Ingester

func BuildLokiGossipRingService

func BuildLokiGossipRingService(stackName string) *corev1.Service

BuildLokiGossipRingService creates a k8s service for the gossip/memberlist members of the cluster

func BuildQuerier

func BuildQuerier(opts Options) ([]client.Object, error)

BuildQuerier returns a list of k8s objects for Loki Querier

func BuildQueryFrontend

func BuildQueryFrontend(opts Options) ([]client.Object, error)

BuildQueryFrontend returns a list of k8s objects for Loki QueryFrontend

func BuildServiceMonitors

func BuildServiceMonitors(opts Options) []client.Object

BuildServiceMonitors builds the service monitors

func CompactorName

func CompactorName(stackName string) string

CompactorName is the name of the compactor statefulset

func ComponentLabels

func ComponentLabels(component, stackName string) labels.Set

ComponentLabels is a list of all commonLabels including the loki.grafana.com/component:<component> label

func ConfigOptions

func ConfigOptions(opt Options) config.Options

ConfigOptions converts Options to config.Options

func DefaultLokiStackSpec

func DefaultLokiStackSpec(size lokiv1beta1.LokiStackSizeType) *lokiv1beta1.LokiStackSpec

DefaultLokiStackSpec returns the default configuration for a LokiStack of the specified size

func DistributorName

func DistributorName(stackName string) string

DistributorName is the name of the distibutor deployment

func GatewayName

func GatewayName(stackName string) string

GatewayName is the name of the lokiStack-gateway statefulset

func GossipLabels

func GossipLabels() map[string]string

GossipLabels is the list of labels that should be assigned to components using the gossip ring

func IndexGatewayName

func IndexGatewayName(stackName string) string

IndexGatewayName is the name of the index-gateway statefulset

func IngesterName

func IngesterName(stackName string) string

IngesterName is the name of the compactor statefulset

func LokiConfigMap

func LokiConfigMap(opt Options) (*corev1.ConfigMap, string, error)

LokiConfigMap creates the single configmap containing the loki configuration for the whole cluster

func MutateFuncFor

func MutateFuncFor(existing, desired client.Object) controllerutil.MutateFn

MutateFuncFor returns a mutate function based on the existing resource's concrete type. It supports currently only the following types or else panics: - ConfigMap - Service - Deployment - StatefulSet - ServiceMonitor

func NewCompactorGRPCService

func NewCompactorGRPCService(opts Options) *corev1.Service

NewCompactorGRPCService creates a k8s service for the compactor GRPC endpoint

func NewCompactorHTTPService

func NewCompactorHTTPService(opts Options) *corev1.Service

NewCompactorHTTPService creates a k8s service for the ingester HTTP endpoint

func NewCompactorServiceMonitor

func NewCompactorServiceMonitor(opts Options) *monitoringv1.ServiceMonitor

NewCompactorServiceMonitor creates a k8s service monitor for the compactor component

func NewCompactorStatefulSet

func NewCompactorStatefulSet(opts Options) *appsv1.StatefulSet

NewCompactorStatefulSet creates a statefulset object for a compactor.

func NewDistributorDeployment

func NewDistributorDeployment(opts Options) *appsv1.Deployment

NewDistributorDeployment creates a deployment object for a distributor

func NewDistributorGRPCService

func NewDistributorGRPCService(opts Options) *corev1.Service

NewDistributorGRPCService creates a k8s service for the distributor GRPC endpoint

func NewDistributorHTTPService

func NewDistributorHTTPService(opts Options) *corev1.Service

NewDistributorHTTPService creates a k8s service for the distributor HTTP endpoint

func NewDistributorServiceMonitor

func NewDistributorServiceMonitor(opts Options) *monitoringv1.ServiceMonitor

NewDistributorServiceMonitor creates a k8s service monitor for the distributor component

func NewGatewayDeployment

func NewGatewayDeployment(opts Options, sha1C string) *appsv1.Deployment

NewGatewayDeployment creates a deployment object for a lokiStack-gateway

func NewGatewayHTTPService

func NewGatewayHTTPService(opts Options) *corev1.Service

NewGatewayHTTPService creates a k8s service for the lokistack-gateway HTTP endpoint

func NewGatewayIngress

func NewGatewayIngress(opts Options) (*networkingv1.Ingress, error)

NewGatewayIngress creates a k8s Ingress object for accessing the lokistack-gateway from public.

func NewGatewayServiceMonitor

func NewGatewayServiceMonitor(opts Options) *monitoringv1.ServiceMonitor

NewGatewayServiceMonitor creates a k8s service monitor for the lokistack-gateway component

func NewIndexGatewayGRPCService

func NewIndexGatewayGRPCService(opts Options) *corev1.Service

NewIndexGatewayGRPCService creates a k8s service for the index-gateway GRPC endpoint

func NewIndexGatewayHTTPService

func NewIndexGatewayHTTPService(opts Options) *corev1.Service

NewIndexGatewayHTTPService creates a k8s service for the index-gateway HTTP endpoint

func NewIndexGatewayServiceMonitor

func NewIndexGatewayServiceMonitor(opts Options) *monitoringv1.ServiceMonitor

NewIndexGatewayServiceMonitor creates a k8s service monitor for the index-gateway component

func NewIndexGatewayStatefulSet

func NewIndexGatewayStatefulSet(opts Options) *appsv1.StatefulSet

NewIndexGatewayStatefulSet creates a statefulset object for an index-gateway

func NewIngesterGRPCService

func NewIngesterGRPCService(opts Options) *corev1.Service

NewIngesterGRPCService creates a k8s service for the ingester GRPC endpoint

func NewIngesterHTTPService

func NewIngesterHTTPService(opts Options) *corev1.Service

NewIngesterHTTPService creates a k8s service for the ingester HTTP endpoint

func NewIngesterServiceMonitor

func NewIngesterServiceMonitor(opts Options) *monitoringv1.ServiceMonitor

NewIngesterServiceMonitor creates a k8s service monitor for the ingester component

func NewIngesterStatefulSet

func NewIngesterStatefulSet(opts Options) *appsv1.StatefulSet

NewIngesterStatefulSet creates a deployment object for an ingester

func NewQuerierDeployment

func NewQuerierDeployment(opts Options) *appsv1.Deployment

NewQuerierDeployment creates a deployment object for a querier

func NewQuerierGRPCService

func NewQuerierGRPCService(opts Options) *corev1.Service

NewQuerierGRPCService creates a k8s service for the querier GRPC endpoint

func NewQuerierHTTPService

func NewQuerierHTTPService(opts Options) *corev1.Service

NewQuerierHTTPService creates a k8s service for the querier HTTP endpoint

func NewQuerierServiceMonitor

func NewQuerierServiceMonitor(opts Options) *monitoringv1.ServiceMonitor

NewQuerierServiceMonitor creates a k8s service monitor for the querier component

func NewQueryFrontendDeployment

func NewQueryFrontendDeployment(opts Options) *appsv1.Deployment

NewQueryFrontendDeployment creates a deployment object for a query-frontend

func NewQueryFrontendGRPCService

func NewQueryFrontendGRPCService(opts Options) *corev1.Service

NewQueryFrontendGRPCService creates a k8s service for the query-frontend GRPC endpoint

func NewQueryFrontendHTTPService

func NewQueryFrontendHTTPService(opts Options) *corev1.Service

NewQueryFrontendHTTPService creates a k8s service for the query-frontend HTTP endpoint

func NewQueryFrontendServiceMonitor

func NewQueryFrontendServiceMonitor(opts Options) *monitoringv1.ServiceMonitor

NewQueryFrontendServiceMonitor creates a k8s service monitor for the query-frontend component

func QuerierName

func QuerierName(stackName string) string

QuerierName is the name of the querier deployment

func QueryFrontendName

func QueryFrontendName(stackName string) string

QueryFrontendName is the name of the query-frontend statefulset

Types

type FeatureFlags

type FeatureFlags struct {
	EnableCertificateSigningService bool
	EnableServiceMonitors           bool
	EnableTLSServiceMonitorConfig   bool
	EnableGateway                   bool
	EnableGatewayRoute              bool
}

FeatureFlags contains flags that activate various features

type ObjectStorage

type ObjectStorage struct {
	Endpoint        string
	Region          string
	Buckets         string
	AccessKeyID     string
	AccessKeySecret string
}

ObjectStorage for storage config.

type Options

type Options struct {
	Name              string
	Namespace         string
	Image             string
	GatewayImage      string
	GatewayBaseDomain string
	ConfigSHA1        string

	Flags FeatureFlags

	Stack                lokiv1beta1.LokiStackSpec
	ResourceRequirements internal.ComponentResources

	ObjectStorage ObjectStorage

	OpenShiftOptions openshift.Options
	TenantSecrets    []*TenantSecrets
	TenantConfigMap  map[string]openshift.TenantData
}

Options is a set of configuration values to use when building manifests such as resource sizes, etc. Most of this should be provided - either directly or indirectly - by the user.

type TenantSecrets

type TenantSecrets struct {
	TenantName   string
	ClientID     string
	ClientSecret string
	IssuerCAPath string
}

TenantSecrets for clientID, clientSecret and issuerCAPath for tenant's authentication.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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