diff --git a/.gitignore b/.gitignore index 7477bd557..914f354d5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ ### Helm ### **/charts/*.tgz +.DS_Store diff --git a/charts/otel-cloud-stack/.helmignore b/charts/otel-cloud-stack/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/charts/otel-cloud-stack/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/otel-cloud-stack/Chart.lock b/charts/otel-cloud-stack/Chart.lock new file mode 100644 index 000000000..86aa9896d --- /dev/null +++ b/charts/otel-cloud-stack/Chart.lock @@ -0,0 +1,15 @@ +dependencies: +- name: crds + repository: "" + version: 0.0.0 +- name: opentelemetry-operator + repository: file://../opentelemetry-operator + version: 0.48.0 +- name: kube-state-metrics + repository: https://prometheus-community.github.io/helm-charts + version: 5.16.2 +- name: prometheus-node-exporter + repository: https://prometheus-community.github.io/helm-charts + version: 4.30.3 +digest: sha256:3d4be94b8ce9d8ee54c0c6e304a80921d0926f5250e8e7f67c9972b82ec65d71 +generated: "2024-03-04T12:00:21.318565-05:00" diff --git a/charts/otel-cloud-stack/Chart.yaml b/charts/otel-cloud-stack/Chart.yaml new file mode 100644 index 000000000..17146db65 --- /dev/null +++ b/charts/otel-cloud-stack/Chart.yaml @@ -0,0 +1,29 @@ +apiVersion: v2 +name: otel-cloud-stack +version: 0.1.0 +description: Helm chart for an Opentelemetry Kubernetes Quickstart +type: application +home: https://opentelemetry.io/ +sources: + - https://github.com/open-telemetry/opentelemetry-operator +maintainers: + - name: jaronoff97 + - name: anammedina21 +icon: https://raw.githubusercontent.com/cncf/artwork/a718fa97fffec1b9fd14147682e9e3ac0c8817cb/projects/opentelemetry/icon/color/opentelemetry-icon-color.png +appVersion: 0.94.0 +dependencies: + - name: crds + version: "0.0.0" + condition: prometheus.customResources.enabled + - name: opentelemetry-operator + repository: "file://../opentelemetry-operator" + version: 0.48.0 + condition: opentelemetry-operator.enabled + - name: kube-state-metrics + version: "5.16.*" + repository: https://prometheus-community.github.io/helm-charts + condition: kubeStateMetrics.enabled + - name: prometheus-node-exporter + version: "4.30.*" + repository: https://prometheus-community.github.io/helm-charts + condition: nodeExporter.enabled diff --git a/charts/otel-cloud-stack/charts/crds/Chart.yaml b/charts/otel-cloud-stack/charts/crds/Chart.yaml new file mode 100644 index 000000000..adb9e4a5d --- /dev/null +++ b/charts/otel-cloud-stack/charts/crds/Chart.yaml @@ -0,0 +1,3 @@ +apiVersion: v2 +name: crds +version: 0.0.0 diff --git a/charts/otel-cloud-stack/charts/crds/crds/podmonitor.yaml b/charts/otel-cloud-stack/charts/crds/crds/podmonitor.yaml new file mode 100644 index 000000000..c142a3e93 --- /dev/null +++ b/charts/otel-cloud-stack/charts/crds/crds/podmonitor.yaml @@ -0,0 +1,848 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.13.0 + name: podmonitors.monitoring.coreos.com +spec: + group: monitoring.coreos.com + names: + categories: + - prometheus-operator + kind: PodMonitor + listKind: PodMonitorList + plural: podmonitors + shortNames: + - pmon + singular: podmonitor + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + description: PodMonitor defines monitoring for a set of pods. + properties: + apiVersion: + description: + "APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" + type: string + kind: + description: + "Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + type: string + metadata: + type: object + spec: + description: + Specification of desired Pod selection for target discovery + by Prometheus. + properties: + attachMetadata: + description: + "`attachMetadata` defines additional metadata which is + added to the discovered targets. \n It requires Prometheus >= v2.37.0." + properties: + node: + description: + When set to true, Prometheus must have the `get` + permission on the `Nodes` objects. + type: boolean + type: object + jobLabel: + description: + "The label to use to retrieve the job name from. `jobLabel` + selects the label from the associated Kubernetes `Pod` object which + will be used as the `job` label for all metrics. \n For example + if `jobLabel` is set to `foo` and the Kubernetes `Pod` object is + labeled with `foo: bar`, then Prometheus adds the `job=\"bar\"` + label to all ingested metrics. \n If the value of this field is + empty, the `job` label of the metrics defaults to the namespace + and name of the PodMonitor object (e.g. `/`)." + type: string + keepDroppedTargets: + description: + "Per-scrape limit on the number of targets dropped by + relabeling that will be kept in memory. 0 means no limit. \n It + requires Prometheus >= v2.47.0." + format: int64 + type: integer + labelLimit: + description: + "Per-scrape limit on number of labels that will be accepted + for a sample. \n It requires Prometheus >= v2.27.0." + format: int64 + type: integer + labelNameLengthLimit: + description: + "Per-scrape limit on length of labels name that will + be accepted for a sample. \n It requires Prometheus >= v2.27.0." + format: int64 + type: integer + labelValueLengthLimit: + description: + "Per-scrape limit on length of labels value that will + be accepted for a sample. \n It requires Prometheus >= v2.27.0." + format: int64 + type: integer + namespaceSelector: + description: + Selector to select which namespaces the Kubernetes `Pods` + objects are discovered from. + properties: + any: + description: + Boolean describing whether all namespaces are selected + in contrast to a list restricting them. + type: boolean + matchNames: + description: List of namespace names to select from. + items: + type: string + type: array + type: object + podMetricsEndpoints: + description: List of endpoints part of this PodMonitor. + items: + description: + PodMetricsEndpoint defines an endpoint serving Prometheus + metrics to be scraped by Prometheus. + properties: + authorization: + description: + "`authorization` configures the Authorization header + credentials to use when scraping the target. \n Cannot be + set at the same time as `basicAuth`, or `oauth2`." + properties: + credentials: + description: + Selects a key of a Secret in the namespace + that contains the credentials for authentication. + properties: + key: + description: + The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + optional: + description: + Specify whether the Secret or its key must + be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: + description: + "Defines the authentication type. The value + is case-insensitive. \n \"Basic\" is not a supported value. + \n Default: \"Bearer\"" + type: string + type: object + basicAuth: + description: + "`basicAuth` configures the Basic Authentication + credentials to use when scraping the target. \n Cannot be + set at the same time as `authorization`, or `oauth2`." + properties: + password: + description: + "`password` specifies a key of a Secret containing + the password for authentication." + properties: + key: + description: + The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + optional: + description: + Specify whether the Secret or its key must + be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + username: + description: + "`username` specifies a key of a Secret containing + the username for authentication." + properties: + key: + description: + The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + optional: + description: + Specify whether the Secret or its key must + be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + bearerTokenSecret: + description: + "`bearerTokenSecret` specifies a key of a Secret + containing the bearer token for scraping targets. The secret + needs to be in the same namespace as the PodMonitor object + and readable by the Prometheus Operator. \n Deprecated: use + `authorization` instead." + properties: + key: + description: + The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + optional: + description: + Specify whether the Secret or its key must + be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + enableHttp2: + description: + "`enableHttp2` can be used to disable HTTP2 when + scraping the target." + type: boolean + filterRunning: + description: + "When true, the pods which are not running (e.g. + either in Failed or Succeeded state) are dropped during the + target discovery. \n If unset, the filtering is enabled. \n + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase" + type: boolean + followRedirects: + description: + "`followRedirects` defines whether the scrape requests + should follow HTTP 3xx redirects." + type: boolean + honorLabels: + description: + When true, `honorLabels` preserves the metric's + labels when they collide with the target's labels. + type: boolean + honorTimestamps: + description: + "`honorTimestamps` controls whether Prometheus + preserves the timestamps when exposed by the target." + type: boolean + interval: + description: + "Interval at which Prometheus scrapes the metrics + from the target. \n If empty, Prometheus uses the global scrape + interval." + pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$ + type: string + metricRelabelings: + description: + "`metricRelabelings` configures the relabeling + rules to apply to the samples before ingestion." + items: + description: + "RelabelConfig allows dynamic rewriting of the + label set for targets, alerts, scraped samples and remote + write samples. \n More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config" + properties: + action: + default: replace + description: + "Action to perform based on the regex matching. + \n `Uppercase` and `Lowercase` actions require Prometheus + >= v2.36.0. `DropEqual` and `KeepEqual` actions require + Prometheus >= v2.41.0. \n Default: \"Replace\"" + enum: + - replace + - Replace + - keep + - Keep + - drop + - Drop + - hashmod + - HashMod + - labelmap + - LabelMap + - labeldrop + - LabelDrop + - labelkeep + - LabelKeep + - lowercase + - Lowercase + - uppercase + - Uppercase + - keepequal + - KeepEqual + - dropequal + - DropEqual + type: string + modulus: + description: + "Modulus to take of the hash of the source + label values. \n Only applicable when the action is + `HashMod`." + format: int64 + type: integer + regex: + description: + Regular expression against which the extracted + value is matched. + type: string + replacement: + description: + "Replacement value against which a Replace + action is performed if the regular expression matches. + \n Regex capture groups are available." + type: string + separator: + description: + Separator is the string between concatenated + SourceLabels. + type: string + sourceLabels: + description: + The source labels select values from existing + labels. Their content is concatenated using the configured + Separator and matched against the configured regular + expression. + items: + description: + LabelName is a valid Prometheus label name + which may only contain ASCII letters, numbers, as + well as underscores. + pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ + type: string + type: array + targetLabel: + description: + "Label to which the resulting string is written + in a replacement. \n It is mandatory for `Replace`, + `HashMod`, `Lowercase`, `Uppercase`, `KeepEqual` and + `DropEqual` actions. \n Regex capture groups are available." + type: string + type: object + type: array + oauth2: + description: + "`oauth2` configures the OAuth2 settings to use + when scraping the target. \n It requires Prometheus >= 2.27.0. + \n Cannot be set at the same time as `authorization`, or `basicAuth`." + properties: + clientId: + description: + "`clientId` specifies a key of a Secret or + ConfigMap containing the OAuth2 client's ID." + properties: + configMap: + description: + ConfigMap containing data to use for the + targets. + properties: + key: + description: The key to select. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?" + type: string + optional: + description: + Specify whether the ConfigMap or its + key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + secret: + description: Secret containing data to use for the targets. + properties: + key: + description: + The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?" + type: string + optional: + description: + Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + clientSecret: + description: + "`clientSecret` specifies a key of a Secret + containing the OAuth2 client's secret." + properties: + key: + description: + The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + optional: + description: + Specify whether the Secret or its key must + be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + endpointParams: + additionalProperties: + type: string + description: + "`endpointParams` configures the HTTP parameters + to append to the token URL." + type: object + scopes: + description: + "`scopes` defines the OAuth2 scopes used for + the token request." + items: + type: string + type: array + tokenUrl: + description: + "`tokenURL` configures the URL to fetch the + token from." + minLength: 1 + type: string + required: + - clientId + - clientSecret + - tokenUrl + type: object + params: + additionalProperties: + items: + type: string + type: array + description: "`params` define optional HTTP URL parameters." + type: object + path: + description: + "HTTP path from which to scrape for metrics. \n + If empty, Prometheus uses the default value (e.g. `/metrics`)." + type: string + port: + description: + "Name of the Pod port which this endpoint refers + to. \n It takes precedence over `targetPort`." + type: string + proxyUrl: + description: + '`proxyURL` configures the HTTP Proxy URL (e.g. + "http://proxyserver:2195") to go through when scraping the + target.' + type: string + relabelings: + description: + "`relabelings` configures the relabeling rules + to apply the target's metadata labels. \n The Operator automatically + adds relabelings for a few standard Kubernetes fields. \n + The original scrape job's name is available via the `__tmp_prometheus_job_name` + label. \n More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config" + items: + description: + "RelabelConfig allows dynamic rewriting of the + label set for targets, alerts, scraped samples and remote + write samples. \n More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config" + properties: + action: + default: replace + description: + "Action to perform based on the regex matching. + \n `Uppercase` and `Lowercase` actions require Prometheus + >= v2.36.0. `DropEqual` and `KeepEqual` actions require + Prometheus >= v2.41.0. \n Default: \"Replace\"" + enum: + - replace + - Replace + - keep + - Keep + - drop + - Drop + - hashmod + - HashMod + - labelmap + - LabelMap + - labeldrop + - LabelDrop + - labelkeep + - LabelKeep + - lowercase + - Lowercase + - uppercase + - Uppercase + - keepequal + - KeepEqual + - dropequal + - DropEqual + type: string + modulus: + description: + "Modulus to take of the hash of the source + label values. \n Only applicable when the action is + `HashMod`." + format: int64 + type: integer + regex: + description: + Regular expression against which the extracted + value is matched. + type: string + replacement: + description: + "Replacement value against which a Replace + action is performed if the regular expression matches. + \n Regex capture groups are available." + type: string + separator: + description: + Separator is the string between concatenated + SourceLabels. + type: string + sourceLabels: + description: + The source labels select values from existing + labels. Their content is concatenated using the configured + Separator and matched against the configured regular + expression. + items: + description: + LabelName is a valid Prometheus label name + which may only contain ASCII letters, numbers, as + well as underscores. + pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ + type: string + type: array + targetLabel: + description: + "Label to which the resulting string is written + in a replacement. \n It is mandatory for `Replace`, + `HashMod`, `Lowercase`, `Uppercase`, `KeepEqual` and + `DropEqual` actions. \n Regex capture groups are available." + type: string + type: object + type: array + scheme: + description: + "HTTP scheme to use for scraping. \n `http` and + `https` are the expected values unless you rewrite the `__scheme__` + label via relabeling. \n If empty, Prometheus uses the default + value `http`." + enum: + - http + - https + type: string + scrapeTimeout: + description: + "Timeout after which Prometheus considers the scrape + to be failed. \n If empty, Prometheus uses the global scrape + timeout unless it is less than the target's scrape interval + value in which the latter is used." + pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$ + type: string + targetPort: + anyOf: + - type: integer + - type: string + description: + "Name or number of the target port of the `Pod` + object behind the Service, the port must be specified with + container port property. \n Deprecated: use 'port' instead." + x-kubernetes-int-or-string: true + tlsConfig: + description: TLS configuration to use when scraping the target. + properties: + ca: + description: + Certificate authority used when verifying server + certificates. + properties: + configMap: + description: + ConfigMap containing data to use for the + targets. + properties: + key: + description: The key to select. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?" + type: string + optional: + description: + Specify whether the ConfigMap or its + key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + secret: + description: Secret containing data to use for the targets. + properties: + key: + description: + The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?" + type: string + optional: + description: + Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + cert: + description: Client certificate to present when doing client-authentication. + properties: + configMap: + description: + ConfigMap containing data to use for the + targets. + properties: + key: + description: The key to select. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?" + type: string + optional: + description: + Specify whether the ConfigMap or its + key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + secret: + description: Secret containing data to use for the targets. + properties: + key: + description: + The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?" + type: string + optional: + description: + Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + insecureSkipVerify: + description: Disable target certificate validation. + type: boolean + keySecret: + description: + Secret containing the client key file for the + targets. + properties: + key: + description: + The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + optional: + description: + Specify whether the Secret or its key must + be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + serverName: + description: Used to verify the hostname for the targets. + type: string + type: object + trackTimestampsStaleness: + description: + "`trackTimestampsStaleness` defines whether Prometheus + tracks staleness of the metrics that have an explicit timestamp + present in scraped data. Has no effect if `honorTimestamps` + is false. \n It requires Prometheus >= v2.48.0." + type: boolean + type: object + type: array + podTargetLabels: + description: + "`podTargetLabels` defines the labels which are transferred + from the associated Kubernetes `Pod` object onto the ingested metrics." + items: + type: string + type: array + sampleLimit: + description: + "`sampleLimit` defines a per-scrape limit on the number + of scraped samples that will be accepted." + format: int64 + type: integer + scrapeClass: + description: The scrape class to apply. + minLength: 1 + type: string + scrapeProtocols: + description: + "`scrapeProtocols` defines the protocols to negotiate + during a scrape. It tells clients the protocols supported by Prometheus + in order of preference (from most to least preferred). \n If unset, + Prometheus uses its default value. \n It requires Prometheus >= + v2.49.0." + items: + description: + "ScrapeProtocol represents a protocol used by Prometheus + for scraping metrics. Supported values are: * `OpenMetricsText0.0.1` + * `OpenMetricsText1.0.0` * `PrometheusProto` * `PrometheusText0.0.4`" + enum: + - PrometheusProto + - OpenMetricsText0.0.1 + - OpenMetricsText1.0.0 + - PrometheusText0.0.4 + type: string + type: array + x-kubernetes-list-type: set + selector: + description: Label selector to select the Kubernetes `Pod` objects. + properties: + matchExpressions: + description: + matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: + description: + A label selector requirement is a selector that + contains values, a key, and an operator that relates the key + and values. + properties: + key: + description: + key is the label key that the selector applies + to. + type: string + operator: + description: + operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: + values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + targetLimit: + description: + "`targetLimit` defines a limit on the number of scraped + targets that will be accepted." + format: int64 + type: integer + required: + - selector + type: object + required: + - spec + type: object + served: true + storage: true diff --git a/charts/otel-cloud-stack/charts/crds/crds/servicemonitor.yaml b/charts/otel-cloud-stack/charts/crds/crds/servicemonitor.yaml new file mode 100644 index 000000000..88ab4c159 --- /dev/null +++ b/charts/otel-cloud-stack/charts/crds/crds/servicemonitor.yaml @@ -0,0 +1,876 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.13.0 + name: servicemonitors.monitoring.coreos.com +spec: + group: monitoring.coreos.com + names: + categories: + - prometheus-operator + kind: ServiceMonitor + listKind: ServiceMonitorList + plural: servicemonitors + shortNames: + - smon + singular: servicemonitor + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + description: ServiceMonitor defines monitoring for a set of services. + properties: + apiVersion: + description: + "APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" + type: string + kind: + description: + "Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + type: string + metadata: + type: object + spec: + description: + Specification of desired Service selection for target discovery + by Prometheus. + properties: + attachMetadata: + description: + "`attachMetadata` defines additional metadata which is + added to the discovered targets. \n It requires Prometheus >= v2.37.0." + properties: + node: + description: + When set to true, Prometheus must have the `get` + permission on the `Nodes` objects. + type: boolean + type: object + endpoints: + description: List of endpoints part of this ServiceMonitor. + items: + description: + Endpoint defines an endpoint serving Prometheus metrics + to be scraped by Prometheus. + properties: + authorization: + description: + "`authorization` configures the Authorization header + credentials to use when scraping the target. \n Cannot be + set at the same time as `basicAuth`, or `oauth2`." + properties: + credentials: + description: + Selects a key of a Secret in the namespace + that contains the credentials for authentication. + properties: + key: + description: + The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + optional: + description: + Specify whether the Secret or its key must + be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: + description: + "Defines the authentication type. The value + is case-insensitive. \n \"Basic\" is not a supported value. + \n Default: \"Bearer\"" + type: string + type: object + basicAuth: + description: + "`basicAuth` configures the Basic Authentication + credentials to use when scraping the target. \n Cannot be + set at the same time as `authorization`, or `oauth2`." + properties: + password: + description: + "`password` specifies a key of a Secret containing + the password for authentication." + properties: + key: + description: + The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + optional: + description: + Specify whether the Secret or its key must + be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + username: + description: + "`username` specifies a key of a Secret containing + the username for authentication." + properties: + key: + description: + The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + optional: + description: + Specify whether the Secret or its key must + be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + bearerTokenFile: + description: + "File to read bearer token for scraping the target. + \n Deprecated: use `authorization` instead." + type: string + bearerTokenSecret: + description: + "`bearerTokenSecret` specifies a key of a Secret + containing the bearer token for scraping targets. The secret + needs to be in the same namespace as the ServiceMonitor object + and readable by the Prometheus Operator. \n Deprecated: use + `authorization` instead." + properties: + key: + description: + The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + optional: + description: + Specify whether the Secret or its key must + be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + enableHttp2: + description: + "`enableHttp2` can be used to disable HTTP2 when + scraping the target." + type: boolean + filterRunning: + description: + "When true, the pods which are not running (e.g. + either in Failed or Succeeded state) are dropped during the + target discovery. \n If unset, the filtering is enabled. \n + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase" + type: boolean + followRedirects: + description: + "`followRedirects` defines whether the scrape requests + should follow HTTP 3xx redirects." + type: boolean + honorLabels: + description: + When true, `honorLabels` preserves the metric's + labels when they collide with the target's labels. + type: boolean + honorTimestamps: + description: + "`honorTimestamps` controls whether Prometheus + preserves the timestamps when exposed by the target." + type: boolean + interval: + description: + "Interval at which Prometheus scrapes the metrics + from the target. \n If empty, Prometheus uses the global scrape + interval." + pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$ + type: string + metricRelabelings: + description: + "`metricRelabelings` configures the relabeling + rules to apply to the samples before ingestion." + items: + description: + "RelabelConfig allows dynamic rewriting of the + label set for targets, alerts, scraped samples and remote + write samples. \n More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config" + properties: + action: + default: replace + description: + "Action to perform based on the regex matching. + \n `Uppercase` and `Lowercase` actions require Prometheus + >= v2.36.0. `DropEqual` and `KeepEqual` actions require + Prometheus >= v2.41.0. \n Default: \"Replace\"" + enum: + - replace + - Replace + - keep + - Keep + - drop + - Drop + - hashmod + - HashMod + - labelmap + - LabelMap + - labeldrop + - LabelDrop + - labelkeep + - LabelKeep + - lowercase + - Lowercase + - uppercase + - Uppercase + - keepequal + - KeepEqual + - dropequal + - DropEqual + type: string + modulus: + description: + "Modulus to take of the hash of the source + label values. \n Only applicable when the action is + `HashMod`." + format: int64 + type: integer + regex: + description: + Regular expression against which the extracted + value is matched. + type: string + replacement: + description: + "Replacement value against which a Replace + action is performed if the regular expression matches. + \n Regex capture groups are available." + type: string + separator: + description: + Separator is the string between concatenated + SourceLabels. + type: string + sourceLabels: + description: + The source labels select values from existing + labels. Their content is concatenated using the configured + Separator and matched against the configured regular + expression. + items: + description: + LabelName is a valid Prometheus label name + which may only contain ASCII letters, numbers, as + well as underscores. + pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ + type: string + type: array + targetLabel: + description: + "Label to which the resulting string is written + in a replacement. \n It is mandatory for `Replace`, + `HashMod`, `Lowercase`, `Uppercase`, `KeepEqual` and + `DropEqual` actions. \n Regex capture groups are available." + type: string + type: object + type: array + oauth2: + description: + "`oauth2` configures the OAuth2 settings to use + when scraping the target. \n It requires Prometheus >= 2.27.0. + \n Cannot be set at the same time as `authorization`, or `basicAuth`." + properties: + clientId: + description: + "`clientId` specifies a key of a Secret or + ConfigMap containing the OAuth2 client's ID." + properties: + configMap: + description: + ConfigMap containing data to use for the + targets. + properties: + key: + description: The key to select. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?" + type: string + optional: + description: + Specify whether the ConfigMap or its + key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + secret: + description: Secret containing data to use for the targets. + properties: + key: + description: + The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?" + type: string + optional: + description: + Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + clientSecret: + description: + "`clientSecret` specifies a key of a Secret + containing the OAuth2 client's secret." + properties: + key: + description: + The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + optional: + description: + Specify whether the Secret or its key must + be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + endpointParams: + additionalProperties: + type: string + description: + "`endpointParams` configures the HTTP parameters + to append to the token URL." + type: object + scopes: + description: + "`scopes` defines the OAuth2 scopes used for + the token request." + items: + type: string + type: array + tokenUrl: + description: + "`tokenURL` configures the URL to fetch the + token from." + minLength: 1 + type: string + required: + - clientId + - clientSecret + - tokenUrl + type: object + params: + additionalProperties: + items: + type: string + type: array + description: params define optional HTTP URL parameters. + type: object + path: + description: + "HTTP path from which to scrape for metrics. \n + If empty, Prometheus uses the default value (e.g. `/metrics`)." + type: string + port: + description: + "Name of the Service port which this endpoint refers + to. \n It takes precedence over `targetPort`." + type: string + proxyUrl: + description: + '`proxyURL` configures the HTTP Proxy URL (e.g. + "http://proxyserver:2195") to go through when scraping the + target.' + type: string + relabelings: + description: + "`relabelings` configures the relabeling rules + to apply the target's metadata labels. \n The Operator automatically + adds relabelings for a few standard Kubernetes fields. \n + The original scrape job's name is available via the `__tmp_prometheus_job_name` + label. \n More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config" + items: + description: + "RelabelConfig allows dynamic rewriting of the + label set for targets, alerts, scraped samples and remote + write samples. \n More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config" + properties: + action: + default: replace + description: + "Action to perform based on the regex matching. + \n `Uppercase` and `Lowercase` actions require Prometheus + >= v2.36.0. `DropEqual` and `KeepEqual` actions require + Prometheus >= v2.41.0. \n Default: \"Replace\"" + enum: + - replace + - Replace + - keep + - Keep + - drop + - Drop + - hashmod + - HashMod + - labelmap + - LabelMap + - labeldrop + - LabelDrop + - labelkeep + - LabelKeep + - lowercase + - Lowercase + - uppercase + - Uppercase + - keepequal + - KeepEqual + - dropequal + - DropEqual + type: string + modulus: + description: + "Modulus to take of the hash of the source + label values. \n Only applicable when the action is + `HashMod`." + format: int64 + type: integer + regex: + description: + Regular expression against which the extracted + value is matched. + type: string + replacement: + description: + "Replacement value against which a Replace + action is performed if the regular expression matches. + \n Regex capture groups are available." + type: string + separator: + description: + Separator is the string between concatenated + SourceLabels. + type: string + sourceLabels: + description: + The source labels select values from existing + labels. Their content is concatenated using the configured + Separator and matched against the configured regular + expression. + items: + description: + LabelName is a valid Prometheus label name + which may only contain ASCII letters, numbers, as + well as underscores. + pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ + type: string + type: array + targetLabel: + description: + "Label to which the resulting string is written + in a replacement. \n It is mandatory for `Replace`, + `HashMod`, `Lowercase`, `Uppercase`, `KeepEqual` and + `DropEqual` actions. \n Regex capture groups are available." + type: string + type: object + type: array + scheme: + description: + "HTTP scheme to use for scraping. \n `http` and + `https` are the expected values unless you rewrite the `__scheme__` + label via relabeling. \n If empty, Prometheus uses the default + value `http`." + enum: + - http + - https + type: string + scrapeTimeout: + description: + "Timeout after which Prometheus considers the scrape + to be failed. \n If empty, Prometheus uses the global scrape + timeout unless it is less than the target's scrape interval + value in which the latter is used." + pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$ + type: string + targetPort: + anyOf: + - type: integer + - type: string + description: + Name or number of the target port of the `Pod` + object behind the Service. The port must be specified with + the container's port property. + x-kubernetes-int-or-string: true + tlsConfig: + description: TLS configuration to use when scraping the target. + properties: + ca: + description: + Certificate authority used when verifying server + certificates. + properties: + configMap: + description: + ConfigMap containing data to use for the + targets. + properties: + key: + description: The key to select. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?" + type: string + optional: + description: + Specify whether the ConfigMap or its + key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + secret: + description: Secret containing data to use for the targets. + properties: + key: + description: + The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?" + type: string + optional: + description: + Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + caFile: + description: + Path to the CA cert in the Prometheus container + to use for the targets. + type: string + cert: + description: Client certificate to present when doing client-authentication. + properties: + configMap: + description: + ConfigMap containing data to use for the + targets. + properties: + key: + description: The key to select. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?" + type: string + optional: + description: + Specify whether the ConfigMap or its + key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + secret: + description: Secret containing data to use for the targets. + properties: + key: + description: + The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?" + type: string + optional: + description: + Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + certFile: + description: + Path to the client cert file in the Prometheus + container for the targets. + type: string + insecureSkipVerify: + description: Disable target certificate validation. + type: boolean + keyFile: + description: + Path to the client key file in the Prometheus + container for the targets. + type: string + keySecret: + description: + Secret containing the client key file for the + targets. + properties: + key: + description: + The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: + "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?" + type: string + optional: + description: + Specify whether the Secret or its key must + be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + serverName: + description: Used to verify the hostname for the targets. + type: string + type: object + trackTimestampsStaleness: + description: + "`trackTimestampsStaleness` defines whether Prometheus + tracks staleness of the metrics that have an explicit timestamp + present in scraped data. Has no effect if `honorTimestamps` + is false. \n It requires Prometheus >= v2.48.0." + type: boolean + type: object + type: array + jobLabel: + description: + "`jobLabel` selects the label from the associated Kubernetes + `Service` object which will be used as the `job` label for all metrics. + \n For example if `jobLabel` is set to `foo` and the Kubernetes + `Service` object is labeled with `foo: bar`, then Prometheus adds + the `job=\"bar\"` label to all ingested metrics. \n If the value + of this field is empty or if the label doesn't exist for the given + Service, the `job` label of the metrics defaults to the name of + the associated Kubernetes `Service`." + type: string + keepDroppedTargets: + description: + "Per-scrape limit on the number of targets dropped by + relabeling that will be kept in memory. 0 means no limit. \n It + requires Prometheus >= v2.47.0." + format: int64 + type: integer + labelLimit: + description: + "Per-scrape limit on number of labels that will be accepted + for a sample. \n It requires Prometheus >= v2.27.0." + format: int64 + type: integer + labelNameLengthLimit: + description: + "Per-scrape limit on length of labels name that will + be accepted for a sample. \n It requires Prometheus >= v2.27.0." + format: int64 + type: integer + labelValueLengthLimit: + description: + "Per-scrape limit on length of labels value that will + be accepted for a sample. \n It requires Prometheus >= v2.27.0." + format: int64 + type: integer + namespaceSelector: + description: + Selector to select which namespaces the Kubernetes `Endpoints` + objects are discovered from. + properties: + any: + description: + Boolean describing whether all namespaces are selected + in contrast to a list restricting them. + type: boolean + matchNames: + description: List of namespace names to select from. + items: + type: string + type: array + type: object + podTargetLabels: + description: + "`podTargetLabels` defines the labels which are transferred + from the associated Kubernetes `Pod` object onto the ingested metrics." + items: + type: string + type: array + sampleLimit: + description: + "`sampleLimit` defines a per-scrape limit on the number + of scraped samples that will be accepted." + format: int64 + type: integer + scrapeClass: + description: The scrape class to apply. + minLength: 1 + type: string + scrapeProtocols: + description: + "`scrapeProtocols` defines the protocols to negotiate + during a scrape. It tells clients the protocols supported by Prometheus + in order of preference (from most to least preferred). \n If unset, + Prometheus uses its default value. \n It requires Prometheus >= + v2.49.0." + items: + description: + "ScrapeProtocol represents a protocol used by Prometheus + for scraping metrics. Supported values are: * `OpenMetricsText0.0.1` + * `OpenMetricsText1.0.0` * `PrometheusProto` * `PrometheusText0.0.4`" + enum: + - PrometheusProto + - OpenMetricsText0.0.1 + - OpenMetricsText1.0.0 + - PrometheusText0.0.4 + type: string + type: array + x-kubernetes-list-type: set + selector: + description: Label selector to select the Kubernetes `Endpoints` objects. + properties: + matchExpressions: + description: + matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: + description: + A label selector requirement is a selector that + contains values, a key, and an operator that relates the key + and values. + properties: + key: + description: + key is the label key that the selector applies + to. + type: string + operator: + description: + operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: + values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: + matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + targetLabels: + description: + "`targetLabels` defines the labels which are transferred + from the associated Kubernetes `Service` object onto the ingested + metrics." + items: + type: string + type: array + targetLimit: + description: + "`targetLimit` defines a limit on the number of scraped + targets that will be accepted." + format: int64 + type: integer + required: + - selector + type: object + required: + - spec + type: object + served: true + storage: true diff --git a/charts/otel-cloud-stack/daemon_scrape_configs.yaml b/charts/otel-cloud-stack/daemon_scrape_configs.yaml new file mode 100644 index 000000000..a26c343a5 --- /dev/null +++ b/charts/otel-cloud-stack/daemon_scrape_configs.yaml @@ -0,0 +1,168 @@ +# Collect node metrics +- job_name: kubernetes-pods + scrape_interval: 30s + kubernetes_sd_configs: + - role: pod + selectors: + - role: pod + # only scrape data from pods running on the same node as collector + field: "spec.nodeName=$OTEL_K8S_NODE_NAME" + relabel_configs: + - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] + action: keep + regex: true + - source_labels: + [__meta_kubernetes_pod_annotation_prometheus_io_scrape_slow] + action: drop + regex: true + - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scheme] + action: replace + regex: (https?) + target_label: __scheme__ + - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path] + action: replace + target_label: __metrics_path__ + regex: (.+) + - source_labels: + [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port] + action: replace + regex: ([^:]+)(?::\d+)?;(\d+) + # NOTE: otel collector uses env var replacement. $$ is used as a literal $. + replacement: $$1:$$2 + target_label: __address__ + - action: labelmap + regex: __meta_kubernetes_pod_annotation_prometheus_io_param_(.+) + replacement: __param_$$1 + - action: labelmap + regex: __meta_kubernetes_pod_label_(.+) + - source_labels: [__meta_kubernetes_namespace] + action: replace + target_label: namespace + - source_labels: [__meta_kubernetes_pod_name] + action: replace + target_label: pod + - source_labels: [__meta_kubernetes_pod_phase] + regex: Pending|Succeeded|Failed|Completed + action: drop + - action: replace + source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_name] + target_label: job +- job_name: node-exporter + scrape_interval: 30s + relabel_configs: + - action: labelmap + regex: __meta_kubernetes_node_label_(.+) + - action: replace + regex: "(.*)" + replacement: "$1" + separator: ";" + source_labels: + - job + target_label: __tmp_prometheus_job_name + static_configs: + - targets: + - ${OTEL_K8S_NODE_IP}:9100 +# We still need to scrape kubelet's CAdvisor which isn't supported +- authorization: + credentials_file: "/var/run/secrets/kubernetes.io/serviceaccount/token" + type: Bearer + follow_redirects: true + honor_labels: true + honor_timestamps: true + job_name: kubelet + kubernetes_sd_configs: + - follow_redirects: true + role: node + selectors: + - role: node + # only scrape data from pods running on the same node as collector + field: "metadata.name=$OTEL_K8S_NODE_NAME" + metric_relabel_configs: + - action: drop + regex: container_cpu_(load_average_10s|system_seconds_total|user_seconds_total) + replacement: "$1" + separator: ";" + source_labels: + - __name__ + - action: drop + regex: container_fs_(io_current|reads_merged_total|sector_reads_total|sector_writes_total|writes_merged_total) + replacement: "$1" + separator: ";" + source_labels: + - __name__ + - action: drop + regex: container_memory_(mapped_file|swap) + replacement: "$1" + separator: ";" + source_labels: + - __name__ + - action: drop + regex: container_(file_descriptors|tasks_state|threads_max) + replacement: "$1" + separator: ";" + source_labels: + - __name__ + - action: drop + regex: container_spec.* + replacement: "$1" + separator: ";" + source_labels: + - __name__ + - action: drop + regex: ".+;" + replacement: "$1" + separator: ";" + source_labels: + - id + - pod + metrics_path: "/metrics/cadvisor" + relabel_configs: + - action: replace + regex: "(.*)" + replacement: "$1" + separator: ";" + source_labels: + - job + target_label: __tmp_prometheus_job_name + - action: replace + replacement: "kubelet" + target_label: job + - action: replace + regex: "(.*)" + replacement: "${1}" + separator: ";" + source_labels: + - __meta_kubernetes_node_name + target_label: node + - action: replace + regex: "(.*)" + replacement: https-metrics + separator: ";" + target_label: endpoint + - action: replace + regex: "(.*)" + replacement: "$1" + separator: ";" + source_labels: + - __metrics_path__ + target_label: metrics_path + - action: hashmod + modulus: 1 + regex: "(.*)" + replacement: "$1" + separator: ";" + source_labels: + - __address__ + target_label: __tmp_hash + - action: keep + regex: "$(SHARD)" + replacement: "$1" + separator: ";" + source_labels: + - __tmp_hash + scheme: https + scrape_interval: 15s + scrape_timeout: 10s + tls_config: + ca_file: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" + insecure_skip_verify: true diff --git a/charts/otel-cloud-stack/kubelet_scrape_configs.yaml b/charts/otel-cloud-stack/kubelet_scrape_configs.yaml new file mode 100644 index 000000000..92c2e6e26 --- /dev/null +++ b/charts/otel-cloud-stack/kubelet_scrape_configs.yaml @@ -0,0 +1,244 @@ +# This is used for scrape kubelet +{{- if .Values.kubelet.enabled }} +- authorization: + credentials_file: "/var/run/secrets/kubernetes.io/serviceaccount/token" + type: Bearer + follow_redirects: true + honor_labels: {{ .Values.kubelet.serviceMonitor.honorLabels }} + honor_timestamps: {{ .Values.kubelet.serviceMonitor.honorTimestamps }} + job_name: serviceMonitor/{{ include "otel-cloud-stack.namespace" . }}/{{ .Chart.Name }}-kubelet/0 + kubernetes_sd_configs: + - follow_redirects: true + kubeconfig_file: '' + role: node + metrics_path: "/metrics" + relabel_configs: + - action: replace + regex: "(.*)" + replacement: "$1" + separator: ";" + source_labels: + - job + target_label: __tmp_prometheus_job_name + - action: replace + replacement: "kubelet" + target_label: job + - action: replace + regex: "(.*)" + replacement: "${1}" + separator: ";" + source_labels: + - __meta_kubernetes_node_name + target_label: node + - action: replace + regex: "(.*)" + replacement: https-metrics + separator: ";" + target_label: endpoint + - action: replace + regex: "(.*)" + replacement: "$1" + separator: ";" + source_labels: + - __metrics_path__ + target_label: metrics_path + - action: hashmod + modulus: 1 + regex: "(.*)" + replacement: "$1" + separator: ";" + source_labels: + - __address__ + target_label: __tmp_hash + - action: keep + regex: "$(SHARD)" + replacement: "$1" + separator: ";" + source_labels: + - __tmp_hash + {{- if .Values.kubelet.serviceMonitor.https }} + scheme: https + {{- else }} + schema: http + {{- end }} + scrape_interval: {{ .Values.kubelet.serviceMonitor.interval | default "30s" }} + scrape_timeout: {{ .Values.kubelet.serviceMonitor.scrapeTimeout | default "10s" }} + tls_config: + ca_file: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" + insecure_skip_verify: true +{{- if .Values.kubelet.serviceMonitor.cAdvisor }} +- authorization: + credentials_file: "/var/run/secrets/kubernetes.io/serviceaccount/token" + type: Bearer + follow_redirects: true + honor_labels: true + honor_timestamps: true + job_name: serviceMonitor/{{ include "otel-cloud-stack.namespace" . }}/{{ .Chart.Name }}-kubelet/1 + kubernetes_sd_configs: + - follow_redirects: true + kubeconfig_file: '' + role: node + metric_relabel_configs: + - action: drop + regex: container_cpu_(cfs_throttled_seconds_total|load_average_10s|system_seconds_total|user_seconds_total) + replacement: "$1" + separator: ";" + source_labels: + - __name__ + - action: drop + regex: container_fs_(io_current|io_time_seconds_total|io_time_weighted_seconds_total|reads_merged_total|sector_reads_total|sector_writes_total|writes_merged_total) + replacement: "$1" + separator: ";" + source_labels: + - __name__ + - action: drop + regex: container_memory_(mapped_file|swap) + replacement: "$1" + separator: ";" + source_labels: + - __name__ + - action: drop + regex: container_(file_descriptors|tasks_state|threads_max) + replacement: "$1" + separator: ";" + source_labels: + - __name__ + - action: drop + regex: container_spec.* + replacement: "$1" + separator: ";" + source_labels: + - __name__ + - action: drop + regex: ".+;" + replacement: "$1" + separator: ";" + source_labels: + - id + - pod + metrics_path: "/metrics/cadvisor" + relabel_configs: + - action: replace + regex: "(.*)" + replacement: "$1" + separator: ";" + source_labels: + - job + target_label: __tmp_prometheus_job_name + - action: replace + replacement: "kubelet" + target_label: job + - action: replace + regex: "(.*)" + replacement: "${1}" + separator: ";" + source_labels: + - __meta_kubernetes_node_name + target_label: node + - action: replace + regex: "(.*)" + replacement: https-metrics + separator: ";" + target_label: endpoint + - action: replace + regex: "(.*)" + replacement: "$1" + separator: ";" + source_labels: + - __metrics_path__ + target_label: metrics_path + - action: hashmod + modulus: 1 + regex: "(.*)" + replacement: "$1" + separator: ";" + source_labels: + - __address__ + target_label: __tmp_hash + - action: keep + regex: "$(SHARD)" + replacement: "$1" + separator: ";" + source_labels: + - __tmp_hash + {{- if .Values.kubelet.serviceMonitor.https }} + scheme: https + {{- else }} + schema: http + {{- end }} + scrape_interval: {{ .Values.kubelet.serviceMonitor.scrapeTimeout | default "30s" }} + scrape_timeout: 10s + tls_config: + ca_file: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" + insecure_skip_verify: true + +{{- end }} +{{- if .Values.kubelet.serviceMonitor.probes }} +- authorization: + credentials_file: "/var/run/secrets/kubernetes.io/serviceaccount/token" + type: Bearer + follow_redirects: true + honor_labels: true + honor_timestamps: true + job_name: serviceMonitor/{{ include "otel-cloud-stack.namespace" . }}/{{ .Chart.Name }}-kubelet/2 + kubernetes_sd_configs: + - follow_redirects: true + kubeconfig_file: '' + role: node + metrics_path: "/metrics/probes" + relabel_configs: + - action: replace + regex: "(.*)" + replacement: "$1" + separator: ";" + source_labels: + - job + target_label: __tmp_prometheus_job_name + - action: replace + replacement: "kubelet" + target_label: job + - action: replace + regex: "(.*)" + replacement: "${1}" + separator: ";" + source_labels: + - __meta_kubernetes_node_name + target_label: node + - action: replace + regex: "(.*)" + replacement: https-metrics + separator: ";" + target_label: endpoint + - action: replace + regex: "(.*)" + replacement: "$1" + separator: ";" + source_labels: + - __metrics_path__ + target_label: metrics_path + - action: hashmod + modulus: 1 + regex: "(.*)" + replacement: "$1" + separator: ";" + source_labels: + - __address__ + target_label: __tmp_hash + - action: keep + regex: "$(SHARD)" + replacement: "$1" + separator: ";" + source_labels: + - __tmp_hash + {{- if .Values.kubelet.serviceMonitor.https }} + scheme: https + {{- else }} + schema: http + {{- end }} + scrape_interval: {{ .Values.kubelet.serviceMonitor.scrapeTimeout | default "30s" }} + scrape_timeout: 10s + tls_config: + ca_file: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" + insecure_skip_verify: true +{{- end }} +{{- end }} diff --git a/charts/otel-cloud-stack/templates/_helpers.tpl b/charts/otel-cloud-stack/templates/_helpers.tpl new file mode 100644 index 000000000..64ddccea5 --- /dev/null +++ b/charts/otel-cloud-stack/templates/_helpers.tpl @@ -0,0 +1,253 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "otel-cloud-stack.name" -}} +{{- default .Chart.Name | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "otel-cloud-stack.fullname" -}} +{{- if .fullnameOverride }} +{{- .fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} + +{{/* +Allow the release namespace to be overridden +*/}} +{{- define "otel-cloud-stack.namespace" -}} + {{- if .Values.namespaceOverride -}} + {{- .Values.namespaceOverride -}} + {{- else -}} + {{- .Release.Namespace -}} + {{- end -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "otel-cloud-stack.labels" -}} +helm.sh/chart: {{ include "opentelemetry-collector.chart" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + + +{{/* Sets default scrape limits for servicemonitor */}} +{{- define "servicemonitor.scrapeLimits" -}} +{{- with .sampleLimit }} +sampleLimit: {{ . }} +{{- end }} +{{- with .targetLimit }} +targetLimit: {{ . }} +{{- end }} +{{- with .labelLimit }} +labelLimit: {{ . }} +{{- end }} +{{- with .labelNameLengthLimit }} +labelNameLengthLimit: {{ . }} +{{- end }} +{{- with .labelValueLengthLimit }} +labelValueLengthLimit: {{ . }} +{{- end }} +{{- end -}} + + +{{/* Prometheus specific stuff. */}} +{{/* Allow KubeVersion to be overridden. */}} +{{- define "otel-cloud-stack.kubeVersion" -}} + {{- default .Capabilities.KubeVersion.Version .Values.kubeVersionOverride -}} +{{- end -}} + +{{/* Get value based on current Kubernetes version */}} +{{- define "otel-cloud-stack.kubeVersionDefaultValue" -}} + {{- $values := index . 0 -}} + {{- $kubeVersion := index . 1 -}} + {{- $old := index . 2 -}} + {{- $new := index . 3 -}} + {{- $default := index . 4 -}} + {{- if kindIs "invalid" $default -}} + {{- if semverCompare $kubeVersion (include "otel-cloud-stack.kubeVersion" $values) -}} + {{- print $new -}} + {{- else -}} + {{- print $old -}} + {{- end -}} + {{- else -}} + {{- print $default }} + {{- end -}} +{{- end -}} + +{{/* Get value for kube-controller-manager depending on insecure scraping availability */}} +{{- define "otel-cloud-stack.kubeControllerManager.insecureScrape" -}} + {{- $values := index . 0 -}} + {{- $insecure := index . 1 -}} + {{- $secure := index . 2 -}} + {{- $userValue := index . 3 -}} + {{- include "otel-cloud-stack.kubeVersionDefaultValue" (list $values ">= 1.22-0" $insecure $secure $userValue) -}} +{{- end -}} + +{{/* Get value for kube-scheduler depending on insecure scraping availability */}} +{{- define "otel-cloud-stack.kubeScheduler.insecureScrape" -}} + {{- $values := index . 0 -}} + {{- $insecure := index . 1 -}} + {{- $secure := index . 2 -}} + {{- $userValue := index . 3 -}} + {{- include "otel-cloud-stack.kubeVersionDefaultValue" (list $values ">= 1.23-0" $insecure $secure $userValue) -}} +{{- end -}} + +{{/* +Expand the name of the chart. +*/}} +{{- define "opentelemetry-collector.name" -}} +{{- default .Chart.Name .collector.name | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{- define "opentelemetry-collector.lowercase_chartname" -}} +{{- default .Chart.Name | lower }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "opentelemetry-collector.fullname" -}} +{{- if .fullnameOverride }} +{{- .fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name (coalesce .collector.name "") }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "opentelemetry-opamp-bridge.fullname" -}} +{{- if .fullnameOverride }} +{{- .fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .opAMPBridge.name }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "opentelemetry-collector.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "opentelemetry-collector.labels" -}} +helm.sh/chart: {{ include "opentelemetry-collector.chart" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "opentelemetry-opamp-bridge.labels" -}} +helm.sh/chart: {{ include "opentelemetry-collector.chart" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Create the name of the clusterRole to use for the opampbridge +*/}} +{{- define "opentelemetry-opamp-bridge.clusterRoleName" -}} +{{- default (printf "%s-bridge" .Release.Name) .Values.bridgeClusterRole.name }} +{{- end }} + +{{/* +Create the name of the clusterRole to use +*/}} +{{- define "opentelemetry-collector.clusterRoleName" -}} +{{- default (printf "%s-collector" .Release.Name) .Values.clusterRole.name }} +{{- end }} + +{{/* +Create the name of the instrumentation to use +*/}} +{{- define "opentelemetry-collector.instrumentation" -}} +{{- default .Release.Name .Values.instrumentation.name }} +{{- end }} + +{{/* +Create the name of the clusterRoleBinding to use +*/}} +{{- define "opentelemetry-collector.clusterRoleBindingName" -}} +{{- default (include "opentelemetry-collector.fullname" .) .Values.clusterRole.clusterRoleBinding.name }} +{{- end }} + +{{/* +Allow the release namespace to be overridden +*/}} +{{- define "opentelemetry-collector.namespace" -}} + {{- if .Values.namespaceOverride -}} + {{- .Values.namespaceOverride -}} + {{- else -}} + {{- .Release.Namespace -}} + {{- end -}} +{{- end -}} + +{{/* +Convert memory value to numeric value in MiB to be used by otel memory_limiter processor. +*/}} +{{- define "opentelemetry-collector.convertMemToMib" -}} +{{- $mem := lower . -}} +{{- if hasSuffix "e" $mem -}} +{{- trimSuffix "e" $mem | atoi | mul 1000 | mul 1000 | mul 1000 | mul 1000 -}} +{{- else if hasSuffix "ei" $mem -}} +{{- trimSuffix "ei" $mem | atoi | mul 1024 | mul 1024 | mul 1024 | mul 1024 -}} +{{- else if hasSuffix "p" $mem -}} +{{- trimSuffix "p" $mem | atoi | mul 1000 | mul 1000 | mul 1000 -}} +{{- else if hasSuffix "pi" $mem -}} +{{- trimSuffix "pi" $mem | atoi | mul 1024 | mul 1024 | mul 1024 -}} +{{- else if hasSuffix "t" $mem -}} +{{- trimSuffix "t" $mem | atoi | mul 1000 | mul 1000 -}} +{{- else if hasSuffix "ti" $mem -}} +{{- trimSuffix "ti" $mem | atoi | mul 1024 | mul 1024 -}} +{{- else if hasSuffix "g" $mem -}} +{{- trimSuffix "g" $mem | atoi | mul 1000 -}} +{{- else if hasSuffix "gi" $mem -}} +{{- trimSuffix "gi" $mem | atoi | mul 1024 -}} +{{- else if hasSuffix "m" $mem -}} +{{- div (trimSuffix "m" $mem | atoi | mul 1000) 1024 -}} +{{- else if hasSuffix "mi" $mem -}} +{{- trimSuffix "mi" $mem | atoi -}} +{{- else if hasSuffix "k" $mem -}} +{{- div (trimSuffix "k" $mem | atoi) 1000 -}} +{{- else if hasSuffix "ki" $mem -}} +{{- div (trimSuffix "ki" $mem | atoi) 1024 -}} +{{- else -}} +{{- div (div ($mem | atoi) 1024) 1024 -}} +{{- end -}} +{{- end -}} diff --git a/charts/otel-cloud-stack/templates/bridge.yaml b/charts/otel-cloud-stack/templates/bridge.yaml new file mode 100644 index 000000000..b654fda1f --- /dev/null +++ b/charts/otel-cloud-stack/templates/bridge.yaml @@ -0,0 +1,149 @@ +{{- if .Values.opAMPBridge.enabled }} +{{- $merged := (dict "Chart" $.Chart "clusterRole" $.Values.clusterRole "opAMPBridge" $.Values.opAMPBridge "Release" $.Release "fullnameOverride" $.Values.fullnameOverride) }} +--- +apiVersion: opentelemetry.io/v1alpha1 +kind: OpAMPBridge +metadata: + name: {{ include "opentelemetry-opamp-bridge.fullname" $merged }} + labels: + {{- include "opentelemetry-opamp-bridge.labels" $merged | nindent 4 }} + {{- with $.Values.opAMPBridge.labels }} + {{- range $key, $value := . }} + {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }} + {{- end }} + {{- end }} + {{- with $.Values.opAMPBridge.annotations }} + annotations: + {{- range $key, $value := . }} + {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }} + {{- end }} + {{- end }} +spec: + {{- if $.Values.opAMPBridge.endpoint }} + endpoint: {{ $.Values.opAMPBridge.endpoint }} + {{- end }} + {{- with $.Values.opAMPBridge.headers }} + headers: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with $.Values.opAMPBridge.capabilities }} + capabilities: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with $.Values.opAMPBridge.componentsAllowed }} + componentsAllowed: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with $.Values.opAMPBridge.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 4}} + {{- end }} + {{- if $.Values.opAMPBridge.replicas }} + replicas: {{ $.Values.opAMPBridge.replicas }} + {{- end }} + {{- if $.Values.opAMPBridge.serviceAccount }} + serviceAccount: {{ $.Values.opAMPBridge.serviceAccount }} + {{- end }} + {{- if $.Values.opAMPBridge.image.digest }} + image: "{{ $.Values.opAMPBridge.image.repository }}@{{ $.Values.opAMPBridge.image.digest }}" + {{- else }} + image: "{{ $.Values.opAMPBridge.image.repository }}:{{ $.Values.opAMPBridge.image.tag | default $.Chart.AppVersion }}" + {{- end }} + {{- if $.Values.opAMPBridge.upgradeStrategy }} + upgradeStrategy: {{ $.Values.opAMPBridge.upgradeStrategy }} + {{- end }} + {{- if $.Values.opAMPBridge.imagePullPolicy }} + imagePullPolicy: {{ $.Values.opAMPBridge.imagePullPolicy }} + {{- end }} + {{- if $.Values.opAMPBridge.hostNetwork }} + hostNetwork: {{ $.Values.opAMPBridge.hostNetwork }} + {{- end }} + {{- if $.Values.opAMPBridge.priorityClassName }} + priorityClassName: {{ $.Values.opAMPBridge.priorityClassName }} + {{- end }} + {{- with $.Values.opAMPBridge.securityContext }} + securityContext: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with $.Values.opAMPBridge.podAnnotations }} + podAnnotations: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with $.Values.opAMPBridge.resources }} + resources: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with $.Values.opAMPBridge.affinity }} + affinity: + {{- toYaml . | nindent 4}} + {{- end }} + {{- if $.Values.opAMPBridge.tolerations }} + tolerations: + {{- with $.Values.opAMPBridge.tolerations }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} + {{- if $.Values.opAMPBridge.volumes }} + volumes: + {{- with $.Values.opAMPBridge.volumes }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} + {{- if $.Values.opAMPBridge.topologySpreadConstraints }} + topologySpreadConstraints: + {{- with $.Values.opAMPBridge.topologySpreadConstraints }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} + {{- if $.Values.opAMPBridge.volumeMounts }} + volumeMounts: + {{- with $.Values.opAMPBridge.volumeMounts }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} + {{- if $.Values.opAMPBridge.ports }} + ports: + {{- with $.Values.opAMPBridge.ports }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} + env: + {{- with $.Values.extraEnvs }} + {{- toYaml . | nindent 2 }} + {{- end }} + - name: OTEL_K8S_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: OTEL_K8S_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: OTEL_K8S_POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + - name: OTEL_K8S_POD_UID + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.uid + - name: OTEL_K8S_POD_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: OTEL_RESOURCE_ATTRIBUTES + value: "k8s.cluster.name={{ $.Values.clusterName }}" + {{- with $.Values.opAMPBridge.env }} + {{- toYaml . | nindent 2 }} + {{- end }} + {{- if $.Values.opAMPBridge.envFrom }} + envFrom: + {{- with $.Values.opAMPBridge.envFrom }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/otel-cloud-stack/templates/clusterrole.yaml b/charts/otel-cloud-stack/templates/clusterrole.yaml new file mode 100644 index 000000000..383aec373 --- /dev/null +++ b/charts/otel-cloud-stack/templates/clusterrole.yaml @@ -0,0 +1,188 @@ +{{- if .Values.clusterRole.enabled }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ include "opentelemetry-collector.clusterRoleName" . }} +rules: +- apiGroups: [""] + resources: + - namespaces + - nodes + - nodes/proxy + - nodes/metrics + - nodes/stats + - services + - endpoints + - pods + - events + - secrets + verbs: ["get", "list", "watch"] +- apiGroups: ["monitoring.coreos.com"] + resources: + - servicemonitors + - podmonitors + verbs: ["get", "list", "watch"] +- apiGroups: + - extensions + resources: + - ingresses + verbs: ["get", "list", "watch"] +- apiGroups: + - apps + resources: + - daemonsets + - deployments + - replicasets + - statefulsets + verbs: ["get", "list", "watch"] +- apiGroups: + - networking.k8s.io + resources: + - ingresses + verbs: ["get", "list", "watch"] +- apiGroups: ["discovery.k8s.io"] + resources: + - endpointslices + verbs: ["get", "list", "watch"] +- nonResourceURLs: ["/metrics", "/metrics/cadvisor"] + verbs: ["get"] +{{- if $.Values.clusterRole.rules }} +{{ toYaml $.Values.clusterRole.rules }} +{{- end }} +{{ range $_, $collector := $.Values.collectors -}} +{{- if $collector.config.receivers.k8s_cluster }} +- apiGroups: + - "" + resources: + - events + - namespaces + - namespaces/status + - nodes + - nodes/spec + - pods + - pods/status + - replicationcontrollers + - replicationcontrollers/status + - resourcequotas + - services + verbs: + - get + - list + - watch +- apiGroups: + - apps + resources: + - daemonsets + - deployments + - replicasets + - statefulsets + verbs: + - get + - list + - watch +- apiGroups: + - extensions + resources: + - daemonsets + - deployments + - replicasets + verbs: + - get + - list + - watch +- apiGroups: + - batch + resources: + - jobs + - cronjobs + verbs: + - get + - list + - watch +- apiGroups: + - autoscaling + resources: + - horizontalpodautoscalers + verbs: + - get + - list + - watch +{{- end }} +{{- end }} +{{- end }} + +{{ range $_, $collector := $.Values.collectors -}} +{{- $collector := (mergeOverwrite (deepCopy $.Values.defaultCollectorConfig) $collector) }} +{{- if and $collector.enabled $collector.clusterRoleBinding.enabled -}} +{{- $merged := (dict "Chart" $.Chart "clusterRole" $.Values.clusterRole "collector" $collector "Release" $.Release "fullnameOverride" $.Values.fullnameOverride) }} +{{- $fullname := (include "opentelemetry-collector.fullname" $merged) }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ $fullname }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ default (include "opentelemetry-collector.clusterRoleName" $) $collector.clusterRoleBinding.clusterRoleName }} +subjects: +- kind: ServiceAccount + # quirk of the Operator +{{- if $collector.serviceAccount }} + name: "{{ $collector.serviceAccount }}" +{{- else }} + name: "{{ $fullname }}-collector" +{{- end }} + namespace: {{ $.Release.Namespace }} +{{- if eq $collector.mode "statefulset" }} +- kind: ServiceAccount +{{- if $collector.targetAllocator.serviceAccount }} + name: "{{ $collector.targetAllocator.serviceAccount }}" +{{- else }} + name: {{ $fullname }}-targetallocator +{{- end }} + namespace: {{ $.Release.Namespace }} +{{- end }} +{{- end }} +{{- end }} +{{- if and $.Values.opAMPBridge.enabled $.Values.bridgeClusterRole.enabled }} +{{- $merged := (dict "Chart" $.Chart "clusterRole" $.Values.clusterRole "opAMPBridge" $.Values.opAMPBridge "Release" $.Release "fullnameOverride" $.Values.fullnameOverride) }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ include "opentelemetry-opamp-bridge.clusterRoleName" . }} +rules: + - apiGroups: + - opentelemetry.io + resources: + - opentelemetrycollectors + verbs: + - "*" + - apiGroups: + - "" + resources: + - pods + verbs: + - 'list' + - 'get' +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ include "opentelemetry-opamp-bridge.fullname" $merged }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: "{{ include "opentelemetry-opamp-bridge.clusterRoleName" . }}" +subjects: + - kind: ServiceAccount + # quirk of the Operator + {{- if $.Values.opAMPBridge.serviceAccount }} + name: "{{ $.Values.opAMPBridge.serviceAccount }}" + {{- else }} + name: "{{ (include "opentelemetry-opamp-bridge.fullname" $merged) }}-bridge-opamp-bridge" + {{- end }} + namespace: "{{ $.Release.Namespace }}" +{{- end }} diff --git a/charts/otel-cloud-stack/templates/collector.yaml b/charts/otel-cloud-stack/templates/collector.yaml new file mode 100644 index 000000000..7a0afbec0 --- /dev/null +++ b/charts/otel-cloud-stack/templates/collector.yaml @@ -0,0 +1,237 @@ +{{ range $_, $collector := $.Values.collectors -}} +{{- if $collector.enabled -}} +{{- $collector := (mergeOverwrite (deepCopy $.Values.defaultCollectorConfig) $collector) }} +{{- $merged := (dict "Chart" $.Chart "clusterRole" $.Values.clusterRole "collector" $collector "Release" $.Release "fullnameOverride" $.Values.fullnameOverride) }} +{{- $fullname := (include "opentelemetry-collector.fullname" $merged) }} +--- +apiVersion: opentelemetry.io/v1alpha1 +kind: OpenTelemetryCollector +metadata: + name: {{ $fullname }} + labels: + {{- include "opentelemetry-collector.labels" $merged | nindent 4 }} + {{- with $collector.labels }} + {{- range $key, $value := . }} + {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }} + {{- end }} + {{- end }} + {{- if and $.Values.opAMPBridge.enabled $.Values.opAMPBridge.addReportingLabel }} + opentelemetry.io/opamp-reporting: "true" + {{- end }} + {{- if and $.Values.opAMPBridge.enabled $.Values.opAMPBridge.addManagedLabel }} + opentelemetry.io/opamp-managed: "true" + {{- end }} + {{- with $collector.annotations }} + annotations: + {{- range $key, $value := . }} + {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }} + {{- end }} + {{- end }} +spec: + managementState: {{ $collector.managementState }} + mode: {{ $collector.mode }} + config: | + {{- if $collector.scrape_configs_file }} + {{- $loaded_config := (fromYamlArray (tpl ($.Files.Get $collector.scrape_configs_file) $)) }} + {{- $prom_override := (dict "receivers" (dict "prometheus" (dict "config" (dict "scrape_configs" $loaded_config))))}} + {{- if (dig "receivers" "prometheus" "config" "scrape_configs" false $collector.config) }} + {{- $merged_prom_scrape_configs := (concat $collector.config.receivers.prometheus.config.scrape_configs $loaded_config) }} + {{- $prom_override = (dict "receivers" (dict "prometheus" (dict "config" (dict "scrape_configs" $merged_prom_scrape_configs)))) }} + {{- end }} + {{- $new_config := (mergeOverwrite $collector.config $prom_override)}} + {{- toYaml $new_config | nindent 4 }} + {{- else }} + {{- toYaml $collector.config | nindent 4 }} + {{- end }} + {{- if $collector.replicas }} + replicas: {{ $collector.replicas }} + {{- end }} + {{- if $collector.serviceAccount }} + serviceAccount: {{ $collector.serviceAccount }} + {{- end }} + {{- if $collector.image.digest }} + image: "{{ $collector.image.repository }}@{{ $collector.image.digest }}" + {{- else }} + image: "{{ $collector.image.repository }}:{{ $collector.image.tag | default $.Chart.AppVersion }}" + {{- end }} + imagePullPolicy: {{ $collector.image.pullPolicy }} + {{- if $collector.upgradeStrategy }} + upgradeStrategy: {{ $collector.upgradeStrategy }} + {{- end }} + {{- if $collector.hostNetwork }} + hostNetwork: {{ $collector.hostNetwork }} + {{- end }} + {{- if $collector.shareProcessNamespace }} + shareProcessNamespace: {{ $collector.shareProcessNamespace }} + {{- end }} + {{- if $collector.priorityClassName }} + priorityClassName: {{ $collector.priorityClassName }} + {{- end }} + {{- if $collector.terminationGracePeriodSeconds }} + terminationGracePeriodSeconds: {{ $collector.terminationGracePeriodSeconds }} + {{- end }} + {{- with $collector.resources }} + resources: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with $collector.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with $collector.args }} + args: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with $collector.autoscaler }} + autoscaler: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with $collector.podDisruptionBudget }} + podDisruptionBudget: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with $collector.securityContext }} + securityContext: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with $collector.podSecurityContext }} + podSecurityContext: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with $collector.podAnnotations }} + podAnnotations: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with $collector.targetAllocator }} + targetAllocator: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with $collector.ingress }} + ingress: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with $collector.affinity }} + affinity: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with $collector.lifecycle }} + lifecycle: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with $collector.livenessProbe }} + livenessProbe: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with $collector.observability }} + observability: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with $collector.updateStrategy }} + updateStrategy: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with $collector.deploymentUpdateStrategy }} + deploymentUpdateStrategy: + {{- toYaml . | nindent 4}} + {{- end }} + {{- if $collector.volumeMounts }} + volumeMounts: + {{- with $collector.volumeMounts }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} + {{- if $collector.ports }} + ports: + {{- with $collector.ports }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} + env: + {{- with $.Values.extraEnvs }} + {{- toYaml . | nindent 2 }} + {{- end }} + - name: OTEL_K8S_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: OTEL_K8S_NODE_IP + valueFrom: + fieldRef: + fieldPath: status.hostIP + - name: OTEL_K8S_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: OTEL_K8S_POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + - name: OTEL_K8S_POD_UID + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.uid + - name: OTEL_K8S_POD_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + {{- if $.Values.clusterName }} + - name: OTEL_RESOURCE_ATTRIBUTES + value: "k8s.cluster.name={{ $.Values.clusterName }}" + {{- end }} + {{- with $collector.env }} + {{- toYaml . | nindent 2 }} + {{- end }} + {{- if $collector.envFrom }} + envFrom: + {{- with $collector.envFrom }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} + {{- if $collector.volumeClaimTemplates }} + volumeClaimTemplates: + {{- with $collector.volumeClaimTemplates }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} + {{- if $collector.tolerations }} + tolerations: + {{- with $collector.tolerations }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} + {{- if $collector.volumes }} + volumes: + {{- with $collector.volumes }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} + {{- if $collector.initContainers }} + initContainers: + {{- with $collector.initContainers }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} + {{- if $collector.additionalContainers }} + additionalContainers: + {{- with $collector.additionalContainers }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} + {{- if $collector.topologySpreadConstraints }} + topologySpreadConstraints: + {{- with $collector.topologySpreadConstraints }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} + {{- if $collector.configmaps }} + configmaps: + {{- with $collector.configmaps }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/otel-cloud-stack/templates/exporters/core-dns/service.yaml b/charts/otel-cloud-stack/templates/exporters/core-dns/service.yaml new file mode 100644 index 000000000..6113ce86f --- /dev/null +++ b/charts/otel-cloud-stack/templates/exporters/core-dns/service.yaml @@ -0,0 +1,24 @@ +{{- if and .Values.coreDns.enabled .Values.coreDns.service.enabled .Values.kubernetesServiceMonitors.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ template "otel-cloud-stack.fullname" . }}-coredns + labels: + app: {{ template "otel-cloud-stack.name" . }}-coredns + jobLabel: coredns +{{ include "otel-cloud-stack.labels" . | indent 4 }} + namespace: kube-system +spec: + clusterIP: None + ports: + - name: {{ .Values.coreDns.serviceMonitor.port }} + port: {{ .Values.coreDns.service.port }} + protocol: TCP + targetPort: {{ .Values.coreDns.service.targetPort }} + selector: + {{- if .Values.coreDns.service.selector }} +{{ toYaml .Values.coreDns.service.selector | indent 4 }} + {{- else}} + k8s-app: kube-dns + {{- end}} +{{- end }} diff --git a/charts/otel-cloud-stack/templates/exporters/core-dns/servicemonitor.yaml b/charts/otel-cloud-stack/templates/exporters/core-dns/servicemonitor.yaml new file mode 100644 index 000000000..22b6a2a6d --- /dev/null +++ b/charts/otel-cloud-stack/templates/exporters/core-dns/servicemonitor.yaml @@ -0,0 +1,48 @@ +{{- if and .Values.coreDns.enabled .Values.coreDns.serviceMonitor.enabled .Values.kubernetesServiceMonitors.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template "otel-cloud-stack.fullname" . }}-coredns + {{- if .Values.prometheus.ignoreNamespaceSelectors }} + namespace: kube-system + {{- else }} + namespace: {{ template "otel-cloud-stack.namespace" . }} + {{- end }} + labels: + app: {{ template "otel-cloud-stack.name" . }}-coredns + {{- with .Values.coreDns.serviceMonitor.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +{{ include "otel-cloud-stack.labels" . | indent 4 }} +spec: + jobLabel: {{ .Values.coreDns.serviceMonitor.jobLabel }} + {{- include "servicemonitor.scrapeLimits" .Values.coreDns.serviceMonitor | nindent 2 }} + selector: + {{- if .Values.coreDns.serviceMonitor.selector }} + {{ tpl (toYaml .Values.coreDns.serviceMonitor.selector | nindent 4) . }} + {{- else }} + matchLabels: + app: {{ template "otel-cloud-stack.name" . }}-coredns + release: {{ $.Release.Name | quote }} + {{- end }} + namespaceSelector: + matchNames: + - "kube-system" + endpoints: + - port: {{ .Values.coreDns.serviceMonitor.port }} + {{- if .Values.coreDns.serviceMonitor.interval}} + interval: {{ .Values.coreDns.serviceMonitor.interval }} + {{- end }} + {{- if .Values.coreDns.serviceMonitor.proxyUrl }} + proxyUrl: {{ .Values.coreDns.serviceMonitor.proxyUrl}} + {{- end }} + bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token +{{- if .Values.coreDns.serviceMonitor.metricRelabelings }} + metricRelabelings: +{{ tpl (toYaml .Values.coreDns.serviceMonitor.metricRelabelings | indent 4) . }} +{{- end }} +{{- if .Values.coreDns.serviceMonitor.relabelings }} + relabelings: +{{ tpl (toYaml .Values.coreDns.serviceMonitor.relabelings | indent 4) . }} +{{- end }} +{{- end }} diff --git a/charts/otel-cloud-stack/templates/exporters/kube-api-server/servicemonitor.yaml b/charts/otel-cloud-stack/templates/exporters/kube-api-server/servicemonitor.yaml new file mode 100644 index 000000000..469b67e39 --- /dev/null +++ b/charts/otel-cloud-stack/templates/exporters/kube-api-server/servicemonitor.yaml @@ -0,0 +1,47 @@ +{{- if and .Values.kubeApiServer.enabled .Values.kubernetesServiceMonitors.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template "otel-cloud-stack.fullname" . }}-apiserver + {{- if .Values.prometheus.ignoreNamespaceSelectors }} + namespace: default + {{- else }} + namespace: {{ template "otel-cloud-stack.namespace" . }} + {{- end }} + labels: + app: {{ template "otel-cloud-stack.name" . }}-apiserver + {{- with .Values.kubeApiServer.serviceMonitor.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +{{ include "otel-cloud-stack.labels" . | indent 4 }} +spec: + {{- include "servicemonitor.scrapeLimits" .Values.kubeApiServer.serviceMonitor | nindent 2 }} + endpoints: + - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token + {{- if .Values.kubeApiServer.serviceMonitor.interval }} + interval: {{ .Values.kubeApiServer.serviceMonitor.interval }} + {{- end }} + {{- if .Values.kubeApiServer.serviceMonitor.proxyUrl }} + proxyUrl: {{ .Values.kubeApiServer.serviceMonitor.proxyUrl }} + {{- end }} + port: https + scheme: https +{{- if .Values.kubeApiServer.serviceMonitor.metricRelabelings }} + metricRelabelings: +{{ tpl (toYaml .Values.kubeApiServer.serviceMonitor.metricRelabelings | indent 6) . }} +{{- end }} +{{- if .Values.kubeApiServer.serviceMonitor.relabelings }} + relabelings: +{{ tpl (toYaml .Values.kubeApiServer.serviceMonitor.relabelings | indent 6) . }} +{{- end }} + tlsConfig: + caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt + serverName: {{ .Values.kubeApiServer.tlsConfig.serverName }} + insecureSkipVerify: {{ .Values.kubeApiServer.tlsConfig.insecureSkipVerify }} + jobLabel: {{ .Values.kubeApiServer.serviceMonitor.jobLabel }} + namespaceSelector: + matchNames: + - default + selector: +{{ toYaml .Values.kubeApiServer.serviceMonitor.selector | indent 4 }} +{{- end}} diff --git a/charts/otel-cloud-stack/templates/exporters/kube-controller-manager/endpoints.yaml b/charts/otel-cloud-stack/templates/exporters/kube-controller-manager/endpoints.yaml new file mode 100644 index 000000000..93192774a --- /dev/null +++ b/charts/otel-cloud-stack/templates/exporters/kube-controller-manager/endpoints.yaml @@ -0,0 +1,22 @@ +{{- if and .Values.kubeControllerManager.enabled .Values.kubeControllerManager.endpoints .Values.kubernetesServiceMonitors.enabled }} +apiVersion: v1 +kind: Endpoints +metadata: + name: {{ template "otel-cloud-stack.fullname" . }}-kube-controller-manager + labels: + app: {{ template "otel-cloud-stack.name" . }}-kube-controller-manager + k8s-app: kube-controller-manager +{{ include "otel-cloud-stack.labels" . | indent 4 }} + namespace: kube-system +subsets: + - addresses: + {{- range .Values.kubeControllerManager.endpoints }} + - ip: {{ . }} + {{- end }} + ports: + - name: {{ .Values.kubeControllerManager.serviceMonitor.port }} + {{- $kubeControllerManagerDefaultInsecurePort := 10252 }} + {{- $kubeControllerManagerDefaultSecurePort := 10257 }} + port: {{ include "otel-cloud-stack.kubeControllerManager.insecureScrape" (list . $kubeControllerManagerDefaultInsecurePort $kubeControllerManagerDefaultSecurePort .Values.kubeControllerManager.service.port) }} + protocol: TCP +{{- end }} diff --git a/charts/otel-cloud-stack/templates/exporters/kube-controller-manager/service.yaml b/charts/otel-cloud-stack/templates/exporters/kube-controller-manager/service.yaml new file mode 100644 index 000000000..c09ea723a --- /dev/null +++ b/charts/otel-cloud-stack/templates/exporters/kube-controller-manager/service.yaml @@ -0,0 +1,29 @@ +{{- if and .Values.kubeControllerManager.enabled .Values.kubeControllerManager.service.enabled .Values.kubernetesServiceMonitors.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ template "otel-cloud-stack.fullname" . }}-kube-controller-manager + labels: + app: {{ template "otel-cloud-stack.name" . }}-kube-controller-manager + jobLabel: kube-controller-manager +{{ include "otel-cloud-stack.labels" . | indent 4 }} + namespace: kube-system +spec: + clusterIP: None + ports: + - name: {{ .Values.kubeControllerManager.serviceMonitor.port }} + {{- $kubeControllerManagerDefaultInsecurePort := 10252 }} + {{- $kubeControllerManagerDefaultSecurePort := 10257 }} + port: {{ include "otel-cloud-stack.kubeControllerManager.insecureScrape" (list . $kubeControllerManagerDefaultInsecurePort $kubeControllerManagerDefaultSecurePort .Values.kubeControllerManager.service.port) }} + protocol: TCP + targetPort: {{ include "otel-cloud-stack.kubeControllerManager.insecureScrape" (list . $kubeControllerManagerDefaultInsecurePort $kubeControllerManagerDefaultSecurePort .Values.kubeControllerManager.service.targetPort) }} +{{- if .Values.kubeControllerManager.endpoints }}{{- else }} + selector: + {{- if .Values.kubeControllerManager.service.selector }} +{{ toYaml .Values.kubeControllerManager.service.selector | indent 4 }} + {{- else}} + component: kube-controller-manager + {{- end}} +{{- end }} + type: ClusterIP +{{- end }} diff --git a/charts/otel-cloud-stack/templates/exporters/kube-controller-manager/servicemonitor.yaml b/charts/otel-cloud-stack/templates/exporters/kube-controller-manager/servicemonitor.yaml new file mode 100644 index 000000000..0b2192cae --- /dev/null +++ b/charts/otel-cloud-stack/templates/exporters/kube-controller-manager/servicemonitor.yaml @@ -0,0 +1,59 @@ +{{- if and .Values.kubeControllerManager.enabled .Values.kubeControllerManager.serviceMonitor.enabled .Values.kubernetesServiceMonitors.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template "otel-cloud-stack.fullname" . }}-kube-controller-manager + {{- if .Values.prometheus.ignoreNamespaceSelectors }} + namespace: kube-system + {{- else }} + namespace: {{ template "otel-cloud-stack.namespace" . }} + {{- end }} + labels: + app: {{ template "otel-cloud-stack.name" . }}-kube-controller-manager + {{- with .Values.kubeControllerManager.serviceMonitor.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +{{ include "otel-cloud-stack.labels" . | indent 4 }} +spec: + jobLabel: {{ .Values.kubeControllerManager.serviceMonitor.jobLabel }} + {{- include "servicemonitor.scrapeLimits" .Values.kubeControllerManager.serviceMonitor | nindent 2 }} + selector: + {{- if .Values.kubeControllerManager.serviceMonitor.selector }} + {{ tpl (toYaml .Values.kubeControllerManager.serviceMonitor.selector | nindent 4) . }} + {{- else }} + matchLabels: + app: {{ template "otel-cloud-stack.name" . }}-kube-controller-manager + release: {{ $.Release.Name | quote }} + {{- end }} + namespaceSelector: + matchNames: + - "kube-system" + endpoints: + - port: {{ .Values.kubeControllerManager.serviceMonitor.port }} + {{- if .Values.kubeControllerManager.serviceMonitor.interval }} + interval: {{ .Values.kubeControllerManager.serviceMonitor.interval }} + {{- end }} + bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token + {{- if .Values.kubeControllerManager.serviceMonitor.proxyUrl }} + proxyUrl: {{ .Values.kubeControllerManager.serviceMonitor.proxyUrl}} + {{- end }} + {{- if eq (include "otel-cloud-stack.kubeControllerManager.insecureScrape" (list . false true .Values.kubeControllerManager.serviceMonitor.https )) "true" }} + scheme: https + tlsConfig: + caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt + {{- if eq (include "otel-cloud-stack.kubeControllerManager.insecureScrape" (list . nil true .Values.kubeControllerManager.serviceMonitor.insecureSkipVerify)) "true" }} + insecureSkipVerify: true + {{- end }} + {{- if .Values.kubeControllerManager.serviceMonitor.serverName }} + serverName: {{ .Values.kubeControllerManager.serviceMonitor.serverName }} + {{- end }} + {{- end }} +{{- if .Values.kubeControllerManager.serviceMonitor.metricRelabelings }} + metricRelabelings: +{{ tpl (toYaml .Values.kubeControllerManager.serviceMonitor.metricRelabelings | indent 4) . }} +{{- end }} +{{- if .Values.kubeControllerManager.serviceMonitor.relabelings }} + relabelings: +{{ tpl (toYaml .Values.kubeControllerManager.serviceMonitor.relabelings | indent 4) . }} +{{- end }} +{{- end }} diff --git a/charts/otel-cloud-stack/templates/exporters/kube-dns/service.yaml b/charts/otel-cloud-stack/templates/exporters/kube-dns/service.yaml new file mode 100644 index 000000000..461546569 --- /dev/null +++ b/charts/otel-cloud-stack/templates/exporters/kube-dns/service.yaml @@ -0,0 +1,28 @@ +{{- if and .Values.kubeDns.enabled .Values.kubernetesServiceMonitors.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ template "otel-cloud-stack.fullname" . }}-kube-dns + labels: + app: {{ template "otel-cloud-stack.name" . }}-kube-dns + jobLabel: kube-dns +{{ include "otel-cloud-stack.labels" . | indent 4 }} + namespace: kube-system +spec: + clusterIP: None + ports: + - name: http-metrics-dnsmasq + port: {{ .Values.kubeDns.service.dnsmasq.port }} + protocol: TCP + targetPort: {{ .Values.kubeDns.service.dnsmasq.targetPort }} + - name: http-metrics-skydns + port: {{ .Values.kubeDns.service.skydns.port }} + protocol: TCP + targetPort: {{ .Values.kubeDns.service.skydns.targetPort }} + selector: + {{- if .Values.kubeDns.service.selector }} +{{ toYaml .Values.kubeDns.service.selector | indent 4 }} + {{- else}} + k8s-app: kube-dns + {{- end}} +{{- end }} diff --git a/charts/otel-cloud-stack/templates/exporters/kube-dns/servicemonitor.yaml b/charts/otel-cloud-stack/templates/exporters/kube-dns/servicemonitor.yaml new file mode 100644 index 000000000..715273730 --- /dev/null +++ b/charts/otel-cloud-stack/templates/exporters/kube-dns/servicemonitor.yaml @@ -0,0 +1,61 @@ +{{- if and .Values.kubeDns.enabled .Values.kubernetesServiceMonitors.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template "otel-cloud-stack.fullname" . }}-kube-dns + {{- if .Values.prometheus.ignoreNamespaceSelectors }} + namespace: kube-system + {{- else }} + namespace: {{ template "otel-cloud-stack.namespace" . }} + {{- end }} + labels: + app: {{ template "otel-cloud-stack.name" . }}-kube-dns + {{- with .Values.kubeDns.serviceMonitor.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +{{ include "otel-cloud-stack.labels" . | indent 4 }} +spec: + jobLabel: {{ .Values.kubeDns.serviceMonitor.jobLabel }} + {{- include "servicemonitor.scrapeLimits" .Values.kubeDns.serviceMonitor | nindent 2 }} + selector: + {{- if .Values.kubeDns.serviceMonitor.selector }} + {{ tpl (toYaml .Values.kubeDns.serviceMonitor.selector | nindent 4) . }} + {{- else }} + matchLabels: + app: {{ template "otel-cloud-stack.name" . }}-kube-dns + release: {{ $.Release.Name | quote }} + {{- end }} + namespaceSelector: + matchNames: + - "kube-system" + endpoints: + - port: http-metrics-dnsmasq + {{- if .Values.kubeDns.serviceMonitor.interval }} + interval: {{ .Values.kubeDns.serviceMonitor.interval }} + {{- end }} + bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token + {{- if .Values.kubeDns.serviceMonitor.proxyUrl }} + proxyUrl: {{ .Values.kubeDns.serviceMonitor.proxyUrl}} + {{- end }} +{{- if .Values.kubeDns.serviceMonitor.dnsmasqMetricRelabelings }} + metricRelabelings: +{{ tpl (toYaml .Values.kubeDns.serviceMonitor.dnsmasqMetricRelabelings | indent 4) . }} +{{- end }} +{{- if .Values.kubeDns.serviceMonitor.dnsmasqRelabelings }} + relabelings: +{{ toYaml .Values.kubeDns.serviceMonitor.dnsmasqRelabelings | indent 4 }} +{{- end }} + - port: http-metrics-skydns + {{- if .Values.kubeDns.serviceMonitor.interval }} + interval: {{ .Values.kubeDns.serviceMonitor.interval }} + {{- end }} + bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token +{{- if .Values.kubeDns.serviceMonitor.metricRelabelings }} + metricRelabelings: +{{ tpl (toYaml .Values.kubeDns.serviceMonitor.metricRelabelings | indent 4) . }} +{{- end }} +{{- if .Values.kubeDns.serviceMonitor.relabelings }} + relabelings: +{{ tpl (toYaml .Values.kubeDns.serviceMonitor.relabelings | indent 4) . }} +{{- end }} +{{- end }} diff --git a/charts/otel-cloud-stack/templates/exporters/kube-etcd/endpoints.yaml b/charts/otel-cloud-stack/templates/exporters/kube-etcd/endpoints.yaml new file mode 100644 index 000000000..2584d0064 --- /dev/null +++ b/charts/otel-cloud-stack/templates/exporters/kube-etcd/endpoints.yaml @@ -0,0 +1,20 @@ +{{- if and .Values.kubeEtcd.enabled .Values.kubeEtcd.endpoints .Values.kubernetesServiceMonitors.enabled }} +apiVersion: v1 +kind: Endpoints +metadata: + name: {{ template "otel-cloud-stack.fullname" . }}-kube-etcd + labels: + app: {{ template "otel-cloud-stack.name" . }}-kube-etcd + k8s-app: etcd-server +{{ include "otel-cloud-stack.labels" . | indent 4 }} + namespace: kube-system +subsets: + - addresses: + {{- range .Values.kubeEtcd.endpoints }} + - ip: {{ . }} + {{- end }} + ports: + - name: {{ .Values.kubeEtcd.serviceMonitor.port }} + port: {{ .Values.kubeEtcd.service.port }} + protocol: TCP +{{- end }} diff --git a/charts/otel-cloud-stack/templates/exporters/kube-etcd/service.yaml b/charts/otel-cloud-stack/templates/exporters/kube-etcd/service.yaml new file mode 100644 index 000000000..5ec64e693 --- /dev/null +++ b/charts/otel-cloud-stack/templates/exporters/kube-etcd/service.yaml @@ -0,0 +1,27 @@ +{{- if and .Values.kubeEtcd.enabled .Values.kubeEtcd.service.enabled .Values.kubernetesServiceMonitors.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ template "otel-cloud-stack.fullname" . }}-kube-etcd + labels: + app: {{ template "otel-cloud-stack.name" . }}-kube-etcd + jobLabel: kube-etcd +{{ include "otel-cloud-stack.labels" . | indent 4 }} + namespace: kube-system +spec: + clusterIP: None + ports: + - name: {{ .Values.kubeEtcd.serviceMonitor.port }} + port: {{ .Values.kubeEtcd.service.port }} + protocol: TCP + targetPort: {{ .Values.kubeEtcd.service.targetPort }} +{{- if .Values.kubeEtcd.endpoints }}{{- else }} + selector: + {{- if .Values.kubeEtcd.service.selector }} +{{ toYaml .Values.kubeEtcd.service.selector | indent 4 }} + {{- else}} + component: etcd + {{- end}} +{{- end }} + type: ClusterIP +{{- end -}} diff --git a/charts/otel-cloud-stack/templates/exporters/kube-etcd/servicemonitor.yaml b/charts/otel-cloud-stack/templates/exporters/kube-etcd/servicemonitor.yaml new file mode 100644 index 000000000..dcf017e3b --- /dev/null +++ b/charts/otel-cloud-stack/templates/exporters/kube-etcd/servicemonitor.yaml @@ -0,0 +1,65 @@ +{{- if and .Values.kubeEtcd.enabled .Values.kubeEtcd.serviceMonitor.enabled .Values.kubernetesServiceMonitors.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template "otel-cloud-stack.fullname" . }}-kube-etcd + {{- if .Values.prometheus.ignoreNamespaceSelectors }} + namespace: kube-system + {{- else }} + namespace: {{ template "otel-cloud-stack.namespace" . }} + {{- end }} + labels: + app: {{ template "otel-cloud-stack.name" . }}-kube-etcd + {{- with .Values.kubeEtcd.serviceMonitor.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +{{ include "otel-cloud-stack.labels" . | indent 4 }} +spec: + jobLabel: {{ .Values.kubeEtcd.serviceMonitor.jobLabel }} + {{- include "servicemonitor.scrapeLimits" .Values.kubeEtcd.serviceMonitor | nindent 4 }} + selector: + {{- if .Values.kubeEtcd.serviceMonitor.selector }} + {{ tpl (toYaml .Values.kubeEtcd.serviceMonitor.selector | nindent 4) . }} + {{- else }} + matchLabels: + app: {{ template "otel-cloud-stack.name" . }}-kube-etcd + release: {{ $.Release.Name | quote }} + {{- end }} + namespaceSelector: + matchNames: + - "kube-system" + endpoints: + - port: {{ .Values.kubeEtcd.serviceMonitor.port }} + {{- if .Values.kubeEtcd.serviceMonitor.interval }} + interval: {{ .Values.kubeEtcd.serviceMonitor.interval }} + {{- end }} + bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token + {{- if .Values.kubeEtcd.serviceMonitor.proxyUrl }} + proxyUrl: {{ .Values.kubeEtcd.serviceMonitor.proxyUrl}} + {{- end }} + {{- if eq .Values.kubeEtcd.serviceMonitor.scheme "https" }} + scheme: https + tlsConfig: + {{- if .Values.kubeEtcd.serviceMonitor.serverName }} + serverName: {{ .Values.kubeEtcd.serviceMonitor.serverName }} + {{- end }} + {{- if .Values.kubeEtcd.serviceMonitor.caFile }} + caFile: {{ .Values.kubeEtcd.serviceMonitor.caFile }} + {{- end }} + {{- if .Values.kubeEtcd.serviceMonitor.certFile }} + certFile: {{ .Values.kubeEtcd.serviceMonitor.certFile }} + {{- end }} + {{- if .Values.kubeEtcd.serviceMonitor.keyFile }} + keyFile: {{ .Values.kubeEtcd.serviceMonitor.keyFile }} + {{- end}} + insecureSkipVerify: {{ .Values.kubeEtcd.serviceMonitor.insecureSkipVerify }} + {{- end }} +{{- if .Values.kubeEtcd.serviceMonitor.metricRelabelings }} + metricRelabelings: +{{ tpl (toYaml .Values.kubeEtcd.serviceMonitor.metricRelabelings | indent 4) . }} +{{- end }} +{{- if .Values.kubeEtcd.serviceMonitor.relabelings }} + relabelings: +{{ tpl (toYaml .Values.kubeEtcd.serviceMonitor.relabelings | indent 4) . }} +{{- end }} +{{- end }} diff --git a/charts/otel-cloud-stack/templates/exporters/kube-proxy/endpoints.yaml b/charts/otel-cloud-stack/templates/exporters/kube-proxy/endpoints.yaml new file mode 100644 index 000000000..b63d0b536 --- /dev/null +++ b/charts/otel-cloud-stack/templates/exporters/kube-proxy/endpoints.yaml @@ -0,0 +1,20 @@ +{{- if and .Values.kubeProxy.enabled .Values.kubeProxy.endpoints .Values.kubernetesServiceMonitors.enabled }} +apiVersion: v1 +kind: Endpoints +metadata: + name: {{ template "otel-cloud-stack.fullname" . }}-kube-proxy + labels: + app: {{ template "otel-cloud-stack.name" . }}-kube-proxy + k8s-app: kube-proxy +{{ include "otel-cloud-stack.labels" . | indent 4 }} + namespace: kube-system +subsets: + - addresses: + {{- range .Values.kubeProxy.endpoints }} + - ip: {{ . }} + {{- end }} + ports: + - name: {{ .Values.kubeProxy.serviceMonitor.port }} + port: {{ .Values.kubeProxy.service.port }} + protocol: TCP +{{- end }} diff --git a/charts/otel-cloud-stack/templates/exporters/kube-proxy/service.yaml b/charts/otel-cloud-stack/templates/exporters/kube-proxy/service.yaml new file mode 100644 index 000000000..f1ee3591e --- /dev/null +++ b/charts/otel-cloud-stack/templates/exporters/kube-proxy/service.yaml @@ -0,0 +1,27 @@ +{{- if and .Values.kubeProxy.enabled .Values.kubeProxy.service.enabled .Values.kubernetesServiceMonitors.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ template "otel-cloud-stack.fullname" . }}-kube-proxy + labels: + app: {{ template "otel-cloud-stack.name" . }}-kube-proxy + jobLabel: kube-proxy +{{ include "otel-cloud-stack.labels" . | indent 4 }} + namespace: kube-system +spec: + clusterIP: None + ports: + - name: {{ .Values.kubeProxy.serviceMonitor.port }} + port: {{ .Values.kubeProxy.service.port }} + protocol: TCP + targetPort: {{ .Values.kubeProxy.service.targetPort }} +{{- if .Values.kubeProxy.endpoints }}{{- else }} + selector: + {{- if .Values.kubeProxy.service.selector }} +{{ toYaml .Values.kubeProxy.service.selector | indent 4 }} + {{- else}} + k8s-app: kube-proxy + {{- end}} +{{- end }} + type: ClusterIP +{{- end -}} diff --git a/charts/otel-cloud-stack/templates/exporters/kube-proxy/servicemonitor.yaml b/charts/otel-cloud-stack/templates/exporters/kube-proxy/servicemonitor.yaml new file mode 100644 index 000000000..c2effe178 --- /dev/null +++ b/charts/otel-cloud-stack/templates/exporters/kube-proxy/servicemonitor.yaml @@ -0,0 +1,53 @@ +{{- if and .Values.kubeProxy.enabled .Values.kubeProxy.serviceMonitor.enabled .Values.kubernetesServiceMonitors.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template "otel-cloud-stack.fullname" . }}-kube-proxy + {{- if .Values.prometheus.ignoreNamespaceSelectors }} + namespace: kube-system + {{- else }} + namespace: {{ template "otel-cloud-stack.namespace" . }} + {{- end }} + labels: + app: {{ template "otel-cloud-stack.name" . }}-kube-proxy + {{- with .Values.kubeProxy.serviceMonitor.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +{{ include "otel-cloud-stack.labels" . | indent 4 }} +spec: + jobLabel: {{ .Values.kubeProxy.serviceMonitor.jobLabel }} + {{- include "servicemonitor.scrapeLimits" .Values.kubeProxy.serviceMonitor | nindent 2 }} + selector: + {{- if .Values.kubeProxy.serviceMonitor.selector }} + {{ tpl (toYaml .Values.kubeProxy.serviceMonitor.selector | nindent 4) . }} + {{- else }} + matchLabels: + app: {{ template "otel-cloud-stack.name" . }}-kube-proxy + release: {{ $.Release.Name | quote }} + {{- end }} + namespaceSelector: + matchNames: + - "kube-system" + endpoints: + - port: {{ .Values.kubeProxy.serviceMonitor.port }} + {{- if .Values.kubeProxy.serviceMonitor.interval }} + interval: {{ .Values.kubeProxy.serviceMonitor.interval }} + {{- end }} + bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token + {{- if .Values.kubeProxy.serviceMonitor.proxyUrl }} + proxyUrl: {{ .Values.kubeProxy.serviceMonitor.proxyUrl}} + {{- end }} + {{- if .Values.kubeProxy.serviceMonitor.https }} + scheme: https + tlsConfig: + caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt + {{- end}} +{{- if .Values.kubeProxy.serviceMonitor.metricRelabelings }} + metricRelabelings: +{{ tpl (toYaml .Values.kubeProxy.serviceMonitor.metricRelabelings | indent 4) . }} +{{- end }} +{{- if .Values.kubeProxy.serviceMonitor.relabelings }} + relabelings: +{{ tpl (toYaml .Values.kubeProxy.serviceMonitor.relabelings | indent 4) . }} +{{- end }} +{{- end }} diff --git a/charts/otel-cloud-stack/templates/exporters/kube-scheduler/endpoints.yaml b/charts/otel-cloud-stack/templates/exporters/kube-scheduler/endpoints.yaml new file mode 100644 index 000000000..a886b30c1 --- /dev/null +++ b/charts/otel-cloud-stack/templates/exporters/kube-scheduler/endpoints.yaml @@ -0,0 +1,22 @@ +{{- if and .Values.kubeScheduler.enabled .Values.kubeScheduler.endpoints .Values.kubernetesServiceMonitors.enabled }} +apiVersion: v1 +kind: Endpoints +metadata: + name: {{ template "otel-cloud-stack.fullname" . }}-kube-scheduler + labels: + app: {{ template "otel-cloud-stack.name" . }}-kube-scheduler + k8s-app: kube-scheduler +{{ include "otel-cloud-stack.labels" . | indent 4 }} + namespace: kube-system +subsets: + - addresses: + {{- range .Values.kubeScheduler.endpoints }} + - ip: {{ . }} + {{- end }} + ports: + - name: {{ .Values.kubeScheduler.serviceMonitor.port }} + {{- $kubeSchedulerDefaultInsecurePort := 10251 }} + {{- $kubeSchedulerDefaultSecurePort := 10259 }} + port: {{ include "otel-cloud-stack.kubeScheduler.insecureScrape" (list . $kubeSchedulerDefaultInsecurePort $kubeSchedulerDefaultSecurePort .Values.kubeScheduler.service.port) }} + protocol: TCP +{{- end }} diff --git a/charts/otel-cloud-stack/templates/exporters/kube-scheduler/service.yaml b/charts/otel-cloud-stack/templates/exporters/kube-scheduler/service.yaml new file mode 100644 index 000000000..05fbb6981 --- /dev/null +++ b/charts/otel-cloud-stack/templates/exporters/kube-scheduler/service.yaml @@ -0,0 +1,29 @@ +{{- if and .Values.kubeScheduler.enabled .Values.kubeScheduler.service.enabled .Values.kubernetesServiceMonitors.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ template "otel-cloud-stack.fullname" . }}-kube-scheduler + labels: + app: {{ template "otel-cloud-stack.name" . }}-kube-scheduler + jobLabel: kube-scheduler +{{ include "otel-cloud-stack.labels" . | indent 4 }} + namespace: kube-system +spec: + clusterIP: None + ports: + - name: {{ .Values.kubeScheduler.serviceMonitor.port }} + {{- $kubeSchedulerDefaultInsecurePort := 10251 }} + {{- $kubeSchedulerDefaultSecurePort := 10259 }} + port: {{ include "otel-cloud-stack.kubeScheduler.insecureScrape" (list . $kubeSchedulerDefaultInsecurePort $kubeSchedulerDefaultSecurePort .Values.kubeScheduler.service.port) }} + protocol: TCP + targetPort: {{ include "otel-cloud-stack.kubeScheduler.insecureScrape" (list . $kubeSchedulerDefaultInsecurePort $kubeSchedulerDefaultSecurePort .Values.kubeScheduler.service.targetPort) }} +{{- if .Values.kubeScheduler.endpoints }}{{- else }} + selector: + {{- if .Values.kubeScheduler.service.selector }} +{{ toYaml .Values.kubeScheduler.service.selector | indent 4 }} + {{- else}} + component: kube-scheduler + {{- end}} +{{- end }} + type: ClusterIP +{{- end -}} diff --git a/charts/otel-cloud-stack/templates/exporters/kube-scheduler/servicemonitor.yaml b/charts/otel-cloud-stack/templates/exporters/kube-scheduler/servicemonitor.yaml new file mode 100644 index 000000000..44ae0ec2c --- /dev/null +++ b/charts/otel-cloud-stack/templates/exporters/kube-scheduler/servicemonitor.yaml @@ -0,0 +1,59 @@ +{{- if and .Values.kubeScheduler.enabled .Values.kubeScheduler.serviceMonitor.enabled .Values.kubernetesServiceMonitors.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template "otel-cloud-stack.fullname" . }}-kube-scheduler + {{- if .Values.prometheus.ignoreNamespaceSelectors }} + namespace: kube-system + {{- else }} + namespace: {{ template "otel-cloud-stack.namespace" . }} + {{- end }} + labels: + app: {{ template "otel-cloud-stack.name" . }}-kube-scheduler + {{- with .Values.kubeScheduler.serviceMonitor.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +{{ include "otel-cloud-stack.labels" . | indent 4 }} +spec: + jobLabel: {{ .Values.kubeScheduler.serviceMonitor.jobLabel }} + {{- include "servicemonitor.scrapeLimits" .Values.kubeScheduler.serviceMonitor | nindent 2 }} + selector: + {{- if .Values.kubeScheduler.serviceMonitor.selector }} + {{ tpl (toYaml .Values.kubeScheduler.serviceMonitor.selector | nindent 4) . }} + {{- else }} + matchLabels: + app: {{ template "otel-cloud-stack.name" . }}-kube-scheduler + release: {{ $.Release.Name | quote }} + {{- end }} + namespaceSelector: + matchNames: + - "kube-system" + endpoints: + - port: {{ .Values.kubeScheduler.serviceMonitor.port }} + {{- if .Values.kubeScheduler.serviceMonitor.interval }} + interval: {{ .Values.kubeScheduler.serviceMonitor.interval }} + {{- end }} + bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token + {{- if .Values.kubeScheduler.serviceMonitor.proxyUrl }} + proxyUrl: {{ .Values.kubeScheduler.serviceMonitor.proxyUrl}} + {{- end }} + {{- if eq (include "otel-cloud-stack.kubeScheduler.insecureScrape" (list . false true .Values.kubeScheduler.serviceMonitor.https )) "true" }} + scheme: https + tlsConfig: + caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt + {{- if eq (include "otel-cloud-stack.kubeScheduler.insecureScrape" (list . nil true .Values.kubeScheduler.serviceMonitor.insecureSkipVerify)) "true" }} + insecureSkipVerify: true + {{- end }} + {{- if .Values.kubeScheduler.serviceMonitor.serverName }} + serverName: {{ .Values.kubeScheduler.serviceMonitor.serverName }} + {{- end}} + {{- end}} +{{- if .Values.kubeScheduler.serviceMonitor.metricRelabelings }} + metricRelabelings: +{{ tpl (toYaml .Values.kubeScheduler.serviceMonitor.metricRelabelings | indent 4) . }} +{{- end }} +{{- if .Values.kubeScheduler.serviceMonitor.relabelings }} + relabelings: +{{ tpl (toYaml .Values.kubeScheduler.serviceMonitor.relabelings | indent 4) . }} +{{- end }} +{{- end }} diff --git a/charts/otel-cloud-stack/templates/instrumentation.yaml b/charts/otel-cloud-stack/templates/instrumentation.yaml new file mode 100644 index 000000000..b3e8ebcda --- /dev/null +++ b/charts/otel-cloud-stack/templates/instrumentation.yaml @@ -0,0 +1,55 @@ +{{- if .Values.instrumentation.enabled }} +--- +apiVersion: opentelemetry.io/v1alpha1 +kind: Instrumentation +metadata: + name: {{ include "opentelemetry-collector.instrumentation" . }} +spec: + exporter: + endpoint: {{ .Values.instrumentation.exporter.endpoint }} + propagators: + {{- toYaml .Values.instrumentation.propagators | nindent 4 }} + {{- with .Values.instrumentation.sampler }} + sampler: + {{- toYaml . | nindent 4 }} + {{- end }} + env: + {{- with $.Values.extraEnvs }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.instrumentation.env }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.instrumentation.resource }} + resource: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.instrumentation.java }} + java: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with .Values.instrumentation.nodejs }} + nodejs: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with .Values.instrumentation.python }} + python: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with .Values.instrumentation.dotnet }} + dotnet: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with .Values.instrumentation.go }} + go: + {{- toYaml . | nindent 4}} + {{- end }} + {{- with .Values.instrumentation.apacheHttpd }} + apacheHtpd: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.instrumentation.nginx }} + nginx: + {{- toYaml . | nindent 4}} + {{- end }} +{{- end }} diff --git a/charts/otel-cloud-stack/values.schema.json b/charts/otel-cloud-stack/values.schema.json new file mode 100644 index 000000000..4447cc2d3 --- /dev/null +++ b/charts/otel-cloud-stack/values.schema.json @@ -0,0 +1,3949 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/open-telemetry/opentelemetry-operator/apis/v1alpha1/open-telemetry-collector-spec", + "$defs": { + "CoreDNS": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "service": { + "$ref": "#/$defs/CoreDNSService" + }, + "serviceMonitor": { + "$ref": "#/$defs/CoreDNSServiceMonitor" + } + }, + "required": ["enabled", "service", "serviceMonitor"], + "title": "CoreDNS" + }, + "CoreDNSService": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "port": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "targetPort": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "required": ["enabled"], + "title": "CoreDNSService" + }, + "CoreDNSServiceMonitor": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "interval": { + "type": "string" + }, + "sampleLimit": { + "type": "integer" + }, + "targetLimit": { + "type": "integer" + }, + "labelLimit": { + "type": "integer" + }, + "labelNameLengthLimit": { + "type": "integer" + }, + "labelValueLengthLimit": { + "type": "integer" + }, + "proxyUrl": { + "type": "string" + }, + "port": { + "type": "string" + }, + "jobLabel": { + "type": "string" + }, + "selector": { + "$ref": "#/$defs/AdditionalLabels" + }, + "metricRelabelings": { + "type": "array", + "items": {} + }, + "relabelings": { + "type": "array", + "items": {} + }, + "additionalLabels": { + "$ref": "#/$defs/AdditionalLabels" + }, + "https": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "insecureSkipVerify": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "serverName": { + "anyOf": [ + { + "type": "null" + }, + { + "type": "string" + } + ] + }, + "dnsmasqMetricRelabelings": { + "type": "array", + "items": {} + }, + "dnsmasqRelabelings": { + "type": "array", + "items": {} + }, + "scheme": { + "type": "string" + }, + "caFile": { + "type": "string" + }, + "certFile": { + "type": "string" + }, + "keyFile": { + "type": "string" + } + }, + "required": [ + "additionalLabels", + "interval", + "jobLabel", + "labelLimit", + "labelNameLengthLimit", + "labelValueLengthLimit", + "metricRelabelings", + "proxyUrl", + "relabelings", + "sampleLimit", + "selector", + "targetLimit" + ], + "title": "CoreDNSServiceMonitor" + }, + "AdditionalLabels": { + "type": "object", + "additionalProperties": false, + "title": "AdditionalLabels" + }, + "KubeStateMetrics": { + "type": "object", + "additionalProperties": true, + "properties": { + "namespaceOverride": { + "type": "string" + }, + "rbac": { + "$ref": "#/$defs/KubeStateMetricsRbac" + }, + "releaseLabel": { + "type": "boolean" + }, + "prometheus": { + "$ref": "#/$defs/Prometheus" + }, + "selfMonitor": { + "$ref": "#/$defs/KubeStateMetricsClass" + } + }, + "required": [ + "namespaceOverride", + "prometheus", + "rbac", + "releaseLabel", + "selfMonitor" + ], + "title": "KubeStateMetrics" + }, + "Prometheus": { + "type": "object", + "additionalProperties": true, + "properties": { + "monitor": { + "$ref": "#/$defs/Monitor" + } + }, + "required": ["monitor"], + "title": "Prometheus" + }, + "Monitor": { + "type": "object", + "additionalProperties": true, + "properties": { + "enabled": { + "type": "boolean" + }, + "interval": { + "type": "string" + }, + "sampleLimit": { + "type": "integer" + }, + "targetLimit": { + "type": "integer" + }, + "labelLimit": { + "type": "integer" + }, + "labelNameLengthLimit": { + "type": "integer" + }, + "labelValueLengthLimit": { + "type": "integer" + }, + "scrapeTimeout": { + "type": "string" + }, + "proxyUrl": { + "type": "string" + }, + "honorLabels": { + "type": "boolean" + }, + "metricRelabelings": { + "type": "array", + "items": { + "$ref": "#/$defs/MetricRelabeling" + } + }, + "relabelings": { + "type": "array", + "items": {} + }, + "jobLabel": { + "type": "string" + }, + "selector": { + "$ref": "#/$defs/Selector" + }, + "additionalLabels": { + "$ref": "#/$defs/AdditionalLabels" + } + }, + "required": [ + "interval", + "labelLimit", + "labelNameLengthLimit", + "labelValueLengthLimit", + "metricRelabelings", + "proxyUrl", + "relabelings", + "sampleLimit", + "targetLimit" + ], + "title": "Monitor" + }, + "MetricRelabeling": { + "type": "object", + "additionalProperties": false, + "properties": { + "action": { + "type": "string" + }, + "regex": { + "type": "string" + }, + "sourceLabels": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["action", "regex", "sourceLabels"], + "title": "MetricRelabeling" + }, + "Selector": { + "type": "object", + "additionalProperties": false, + "properties": { + "matchLabels": { + "$ref": "#/$defs/MatchLabels" + } + }, + "required": ["matchLabels"], + "title": "Selector" + }, + "MatchLabels": { + "type": "object", + "additionalProperties": false, + "properties": { + "component": { + "type": "string" + }, + "provider": { + "type": "string" + } + }, + "required": ["component", "provider"], + "title": "MatchLabels" + }, + "KubeStateMetricsRbac": { + "type": "object", + "additionalProperties": true, + "properties": { + "create": { + "type": "boolean" + } + }, + "required": ["create"], + "title": "KubeStateMetricsRbac" + }, + "KubeStateMetricsClass": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + } + }, + "required": ["enabled"], + "title": "KubeStateMetricsClass" + }, + "KubeAPIServer": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "tlsConfig": { + "$ref": "#/$defs/TLSConfig" + }, + "serviceMonitor": { + "$ref": "#/$defs/Monitor" + } + }, + "required": ["enabled", "serviceMonitor", "tlsConfig"], + "title": "KubeAPIServer" + }, + "TLSConfig": { + "type": "object", + "additionalProperties": false, + "properties": { + "serverName": { + "type": "string" + }, + "insecureSkipVerify": { + "type": "boolean" + } + }, + "required": ["insecureSkipVerify", "serverName"], + "title": "TLSConfig" + }, + "Kube": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "endpoints": { + "type": "array", + "items": {} + }, + "service": { + "$ref": "#/$defs/CoreDNSService" + }, + "serviceMonitor": { + "$ref": "#/$defs/CoreDNSServiceMonitor" + } + }, + "required": ["enabled", "endpoints", "service", "serviceMonitor"], + "title": "Kube" + }, + "KubeDNS": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "service": { + "$ref": "#/$defs/KubeDNSService" + }, + "serviceMonitor": { + "$ref": "#/$defs/CoreDNSServiceMonitor" + } + }, + "required": ["enabled", "service", "serviceMonitor"], + "title": "KubeDNS" + }, + "KubeDNSService": { + "type": "object", + "additionalProperties": false, + "properties": { + "dnsmasq": { + "$ref": "#/$defs/Dnsmasq" + }, + "skydns": { + "$ref": "#/$defs/Dnsmasq" + } + }, + "required": ["dnsmasq", "skydns"], + "title": "KubeDNSService" + }, + "Dnsmasq": { + "type": "object", + "additionalProperties": false, + "properties": { + "port": { + "type": "integer" + }, + "targetPort": { + "type": "integer" + } + }, + "required": ["port", "targetPort"], + "title": "Dnsmasq" + }, + "Kubelet": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "namespace": { + "type": "string" + }, + "serviceMonitor": { + "$ref": "#/$defs/KubeletServiceMonitor" + } + }, + "required": ["enabled", "namespace", "serviceMonitor"], + "title": "Kubelet" + }, + "KubeletServiceMonitor": { + "type": "object", + "additionalProperties": false, + "properties": { + "attachMetadata": { + "$ref": "#/$defs/AttachMetadata" + }, + "interval": { + "type": "string" + }, + "honorLabels": { + "type": "boolean" + }, + "honorTimestamps": { + "type": "boolean" + }, + "https": { + "type": "boolean" + }, + "cAdvisor": { + "type": "boolean" + }, + "probes": { + "type": "boolean" + } + }, + "required": [ + "cAdvisor", + "honorLabels", + "honorTimestamps", + "https", + "interval", + "probes" + ], + "title": "KubeletServiceMonitor" + }, + "AttachMetadata": { + "type": "object", + "additionalProperties": false, + "properties": { + "node": { + "type": "boolean" + } + }, + "required": ["node"], + "title": "AttachMetadata" + }, + "Relabeling": { + "type": "object", + "additionalProperties": false, + "properties": { + "action": { + "type": "string" + }, + "sourceLabels": { + "type": "array", + "items": { + "type": "string" + } + }, + "targetLabel": { + "type": "string" + } + }, + "required": ["action", "sourceLabels", "targetLabel"], + "title": "Relabeling" + }, + "NodeExporter": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "operatingSystems": { + "$ref": "#/$defs/OperatingSystems" + }, + "forceDeployDashboards": { + "type": "boolean" + } + }, + "required": ["enabled", "forceDeployDashboards", "operatingSystems"], + "title": "NodeExporter" + }, + "OperatingSystems": { + "type": "object", + "additionalProperties": false, + "properties": { + "linux": { + "$ref": "#/$defs/KubeStateMetricsClass" + }, + "darwin": { + "$ref": "#/$defs/KubeStateMetricsClass" + } + }, + "required": ["darwin", "linux"], + "title": "OperatingSystems" + }, + "PrometheusNodeExporter": { + "type": "object", + "additionalProperties": true, + "properties": { + "namespaceOverride": { + "type": "string" + }, + "podLabels": { + "$ref": "#/$defs/PodLabels" + }, + "releaseLabel": { + "type": "boolean" + }, + "extraArgs": { + "type": "array", + "items": { + "type": "string" + } + }, + "service": { + "$ref": "#/$defs/PrometheusNodeExporterService" + }, + "prometheus": { + "$ref": "#/$defs/Prometheus" + }, + "rbac": { + "$ref": "#/$defs/PrometheusNodeExporterRbac" + } + }, + "required": [ + "extraArgs", + "namespaceOverride", + "podLabels", + "prometheus", + "rbac", + "releaseLabel", + "service" + ], + "title": "PrometheusNodeExporter" + }, + "PodLabels": { + "type": "object", + "additionalProperties": false, + "properties": { + "jobLabel": { + "type": "string" + } + }, + "required": ["jobLabel"], + "title": "PodLabels" + }, + "PrometheusNodeExporterRbac": { + "type": "object", + "additionalProperties": true, + "properties": { + "pspEnabled": { + "type": "boolean" + } + }, + "required": ["pspEnabled"], + "title": "PrometheusNodeExporterRbac" + }, + "PrometheusNodeExporterService": { + "type": "object", + "additionalProperties": true, + "properties": { + "portName": { + "type": "string" + } + }, + "required": ["portName"], + "title": "PrometheusNodeExporterService" + }, + "AWSElasticBlockStoreVolumeSource": { + "properties": { + "volumeID": { + "type": "string" + }, + "fsType": { + "type": "string" + }, + "partition": { + "type": "integer" + }, + "readOnly": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["volumeID"] + }, + "Affinity": { + "properties": { + "nodeAffinity": { + "$ref": "#/$defs/NodeAffinity" + }, + "podAffinity": { + "$ref": "#/$defs/PodAffinity" + }, + "podAntiAffinity": { + "$ref": "#/$defs/PodAntiAffinity" + } + }, + "additionalProperties": false, + "type": "object" + }, + "AutoscalerSpec": { + "properties": { + "minReplicas": { + "type": "integer" + }, + "maxReplicas": { + "type": "integer" + }, + "behavior": { + "$ref": "#/$defs/HorizontalPodAutoscalerBehavior" + }, + "metrics": { + "items": { + "$ref": "#/$defs/MetricSpec" + }, + "type": "array" + }, + "targetCPUUtilization": { + "type": "integer" + }, + "targetMemoryUtilization": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object" + }, + "AzureDiskVolumeSource": { + "properties": { + "diskName": { + "type": "string" + }, + "diskURI": { + "type": "string" + }, + "cachingMode": { + "type": "string" + }, + "fsType": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + }, + "kind": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["diskName", "diskURI"] + }, + "AzureFileVolumeSource": { + "properties": { + "secretName": { + "type": "string" + }, + "shareName": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["secretName", "shareName"] + }, + "CSIVolumeSource": { + "properties": { + "driver": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + }, + "fsType": { + "type": "string" + }, + "volumeAttributes": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "nodePublishSecretRef": { + "$ref": "#/$defs/LocalObjectReference" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["driver"] + }, + "Capabilities": { + "properties": { + "add": { + "items": { + "type": "string" + }, + "type": "array" + }, + "drop": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "CephFSVolumeSource": { + "properties": { + "monitors": { + "items": { + "type": "string" + }, + "type": "array" + }, + "path": { + "type": "string" + }, + "user": { + "type": "string" + }, + "secretFile": { + "type": "string" + }, + "secretRef": { + "$ref": "#/$defs/LocalObjectReference" + }, + "readOnly": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["monitors"] + }, + "CinderVolumeSource": { + "properties": { + "volumeID": { + "type": "string" + }, + "fsType": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + }, + "secretRef": { + "$ref": "#/$defs/LocalObjectReference" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["volumeID"] + }, + "ClusterTrustBundleProjection": { + "properties": { + "name": { + "type": "string" + }, + "signerName": { + "type": "string" + }, + "labelSelector": { + "$ref": "#/$defs/LabelSelector" + }, + "optional": { + "type": "boolean" + }, + "path": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["path"] + }, + "ConfigMapEnvSource": { + "properties": { + "name": { + "type": "string" + }, + "optional": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ConfigMapKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + }, + "optional": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["key"] + }, + "ConfigMapProjection": { + "properties": { + "name": { + "type": "string" + }, + "items": { + "items": { + "$ref": "#/$defs/KeyToPath" + }, + "type": "array" + }, + "optional": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ConfigMapVolumeSource": { + "properties": { + "name": { + "type": "string" + }, + "items": { + "items": { + "$ref": "#/$defs/KeyToPath" + }, + "type": "array" + }, + "defaultMode": { + "type": "integer" + }, + "optional": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ConfigMapsSpec": { + "properties": { + "name": { + "type": "string" + }, + "mountPath": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["name", "mountPath"] + }, + "Container": { + "properties": { + "name": { + "type": "string" + }, + "image": { + "type": "string" + }, + "command": { + "items": { + "type": "string" + }, + "type": "array" + }, + "args": { + "items": { + "type": "string" + }, + "type": "array" + }, + "workingDir": { + "type": "string" + }, + "ports": { + "items": { + "$ref": "#/$defs/ContainerPort" + }, + "type": "array" + }, + "envFrom": { + "items": { + "$ref": "#/$defs/EnvFromSource" + }, + "type": "array" + }, + "env": { + "items": { + "$ref": "#/$defs/EnvVar" + }, + "type": "array" + }, + "resources": { + "$ref": "#/$defs/ResourceRequirements" + }, + "resizePolicy": { + "items": { + "$ref": "#/$defs/ContainerResizePolicy" + }, + "type": "array" + }, + "restartPolicy": { + "type": "string" + }, + "volumeMounts": { + "items": { + "$ref": "#/$defs/VolumeMount" + }, + "type": "array" + }, + "volumeDevices": { + "items": { + "$ref": "#/$defs/VolumeDevice" + }, + "type": "array" + }, + "livenessProbe": { + "$ref": "#/$defs/Probe" + }, + "readinessProbe": { + "$ref": "#/$defs/Probe" + }, + "startupProbe": { + "$ref": "#/$defs/Probe" + }, + "lifecycle": { + "$ref": "#/$defs/Lifecycle" + }, + "terminationMessagePath": { + "type": "string" + }, + "terminationMessagePolicy": { + "type": "string" + }, + "imagePullPolicy": { + "type": "string" + }, + "securityContext": { + "$ref": "#/$defs/SecurityContext" + }, + "stdin": { + "type": "boolean" + }, + "stdinOnce": { + "type": "boolean" + }, + "tty": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["name"] + }, + "ContainerPort": { + "properties": { + "name": { + "type": "string" + }, + "hostPort": { + "type": "integer" + }, + "containerPort": { + "type": "integer" + }, + "protocol": { + "type": "string" + }, + "hostIP": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["containerPort"] + }, + "ContainerResizePolicy": { + "properties": { + "resourceName": { + "type": "string" + }, + "restartPolicy": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["resourceName", "restartPolicy"] + }, + "DaemonSetUpdateStrategy": { + "properties": { + "type": { + "type": "string" + }, + "rollingUpdate": { + "$ref": "#/$defs/RollingUpdateDaemonSet" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DeploymentStrategy": { + "properties": { + "type": { + "type": "string" + }, + "rollingUpdate": { + "$ref": "#/$defs/RollingUpdateDeployment" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DownwardAPIProjection": { + "properties": { + "items": { + "items": { + "$ref": "#/$defs/DownwardAPIVolumeFile" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DownwardAPIVolumeFile": { + "properties": { + "path": { + "type": "string" + }, + "fieldRef": { + "$ref": "#/$defs/ObjectFieldSelector" + }, + "resourceFieldRef": { + "$ref": "#/$defs/ResourceFieldSelector" + }, + "mode": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["path"] + }, + "DownwardAPIVolumeSource": { + "properties": { + "items": { + "items": { + "$ref": "#/$defs/DownwardAPIVolumeFile" + }, + "type": "array" + }, + "defaultMode": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EmptyDirVolumeSource": { + "properties": { + "medium": { + "type": "string" + }, + "sizeLimit": { + "$ref": "#/$defs/Quantity" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvFromSource": { + "properties": { + "prefix": { + "type": "string" + }, + "configMapRef": { + "$ref": "#/$defs/ConfigMapEnvSource" + }, + "secretRef": { + "$ref": "#/$defs/SecretEnvSource" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVar": { + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueFrom": { + "$ref": "#/$defs/EnvVarSource" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["name"] + }, + "EnvVarSource": { + "properties": { + "fieldRef": { + "$ref": "#/$defs/ObjectFieldSelector" + }, + "resourceFieldRef": { + "$ref": "#/$defs/ResourceFieldSelector" + }, + "configMapKeyRef": { + "$ref": "#/$defs/ConfigMapKeySelector" + }, + "secretKeyRef": { + "$ref": "#/$defs/SecretKeySelector" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EphemeralVolumeSource": { + "properties": { + "volumeClaimTemplate": { + "$ref": "#/$defs/PersistentVolumeClaimTemplate" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ExecAction": { + "properties": { + "command": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "FCVolumeSource": { + "properties": { + "targetWWNs": { + "items": { + "type": "string" + }, + "type": "array" + }, + "lun": { + "type": "integer" + }, + "fsType": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + }, + "wwids": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "FieldsV1": { + "properties": {}, + "additionalProperties": false, + "type": "object" + }, + "FlexVolumeSource": { + "properties": { + "driver": { + "type": "string" + }, + "fsType": { + "type": "string" + }, + "secretRef": { + "$ref": "#/$defs/LocalObjectReference" + }, + "readOnly": { + "type": "boolean" + }, + "options": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["driver"] + }, + "FlockerVolumeSource": { + "properties": { + "datasetName": { + "type": "string" + }, + "datasetUUID": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "GCEPersistentDiskVolumeSource": { + "properties": { + "pdName": { + "type": "string" + }, + "fsType": { + "type": "string" + }, + "partition": { + "type": "integer" + }, + "readOnly": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["pdName"] + }, + "GitRepoVolumeSource": { + "properties": { + "repository": { + "type": "string" + }, + "revision": { + "type": "string" + }, + "directory": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["repository"] + }, + "GlusterfsVolumeSource": { + "properties": { + "endpoints": { + "type": "string" + }, + "path": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["endpoints", "path"] + }, + "HPAScalingPolicy": { + "properties": { + "type": { + "type": "string" + }, + "value": { + "type": "integer" + }, + "periodSeconds": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["type", "value", "periodSeconds"] + }, + "HPAScalingRules": { + "properties": { + "stabilizationWindowSeconds": { + "type": "integer" + }, + "selectPolicy": { + "type": "string" + }, + "policies": { + "items": { + "$ref": "#/$defs/HPAScalingPolicy" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "HTTPGetAction": { + "properties": { + "path": { + "type": "string" + }, + "port": { + "type": ["string", "integer"] + }, + "host": { + "type": "string" + }, + "scheme": { + "type": "string" + }, + "httpHeaders": { + "items": { + "$ref": "#/$defs/HTTPHeader" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["port"] + }, + "HTTPHeader": { + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["name", "value"] + }, + "HorizontalPodAutoscalerBehavior": { + "properties": { + "scaleUp": { + "$ref": "#/$defs/HPAScalingRules" + }, + "scaleDown": { + "$ref": "#/$defs/HPAScalingRules" + } + }, + "additionalProperties": false, + "type": "object" + }, + "HostPathVolumeSource": { + "properties": { + "path": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["path"] + }, + "ISCSIVolumeSource": { + "properties": { + "targetPortal": { + "type": "string" + }, + "iqn": { + "type": "string" + }, + "lun": { + "type": "integer" + }, + "iscsiInterface": { + "type": "string" + }, + "fsType": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + }, + "portals": { + "items": { + "type": "string" + }, + "type": "array" + }, + "chapAuthDiscovery": { + "type": "boolean" + }, + "chapAuthSession": { + "type": "boolean" + }, + "secretRef": { + "$ref": "#/$defs/LocalObjectReference" + }, + "initiatorName": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["targetPortal", "iqn", "lun"] + }, + "Ingress": { + "properties": { + "type": { + "type": "string" + }, + "ruleType": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "annotations": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "tls": { + "items": { + "$ref": "#/$defs/IngressTLS" + }, + "type": "array" + }, + "ingressClassName": { + "type": "string" + }, + "route": { + "$ref": "#/$defs/OpenShiftRoute" + } + }, + "additionalProperties": false, + "type": "object" + }, + "IngressTLS": { + "properties": { + "hosts": { + "items": { + "type": "string" + }, + "type": "array" + }, + "secretName": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "IntOrString": { + "properties": { + "Type": { + "type": "integer" + }, + "IntVal": { + "type": "integer" + }, + "StrVal": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["Type", "IntVal", "StrVal"] + }, + "KeyToPath": { + "properties": { + "key": { + "type": "string" + }, + "path": { + "type": "string" + }, + "mode": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["key", "path"] + }, + "LabelSelector": { + "properties": { + "matchLabels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "matchExpressions": { + "items": { + "$ref": "#/$defs/LabelSelectorRequirement" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LabelSelectorRequirement": { + "properties": { + "key": { + "type": "string" + }, + "operator": { + "type": "string" + }, + "values": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["key", "operator"] + }, + "Lifecycle": { + "properties": { + "postStart": { + "$ref": "#/$defs/LifecycleHandler" + }, + "preStop": { + "$ref": "#/$defs/LifecycleHandler" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LifecycleHandler": { + "properties": { + "exec": { + "$ref": "#/$defs/ExecAction" + }, + "httpGet": { + "$ref": "#/$defs/HTTPGetAction" + }, + "tcpSocket": { + "$ref": "#/$defs/TCPSocketAction" + }, + "sleep": { + "$ref": "#/$defs/SleepAction" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LocalObjectReference": { + "properties": { + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ManagedFieldsEntry": { + "properties": { + "manager": { + "type": "string" + }, + "operation": { + "type": "string" + }, + "apiVersion": { + "type": "string" + }, + "time": { + "$ref": "#/$defs/Time" + }, + "fieldsType": { + "type": "string" + }, + "fieldsV1": { + "$ref": "#/$defs/FieldsV1" + }, + "subresource": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "MetricIdentifier": { + "properties": { + "name": { + "type": "string" + }, + "selector": { + "$ref": "#/$defs/LabelSelector" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["name"] + }, + "MetricSpec": { + "properties": { + "type": { + "type": "string" + }, + "pods": { + "$ref": "#/$defs/PodsMetricSource" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["type"] + }, + "MetricTarget": { + "properties": { + "type": { + "type": "string" + }, + "value": { + "$ref": "#/$defs/Quantity" + }, + "averageValue": { + "$ref": "#/$defs/Quantity" + }, + "averageUtilization": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["type"] + }, + "MetricsConfigSpec": { + "properties": { + "enableMetrics": { + "type": "boolean" + }, + "DisablePrometheusAnnotations": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ModifyVolumeStatus": { + "properties": { + "targetVolumeAttributesClassName": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["status"] + }, + "NFSVolumeSource": { + "properties": { + "server": { + "type": "string" + }, + "path": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["server", "path"] + }, + "NodeAffinity": { + "properties": { + "requiredDuringSchedulingIgnoredDuringExecution": { + "$ref": "#/$defs/NodeSelector" + }, + "preferredDuringSchedulingIgnoredDuringExecution": { + "items": { + "$ref": "#/$defs/PreferredSchedulingTerm" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "NodeSelector": { + "properties": { + "nodeSelectorTerms": { + "items": { + "$ref": "#/$defs/NodeSelectorTerm" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["nodeSelectorTerms"] + }, + "NodeSelectorRequirement": { + "properties": { + "key": { + "type": "string" + }, + "operator": { + "type": "string" + }, + "values": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["key", "operator"] + }, + "NodeSelectorTerm": { + "properties": { + "matchExpressions": { + "items": { + "$ref": "#/$defs/NodeSelectorRequirement" + }, + "type": "array" + }, + "matchFields": { + "items": { + "$ref": "#/$defs/NodeSelectorRequirement" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ObjectFieldSelector": { + "properties": { + "apiVersion": { + "type": "string" + }, + "fieldPath": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["fieldPath"] + }, + "ObjectMeta": { + "properties": { + "name": { + "type": "string" + }, + "generateName": { + "type": "string" + }, + "namespace": { + "type": "string" + }, + "selfLink": { + "type": "string" + }, + "uid": { + "type": "string" + }, + "resourceVersion": { + "type": "string" + }, + "generation": { + "type": "integer" + }, + "creationTimestamp": { + "$ref": "#/$defs/Time" + }, + "deletionTimestamp": { + "$ref": "#/$defs/Time" + }, + "deletionGracePeriodSeconds": { + "type": "integer" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "annotations": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "ownerReferences": { + "items": { + "$ref": "#/$defs/OwnerReference" + }, + "type": "array" + }, + "finalizers": { + "items": { + "type": "string" + }, + "type": "array" + }, + "managedFields": { + "items": { + "$ref": "#/$defs/ManagedFieldsEntry" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ObservabilitySpec": { + "properties": { + "metrics": { + "$ref": "#/$defs/MetricsConfigSpec" + } + }, + "additionalProperties": false, + "type": "object" + }, + "OpenShiftRoute": { + "properties": { + "termination": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "OpenTelemetryCollectorSpec": { + "properties": { + "enabled": { + "type": "boolean" + }, + "clusterRoleBinding": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": "true" + }, + "clusterRoleName": { + "type": "string" + } + } + }, + "name": { + "type": "string" + }, + "annotations": { + "type": "object" + }, + "labels": { + "type": "object" + }, + "managementState": { + "type": "string" + }, + "scrape_configs_file": { + "type": "string", + "default": "" + }, + "resources": { + "$ref": "#/$defs/ResourceRequirements" + }, + "nodeSelector": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "args": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "replicas": { + "type": "integer" + }, + "minReplicas": { + "type": "integer" + }, + "maxReplicas": { + "type": "integer" + }, + "autoscaler": { + "$ref": "#/$defs/AutoscalerSpec" + }, + "podDisruptionBudget": { + "$ref": "#/$defs/PodDisruptionBudgetSpec" + }, + "securityContext": { + "$ref": "#/$defs/SecurityContext" + }, + "podSecurityContext": { + "$ref": "#/$defs/PodSecurityContext" + }, + "podAnnotations": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "targetAllocator": { + "$ref": "#/$defs/OpenTelemetryTargetAllocator" + }, + "mode": { + "type": "string" + }, + "serviceAccount": { + "type": "string" + }, + "image": { + "description": "Image use in both standalone and agent configs", + "type": "object", + "additionalProperties": false, + "properties": { + "registry": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "digest": { + "type": "string" + }, + "pullPolicy": { + "type": "string", + "enum": ["IfNotPresent", "Always", "Never"] + } + } + }, + "upgradeStrategy": { + "type": "string" + }, + "config": { + "type": "object" + }, + "volumeMounts": { + "items": { + "$ref": "#/$defs/VolumeMount" + }, + "type": "array" + }, + "ports": { + "items": { + "$ref": "#/$defs/ServicePort" + }, + "type": "array" + }, + "env": { + "items": { + "$ref": "#/$defs/EnvVar" + }, + "type": "array" + }, + "envFrom": { + "items": { + "$ref": "#/$defs/EnvFromSource" + }, + "type": "array" + }, + "volumeClaimTemplates": { + "items": { + "$ref": "#/$defs/PersistentVolumeClaim" + }, + "type": "array" + }, + "tolerations": { + "items": { + "$ref": "#/$defs/Toleration" + }, + "type": "array" + }, + "volumes": { + "items": { + "$ref": "#/$defs/Volume" + }, + "type": "array" + }, + "ingress": { + "$ref": "#/$defs/Ingress" + }, + "hostNetwork": { + "type": "boolean" + }, + "shareProcessNamespace": { + "type": "boolean" + }, + "priorityClassName": { + "type": "string" + }, + "affinity": { + "$ref": "#/$defs/Affinity" + }, + "lifecycle": { + "$ref": "#/$defs/Lifecycle" + }, + "terminationGracePeriodSeconds": { + "type": "integer" + }, + "livenessProbe": { + "$ref": "#/$defs/Probe" + }, + "initContainers": { + "items": { + "$ref": "#/$defs/Container" + }, + "type": "array" + }, + "additionalContainers": { + "items": { + "$ref": "#/$defs/Container" + }, + "type": "array" + }, + "observability": { + "$ref": "#/$defs/ObservabilitySpec" + }, + "topologySpreadConstraints": { + "items": { + "$ref": "#/$defs/TopologySpreadConstraint" + }, + "type": "array" + }, + "configmaps": { + "items": { + "$ref": "#/$defs/ConfigMapsSpec" + }, + "type": "array" + }, + "updateStrategy": { + "$ref": "#/$defs/DaemonSetUpdateStrategy" + }, + "deploymentUpdateStrategy": { + "$ref": "#/$defs/DeploymentStrategy" + } + }, + "additionalProperties": true, + "type": "object" + }, + "OpenTelemetryTargetAllocator": { + "properties": { + "replicas": { + "type": "integer" + }, + "nodeSelector": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "resources": { + "$ref": "#/$defs/ResourceRequirements" + }, + "allocationStrategy": { + "type": "string" + }, + "filterStrategy": { + "type": "string" + }, + "serviceAccount": { + "type": "string" + }, + "image": { + "description": "Image use in both standalone and agent configs", + "type": "object", + "additionalProperties": false, + "properties": { + "registry": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "digest": { + "type": "string" + }, + "pullPolicy": { + "type": "string", + "enum": ["IfNotPresent", "Always", "Never"] + } + } + }, + "enabled": { + "type": "boolean" + }, + "affinity": { + "$ref": "#/$defs/Affinity" + }, + "prometheusCR": { + "$ref": "#/$defs/OpenTelemetryTargetAllocatorPrometheusCR" + }, + "securityContext": { + "$ref": "#/$defs/SecurityContext" + }, + "podSecurityContext": { + "$ref": "#/$defs/PodSecurityContext" + }, + "topologySpreadConstraints": { + "items": { + "$ref": "#/$defs/TopologySpreadConstraint" + }, + "type": "array" + }, + "tolerations": { + "items": { + "$ref": "#/$defs/Toleration" + }, + "type": "array" + }, + "env": { + "items": { + "$ref": "#/$defs/EnvVar" + }, + "type": "array" + }, + "observability": { + "$ref": "#/$defs/ObservabilitySpec" + }, + "podDisruptionBudget": { + "$ref": "#/$defs/PodDisruptionBudgetSpec" + } + }, + "additionalProperties": false, + "type": "object" + }, + "OpenTelemetryTargetAllocatorPrometheusCR": { + "properties": { + "enabled": { + "type": "boolean" + }, + "scrapeInterval": { + "type": "string" + }, + "podMonitorSelector": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "serviceMonitorSelector": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + }, + "additionalProperties": false, + "type": "object" + }, + "OwnerReference": { + "properties": { + "apiVersion": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "name": { + "type": "string" + }, + "uid": { + "type": "string" + }, + "controller": { + "type": "boolean" + }, + "blockOwnerDeletion": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["apiVersion", "kind", "name", "uid"] + }, + "PersistentVolumeClaim": { + "properties": { + "kind": { + "type": "string" + }, + "apiVersion": { + "type": "string" + }, + "metadata": { + "$ref": "#/$defs/ObjectMeta" + }, + "spec": { + "$ref": "#/$defs/PersistentVolumeClaimSpec" + }, + "status": { + "$ref": "#/$defs/PersistentVolumeClaimStatus" + } + }, + "additionalProperties": false, + "type": "object" + }, + "PersistentVolumeClaimCondition": { + "properties": { + "type": { + "type": "string" + }, + "status": { + "type": "string" + }, + "lastProbeTime": { + "$ref": "#/$defs/Time" + }, + "lastTransitionTime": { + "$ref": "#/$defs/Time" + }, + "reason": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["type", "status"] + }, + "PersistentVolumeClaimSpec": { + "properties": { + "accessModes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "selector": { + "$ref": "#/$defs/LabelSelector" + }, + "resources": { + "$ref": "#/$defs/VolumeResourceRequirements" + }, + "volumeName": { + "type": "string" + }, + "storageClassName": { + "type": "string" + }, + "volumeMode": { + "type": "string" + }, + "dataSource": { + "$ref": "#/$defs/TypedLocalObjectReference" + }, + "dataSourceRef": { + "$ref": "#/$defs/TypedObjectReference" + }, + "volumeAttributesClassName": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "PersistentVolumeClaimStatus": { + "properties": { + "phase": { + "type": "string" + }, + "accessModes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "capacity": { + "$ref": "#/$defs/ResourceList" + }, + "conditions": { + "items": { + "$ref": "#/$defs/PersistentVolumeClaimCondition" + }, + "type": "array" + }, + "allocatedResources": { + "$ref": "#/$defs/ResourceList" + }, + "allocatedResourceStatuses": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "currentVolumeAttributesClassName": { + "type": "string" + }, + "modifyVolumeStatus": { + "$ref": "#/$defs/ModifyVolumeStatus" + } + }, + "additionalProperties": false, + "type": "object" + }, + "PersistentVolumeClaimTemplate": { + "properties": { + "metadata": { + "$ref": "#/$defs/ObjectMeta" + }, + "spec": { + "$ref": "#/$defs/PersistentVolumeClaimSpec" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["spec"] + }, + "PersistentVolumeClaimVolumeSource": { + "properties": { + "claimName": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["claimName"] + }, + "PhotonPersistentDiskVolumeSource": { + "properties": { + "pdID": { + "type": "string" + }, + "fsType": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["pdID"] + }, + "PodAffinity": { + "properties": { + "requiredDuringSchedulingIgnoredDuringExecution": { + "items": { + "$ref": "#/$defs/PodAffinityTerm" + }, + "type": "array" + }, + "preferredDuringSchedulingIgnoredDuringExecution": { + "items": { + "$ref": "#/$defs/WeightedPodAffinityTerm" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "PodAffinityTerm": { + "properties": { + "labelSelector": { + "$ref": "#/$defs/LabelSelector" + }, + "namespaces": { + "items": { + "type": "string" + }, + "type": "array" + }, + "topologyKey": { + "type": "string" + }, + "namespaceSelector": { + "$ref": "#/$defs/LabelSelector" + }, + "matchLabelKeys": { + "items": { + "type": "string" + }, + "type": "array" + }, + "mismatchLabelKeys": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["topologyKey"] + }, + "PodAntiAffinity": { + "properties": { + "requiredDuringSchedulingIgnoredDuringExecution": { + "items": { + "$ref": "#/$defs/PodAffinityTerm" + }, + "type": "array" + }, + "preferredDuringSchedulingIgnoredDuringExecution": { + "items": { + "$ref": "#/$defs/WeightedPodAffinityTerm" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "PodDisruptionBudgetSpec": { + "properties": { + "minAvailable": { + "type": ["string", "integer"] + }, + "maxUnavailable": { + "type": ["string", "integer"] + } + }, + "additionalProperties": false, + "type": "object" + }, + "PodSecurityContext": { + "properties": { + "seLinuxOptions": { + "$ref": "#/$defs/SELinuxOptions" + }, + "windowsOptions": { + "$ref": "#/$defs/WindowsSecurityContextOptions" + }, + "runAsUser": { + "type": "integer" + }, + "runAsGroup": { + "type": "integer" + }, + "runAsNonRoot": { + "type": "boolean" + }, + "supplementalGroups": { + "items": { + "type": "integer" + }, + "type": "array" + }, + "fsGroup": { + "type": "integer" + }, + "sysctls": { + "items": { + "$ref": "#/$defs/Sysctl" + }, + "type": "array" + }, + "fsGroupChangePolicy": { + "type": "string" + }, + "seccompProfile": { + "$ref": "#/$defs/SeccompProfile" + } + }, + "additionalProperties": false, + "type": "object" + }, + "PodsMetricSource": { + "properties": { + "metric": { + "$ref": "#/$defs/MetricIdentifier" + }, + "target": { + "$ref": "#/$defs/MetricTarget" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["metric", "target"] + }, + "PortworxVolumeSource": { + "properties": { + "volumeID": { + "type": "string" + }, + "fsType": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["volumeID"] + }, + "PreferredSchedulingTerm": { + "properties": { + "weight": { + "type": "integer" + }, + "preference": { + "$ref": "#/$defs/NodeSelectorTerm" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["weight", "preference"] + }, + "Probe": { + "properties": { + "initialDelaySeconds": { + "type": "integer" + }, + "timeoutSeconds": { + "type": "integer" + }, + "periodSeconds": { + "type": "integer" + }, + "successThreshold": { + "type": "integer" + }, + "failureThreshold": { + "type": "integer" + }, + "terminationGracePeriodSeconds": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ProjectedVolumeSource": { + "properties": { + "sources": { + "items": { + "$ref": "#/$defs/VolumeProjection" + }, + "type": "array" + }, + "defaultMode": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["sources"] + }, + "Quantity": { + "properties": { + "Format": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["Format"] + }, + "QuobyteVolumeSource": { + "properties": { + "registry": { + "type": "string" + }, + "volume": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + }, + "user": { + "type": "string" + }, + "group": { + "type": "string" + }, + "tenant": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["registry", "volume"] + }, + "RBDVolumeSource": { + "properties": { + "monitors": { + "items": { + "type": "string" + }, + "type": "array" + }, + "image": { + "type": "string" + }, + "fsType": { + "type": "string" + }, + "pool": { + "type": "string" + }, + "user": { + "type": "string" + }, + "keyring": { + "type": "string" + }, + "secretRef": { + "$ref": "#/$defs/LocalObjectReference" + }, + "readOnly": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["monitors", "image"] + }, + "ResourceClaim": { + "properties": { + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["name"] + }, + "ResourceFieldSelector": { + "properties": { + "containerName": { + "type": "string" + }, + "resource": { + "type": "string" + }, + "divisor": { + "$ref": "#/$defs/Quantity" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["resource"] + }, + "ResourceList": { + "additionalProperties": { + "$ref": "#/$defs/Quantity" + }, + "type": "object" + }, + "ResourceRequirements": { + "type": "object", + "additionalProperties": false, + "properties": { + "limits": { + "type": "object", + "additionalProperties": false, + "properties": { + "cpu": { + "type": ["string", "integer"] + }, + "memory": { + "type": "string" + } + } + }, + "requests": { + "type": "object", + "additionalProperties": false, + "properties": { + "cpu": { + "type": ["string", "integer"] + }, + "memory": { + "type": "string" + } + } + } + } + }, + "RollingUpdateDaemonSet": { + "properties": { + "maxUnavailable": { + "type": ["string", "integer"] + }, + "maxSurge": { + "type": ["string", "integer"] + } + }, + "additionalProperties": false, + "type": "object" + }, + "RollingUpdateDeployment": { + "properties": { + "maxUnavailable": { + "type": ["string", "integer"] + }, + "maxSurge": { + "type": ["string", "integer"] + } + }, + "additionalProperties": false, + "type": "object" + }, + "SELinuxOptions": { + "properties": { + "user": { + "type": "string" + }, + "role": { + "type": "string" + }, + "type": { + "type": "string" + }, + "level": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ScaleIOVolumeSource": { + "properties": { + "gateway": { + "type": "string" + }, + "system": { + "type": "string" + }, + "secretRef": { + "$ref": "#/$defs/LocalObjectReference" + }, + "sslEnabled": { + "type": "boolean" + }, + "protectionDomain": { + "type": "string" + }, + "storagePool": { + "type": "string" + }, + "storageMode": { + "type": "string" + }, + "volumeName": { + "type": "string" + }, + "fsType": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["gateway", "system", "secretRef"] + }, + "SeccompProfile": { + "properties": { + "type": { + "type": "string" + }, + "localhostProfile": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["type"] + }, + "SecretEnvSource": { + "properties": { + "name": { + "type": "string" + }, + "optional": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "SecretKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + }, + "optional": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["key"] + }, + "SecretProjection": { + "properties": { + "name": { + "type": "string" + }, + "items": { + "items": { + "$ref": "#/$defs/KeyToPath" + }, + "type": "array" + }, + "optional": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "SecretVolumeSource": { + "properties": { + "secretName": { + "type": "string" + }, + "items": { + "items": { + "$ref": "#/$defs/KeyToPath" + }, + "type": "array" + }, + "defaultMode": { + "type": "integer" + }, + "optional": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "SecurityContext": { + "properties": { + "capabilities": { + "$ref": "#/$defs/Capabilities" + }, + "privileged": { + "type": "boolean" + }, + "seLinuxOptions": { + "$ref": "#/$defs/SELinuxOptions" + }, + "windowsOptions": { + "$ref": "#/$defs/WindowsSecurityContextOptions" + }, + "runAsUser": { + "type": "integer" + }, + "runAsGroup": { + "type": "integer" + }, + "runAsNonRoot": { + "type": "boolean" + }, + "readOnlyRootFilesystem": { + "type": "boolean" + }, + "allowPrivilegeEscalation": { + "type": "boolean" + }, + "procMount": { + "type": "string" + }, + "seccompProfile": { + "$ref": "#/$defs/SeccompProfile" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ServiceAccountTokenProjection": { + "properties": { + "audience": { + "type": "string" + }, + "expirationSeconds": { + "type": "integer" + }, + "path": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["path"] + }, + "ServicePort": { + "properties": { + "name": { + "type": "string" + }, + "protocol": { + "type": "string" + }, + "appProtocol": { + "type": "string" + }, + "port": { + "type": "integer" + }, + "targetPort": { + "type": ["string", "integer"] + }, + "nodePort": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["port"] + }, + "SleepAction": { + "properties": { + "seconds": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["seconds"] + }, + "StorageOSVolumeSource": { + "properties": { + "volumeName": { + "type": "string" + }, + "volumeNamespace": { + "type": "string" + }, + "fsType": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + }, + "secretRef": { + "$ref": "#/$defs/LocalObjectReference" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Sysctl": { + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["name", "value"] + }, + "TCPSocketAction": { + "properties": { + "port": { + "type": ["string", "integer"] + }, + "host": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["port"] + }, + "Time": { + "properties": {}, + "additionalProperties": false, + "type": "object" + }, + "Toleration": { + "properties": { + "key": { + "type": "string" + }, + "operator": { + "type": "string" + }, + "value": { + "type": "string" + }, + "effect": { + "type": "string" + }, + "tolerationSeconds": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TopologySpreadConstraint": { + "properties": { + "maxSkew": { + "type": "integer" + }, + "topologyKey": { + "type": "string" + }, + "whenUnsatisfiable": { + "type": "string" + }, + "labelSelector": { + "$ref": "#/$defs/LabelSelector" + }, + "minDomains": { + "type": "integer" + }, + "nodeAffinityPolicy": { + "type": "string" + }, + "nodeTaintsPolicy": { + "type": "string" + }, + "matchLabelKeys": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["maxSkew", "topologyKey", "whenUnsatisfiable"] + }, + "TypedLocalObjectReference": { + "properties": { + "apiGroup": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["apiGroup", "kind", "name"] + }, + "TypedObjectReference": { + "properties": { + "apiGroup": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "name": { + "type": "string" + }, + "namespace": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["apiGroup", "kind", "name"] + }, + "Volume": { + "properties": { + "name": { + "type": "string" + }, + "hostPath": { + "$ref": "#/$defs/HostPathVolumeSource" + }, + "emptyDir": { + "$ref": "#/$defs/EmptyDirVolumeSource" + }, + "gcePersistentDisk": { + "$ref": "#/$defs/GCEPersistentDiskVolumeSource" + }, + "awsElasticBlockStore": { + "$ref": "#/$defs/AWSElasticBlockStoreVolumeSource" + }, + "gitRepo": { + "$ref": "#/$defs/GitRepoVolumeSource" + }, + "secret": { + "$ref": "#/$defs/SecretVolumeSource" + }, + "nfs": { + "$ref": "#/$defs/NFSVolumeSource" + }, + "iscsi": { + "$ref": "#/$defs/ISCSIVolumeSource" + }, + "glusterfs": { + "$ref": "#/$defs/GlusterfsVolumeSource" + }, + "persistentVolumeClaim": { + "$ref": "#/$defs/PersistentVolumeClaimVolumeSource" + }, + "rbd": { + "$ref": "#/$defs/RBDVolumeSource" + }, + "flexVolume": { + "$ref": "#/$defs/FlexVolumeSource" + }, + "cinder": { + "$ref": "#/$defs/CinderVolumeSource" + }, + "cephfs": { + "$ref": "#/$defs/CephFSVolumeSource" + }, + "flocker": { + "$ref": "#/$defs/FlockerVolumeSource" + }, + "downwardAPI": { + "$ref": "#/$defs/DownwardAPIVolumeSource" + }, + "fc": { + "$ref": "#/$defs/FCVolumeSource" + }, + "azureFile": { + "$ref": "#/$defs/AzureFileVolumeSource" + }, + "configMap": { + "$ref": "#/$defs/ConfigMapVolumeSource" + }, + "vsphereVolume": { + "$ref": "#/$defs/VsphereVirtualDiskVolumeSource" + }, + "quobyte": { + "$ref": "#/$defs/QuobyteVolumeSource" + }, + "azureDisk": { + "$ref": "#/$defs/AzureDiskVolumeSource" + }, + "photonPersistentDisk": { + "$ref": "#/$defs/PhotonPersistentDiskVolumeSource" + }, + "projected": { + "$ref": "#/$defs/ProjectedVolumeSource" + }, + "portworxVolume": { + "$ref": "#/$defs/PortworxVolumeSource" + }, + "scaleIO": { + "$ref": "#/$defs/ScaleIOVolumeSource" + }, + "storageos": { + "$ref": "#/$defs/StorageOSVolumeSource" + }, + "csi": { + "$ref": "#/$defs/CSIVolumeSource" + }, + "ephemeral": { + "$ref": "#/$defs/EphemeralVolumeSource" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["name"] + }, + "VolumeDevice": { + "properties": { + "name": { + "type": "string" + }, + "devicePath": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["name", "devicePath"] + }, + "VolumeMount": { + "properties": { + "name": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + }, + "mountPath": { + "type": "string" + }, + "subPath": { + "type": "string" + }, + "mountPropagation": { + "type": "string" + }, + "subPathExpr": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["name", "mountPath"] + }, + "VolumeProjection": { + "properties": { + "secret": { + "$ref": "#/$defs/SecretProjection" + }, + "downwardAPI": { + "$ref": "#/$defs/DownwardAPIProjection" + }, + "configMap": { + "$ref": "#/$defs/ConfigMapProjection" + }, + "serviceAccountToken": { + "$ref": "#/$defs/ServiceAccountTokenProjection" + }, + "clusterTrustBundle": { + "$ref": "#/$defs/ClusterTrustBundleProjection" + } + }, + "additionalProperties": false, + "type": "object" + }, + "VolumeResourceRequirements": { + "properties": { + "limits": { + "type": "object" + }, + "requests": { + "type": "object" + } + }, + "additionalProperties": false, + "type": "object" + }, + "VsphereVirtualDiskVolumeSource": { + "properties": { + "volumePath": { + "type": "string" + }, + "fsType": { + "type": "string" + }, + "storagePolicyName": { + "type": "string" + }, + "storagePolicyID": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["volumePath"] + }, + "WeightedPodAffinityTerm": { + "properties": { + "weight": { + "type": "integer" + }, + "podAffinityTerm": { + "$ref": "#/$defs/PodAffinityTerm" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["weight", "podAffinityTerm"] + }, + "WindowsSecurityContextOptions": { + "properties": { + "gmsaCredentialSpecName": { + "type": "string" + }, + "gmsaCredentialSpec": { + "type": "string" + }, + "runAsUserName": { + "type": "string" + }, + "hostProcess": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ApacheHttpd": { + "properties": { + "image": { + "type": "string" + }, + "volumeLimitSize": { + "type": "string" + }, + "env": { + "items": { + "$ref": "#/$defs/EnvVar" + }, + "type": "array" + }, + "attrs": { + "items": { + "$ref": "#/$defs/EnvVar" + }, + "type": "array" + }, + "version": { + "type": "string" + }, + "configPath": { + "type": "string" + }, + "resourceRequirements": { + "$ref": "#/$defs/ResourceRequirements" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DotNet": { + "properties": { + "image": { + "type": "string" + }, + "volumeLimitSize": { + "type": "string" + }, + "env": { + "items": { + "$ref": "#/$defs/EnvVar" + }, + "type": "array" + }, + "resourceRequirements": { + "$ref": "#/$defs/ResourceRequirements" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Exporter": { + "properties": { + "endpoint": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Go": { + "properties": { + "image": { + "type": "string" + }, + "volumeLimitSize": { + "type": "string" + }, + "env": { + "items": { + "$ref": "#/$defs/EnvVar" + }, + "type": "array" + }, + "resourceRequirements": { + "$ref": "#/$defs/ResourceRequirements" + } + }, + "additionalProperties": false, + "type": "object" + }, + "InstrumentationSpec": { + "properties": { + "name": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "exporter": { + "$ref": "#/$defs/Exporter" + }, + "resource": { + "$ref": "#/$defs/Resource" + }, + "propagators": { + "items": { + "type": "string" + }, + "type": "array" + }, + "sampler": { + "$ref": "#/$defs/Sampler" + }, + "env": { + "items": { + "$ref": "#/$defs/EnvVar" + }, + "type": "array" + }, + "java": { + "$ref": "#/$defs/Java" + }, + "nodejs": { + "$ref": "#/$defs/NodeJS" + }, + "python": { + "$ref": "#/$defs/Python" + }, + "dotnet": { + "$ref": "#/$defs/DotNet" + }, + "go": { + "$ref": "#/$defs/Go" + }, + "apacheHttpd": { + "$ref": "#/$defs/ApacheHttpd" + }, + "nginx": { + "$ref": "#/$defs/Nginx" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Java": { + "properties": { + "image": { + "type": "string" + }, + "volumeLimitSize": { + "type": "string" + }, + "env": { + "items": { + "$ref": "#/$defs/EnvVar" + }, + "type": "array" + }, + "resources": { + "$ref": "#/$defs/ResourceRequirements" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Nginx": { + "properties": { + "image": { + "type": "string" + }, + "volumeLimitSize": { + "type": "string" + }, + "env": { + "items": { + "$ref": "#/$defs/EnvVar" + }, + "type": "array" + }, + "attrs": { + "items": { + "$ref": "#/$defs/EnvVar" + }, + "type": "array" + }, + "configFile": { + "type": "string" + }, + "resourceRequirements": { + "$ref": "#/$defs/ResourceRequirements" + } + }, + "additionalProperties": false, + "type": "object" + }, + "NodeJS": { + "properties": { + "image": { + "type": "string" + }, + "volumeLimitSize": { + "type": "string" + }, + "env": { + "items": { + "$ref": "#/$defs/EnvVar" + }, + "type": "array" + }, + "resourceRequirements": { + "$ref": "#/$defs/ResourceRequirements" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Python": { + "properties": { + "image": { + "type": "string" + }, + "volumeLimitSize": { + "type": "string" + }, + "env": { + "items": { + "$ref": "#/$defs/EnvVar" + }, + "type": "array" + }, + "resourceRequirements": { + "$ref": "#/$defs/ResourceRequirements" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Resource": { + "properties": { + "resourceAttributes": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "addK8sUIDAttributes": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Sampler": { + "properties": { + "type": { + "type": "string" + }, + "argument": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "OpAMPBridgeSpec": { + "properties": { + "enabled": { + "type": "boolean" + }, + "addReportingLabel": { + "type": "boolean" + }, + "addManagedLabel": { + "type": "boolean" + }, + "endpoint": { + "type": "string" + }, + "annotations": { + "type": "object" + }, + "labels": { + "type": "object" + }, + "headers": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "capabilities": { + "additionalProperties": { + "type": "boolean" + }, + "type": "object" + }, + "componentsAllowed": { + "additionalProperties": { + "items": { + "type": "string" + }, + "type": "array" + }, + "type": "object" + }, + "resources": { + "$ref": "#/$defs/ResourceRequirements" + }, + "nodeSelector": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "replicas": { + "type": "integer" + }, + "securityContext": { + "$ref": "#/$defs/SecurityContext" + }, + "podSecurityContext": { + "$ref": "#/$defs/PodSecurityContext" + }, + "podAnnotations": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "serviceAccount": { + "type": "string" + }, + "image": { + "description": "Image use in both standalone and agent configs", + "type": "object", + "additionalProperties": false, + "properties": { + "registry": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "digest": { + "type": "string" + }, + "pullPolicy": { + "type": "string", + "enum": ["IfNotPresent", "Always", "Never"] + } + } + }, + "upgradeStrategy": { + "type": "string" + }, + "volumeMounts": { + "items": { + "$ref": "#/$defs/VolumeMount" + }, + "type": "array" + }, + "ports": { + "items": { + "$ref": "#/$defs/ServicePort" + }, + "type": "array" + }, + "env": { + "items": { + "$ref": "#/$defs/EnvVar" + }, + "type": "array" + }, + "envFrom": { + "items": { + "$ref": "#/$defs/EnvFromSource" + }, + "type": "array" + }, + "tolerations": { + "items": { + "$ref": "#/$defs/Toleration" + }, + "type": "array" + }, + "volumes": { + "items": { + "$ref": "#/$defs/Volume" + }, + "type": "array" + }, + "hostNetwork": { + "type": "boolean" + }, + "priorityClassName": { + "type": "string" + }, + "affinity": { + "$ref": "#/$defs/Affinity" + }, + "topologySpreadConstraints": { + "items": { + "$ref": "#/$defs/TopologySpreadConstraint" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["endpoint", "capabilities", "upgradeStrategy"] + } + }, + "properties": { + "fullnameOverride": { + "type": "string" + }, + "namespaceOverride": { + "type": "string" + }, + "kubeVersionOverride": { + "type": "string" + }, + "opAMPBridge": { + "$ref": "#/$defs/OpAMPBridgeSpec" + }, + "instrumentation": { + "$ref": "#/$defs/InstrumentationSpec" + }, + "defaultCollectorConfig": { + "$ref": "#/$defs/OpenTelemetryCollectorSpec" + }, + "collectors": { + "type": "object", + "patternProperties": { + "^[a-z]+[a-zA-Z0-9]+$": { + "$ref": "#/$defs/OpenTelemetryCollectorSpec" + } + } + }, + "clusterName": { + "type": "string" + }, + "clusterRole": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "annotations": { + "type": "object" + }, + "name": { + "type": "string" + }, + "rules": { + "type": "array", + "items": { + "type": "object" + } + }, + "clusterRoleBinding": { + "type": "object", + "additionalProperties": false, + "properties": { + "annotations": { + "type": "object" + }, + "name": { + "type": "string" + }, + "collectors": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "required": ["enabled"] + }, + "bridgeClusterRole": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "annotations": { + "type": "object" + }, + "name": { + "type": "string" + }, + "rules": { + "type": "array", + "items": { + "type": "object" + } + }, + "clusterRoleBinding": { + "type": "object", + "additionalProperties": false, + "properties": { + "annotations": { + "type": "object" + }, + "name": { + "type": "string" + }, + "collectors": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "required": ["enabled"] + }, + "prometheus": { + "type": "object", + "properties": { + "customResources": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + }, + "ignoreNamespaceSelectors": { + "type": "boolean", + "default": "false" + } + } + }, + "kubernetesServiceMonitors": { + "$ref": "#/$defs/KubeStateMetricsClass" + }, + "kubeApiServer": { + "$ref": "#/$defs/KubeAPIServer" + }, + "kubelet": { + "$ref": "#/$defs/Kubelet" + }, + "kubeControllerManager": { + "$ref": "#/$defs/Kube" + }, + "coreDns": { + "$ref": "#/$defs/CoreDNS" + }, + "kubeDns": { + "$ref": "#/$defs/KubeDNS" + }, + "kubeEtcd": { + "$ref": "#/$defs/Kube" + }, + "kubeScheduler": { + "$ref": "#/$defs/Kube" + }, + "kubeProxy": { + "$ref": "#/$defs/Kube" + }, + "kubeStateMetrics": { + "$ref": "#/$defs/KubeStateMetricsClass" + }, + "kube-state-metrics": { + "$ref": "#/$defs/KubeStateMetrics" + }, + "nodeExporter": { + "$ref": "#/$defs/NodeExporter" + }, + "prometheus-node-exporter": { + "$ref": "#/$defs/PrometheusNodeExporter" + }, + "extraEnvs": { + "type": "array", + "items": { + "type": "object" + } + } + } +} diff --git a/charts/otel-cloud-stack/values.yaml b/charts/otel-cloud-stack/values.yaml new file mode 100644 index 000000000..ba64b7f37 --- /dev/null +++ b/charts/otel-cloud-stack/values.yaml @@ -0,0 +1,2141 @@ +# Top level field indicating an override for fullname +fullnameOverride: "" +# Top level field indicating an override for the namespace +namespaceOverride: "" +# Top level field indicating an override for the kube cluster version +kubeVersionOverride: "" + +# Top level field specifying the name of the cluster +clusterName: "" + +# Extra environment variables to add to each collector, bridge and instrumentation +extraEnvs: [] + +# Top level field related to the OpenTelemetry Operator +opentelemetry-operator: + # Field indicating whether the operator is enabled or not + enabled: false + + # Sub-field for admission webhooks configuration + admissionWebhooks: + # Policy for handling failures + # Setting this allows for an installation of the otel operator at the same time as the collectors. + failurePolicy: "Ignore" + +# This is the default configuration for all collectors generated by the chart. +# Any collectors in the `collectors` are overlayed on top of this configuration. +defaultCollectorConfig: + enabled: false + + # Name of the collector + name: "test" + + # Annotations for the collector + annotations: {} + # io.opentelemetry.com/resource: hello + + # Labels for the collector + labels: {} + # app: otc + + # Management state of the collector + managementState: managed + + # Configuration for cluster role binding + clusterRoleBinding: + enabled: true + clusterRoleName: "" + + # Number of replicas for the collector + # replicas: 1 + + # Mode of deployment for the collector + mode: deployment + + # Service account associated with the collector + serviceAccount: "" + + # Image details for the collector + image: + # If you want to use the core image `otel/opentelemetry-collector`, you also need to change `command.name` value to `otelcol`. + repository: otel/opentelemetry-collector-contrib + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + # When digest is set to a non-empty value, images will be pulled by digest (regardless of tag value). + digest: "" + + # Upgrade strategy for the collector + upgradeStrategy: automatic + + # Configuration options for the collector + config: {} + # receivers: + # otlp: + # protocols: + # grpc: + # endpoint: ${env:MY_POD_IP}:4317 + # http: + # endpoint: ${env:MY_POD_IP}:4318 + # exporters: + # otlp: + # endpoint: "otel-collector.default:4317" + # tls: + # insecure: true + # sending_queue: + # num_consumers: 4 + # queue_size: 100 + # retry_on_failure: + # enabled: true + # processors: + # batch: + # memory_limiter: + # # 80% of maximum memory up to 2G + # limit_mib: 400 + # # 25% of limit up to 2G + # spike_limit_mib: 100 + # check_interval: 5s + # extensions: + # zpages: {} + # service: + # extensions: [zpages] + # pipelines: + # traces: + # receivers: [otlp] + # processors: [memory_limiter, batch] + # exporters: [otlp] + + # Whether to use host network for the collector + hostNetwork: false + + # Whether to share process namespace for the collector + shareProcessNamespace: false + + # Priority class name for the collector + priorityClassName: "" + + # Termination grace period for the collector + terminationGracePeriodSeconds: 30 + + # Resource requests and limits for the collector + resources: + requests: + memory: "64Mi" + cpu: "250m" + limits: + memory: "128Mi" + cpu: "250m" + + # Node selector for the collector + nodeSelector: {} + # nodeType: worker + + # Arguments for the collector + args: {} + # arg1: value1 + # arg2: value2 + + # Autoscaler configuration for the collector + autoscaler: {} + # minReplicas: 1 + # maxReplicas: 10 + # targetCPUUtilization: 50 + + # Pod disruption budget for the collector + podDisruptionBudget: {} + # maxUnavailable: 1 + + # Security context for the collector + securityContext: {} + # runAsUser: 1000 + # capabilities: + # drop: + # - ALL + + # Pod security context for the collector + podSecurityContext: {} + # runAsUser: 1000 + + # Annotations for the collector's pods + podAnnotations: {} + # prometheus.io/scrape: "true" + + # Target allocator configuration + targetAllocator: {} + # replicas: 1 + # nodeSelector: + # nodeType: worker + # resources: + # requests: + # memory: "64Mi" + # cpu: "250m" + # limits: + # memory: "128Mi" + # cpu: "500m" + # allocationStrategy: consistent-hashing + # filterStrategy: relabel-config + # serviceAccount: my-service-account + # image: myregistry/myimage:latest + # enabled: true + # affinity: + # nodeAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # nodeSelectorTerms: + # - matchExpressions: + # - key: kubernetes.io/e2e-az-name + # operator: In + # values: + # - e2e-az1 + # - e2e-az2 + # # Configuration for Prometheus Custom Resources + # prometheusCR: + # enabled: true + # scrapeInterval: 30s + # podMonitorSelector: + # key1: value1 + # key2: value2 + # serviceMonitorSelector: + # key1: value1 + # key2: value2 + # securityContext: + # runAsUser: 1000 + # capabilities: + # drop: + # - ALL + # podSecurityContext: + # runAsUser: 1000 + # # Topology spread constraints for the target allocator + # topologySpreadConstraints: + # - maxSkew: 1 + # topologyKey: kubernetes.io/hostname + # whenUnsatisfiable: DoNotSchedule + # # Tolerations for the collector + # tolerations: + # - key: "key" + # operator: "Equal" + # value: "value" + # effect: "NoSchedule" + # # Environment variables for the target allocator + # env: + # - name: ENV_VAR1 + # value: value1 + # - name: ENV_VAR2 + # value: value2 + # # Observability configuration for the target allocator + # observability: + # metrics: + # enableMetrics: true + + # Affinity configuration for the collector + affinity: {} + # nodeAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # nodeSelectorTerms: + # - matchExpressions: + # - key: kubernetes.io/e2e-az-name + # operator: In + # values: + # - e2e-az1 + # - e2e-az2 + + # Lifecycle configuration for the collector + lifecycle: {} + # preStop: + # exec: + # command: + # [ + # "/bin/sh", + # "-c", + # "echo Hello from the preStop handler > /dev/termination-log", + # ] + + # Liveness probe configuration for the collector + livenessProbe: {} + # initialDelaySeconds: 3 + # periodSeconds: 5 + # timeoutSeconds: 2 + # failureThreshold: 5 + + # Observability configuration for the collector + observability: {} + # metrics: + # enableMetrics: true + + # Update strategy for the collector + updateStrategy: {} + # type: RollingUpdate + + # Volume mounts for the collector + volumeMounts: [] + # - name: data + # mountPath: /data + + # Ports configuration for the collector + # The operator automatically calculates ports for known receivers and exporters + # Set any custom ports here. + ports: [] + # - name: http + # protocol: TCP + # port: 80 + # targetPort: 8080 + + # Environment variables for the collector + env: [] + # - name: ENV_VAR1 + # value: value1 + # - name: ENV_VAR2 + # value: value2 + + # Volume claim templates for the collector + volumeClaimTemplates: [] + # - metadata: + # name: storage + # spec: + # accessModes: ["ReadWriteOnce"] + # resources: + # requests: + # storage: 1Gi + + # Tolerations for the collector + tolerations: [] + # - key: "key" + # operator: "Equal" + # value: "value" + # effect: "NoSchedule" + + # Volumes for the collector + volumes: [] + # - name: config-volume + # configMap: + # name: config + + # Init containers for the collector + initContainers: [] + # - name: init-nginx + # image: nginx + + # Additional containers for the collector + additionalContainers: [] + # - name: additional-container + # image: busybox + + # Topology spread constraints for the collector + topologySpreadConstraints: [] + # - maxSkew: 1 + # topologyKey: kubernetes.io/hostname + # whenUnsatisfiable: DoNotSchedule + # labelSelector: + # matchLabels: + # app: my-app + + # Config maps for the collector + configmaps: [] + # - name: config + # mountPath: /etc/config + +# Top level field specifying collectors configuration +collectors: + # a collector dedicated to tracing + tracing: + enabled: true + name: traces + mode: deployment + autoscaler: + minReplicas: 1 + maxReplicas: 3 + targetMemoryUtilization: 70 + resources: + limits: + cpu: 250m + memory: 250Mi + requests: + cpu: 250m + memory: 250Mi + config: + receivers: + otlp: + protocols: + grpc: + endpoint: "0.0.0.0:4317" + processors: + resourcedetection/env: + detectors: [env] + timeout: 2s + override: false + batch: + send_batch_size: 1000 + timeout: 1s + send_batch_max_size: 1500 + k8sattributes: + passthrough: false + pod_association: + - sources: + - from: resource_attribute + name: k8s.pod.uid + - sources: + - from: resource_attribute + name: k8s.pod.name + - from: resource_attribute + name: k8s.namespace.name + - from: resource_attribute + name: k8s.node.name + - sources: + - from: resource_attribute + name: k8s.pod.ip + - sources: + - from: resource_attribute + name: k8s.pod.name + - from: resource_attribute + name: k8s.namespace.name + - sources: + - from: connection + extract: + labels: + - tag_name: service.name + key: app.kubernetes.io/name + from: pod + - tag_name: service.name + key: k8s-app + from: pod + - tag_name: k8s.app.instance + key: app.kubernetes.io/instance + from: pod + - tag_name: service.version + key: app.kubernetes.io/version + from: pod + - tag_name: k8s.app.component + key: app.kubernetes.io/component + from: pod + metadata: + - k8s.namespace.name + - k8s.pod.name + - k8s.pod.uid + - k8s.node.name + - k8s.pod.start_time + - k8s.deployment.name + - k8s.replicaset.name + - k8s.replicaset.uid + - k8s.daemonset.name + - k8s.daemonset.uid + - k8s.job.name + - k8s.job.uid + - k8s.container.name + - k8s.cronjob.name + - k8s.statefulset.name + - k8s.statefulset.uid + - container.image.tag + - container.image.name + - k8s.cluster.uid + exporters: + debug: {} + service: + pipelines: + traces: + receivers: [otlp] + processors: + - resourcedetection/env + - k8sattributes + - batch + exporters: [debug] + # a daemonset collector dedicated to getting infrastructure logs and metrics + daemon: + enabled: true + name: daemon + resources: + limits: + cpu: 100m + memory: 250Mi + requests: + cpu: 100m + memory: 128Mi + volumeMounts: + - name: hostfs + mountPath: /hostfs + readOnly: true + mountPropagation: HostToContainer + - mountPath: /var/log + name: varlog + readOnly: true + - mountPath: /var/lib/docker/containers + name: varlibdockercontainers + readOnly: true + volumes: + - name: hostfs + hostPath: + path: / + - name: varlog + hostPath: + path: /var/log + - name: varlibdockercontainers + hostPath: + path: /var/lib/docker/containers + # A scrape config file to instruct the daemon collector to pull metrics from any matching targets on the same node with + # prometheus.io/scrape=true + # This config also scrapes a running node exporter and the kubelet CAdvisor metrics which aren't currently supported. + scrape_configs_file: "daemon_scrape_configs.yaml" + config: + receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + http: + endpoint: 0.0.0.0:4318 + kubeletstats: + collection_interval: "15s" + auth_type: "serviceAccount" + insecure_skip_verify: true + # For this scrape to work, the RBAC must have `nodes/stats` GET access. + endpoint: "https://${env:OTEL_K8S_NODE_IP}:10250" + extra_metadata_labels: + - container.id + - k8s.volume.type + metric_groups: + - node + - pod + - volume + - container + k8s_api_config: + auth_type: serviceAccount + hostmetrics: + collection_interval: "30s" + root_path: /hostfs + scrapers: + cpu: + metrics: + system.cpu.utilization: + enabled: true + disk: {} + load: {} + filesystem: + metrics: + system.filesystem.utilization: + enabled: true + exclude_mount_points: + match_type: regexp + mount_points: + - /dev/.* + - /proc/.* + - /sys/.* + - /run/k3s/containerd/.* + - /var/lib/docker/.* + - /var/lib/kubelet/.* + - /snap/.* + exclude_fs_types: + match_type: strict + fs_types: + - autofs + - binfmt_misc + - bpf + - cgroup2 + - configfs + - debugfs + - devpts + - devtmpfs + - fusectl + - hugetlbfs + - iso9660 + - mqueue + - nsfs + - overlay + - proc + - procfs + - pstore + - rpc_pipefs + - securityfs + - selinuxfs + - squashfs + - sysfs + - tracefs + memory: + metrics: + system.memory.utilization: + enabled: true + # paging: + # processes: + # process: + network: {} + k8s_events: {} + filelog: + include: + - /var/log/pods/*/*/*.log + start_at: beginning + include_file_path: true + include_file_name: false + operators: + - type: router + id: get-format + routes: + - output: parser-docker + expr: 'body matches "^\\{"' + - output: parser-crio + expr: 'body matches "^[^ Z]+ "' + - output: parser-containerd + expr: 'body matches "^[^ Z]+Z"' + # Parse CRI-O format + - type: regex_parser + id: parser-crio + regex: "^(?P