Skip to content

Commit

Permalink
deps: move logging to 6.0 API
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoBraveCoding committed Aug 29, 2024
1 parent 751aab3 commit e2db819
Show file tree
Hide file tree
Showing 24 changed files with 239 additions and 121 deletions.
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,19 @@ spec:
customizedVariables:
# Platform Observability
- name: platformLogsCollection
value: clusterlogforwarders.v1.logging.openshift.io
value: clusterlogforwarders.v1.observability.openshift.io
# User Workloads Observability
- name: userWorkloadLogsCollection
value: clusterlogforwarders.v1.logging.openshift.io
value: clusterlogforwarders.v1.observability.openshift.io
- name: userWorkloadTracesCollection
value: opentelemetrycollectors.v1beta1.opentelemetry.io
- name: userWorkloadInstrumentation
value: instrumentations.v1alpha1.opentelemetry.io
```
Supported keys are:
- `platformLogsCollection`: Supports values `clusterlogforwarders.v1.logging.openshift.io`
- `userWorkloadLogsCollection`: Supports values `clusterlogforwarders.v1.logging.openshift.io`
- `platformLogsCollection`: Supports values `clusterlogforwarders.v1.observability.openshift.io`
- `userWorkloadLogsCollection`: Supports values `clusterlogforwarders.v1.observability.openshift.io`
- `userWorkloadTracesCollection`: Supports values `opentelemetrycollectors.v1beta1.opentelemetry.io`
- `userWorkloadTracesInstrumentation`: Supports values `instrumentations.v1alpha1.opentelemetry.io`

Expand All @@ -111,7 +111,7 @@ spec:
customizedVariables:
# User Workloads Observability with multiple collectors
- name: userWorkloadLogsCollection
value: clusterlogforwarders.v1.logging.openshift.io;opentelemetrycollectors.v1beta1.opentelemetry.io
value: clusterlogforwarders.v1.observability.openshift.io;opentelemetrycollectors.v1beta1.opentelemetry.io
```

The addon installation is managed by the addon-manager. This means that users
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ deps: go.mod go.sum
go mod download
go mod verify

$(CRD_DIR)/logging.openshift.io_clusterlogforwarders.yaml:
$(CRD_DIR)/observability.openshift.io_clusterlogforwarders.yaml:
@mkdir -p $(CRD_DIR)
@curl https://raw.githubusercontent.com/openshift/cluster-logging-operator/release-5.8/bundle/manifests/logging.openshift.io_clusterlogforwarders.yaml > $(CRD_DIR)/logging.openshift.io_clusterlogforwarders.yaml
@curl https://raw.githubusercontent.com/openshift/cluster-logging-operator/release-6.0/bundle/manifests/observability.openshift.io_clusterlogforwarders.yaml > $(CRD_DIR)/observability.openshift.io_clusterlogforwarders.yaml

$(CRD_DIR)/opentelemetry.io_opentelemetrycollectors.yaml:
@mkdir -p $(CRD_DIR)
@curl https://raw.githubusercontent.com/open-telemetry/opentelemetry-operator/v0.100.1/bundle/manifests/opentelemetry.io_opentelemetrycollectors.yaml > $(CRD_DIR)/opentelemetry.io_opentelemetrycollectors.yaml

.PHONY: install-crds
install-crds: $(CRD_DIR)/logging.openshift.io_clusterlogforwarders.yaml $(CRD_DIR)/opentelemetry.io_opentelemetrycollectors.yaml
install-crds: $(CRD_DIR)/observability.openshift.io_clusterlogforwarders.yaml $(CRD_DIR)/opentelemetry.io_opentelemetrycollectors.yaml

.PHONY: fmt
fmt: $(GOFUMPT) ## Run gofumpt on source code.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: logging.openshift.io/v1
apiVersion: observability.openshift.io/v1
kind: ClusterLogForwarder
metadata:
name: instance
Expand Down
2 changes: 1 addition & 1 deletion deploy/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ resources:
- resources/service_account.yaml
- resources/cluster-management-addon.yaml
- resources/addondeploymentconfig.yaml
- crds/logging.openshift.io_clusterlogforwarders.yaml
- crds/observability.openshift.io_clusterlogforwarders.yaml
- crds/opentelemetry.io_opentelemetrycollectors.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
Expand Down
6 changes: 3 additions & 3 deletions deploy/resources/addondeploymentconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ spec:
value: stable-5.9
# Platform Observability
- name: platformLogsCollection
value: clusterlogforwarders.v1.logging.openshift.io
value: clusterlogforwarders.v1.observability.openshift.io
# User Workloads Observability
- name: userWorkloadLogsCollection
value: clusterlogforwarders.v1.logging.openshift.io
value: clusterlogforwarders.v1.observability.openshift.io
- name: userWorkloadTracesCollection
value: opentelemetrycollectors.v1beta1.opentelemetry.io
- name: userWorkloadInstrumentation
value: instrumentations.v1alpha1.opentelemetry.io
value: instrumentations.v1alpha1.opentelemetry.io
4 changes: 2 additions & 2 deletions deploy/resources/cluster-management-addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
name: multicluster-observability-addon
namespace: open-cluster-management-observability
# Describes the default log forwarding outputs for each log type applied to all managed clusters.
- group: logging.openshift.io
- group: observability.openshift.io
resource: clusterlogforwarders
# Describes the default OpenTelemetryCollector type applied to all managed clusters.
- group: opentelemetry.io
Expand All @@ -29,7 +29,7 @@ spec:
- name: global
namespace: open-cluster-management-global-set
configs:
- group: logging.openshift.io
- group: observability.openshift.io
resource: clusterlogforwarders
name: instance
namespace: open-cluster-management-observability
Expand Down
2 changes: 1 addition & 1 deletion deploy/resources/cluster_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
resources: ["secrets"]
verbs: ["get", "list", "watch"]
# Roles for addon to perform logging specific actions
- apiGroups: ["logging.openshift.io"]
- apiGroups: ["observability.openshift.io"]
resources: ["clusterlogforwarders"]
verbs: ["get", "list", "watch"]
# Role for addon to perform tracing specific actions
Expand Down
13 changes: 4 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ toolchain go1.21.9
require (
github.com/ViaQ/logerr/v2 v2.1.0
github.com/open-telemetry/opentelemetry-operator v0.100.1
github.com/openshift/api v0.0.0-20240124164020-e2ce40831f2e // indirect; release-4.15
github.com/openshift/cluster-logging-operator v0.0.0-20231130135759-9270994dc4bc
github.com/openshift/api v0.0.0-20240212125214-04ea3891d9cb // indirect; release-4.15
github.com/openshift/cluster-logging-operator/api/observability v0.0.0-20240828014436-a19feb86783c
github.com/operator-framework/api v0.17.7
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
Expand All @@ -31,13 +31,9 @@ replace github.com/prometheus/common => github.com/prometheus/common v0.46.0

replace github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.18.0

require (
github.com/go-logr/logr v1.4.2
gopkg.in/yaml.v2 v2.4.0
)
require github.com/go-logr/logr v1.4.2

require (
cloud.google.com/go/compute/metadata v0.3.0 // indirect
github.com/BurntSushi/toml v1.2.1 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
Expand Down Expand Up @@ -65,7 +61,6 @@ require (
github.com/go-openapi/swag v0.22.9 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/cel-go v0.17.7 // indirect
Expand All @@ -86,7 +81,6 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/openshift/elasticsearch-operator v0.0.0-20220613183908-e1648e67c298 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.19.1 // indirect
Expand Down Expand Up @@ -130,6 +124,7 @@ require (
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
helm.sh/helm/v3 v3.11.1 // indirect
k8s.io/apiserver v0.29.3 // indirect
k8s.io/kms v0.29.3 // indirect
Expand Down
21 changes: 9 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
cloud.google.com/go/compute v1.24.0 h1:phWcR2eWzRJaL/kOiJwfFsPs4BaKq1j6vnpZrc1YlVg=
cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc=
cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k=
github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
Expand Down Expand Up @@ -74,8 +75,6 @@ github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJA
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 h1:zN2lZNZRflqFyxVaTIU61KNKQ9C0055u9CAfpmqUvo4=
github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3/go.mod h1:nPpo7qLxd6XL3hWJG/O60sR8ZKfMCiIoNap5GvD12KU=
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
Expand All @@ -94,8 +93,8 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec=
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 h1:E/LAvt58di64hlYjx7AsNS6C/ysHWYo+2qPCZKTQhRo=
github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
Expand Down Expand Up @@ -147,18 +146,16 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
github.com/onsi/ginkgo/v2 v2.14.0 h1:vSmGj2Z5YPb9JwCWT6z6ihcUvDhuXLc3sJiqd3jMKAY=
github.com/onsi/ginkgo/v2 v2.14.0/go.mod h1:JkUdW7JkN0V6rFvsHcJ478egV3XH9NxpD27Hal/PhZw=
github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY=
github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM=
github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=
github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/open-telemetry/opentelemetry-operator v0.100.1 h1:sUaTghX7KmcOBLlMAgNXJYT9nVmOy4kLd4nM/DtUfeo=
github.com/open-telemetry/opentelemetry-operator v0.100.1/go.mod h1:knqTRjO+TnZLt4LKBvBoUcf/ICx7oM+FSz75+BwSOMk=
github.com/openshift/api v0.0.0-20240124164020-e2ce40831f2e h1:cxgCNo/R769CO23AK5TCh45H9SMUGZ8RukiF2/Qif3o=
github.com/openshift/api v0.0.0-20240124164020-e2ce40831f2e/go.mod h1:CxgbWAlvu2iQB0UmKTtRu1YfepRg1/vJ64n2DlIEVz4=
github.com/openshift/cluster-logging-operator v0.0.0-20231130135759-9270994dc4bc h1:p06byDknrnKR0xwF/iJvhZSaJR3PUHzM27/RF9PQbsM=
github.com/openshift/cluster-logging-operator v0.0.0-20231130135759-9270994dc4bc/go.mod h1:oMXS3dR3syXIkQaje6iOQU5WCk2jrAQN7UsiF/pyM7Y=
github.com/openshift/elasticsearch-operator v0.0.0-20220613183908-e1648e67c298 h1:/CbENmI9HuJHd8N/h3eaUkqhHoQjj1BdwIGOF+X3wnM=
github.com/openshift/elasticsearch-operator v0.0.0-20220613183908-e1648e67c298/go.mod h1:6dxhWPY3Wr/0b0eGrFpV7gcyeS+ne48Mo9OQ9dxrLNI=
github.com/openshift/api v0.0.0-20240212125214-04ea3891d9cb h1:xOfQ4FjP7GiWeW7GgAvxfLbX3ISoVGy9Zru22i3ENCc=
github.com/openshift/api v0.0.0-20240212125214-04ea3891d9cb/go.mod h1:CxgbWAlvu2iQB0UmKTtRu1YfepRg1/vJ64n2DlIEVz4=
github.com/openshift/cluster-logging-operator/api/observability v0.0.0-20240828014436-a19feb86783c h1:RLWCkbbMzre0Q1RgbJ/hHlSULb0+uNAZh2M6mRbZ868=
github.com/openshift/cluster-logging-operator/api/observability v0.0.0-20240828014436-a19feb86783c/go.mod h1:iYbyyrn/zt46Tl9lEr30u4ZPRQpDSGjqKrerALwSBXs=
github.com/openshift/library-go v0.0.0-20240116081341-964bcb3f545c h1:gLylEQQryG+A6nqWYIwE1wUzn1eFUmthjADvflMWKnM=
github.com/openshift/library-go v0.0.0-20240116081341-964bcb3f545c/go.mod h1:82B0gt8XawdXWRtKMrm3jSMTeRsiOSYKCi4F0fvPjG0=
github.com/operator-framework/api v0.17.7 h1:NLn+Ieg+HaPrw75KbX4efllN21ofFArQzS3q8TDbQY0=
Expand Down
14 changes: 10 additions & 4 deletions hack/addon-install/templates/clf-instance.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: logging.openshift.io/v1
apiVersion: observability.openshift.io/v1
kind: ClusterLogForwarder
metadata:
name: instance
Expand All @@ -7,11 +7,17 @@ spec:
outputs:
- cloudwatch:
region: eu-central-1
groupBy: logType
authentication:
type: awsAccessKey
awsAccessKey:
keyId:
secretName: aws-credentials
key: aws_access_key_id
keySecret:
secretName: aws-credentials
key: aws_secret_access_key
type: cloudwatch
name: cw
secret:
name: aws-credentials
pipelines:
- name: infra-cw
inputRefs:
Expand Down
14 changes: 10 additions & 4 deletions hack/addon-install/templates/instance-default.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: logging.openshift.io/v1
apiVersion: observability.openshift.io/v1
kind: ClusterLogForwarder
metadata:
name: instance-default
Expand All @@ -7,11 +7,17 @@ spec:
outputs:
- cloudwatch:
region: eu-central-1
groupBy: logType
authentication:
type: awsAccessKey
awsAccessKey:
keyId:
secretName: aws-credentials-default
key: aws_access_key_id
keySecret:
secretName: aws-credentials-default
key: aws_secret_access_key
type: cloudwatch
name: cw
secret:
name: aws-credentials-default
pipelines:
- name: infra-cw
inputRefs:
Expand Down
2 changes: 1 addition & 1 deletion internal/addon/addon.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"

otelv1alpha1 "github.com/open-telemetry/opentelemetry-operator/apis/v1alpha1"
loggingv1 "github.com/openshift/cluster-logging-operator/apis/logging/v1"
loggingv1 "github.com/openshift/cluster-logging-operator/api/observability/v1"
"open-cluster-management.io/addon-framework/pkg/agent"
"open-cluster-management.io/addon-framework/pkg/utils"
addonapiv1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
Expand Down
2 changes: 1 addition & 1 deletion internal/addon/addon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
workv1 "open-cluster-management.io/api/work/v1"

otelv1alpha1 "github.com/open-telemetry/opentelemetry-operator/apis/v1alpha1"
loggingv1 "github.com/openshift/cluster-logging-operator/apis/logging/v1"
loggingv1 "github.com/openshift/cluster-logging-operator/api/observability/v1"
)

func Test_AgentHealthProber_CLF(t *testing.T) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.enabled }}
apiVersion: logging.openshift.io/v1
apiVersion: observability.openshift.io/v1
kind: ClusterLogForwarder
metadata:
name: mcoa-instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: openshift-logging
namespace: openshift-logging
annotations:
olm.providedAPIs: ClusterLogForwarder.v1.logging.openshift.io,ClusterLogging.v1.logging.openshift.io
olm.providedAPIs: ClusterLogForwarder.v1.observability.openshift.io,ClusterLogging.v1.observability.openshift.io
labels:
app: {{ template "logginghelm.name" . }}
chart: {{ template "logginghelm.chart" . }}
Expand Down
2 changes: 1 addition & 1 deletion internal/addon/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const (
type CollectionKind string

const (
ClusterLogForwarderV1 CollectionKind = "clusterlogforwarders.v1.logging.openshift.io"
ClusterLogForwarderV1 CollectionKind = "clusterlogforwarders.v1.observability.openshift.io"
OpenTelemetryCollectorV1beta1 CollectionKind = "opentelemetrycollectors.v1beta1.opentelemetry.io"
)

Expand Down
1 change: 1 addition & 0 deletions internal/addon/var.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const (
SpokeCLFName = "mcoa-instance"
SpokeCLFNamespace = "openshift-logging"
clfProbeKey = "isReady"
// TODO @JoaoBraveCoding this most likely needs to be updated to reflect the new path
clfProbePath = ".status.conditions[?(@.type==\"Ready\")].status"

Check failure on line 21 in internal/addon/var.go

View workflow job for this annotation

GitHub Actions / lint (1.21)

File is not `gofumpt`-ed (gofumpt)

OpenTelemetryCollectorsResource = "opentelemetrycollectors"
Expand Down
Loading

0 comments on commit e2db819

Please sign in to comment.