diff --git a/operator/.bingo/Variables.mk b/operator/.bingo/Variables.mk index c05de14bfd..4935526a4b 100644 --- a/operator/.bingo/Variables.mk +++ b/operator/.bingo/Variables.mk @@ -29,11 +29,11 @@ $(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 := $(GOBIN)/gen-crd-api-reference-docs-v0.0.3 $(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" + @echo "(re)installing $(GOBIN)/gen-crd-api-reference-docs-v0.0.3" + @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=gen-crd-api-reference-docs.mod -o=$(GOBIN)/gen-crd-api-reference-docs-v0.0.3 "github.com/ViaQ/gen-crd-api-reference-docs" GOFUMPT := $(GOBIN)/gofumpt-v0.4.0 $(GOFUMPT): $(BINGO_DIR)/gofumpt.mod diff --git a/operator/.bingo/gen-crd-api-reference-docs.mod b/operator/.bingo/gen-crd-api-reference-docs.mod index 1eddf57e49..975a7e6c72 100644 --- a/operator/.bingo/gen-crd-api-reference-docs.mod +++ b/operator/.bingo/gen-crd-api-reference-docs.mod @@ -2,4 +2,4 @@ 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 +require github.com/ViaQ/gen-crd-api-reference-docs v0.0.3 diff --git a/operator/.bingo/gen-crd-api-reference-docs.sum b/operator/.bingo/gen-crd-api-reference-docs.sum index 9bc8f9e8e0..5fe3d4119d 100644 --- a/operator/.bingo/gen-crd-api-reference-docs.sum +++ b/operator/.bingo/gen-crd-api-reference-docs.sum @@ -1,14 +1,11 @@ -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/ViaQ/gen-crd-api-reference-docs v0.0.2 h1:OVI5SfpuPo/TTANkqiJvNf+qUWE50+DvhbQC12e3ogk= +github.com/ViaQ/gen-crd-api-reference-docs v0.0.2/go.mod h1:WxpfZG1IGqhtLb0yM4e0Bl7K8VVmg4FAvQkd3x2R660= +github.com/ViaQ/gen-crd-api-reference-docs v0.0.3 h1:ChSn0sz5GEkVkjart0RlyeHtuI2ahufu3qyvyjksDq0= +github.com/ViaQ/gen-crd-api-reference-docs v0.0.3/go.mod h1:WxpfZG1IGqhtLb0yM4e0Bl7K8VVmg4FAvQkd3x2R660= 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= diff --git a/operator/.bingo/variables.env b/operator/.bingo/variables.env index 09177b49c6..122010d764 100644 --- a/operator/.bingo/variables.env +++ b/operator/.bingo/variables.env @@ -12,7 +12,7 @@ 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" +GEN_CRD_API_REFERENCE_DOCS="${GOBIN}/gen-crd-api-reference-docs-v0.0.3" GOFUMPT="${GOBIN}/gofumpt-v0.4.0" diff --git a/operator/CHANGELOG.md b/operator/CHANGELOG.md index bb561caf82..34ffe82f46 100644 --- a/operator/CHANGELOG.md +++ b/operator/CHANGELOG.md @@ -1,5 +1,6 @@ ## Main +- [7716](https://github.com/grafana/loki/pull/7716) **aminesnow**: Migrate API docs generation tool - [7710](https://github.com/grafana/loki/pull/7710) **periklis**: Fix LokiStackController watches for cluster-scoped resources - [7682](https://github.com/grafana/loki/pull/7682) **periklis**: Refactor cluster proxy to use configv1.Proxy on OpenShift - [7711](https://github.com/grafana/loki/pull/7711) **Red-GV**: Remove default value from replicationFactor field diff --git a/operator/docs/operator/api.md b/operator/docs/operator/api.md index 7854f64e3b..ebd229b1b9 100644 --- a/operator/docs/operator/api.md +++ b/operator/docs/operator/api.md @@ -132,6 +132,72 @@ OPASpec +## ClusterProxy { #loki-grafana-com-v1-ClusterProxy } +

+(Appears on:LokiStackSpec) +

+
+

ClusterProxy is the Proxy configuration when the cluster is behind a Proxy.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+httpProxy
+ +string + +
+(Optional) +

HTTPProxy configures the HTTP_PROXY/http_proxy env variable.

+
+httpsProxy
+ +string + +
+(Optional) +

HTTPSProxy configures the HTTPS_PROXY/https_proxy env variable.

+
+noProxy
+ +string + +
+(Optional) +

NoProxy configures the NO_PROXY/no_proxy env variable.

+
+readVarsFromEnv
+ +bool + +
+(Optional) +

ReadVarsFromEnv defines a flag to use Operator-lib provides a helper function

+
+ ## IngestionLimitSpec { #loki-grafana-com-v1-IngestionLimitSpec }

(Appears on:LimitsTemplateSpec) @@ -604,7 +670,10 @@ PodStatusMap Description -

"FailedComponents"

+

"FailedCertificateRotation"

+

ReasonFailedCertificateRotation when the reconciler cannot rotate any of the required TLS certificates.

+ +

"FailedComponents"

ReasonFailedComponents when all/some LokiStack components fail to roll out.

"InvalidGatewayTenantSecret"

@@ -792,6 +861,20 @@ string +proxy
+ + +ClusterProxy + + + + +(Optional) +

Proxy defines the spec for the object proxy to configure cluster proxy information.

+ + + + replicationFactor
int32 @@ -1633,7 +1716,7 @@ uint streams
-[]*github.com/grafana/loki/operator/apis/loki/v1.RetentionStreamSpec +[]*RetentionStreamSpec @@ -1646,6 +1729,9 @@ uint ## RetentionStreamSpec { #loki-grafana-com-v1-RetentionStreamSpec } +

+(Appears on:RetentionLimitSpec) +

RetentionStreamSpec defines a log stream with separate retention time.

@@ -2328,6 +2414,9 @@ AlertingRuleStatus ## AlertingRuleGroup { #loki-grafana-com-v1beta1-AlertingRuleGroup } +

+(Appears on:AlertingRuleSpec) +

AlertingRuleGroup defines a group of Loki alerting rules.

@@ -2382,7 +2471,7 @@ int32 rules
-[]*github.com/grafana/loki/operator/apis/loki/v1beta1.AlertingRuleGroupSpec +[]*AlertingRuleGroupSpec @@ -2394,6 +2483,9 @@ int32 ## AlertingRuleGroupSpec { #loki-grafana-com-v1beta1-AlertingRuleGroupSpec } +

+(Appears on:AlertingRuleGroup) +

AlertingRuleGroupSpec defines the spec for a Loki alerting rule.

@@ -2503,7 +2595,7 @@ string groups
-[]*github.com/grafana/loki/operator/apis/loki/v1beta1.AlertingRuleGroup +[]*AlertingRuleGroup @@ -4150,6 +4242,9 @@ RecordingRuleStatus ## RecordingRuleGroup { #loki-grafana-com-v1beta1-RecordingRuleGroup } +

+(Appears on:RecordingRuleSpec) +

RecordingRuleGroup defines a group of Loki recording rules.

@@ -4204,7 +4299,7 @@ int32 rules
-[]*github.com/grafana/loki/operator/apis/loki/v1beta1.RecordingRuleGroupSpec +[]*RecordingRuleGroupSpec @@ -4216,6 +4311,9 @@ int32 ## RecordingRuleGroupSpec { #loki-grafana-com-v1beta1-RecordingRuleGroupSpec } +

+(Appears on:RecordingRuleGroup) +

RecordingRuleGroupSpec defines the spec for a Loki recording rule.

@@ -4286,7 +4384,7 @@ string groups
-[]*github.com/grafana/loki/operator/apis/loki/v1beta1.RecordingRuleGroup +[]*RecordingRuleGroup diff --git a/operator/docs/operator/feature-gates.md b/operator/docs/operator/feature-gates.md index cbdb4c49d1..b6f80194e4 100644 --- a/operator/docs/operator/feature-gates.md +++ b/operator/docs/operator/feature-gates.md @@ -18,6 +18,86 @@ This Document contains the types introduced by the Loki Operator to be consumed Resource Types: +## BuiltInCertManagement { #config-loki-grafana-com-v1-BuiltInCertManagement } +

+(Appears on:FeatureGates) +

+
+

BuiltInCertManagement is the configuration for the built-in facility to generate and rotate +TLS client and serving certificates for all LokiStack services and internal clients except +for the lokistack-gateway.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+enabled
+ +bool + +
+

Enabled defines to flag to enable/disable built-in certificate management feature gate.

+
+caValidity
+ +string + +
+

CACertValidity defines the total duration of the CA certificate validity.

+
+caRefresh
+ +string + +
+

CACertRefresh defines the duration of the CA certificate validity until a rotation +should happen. It can be set up to 80% of CA certificate validity or equal to the +CA certificate validity. Latter should be used only for rotating only when expired.

+
+certValidity
+ +string + +
+

CertValidity defines the total duration of the validity for all LokiStack certificates.

+
+certRefresh
+ +string + +
+

CertRefresh defines the duration of the certificate validity until a rotation +should happen. It can be set up to 80% of certificate validity or equal to the +certificate validity. Latter should be used only for rotating only when expired. +The refresh is applied to all LokiStack certificates at once.

+
+ ## FeatureGates { #config-loki-grafana-com-v1-FeatureGates }

(Appears on:ProjectConfig) @@ -104,6 +184,28 @@ suffix -ca-bundle, e.g. lokistack-dev-ca-bundle and th +builtInCertManagement
+ + +BuiltInCertManagement + + + + +

BuiltInCertManagement enables the built-in facility for generating and rotating +TLS client and serving certificates for all LokiStack services and internal clients except +for the lokistack-gateway, In detail all internal Loki HTTP and GRPC communication is lifted +to require mTLS. For the lokistack-gateay you need to provide a secret with or use the ServingCertsService +on OpenShift: +- 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.

+ + + + lokiStackGateway
bool @@ -235,7 +337,7 @@ bool -

ServingCertsService enables OpenShift service-ca annotations on Services +

ServingCertsService enables OpenShift service-ca annotations on the lokistack-gateway service only 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

@@ -288,6 +390,8 @@ bool

ClusterProxy enables usage of the proxy variables set in the proxy resource. More details: https://docs.openshift.com/container-platform/4.11/networking/enable-cluster-wide-proxy.html#enable-cluster-wide-proxy

+ +