operator: Update API docs generation using gen-crd-api-reference-docs (#7592)

k123
Mohamed-Amine Bouqsimi 3 years ago committed by GitHub
parent 7ec072dbac
commit de8ed49db6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      operator/.bingo/Variables.mk
  2. 5
      operator/.bingo/gen-crd-api-reference-docs.mod
  3. 14
      operator/.bingo/gen-crd-api-reference-docs.sum
  4. 2
      operator/.bingo/hugo.mod
  5. 4
      operator/.bingo/variables.env
  6. 1
      operator/CHANGELOG.md
  7. 18
      operator/Makefile
  8. 0
      operator/apis/config/v1/doc.go
  9. 1
      operator/apis/loki/register.go
  10. 4
      operator/apis/loki/v1/doc.go
  11. 3
      operator/apis/loki/v1/groupversion_info.go
  12. 4
      operator/apis/loki/v1/lokistack_types.go
  13. 4
      operator/apis/loki/v1beta1/doc.go
  14. 3
      operator/apis/loki/v1beta1/groupversion_info.go
  15. 69
      operator/config/docs/config.json
  16. 45
      operator/config/docs/templates/members.tpl
  17. 39
      operator/config/docs/templates/pkg.tpl
  18. 80
      operator/config/docs/templates/type.tpl
  19. 6059
      operator/docs/operator/api.md
  20. 497
      operator/docs/operator/feature-gates.md
  21. 9
      operator/website/config.toml

@ -29,6 +29,12 @@ $(CONTROLLER_GEN): $(BINGO_DIR)/controller-gen.mod
@echo "(re)installing $(GOBIN)/controller-gen-v0.10.0"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=controller-gen.mod -o=$(GOBIN)/controller-gen-v0.10.0 "sigs.k8s.io/controller-tools/cmd/controller-gen"
GEN_CRD_API_REFERENCE_DOCS := $(GOBIN)/gen-crd-api-reference-docs-v0.4.2
$(GEN_CRD_API_REFERENCE_DOCS): $(BINGO_DIR)/gen-crd-api-reference-docs.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/gen-crd-api-reference-docs-v0.4.2"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=gen-crd-api-reference-docs.mod -o=$(GOBIN)/gen-crd-api-reference-docs-v0.4.2 "github.com/aminesnow/gen-crd-api-reference-docs"
GOFUMPT := $(GOBIN)/gofumpt-v0.4.0
$(GOFUMPT): $(BINGO_DIR)/gofumpt.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@ -41,11 +47,11 @@ $(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod
@echo "(re)installing $(GOBIN)/golangci-lint-v1.50.0"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.50.0 "github.com/golangci/golangci-lint/cmd/golangci-lint"
HUGO := $(GOBIN)/hugo-v0.104.3
HUGO := $(GOBIN)/hugo-v0.80.0
$(HUGO): $(BINGO_DIR)/hugo.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/hugo-v0.104.3"
@cd $(BINGO_DIR) && GOWORK=off CGO_ENABLED=1 $(GO) build -tags=extended -mod=mod -modfile=hugo.mod -o=$(GOBIN)/hugo-v0.104.3 "github.com/gohugoio/hugo"
@echo "(re)installing $(GOBIN)/hugo-v0.80.0"
@cd $(BINGO_DIR) && GOWORK=off CGO_ENABLED=1 $(GO) build -tags=extended -mod=mod -modfile=hugo.mod -o=$(GOBIN)/hugo-v0.80.0 "github.com/gohugoio/hugo"
KIND := $(GOBIN)/kind-v0.16.0
$(KIND): $(BINGO_DIR)/kind.mod

@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.19
require github.com/aminesnow/gen-crd-api-reference-docs v0.4.2

@ -0,0 +1,14 @@
github.com/aminesnow/gen-crd-api-reference-docs v0.3.1 h1:IaijJi+CTTW5qPMkoGoqWAwfiOWrKg28PX/zpcneVbA=
github.com/aminesnow/gen-crd-api-reference-docs v0.3.1/go.mod h1:7J+YZ/5vg1ipvcSA6xvG/yf2elOooX76hY+djHUJRKQ=
github.com/aminesnow/gen-crd-api-reference-docs v0.4.0 h1:E4oz6CT1ZXQ2Bjkge79Fv9PYvc53dyZ+PeAdOgK5CLY=
github.com/aminesnow/gen-crd-api-reference-docs v0.4.0/go.mod h1:+rKY73OjTIruf1SSjNEX/BQ0giZs7HnDVGRLk6lNVWQ=
github.com/aminesnow/gen-crd-api-reference-docs v0.4.2 h1:De+lkI8HzPr4wp7wTteKYqvOVKduLmMkDVsHmT4Lg34=
github.com/aminesnow/gen-crd-api-reference-docs v0.4.2/go.mod h1:1cYMS+Yggurk7ZNmsn9B7IagUhZ9jmLAsThYW/111Q4=
github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
k8s.io/gengo v0.0.0-20201203183100-97869a43a9d9 h1:1bLA4Agvs1DILmc+q2Bbcqjx6jOHO7YEFA+G+0aTZoc=
k8s.io/gengo v0.0.0-20221011193443-fad74ee6edd9 h1:iu3o/SxaHVI7tKPtkGzD3M9IzrE21j+CUKH98NQJ8Ms=
k8s.io/klog v0.2.0 h1:0ElL0OHzF3N+OhoJTL0uca20SxtYt4X4+bzHeqrB83c=
k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A=

@ -4,4 +4,4 @@ go 1.19
replace github.com/markbates/inflect => github.com/markbates/inflect v0.0.0-20171215194931-a12c3aec81a6
require github.com/gohugoio/hugo v0.104.3 // CGO_ENABLED=1 -tags=extended
require github.com/gohugoio/hugo v0.80.0 // CGO_ENABLED=1 -tags=extended

@ -12,11 +12,13 @@ BINGO="${GOBIN}/bingo-v0.7.0"
CONTROLLER_GEN="${GOBIN}/controller-gen-v0.10.0"
GEN_CRD_API_REFERENCE_DOCS="${GOBIN}/gen-crd-api-reference-docs-v0.4.2"
GOFUMPT="${GOBIN}/gofumpt-v0.4.0"
GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.50.0"
HUGO="${GOBIN}/hugo-v0.104.3"
HUGO="${GOBIN}/hugo-v0.80.0"
KIND="${GOBIN}/kind-v0.16.0"

@ -1,5 +1,6 @@
## Main
- [7592](https://github.com/grafana/loki/pull/7592) **aminesnow**: Update API docs generation using gen-crd-api-reference-docs
- [7448](https://github.com/grafana/loki/pull/7448) **periklis**: Add TLS support for compactor delete client
- [7596](https://github.com/grafana/loki/pull/7596) **periklis**: Fix fresh-installs with built-in cert management enabled
- [7064](https://github.com/grafana/loki/pull/7064) **periklis**: Add support for built-in cert management

@ -275,16 +275,22 @@ oci-push-calculator: ## Push the calculator image
$(OCI_RUNTIME) push $(CALCULATOR_IMG)
##@ Website
TYPES_V1BETA1_TARGET := $(shell find apis/loki -type f -iname "*_types.go")
docs/operator/api.md: $(TYPES_V1BETA1_TARGET)
po-docgen api $(TYPES_V1BETA1_TARGET) > $@
sed -i 's/Prometheus Operator/Loki Operator/ig' $@
TYPES_TARGET := $(shell find apis/loki -type f -iname "*_types.go")
docs/operator/api.md: $(TYPES_TARGET)
$(GEN_CRD_API_REFERENCE_DOCS) -api-dir "github.com/grafana/loki/operator/apis/loki/" -config "$(PWD)/config/docs/config.json" -template-dir "$(PWD)/config/docs/templates" -out-file "$(PWD)/$@"
sed -i 's/+docs:/ docs:/' $@
sed -i 's/+parent:/ parent:/' $@
sed -i 's/##/\n##/' $@
sed -i 's/+newline/\n/' $@
FEATURE_GATES_TARGET := $(shell find apis/config -type f -iname "*_types.go")
docs/operator/feature-gates.md: $(FEATURE_GATES_TARGET)
po-docgen api $(FEATURE_GATES_TARGET) > $@
$(GEN_CRD_API_REFERENCE_DOCS) -api-dir "github.com/grafana/loki/operator/apis/config/v1/" -config "$(PWD)/config/docs/config.json" -template-dir "$(PWD)/config/docs/templates" -out-file "$(PWD)/$@"
sed -i 's/title: "API"/title: "Feature Gates"/' $@
sed -i 's/Prometheus Operator/Loki Operator/ig' $@
sed -i 's/+docs:/ docs:/' $@
sed -i 's/+parent:/ parent:/' $@
sed -i 's/##/\n##/' $@
sed -i 's/+newline/\n/' $@
.PHONY: web-pre
web-pre: docs/operator/api.md docs/operator/feature-gates.md

@ -0,0 +1,4 @@
// Package v1 contains API Schema definitions for the loki v1 API group
// +kubebuilder:object:generate=true
// +groupName=loki.grafana.com
package v1

@ -1,6 +1,3 @@
// Package v1 contains API Schema definitions for the loki v1 API group
// +kubebuilder:object:generate=true
// +groupName=loki.grafana.com
package v1
import (

@ -872,7 +872,9 @@ type LokiStackStatus struct {
//
// +operator-sdk:csv:customresourcedefinitions:displayName="LokiStack",resources={{Deployment,v1},{StatefulSet,v1},{ConfigMap,v1},{Ingress,v1},{Service,v1},{ServiceAccount,v1},{PersistentVolumeClaims,v1},{Route,v1},{ServiceMonitor,v1}}
type LokiStack struct {
Spec LokiStackSpec `json:"spec,omitempty"`
// LokiStack CR spec field.
Spec LokiStackSpec `json:"spec,omitempty"`
// LokiStack CR spec Status.
Status LokiStackStatus `json:"status,omitempty"`
metav1.ObjectMeta `json:"metadata,omitempty"`
metav1.TypeMeta `json:",inline"`

@ -0,0 +1,4 @@
// Package v1beta1 contains API Schema definitions for the loki v1beta1 API group
// +kubebuilder:object:generate=true
// +groupName=loki.grafana.com
package v1beta1

@ -1,6 +1,3 @@
// Package v1beta1 contains API Schema definitions for the loki v1beta1 API group
// +kubebuilder:object:generate=true
// +groupName=loki.grafana.com
package v1beta1
import (

@ -0,0 +1,69 @@
{
"hideMemberFields": [
"TypeMeta"
],
"hideTypePatterns": [
"ParseError$",
"List$"
],
"externalPackages": [
{
"typeMatchPrefix": "^k8s\\.io/apimachinery/pkg/apis/meta/v1\\.Duration$",
"docsURLTemplate": "https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1#Duration"
},
{
"typeMatchPrefix": "^k8s\\.io/apimachinery/pkg/util/intstr\\.IntOrString$",
"docsURLTemplate": "https://pkg.go.dev/k8s.io/apimachinery/pkg/util/intstr#IntOrString"
},
{
"typeMatchPrefix": "^k8s\\.io/(api|apimachinery/pkg/apis)/",
"docsURLTemplate": "https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#{{lower .TypeIdentifier}}-{{arrIndex .PackageSegments -1}}-{{arrIndex .PackageSegments -2}}"
},
{
"typeMatchPrefix": "^k8s\\.io/apiextensions-apiserver/pkg/apis/apiextensions/v1\\.JSON$",
"docsURLTemplate": "https://pkg.go.dev/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1#JSON"
},
{
"typeMatchPrefix": "^github\\.com/grafana/loki/operator/apis/loki/v1",
"docsURLTemplate": "../v1/api.md#loki.grafana.com/v1.{{ .TypeIdentifier}}"
},
{
"typeMatchPrefix": "^github\\.com/grafana/loki/operator/apis/loki/v1beta1",
"docsURLTemplate": "../v1beta1/api.md#loki-grafana.com-v1beta1-{{ .TypeIdentifier}}"
},
{
"typeMatchPrefix": "^github\\.com/grafana/loki/operator/apis/loki/config/v1",
"docsURLTemplate": "../v1/feature-gates.md#loki-grafana-com-v1-{{ .TypeIdentifier}}"
},
{
"typeMatchPrefix": "^k8s\\.io/component-base/config/v1alpha1\\.LeaderElectionConfiguration$",
"docsURLTemplate": "https://pkg.go.dev/k8s.io/component-base/config#LeaderElectionConfiguration"
},
{
"typeMatchPrefix": "^sigs\\.k8s\\.io/controller-runtime/pkg/config/v1alpha1\\.ControllerConfigurationSpec$",
"docsURLTemplate": "https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/config/v1alpha1#ControllerConfigurationSpec"
},
{
"typeMatchPrefix": "^sigs\\.k8s\\.io/controller-runtime/pkg/config/v1alpha1\\.ControllerMetrics$",
"docsURLTemplate": "https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/config/v1alpha1#ControllerMetrics"
},
{
"typeMatchPrefix": "^sigs\\.k8s\\.io/controller-runtime/pkg/config/v1alpha1\\.ControllerHealth$",
"docsURLTemplate": "https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/config/v1alpha1#ControllerHealth"
},
{
"typeMatchPrefix": "^sigs\\.k8s\\.io/controller-runtime/pkg/config/v1alpha1\\.ControllerWebhook$",
"docsURLTemplate": "https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/config/v1alpha1#ControllerWebhook"
}
],
"typeDisplayNamePrefixOverrides": {
"k8s.io/api/": "Kubernetes ",
"k8s.io/apimachinery/pkg/apis/": "Kubernetes ",
"k8s.io/component-base/config/": "Kubernetes ",
"sigs.k8s.io/controller-runtime/pkg/config/": "K8S Controller-runtime ",
"github.com/grafana/loki/operator/apis/loki/v1": "Loki Operator v1",
"github.com/grafana/loki/operator/apis/loki/v1beta1": "Loki Operator v1beta1",
"github.com/grafana/loki/operator/apis/loki/config/v1": "Feature Gates"
},
"markdownDisabled": false
}

@ -0,0 +1,45 @@
{{ define "member" }}
{{ if not (hiddenMember .)}}
{{ if fieldEmbedded . }}
{{ range .Type.Members }}
{{ template "member" . }}
{{ end }}
{{ else }}
<tr>
<td>
<code>{{ fieldName . }}</code><br/>
<em>
{{ if linkMDForType .Type }}
<a href="{{ linkMDForType .Type }}">
{{ typeDisplayName .Type }}
</a>
{{ else }}
{{ typeDisplayName .Type }}
{{ end }}
</em>
</td>
<td>
{{ if isOptionalMember .}}
<em>(Optional)</em>
{{ end }}
{{ safe (renderComments .CommentLines) }}
{{ if and (eq (.Type.Name.Name) "ObjectMeta") }}
Refer to the Kubernetes API documentation for the fields of the
<code>metadata</code> field.
{{ end }}
</td>
</tr>
{{ end }}
{{ end }}
{{ end }}
{{ define "members" }}
{{ range .Members }}
{{ template "member" . }}
{{ end }}
{{ end }}

@ -0,0 +1,39 @@
{{ define "packages" }}
---
title: "API"
description: "Generated API docs for the Loki Operator"
lead: ""
draft: false
images: []
menu:
+docs:
+parent: "operator"
weight: 1000
toc: true
---
This Document contains the types introduced by the Loki Operator to be consumed by users.
> This page is automatically generated with `gen-crd-api-reference-docs`.
{{ range .packages }}
# {{ packageDisplayName . }} { #{{packageMDAnchorID . }} }
{{ with (index .GoPackages 0 )}}
{{ with .DocComments }}
<div>
{{ safe (renderComments .) }}
</div>
{{ end }}
{{ end }}
<b>Resource Types:</b>
{{ range (visibleTypes (sortedTypes .Types))}}
{{ template "type" . }}
{{ end }}
<hr/>
+newline
{{ end }}
{{ end }}

@ -0,0 +1,80 @@
{{ define "type" }}
## {{ .Name.Name }} { #{{ anchorIDForTypeMD . }} }
{{ if eq .Kind "Alias" }}(<code>{{.Underlying}}</code> alias){{ end -}}
{{ with (typeReferences .) }}
<p>
(<em>Appears on:</em>
{{- $prev := "" -}}
{{- range . -}}
{{- if $prev -}}, {{ end -}}
{{- $prev = . -}}
<a href="{{ linkMDForType . }}">{{ typeDisplayName . }}</a>
{{- end -}}
)
</p>
{{ end }}
<div>
{{ safe (renderComments .CommentLines) }}
</div>
{{ with (constantsOfType .) }}
<table>
<thead>
<tr>
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{{- range . -}}
<tr>
{{- /*
renderComments implicitly creates a <p> element, so we
add one to the display name as well to make the contents
of the two cells align evenly.
*/ -}}
<td><p>{{ typeDisplayName . }}</p></td>
<td>{{ safe (renderComments .CommentLines) }}</td>
</tr>
{{- end -}}
</tbody>
</table>
{{ end }}
{{ if .Members }}
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{{ if isExportedType . }}
<tr>
<td>
<code>apiVersion</code><br/>
string
</td>
<td>
<code>
{{apiGroup .}}
</code>
</td>
</tr>
<tr>
<td>
<code>kind</code><br/>
string
</td>
<td><code>{{.Name.Name}}</code></td>
</tr>
{{ end }}
{{ template "members" .}}
</tbody>
</table>
{{ end }}
{{ end }}

File diff suppressed because it is too large Load Diff

@ -2,7 +2,6 @@
title: "Feature Gates"
description: "Generated API docs for the Loki Operator"
lead: ""
date: 2021-03-08T08:49:31+00:00
draft: false
images: []
menu:
@ -11,60 +10,454 @@ menu:
weight: 1000
toc: true
---
This Document contains the types introduced by the Loki Operator to be consumed by users.
> This page is automatically generated with `gen-crd-api-reference-docs`.
# config.loki.grafana.com/v1 { #config-loki-grafana-com-v1 }
<div>
<p>Package v1 contains API Schema definitions for the config v1 API group</p>
</div>
<b>Resource Types:</b>
This Document documents the types introduced by the Loki Operator to be consumed by users.
## FeatureGates { #config-loki-grafana-com-v1-FeatureGates }
<p>
(<em>Appears on:</em><a href="#config-loki-grafana-com-v1-ProjectConfig">ProjectConfig</a>)
</p>
<div>
<p>FeatureGates is the supported set of all operator feature gates.</p>
</div>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>serviceMonitors</code><br/>
<em>
bool
</em>
</td>
<td>
<p>ServiceMonitors enables creating a Prometheus-Operator managed ServiceMonitor
resource per LokiStack component.</p>
</td>
</tr>
<tr>
<td>
<code>serviceMonitorTlsEndpoints</code><br/>
<em>
bool
</em>
</td>
<td>
<p>ServiceMonitorTLSEndpoints enables TLS for the ServiceMonitor endpoints.</p>
</td>
</tr>
<tr>
<td>
<code>lokiStackAlerts</code><br/>
<em>
bool
</em>
</td>
<td>
<p>LokiStackAlerts enables creating Prometheus-Operator managed PrometheusRules
for common Loki alerts.</p>
</td>
</tr>
<tr>
<td>
<code>httpEncryption</code><br/>
<em>
bool
</em>
</td>
<td>
<p>HTTPEncryption enables TLS encryption for all HTTP LokiStack services.
Each HTTP service requires a secret named as the service with the following data:
- <code>tls.crt</code>: The TLS server side certificate.
- <code>tls.key</code>: The TLS key for server-side encryption.
In addition each service requires a configmap named as the LokiStack CR with the
suffix <code>-ca-bundle</code>, e.g. <code>lokistack-dev-ca-bundle</code> and the following data:
- <code>service-ca.crt</code>: The CA signing the service certificate in <code>tls.crt</code>.</p>
</td>
</tr>
<tr>
<td>
<code>grpcEncryption</code><br/>
<em>
bool
</em>
</td>
<td>
<p>GRPCEncryption enables TLS encryption for all GRPC LokiStack services.
Each GRPC service requires a secret named as the service with the following data:
- <code>tls.crt</code>: The TLS server side certificate.
- <code>tls.key</code>: The TLS key for server-side encryption.
In addition each service requires a configmap named as the LokiStack CR with the
suffix <code>-ca-bundle</code>, e.g. <code>lokistack-dev-ca-bundle</code> and the following data:
- <code>service-ca.crt</code>: The CA signing the service certificate in <code>tls.crt</code>.</p>
</td>
</tr>
<tr>
<td>
<code>lokiStackGateway</code><br/>
<em>
bool
</em>
</td>
<td>
<p>LokiStackGateway enables reconciling the reverse-proxy lokistack-gateway
component for multi-tenant authentication/authorization traffic control
to Loki.</p>
</td>
</tr>
<tr>
<td>
<code>grafanaLabsUsageReport</code><br/>
<em>
bool
</em>
</td>
<td>
<p>GrafanaLabsUsageReport enables the Grafana Labs usage report for Loki.
More details: <a href="https://grafana.com/docs/loki/latest/release-notes/v2-5/#usage-reporting">https://grafana.com/docs/loki/latest/release-notes/v2-5/#usage-reporting</a></p>
</td>
</tr>
<tr>
<td>
<code>runtimeSeccompProfile</code><br/>
<em>
bool
</em>
</td>
<td>
<p>RuntimeSeccompProfile enables the restricted seccomp profile on all
Lokistack components.</p>
</td>
</tr>
<tr>
<td>
<code>lokiStackWebhook</code><br/>
<em>
bool
</em>
</td>
<td>
<p>LokiStackWebhook enables the LokiStack CR validation and conversion webhooks.</p>
</td>
</tr>
<tr>
<td>
<code>alertingRuleWebhook</code><br/>
<em>
bool
</em>
</td>
<td>
<p>AlertingRuleWebhook enables the AlertingRule CR validation webhook.</p>
</td>
</tr>
<tr>
<td>
<code>recordingRuleWebhook</code><br/>
<em>
bool
</em>
</td>
<td>
<p>RecordingRuleWebhook enables the RecordingRule CR validation webhook.</p>
</td>
</tr>
<tr>
<td>
<code>defaultNodeAffinity</code><br/>
<em>
bool
</em>
</td>
<td>
<p>When DefaultNodeAffinity is enabled the operator will set a default node affinity on all pods.
This will limit scheduling of the pods to Nodes with Linux.</p>
</td>
</tr>
<tr>
<td>
<code>openshift</code><br/>
<em>
<a href="#config-loki-grafana-com-v1-OpenShiftFeatureGates">
OpenShiftFeatureGates
</a>
</em>
</td>
<td>
<p>OpenShift contains a set of feature gates supported only on OpenShift.</p>
</td>
</tr>
<tr>
<td>
<code>tlsProfile</code><br/>
<em>
string
</em>
</td>
<td>
<p>TLSProfile allows to chose a TLS security profile. Enforced
when using HTTPEncryption or GRPCEncryption.</p>
</td>
</tr>
</tbody>
</table>
> Note this document is generated from code comments. When contributing a change to this document please do so by changing the code comments.
## OpenShiftFeatureGates { #config-loki-grafana-com-v1-OpenShiftFeatureGates }
<p>
(<em>Appears on:</em><a href="#config-loki-grafana-com-v1-FeatureGates">FeatureGates</a>)
</p>
<div>
<p>OpenShiftFeatureGates is the supported set of all operator features gates on OpenShift.</p>
</div>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>servingCertsService</code><br/>
<em>
bool
</em>
</td>
<td>
<p>ServingCertsService enables OpenShift service-ca annotations on Services
to use the in-platform CA and generate a TLS cert/key pair per service for
in-cluster data-in-transit encryption.
More details: <a href="https://docs.openshift.com/container-platform/latest/security/certificate_types_descriptions/service-ca-certificates.html">https://docs.openshift.com/container-platform/latest/security/certificate_types_descriptions/service-ca-certificates.html</a></p>
</td>
</tr>
<tr>
<td>
<code>gatewayRoute</code><br/>
<em>
bool
</em>
</td>
<td>
<p>GatewayRoute enables creating an OpenShift Route for the LokiStack
gateway to expose the service to public internet access.
More details: <a href="https://docs.openshift.com/container-platform/latest/networking/understanding-networking.html">https://docs.openshift.com/container-platform/latest/networking/understanding-networking.html</a></p>
</td>
</tr>
<tr>
<td>
<code>ruleExtendedValidation</code><br/>
<em>
bool
</em>
</td>
<td>
<p>ExtendedRuleValidation enables extended validation of AlertingRule and RecordingRule
to enforce tenancy in an OpenShift context.</p>
</td>
</tr>
<tr>
<td>
<code>clusterTLSPolicy</code><br/>
<em>
bool
</em>
</td>
<td>
<p>ClusterTLSPolicy enables usage of TLS policies set in the API Server.
More details: <a href="https://docs.openshift.com/container-platform/4.11/security/tls-security-profiles.html">https://docs.openshift.com/container-platform/4.11/security/tls-security-profiles.html</a></p>
</td>
</tr>
</tbody>
</table>
## Table of Contents
* [FeatureGates](#featuregates)
* [OpenShiftFeatureGates](#openshiftfeaturegates)
* [ProjectConfig](#projectconfig)
## ProjectConfig { #config-loki-grafana-com-v1-ProjectConfig }
<div>
<p>ProjectConfig is the Schema for the projectconfigs API</p>
</div>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>syncPeriod</code><br/>
<em>
<a href="https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1#Duration">
Kubernetes meta/v1.Duration
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>SyncPeriod determines the minimum frequency at which watched resources are
reconciled. A lower period will correct entropy more quickly, but reduce
responsiveness to change if there are many watched resources. Change this
value only if you know what you are doing. Defaults to 10 hours if unset.
there will a 10 percent jitter between the SyncPeriod of all controllers
so that all controllers will not send list requests simultaneously.</p>
</td>
</tr>
<tr>
<td>
<code>leaderElection</code><br/>
<em>
<a href="https://pkg.go.dev/k8s.io/component-base/config#LeaderElectionConfiguration">
Kubernetes v1alpha1.LeaderElectionConfiguration
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>LeaderElection is the LeaderElection config to be used when configuring
the manager.Manager leader election</p>
</td>
</tr>
<tr>
<td>
<code>cacheNamespace</code><br/>
<em>
string
</em>
</td>
<td>
<em>(Optional)</em>
<p>CacheNamespace if specified restricts the manager&rsquo;s cache to watch objects in
the desired namespace Defaults to all namespaces</p>
<p>Note: If a namespace is specified, controllers can still Watch for a
cluster-scoped resource (e.g Node). For namespaced resources the cache
will only hold objects from the desired namespace.</p>
</td>
</tr>
<tr>
<td>
<code>gracefulShutDown</code><br/>
<em>
<a href="https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1#Duration">
Kubernetes meta/v1.Duration
</a>
</em>
</td>
<td>
<p>GracefulShutdownTimeout is the duration given to runnable to stop before the manager actually returns on stop.
To disable graceful shutdown, set to time.Duration(0)
To use graceful shutdown without timeout, set to a negative duration, e.G. time.Duration(-1)
The graceful shutdown is skipped for safety reasons in case the leader election lease is lost.</p>
</td>
</tr>
<tr>
<td>
<code>controller</code><br/>
<em>
<a href="https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/config/v1alpha1#ControllerConfigurationSpec">
K8S Controller-runtime v1alpha1.ControllerConfigurationSpec
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>Controller contains global configuration options for controllers
registered within this manager.</p>
</td>
</tr>
<tr>
<td>
<code>metrics</code><br/>
<em>
<a href="https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/config/v1alpha1#ControllerMetrics">
K8S Controller-runtime v1alpha1.ControllerMetrics
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>Metrics contains thw controller metrics configuration</p>
</td>
</tr>
<tr>
<td>
<code>health</code><br/>
<em>
<a href="https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/config/v1alpha1#ControllerHealth">
K8S Controller-runtime v1alpha1.ControllerHealth
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>Health contains the controller health configuration</p>
</td>
</tr>
<tr>
<td>
<code>webhook</code><br/>
<em>
<a href="https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/config/v1alpha1#ControllerWebhook">
K8S Controller-runtime v1alpha1.ControllerWebhook
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>Webhook contains the controllers webhook configuration</p>
</td>
</tr>
<tr>
<td>
<code>featureGates</code><br/>
<em>
<a href="#config-loki-grafana-com-v1-FeatureGates">
FeatureGates
</a>
</em>
</td>
<td>
</td>
</tr>
</tbody>
</table>
## FeatureGates
## TLSProfileType { #config-loki-grafana-com-v1-TLSProfileType }
(<code>string</code> alias)
<div>
<p>TLSProfileType is a TLS security profile based on the Mozilla definitions:
<a href="https://wiki.mozilla.org/Security/Server_Side_TLS">https://wiki.mozilla.org/Security/Server_Side_TLS</a></p>
</div>
<table>
<thead>
<tr>
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr><td><p>&#34;Intermediate&#34;</p></td>
<td><p>TLSProfileIntermediateType is a TLS security profile based on:
<a href="https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28default.29">https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28default.29</a></p>
</td>
</tr><tr><td><p>&#34;Modern&#34;</p></td>
<td><p>TLSProfileModernType is a TLS security profile based on:
<a href="https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility">https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility</a></p>
</td>
</tr><tr><td><p>&#34;Old&#34;</p></td>
<td><p>TLSProfileOldType is a TLS security profile based on:
<a href="https://wiki.mozilla.org/Security/Server_Side_TLS#Old_backward_compatibility">https://wiki.mozilla.org/Security/Server_Side_TLS#Old_backward_compatibility</a></p>
</td>
</tr></tbody>
</table>
<hr/>
FeatureGates is the supported set of all operator feature gates.
<em>appears in: [ProjectConfig](#projectconfig)</em>
| Field | Description | Scheme | Required |
| ----- | ----------- | ------ | -------- |
| serviceMonitors | ServiceMonitors enables creating a Prometheus-Operator managed ServiceMonitor resource per LokiStack component. | bool | false |
| serviceMonitorTlsEndpoints | ServiceMonitorTLSEndpoints enables TLS for the ServiceMonitor endpoints. | bool | false |
| lokiStackAlerts | LokiStackAlerts enables creating Prometheus-Operator managed PrometheusRules for common Loki alerts. | bool | false |
| httpEncryption | HTTPEncryption enables TLS encryption for all HTTP LokiStack services. Each HTTP service requires a secret named as the service with the following data: - `tls.crt`: The TLS server side certificate. - `tls.key`: The TLS key for server-side encryption. In addition each service requires a configmap named as the LokiStack CR with the suffix `-ca-bundle`, e.g. `lokistack-dev-ca-bundle` and the following data: - `service-ca.crt`: The CA signing the service certificate in `tls.crt`. | bool | false |
| grpcEncryption | GRPCEncryption enables TLS encryption for all GRPC LokiStack services. Each GRPC service requires a secret named as the service with the following data: - `tls.crt`: The TLS server side certificate. - `tls.key`: The TLS key for server-side encryption. In addition each service requires a configmap named as the LokiStack CR with the suffix `-ca-bundle`, e.g. `lokistack-dev-ca-bundle` and the following data: - `service-ca.crt`: The CA signing the service certificate in `tls.crt`. | bool | false |
| lokiStackGateway | LokiStackGateway enables reconciling the reverse-proxy lokistack-gateway component for multi-tenant authentication/authorization traffic control to Loki. | bool | false |
| grafanaLabsUsageReport | GrafanaLabsUsageReport enables the Grafana Labs usage report for Loki. More details: https://grafana.com/docs/loki/latest/release-notes/v2-5/#usage-reporting | bool | false |
| runtimeSeccompProfile | RuntimeSeccompProfile enables the restricted seccomp profile on all Lokistack components. | bool | false |
| lokiStackWebhook | LokiStackWebhook enables the LokiStack CR validation and conversion webhooks. | bool | false |
| alertingRuleWebhook | AlertingRuleWebhook enables the AlertingRule CR validation webhook. | bool | false |
| recordingRuleWebhook | RecordingRuleWebhook enables the RecordingRule CR validation webhook. | bool | false |
| openshift | OpenShift contains a set of feature gates supported only on OpenShift. | [OpenShiftFeatureGates](#openshiftfeaturegates) | false |
[Back to TOC](#table-of-contents)
## OpenShiftFeatureGates
OpenShiftFeatureGates is the supported set of all operator features gates on OpenShift.
<em>appears in: [FeatureGates](#featuregates)</em>
| Field | Description | Scheme | Required |
| ----- | ----------- | ------ | -------- |
| servingCertsService | ServingCertsService enables OpenShift service-ca annotations on Services to use the in-platform CA and generate a TLS cert/key pair per service for in-cluster data-in-transit encryption. More details: https://docs.openshift.com/container-platform/latest/security/certificate_types_descriptions/service-ca-certificates.html | bool | false |
| gatewayRoute | GatewayRoute enables creating an OpenShift Route for the LokiStack gateway to expose the service to public internet access. More details: https://docs.openshift.com/container-platform/latest/networking/understanding-networking.html | bool | false |
[Back to TOC](#table-of-contents)
## ProjectConfig
ProjectConfig is the Schema for the projectconfigs API
| Field | Description | Scheme | Required |
| ----- | ----------- | ------ | -------- |
| featureGates | | [FeatureGates](#featuregates) | false |
[Back to TOC](#table-of-contents)

@ -4,4 +4,11 @@ title = 'Loki Operator'
theme = 'doks'
[permalinks]
docs = "/:sections/:filename.md"
docs = "/:sections/:filename.md"
[markup.goldmark.renderer]
unsafe = true
[markup.tableOfContents]
endLevel = 4
ordered = false
startLevel = 1
Loading…
Cancel
Save