Skip to content

Commit

Permalink
Add addon template renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
periklis committed Jun 5, 2024
1 parent cdb7fa4 commit b4d908c
Show file tree
Hide file tree
Showing 7 changed files with 522 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import (

// MultiClusterObservabilitySpec defines the desired state of MultiClusterObservability.
type MultiClusterObservabilitySpec struct {
// Platform and UserWorkload Observability Capabilities
// +optional
Capabilities *CapabilitiesSpec `json:"capabilities,omitempty"`
// Advanced configurations for observability
// +optional
AdvancedConfig *AdvancedConfig `json:"advanced,omitempty"`
Expand Down Expand Up @@ -41,6 +44,59 @@ type MultiClusterObservabilitySpec struct {
ObservabilityAddonSpec *observabilityshared.ObservabilityAddonSpec `json:"observabilityAddonSpec"`
}

type LogsCollectionSpec struct {
// +optional
Enabled bool `json:"enabled,omitempty"`
}

type PlatformLogsSpec struct {
// +optional
Collection *LogsCollectionSpec `json:"collection,omitempty"`
}

type PlatformCapabilitiesSpec struct {
// +optional
Logs LogsCollectionSpec `json:"logs,omitempty"`
}

type ClusterLogForwarderSpec struct {
// +optional
Enabled bool `json:"enabled,omitempty"`
}

type UserWorkloadLogsSpec struct {
ClusterLogForwarder ClusterLogForwarderSpec `json:"clusterLogForwarder,omitempty"`
}

type OpenTelemetryCollectorSpec struct {
// +optional
Enabled bool `json:"enabled,omitempty"`
}

type InstrumentationSpec struct {
// +optional
Enabled bool `json:"enabled,omitempty"`
}

type UserWorkloadTracesSpec struct {
// +optional
OpenTelemetryCollector OpenTelemetryCollectorSpec `json:"openTelemetryCollector,omitempty"`
// +optional
Instrumentation InstrumentationSpec `json:"instrumentation,omitempty"`
}

type UserWorkloadCapabilitiesSpec struct {
Logs UserWorkloadLogsSpec `json:"logs,omitempty"`
Traces UserWorkloadTracesSpec `json:"traces,omitempty"`
}

type CapabilitiesSpec struct {
// +optional
Platform *PlatformCapabilitiesSpec `json:"platform,omitempty"`
// +optional
UserWorkloads *UserWorkloadCapabilitiesSpec `json:"userWorkloads,omitempty"`
}

type AdvancedConfig struct {
// CustomObservabilityHubURL overrides the endpoint used by the metrics-collector to send
// metrics to the hub server.
Expand Down Expand Up @@ -91,6 +147,8 @@ type AdvancedConfig struct {
// spec for thanos-store-shard
// +optional
Store *StoreSpec `json:"store,omitempty"`
// spec for multicluster-obervability-addon
MultiClusterObservabilityAddon *CommonSpec `json:"multiClusterObservabilityAddon,omitempty"`
}

type CommonSpec struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,51 @@ spec:
type: object
type: object
type: object
multiClusterObservabilityAddon:
description: spec for multicluster-obervability-addon
properties:
replicas:
description: Replicas for this component.
format: int32
type: integer
resources:
description: Compute Resources required by this component.
properties:
claims:
description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. \n This field is immutable. It can only be set for containers."
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
properties:
name:
description: Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
type: object
observatoriumAPI:
description: Spec of observatorium api
properties:
Expand Down Expand Up @@ -5654,6 +5699,42 @@ spec:
type: object
type: object
type: object
capabilities:
description: Platform and UserWorkload Observability Capabilities
properties:
platform:
properties:
logs:
properties:
enabled:
type: boolean
type: object
type: object
userWorkloads:
properties:
logs:
properties:
clusterLogForwarder:
properties:
enabled:
type: boolean
type: object
type: object
traces:
properties:
instrumentation:
properties:
enabled:
type: boolean
type: object
openTelemetryCollector:
properties:
enabled:
type: boolean
type: object
type: object
type: object
type: object
enableDownsampling:
default: true
description: Enable or disable the downsample.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1833,6 +1833,63 @@ spec:
type: object
type: object
type: object
multiClusterObservabilityAddon:
description: spec for multicluster-obervability-addon
properties:
replicas:
description: Replicas for this component.
format: int32
type: integer
resources:
description: Compute Resources required by this component.
properties:
claims:
description: "Claims lists the names of resources, defined
in spec.resourceClaims, that are used by this container.
\n This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate. \n This field
is immutable. It can only be set for containers."
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
properties:
name:
description: Name must match the name of one entry
in pod.spec.resourceClaims of the Pod where this
field is used. It makes that resource available
inside a container.
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Limits describes the maximum amount of compute
resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Requests describes the minimum amount of
compute resources required. If Requests is omitted for
a container, it defaults to Limits if that is explicitly
specified, otherwise to an implementation-defined value.
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
type: object
observatoriumAPI:
description: Spec of observatorium api
properties:
Expand Down Expand Up @@ -9018,6 +9075,42 @@ spec:
type: object
type: object
type: object
capabilities:
description: Platform and UserWorkload Observability Capabilities
properties:
platform:
properties:
logs:
properties:
enabled:
type: boolean
type: object
type: object
userWorkloads:
properties:
logs:
properties:
clusterLogForwarder:
properties:
enabled:
type: boolean
type: object
type: object
traces:
properties:
instrumentation:
properties:
enabled:
type: boolean
type: object
openTelemetryCollector:
properties:
enabled:
type: boolean
type: object
type: object
type: object
type: object
enableDownsampling:
default: true
description: Enable or disable the downsample.
Expand Down
Loading

0 comments on commit b4d908c

Please sign in to comment.