diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..c38fa4e005 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +*.iml diff --git a/CHANGELOG.md b/CHANGELOG.md index d3a27ecc70..d5be84c1ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## Unreleased +### Added + +- Add `eks/fargate` distribution option for 2-replica StatefulSet (#346) + ## [0.43.0] - 2022-01-27 ### Changed diff --git a/Makefile b/Makefile index 7444bf73a7..78e2d9a55f 100644 --- a/Makefile +++ b/Makefile @@ -49,3 +49,15 @@ render: default helm-charts/splunk-otel-collector; \ mv "$$dir"/splunk-otel-collector/templates/* "$$dir"; \ rm -rf "$$dir"/splunk-otel-collector + + # eks/fargate deployment (with recommended gateway) + dir=rendered/manifests/eks-fargate; \ + mkdir -p "$$dir"; \ + helm template \ + --namespace default \ + --values rendered/values.yaml \ + --output-dir "$$dir" \ + --set distribution=eks/fargate,gateway.enabled=true,cloudProvider=aws \ + default helm-charts/splunk-otel-collector; \ + mv "$$dir"/splunk-otel-collector/templates/* "$$dir"; \ + rm -rf "$$dir"/splunk-otel-collector diff --git a/README.md b/README.md index de3b52460f..e36dbf61b3 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,7 @@ Kubernetes distributions: - [Vanilla (unmodified version) Kubernetes](https://kubernetes.io) - [Amazon Elastic Kubernetes Service](https://aws.amazon.com/eks) + including [with Fargate profiles](docs/advanced-configuration.md#eks-fargate-support) - [Azure Kubernetes Service](https://docs.microsoft.com/en-us/azure/aks) - [Google Kubernetes Engine](https://cloud.google.com/kubernetes-engine) including [GKE Autopilot](docs/advanced-configuration.md#gke-autopilot-support) diff --git a/docs/advanced-configuration.md b/docs/advanced-configuration.md index ea8d1b60c8..2ac91618c4 100644 --- a/docs/advanced-configuration.md +++ b/docs/advanced-configuration.md @@ -43,10 +43,11 @@ Use the `distribution` parameter to provide information about underlying Kubernetes deployment. This parameter allows the connector to automatically scrape additional metadata. The supported options are: +- `aks` - Azure AKS - `eks` - Amazon EKS +- `eks/fargate` - Amazon EKS with Fargate profiles - `gke` - Google GKE / Standard mode - `gke/autopilot` - Google GKE / Autopilot mode -- `aks` - Azure AKS - `openshift` - Red Hat OpenShift This value can be omitted if none of the values apply. @@ -157,6 +158,39 @@ the following line to your custom values.yaml: priorityClassName: splunk-otel-agent-priority ``` +## EKS Fargate support + +If you want to run the Splunk OpenTelemetry Collector in [Amazon Elastic Kubernetes Service +with Fargate profiles](https://docs.aws.amazon.com/eks/latest/userguide/fargate.html), +make sure to set the required `distribution` value to `eks/fargate`: + +```yaml +distribution: eks/fargate +``` + +**NOTE:** Fluentd and Native OTel logs collection are not yet automatically configured in EKS with Fargate profiles + +This distribution will operate similarly to the `eks` distribution but with the following distinctions: + +1. The Collector agent daemonset is not applied since Fargate doesn't support daemonsets. Any desired Collector instances +running as agents must be configured manually as sidecar containers in your custom deployments. This includes any application +logging services like Fluentd. We recommend setting the `gateway.enabled` to `true` and configuring your instrumented +applications to report metrics, traces, and logs to the gateway's `-splunk-otel-collector` service address. +Any desired agent instances that would run as a daemonset should instead run as sidecar containers in your pods. + +2. Since Fargate nodes use a VM boundary to prevent access to host-based resources used by other pods, pods are not able to reach their own kubelet. The cluster receiver +for the Fargate distribution has two primary differences between regular `eks` to work around this limitation: + * The configured cluster receiver is deployed as a 2-replica StatefulSet instead of a Deployment and uses a + [Kubernetes Observer extension](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/extension/observer/k8sobserver/README.md) + that discovers the cluster's nodes and, on the second replica, its pods for user-configurable receiver creator additions. It uses this observer to dynamically create + [Kubelet Stats receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/kubeletstatsreceiver/README.md) + instances that will report kubelet metrics for all observed Fargate nodes. The first replica will monitor the cluster with a `k8s_cluster` receiver + and the second will monitor all kubelets except its own (due to an EKS/Fargate networking restriction). + + * The first replica's collector will monitor the second's kubelet. This is made possible by a Fargate-specific `splunk-otel-eks-fargate-kubeletstats-receiver-node` + node label. The Collector's ClusterRole for `eks/fargate` will allow the `patch` verb on `nodes` resources for the default API groups to allow the cluster + receiver's init container to add this node label for designated self monitoring. + ## Logs collection The helm chart currently utilizes [fluentd](https://docs.fluentd.org/) for Kubernetes logs diff --git a/helm-charts/splunk-otel-collector/scripts/init-eks-fargate-cluster-receiver.sh b/helm-charts/splunk-otel-collector/scripts/init-eks-fargate-cluster-receiver.sh new file mode 100644 index 0000000000..26afab176b --- /dev/null +++ b/helm-charts/splunk-otel-collector/scripts/init-eks-fargate-cluster-receiver.sh @@ -0,0 +1,44 @@ +#! /usr/bin/bash +set -ex + +echo "Downloading yq" +curl -L -o yq https://github.com/mikefarah/yq/releases/download/v4.16.2/yq_linux_amd64 +ACTUAL=$(sha256sum yq | awk '{print $1}') +if [ "${ACTUAL}" != "5c911c4da418ae64af5527b7ee36e77effb85de20c2ce732ed14c7f72743084d" ]; then + echo "will not attempt to use yq with unexpected sha256 (${ACTUAL} != 5c911c4da418ae64af5527b7ee36e77effb85de20c2ce732ed14c7f72743084d)" + exit 1 +fi +chmod a+x yq + +# If we are the first pod (cluster receiver), set the kubelet stats node filter to only follow labelled nodes. +# This node label will be set by the second pod. +if [[ "${K8S_POD_NAME}" == *-0 ]]; then + echo "will configure kubelet stats receiver to follow other StatefulSet replica's node, as well as use cluster receiver." + ./yq e '.receivers.receiver_creator.receivers.kubeletstats.rule = .receivers.receiver_creator.receivers.kubeletstats.rule + " && labels[\"splunk-otel-eks-fargate-kubeletstats-receiver-node\"] == \"true\""' /conf/relay.yaml >/splunk-messages/config.yaml + ./yq e -i '.extensions.k8s_observer.observe_pods = false' /splunk-messages/config.yaml + exit 0 +fi + +# Else we are the second pod (wide kubelet stats) label our node to be monitored by the first pod and disable the k8s_cluster receiver. +# Update our config to not monitor ourselves +echo "Labelling our fargate node to denote it hosts the cluster receiver" + +# download kubectl (verifying checksum) +curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.20.4/2021-04-12/bin/linux/amd64/kubectl +ACTUAL=$(sha256sum kubectl | awk '{print $1}') +if [ "${ACTUAL}" != "e84ff8c607b2a10f635c312403f9ede40a045404957e55adcf3d663f9e32c630" ]; then + echo "will not attempt to use kubectl with unexpected sha256 (${ACTUAL} != e84ff8c607b2a10f635c312403f9ede40a045404957e55adcf3d663f9e32c630)" + exit 1 +fi +chmod a+x kubectl +# label node +./kubectl label nodes $K8S_NODE_NAME splunk-otel-eks-fargate-kubeletstats-receiver-node=true + +echo "Disabling k8s_cluster receiver for this instance" +# strip k8s_cluster and its pipeline +./yq e 'del(.service.pipelines.metrics)' /conf/relay.yaml >/splunk-messages/config.yaml +./yq e -i 'del(.receivers.k8s_cluster)' /splunk-messages/config.yaml + +# set kubelet stats to not monitor ourselves (all other kubelets) +echo "Ensuring k8s_observer-based kubeletstats receivers won't monitor own node to avoid Fargate network limitation." +./yq e -i '.receivers.receiver_creator.receivers.kubeletstats.rule = .receivers.receiver_creator.receivers.kubeletstats.rule + " && not ( name contains \"${K8S_NODE_NAME}\" )"' /splunk-messages/config.yaml diff --git a/helm-charts/splunk-otel-collector/templates/_helpers.tpl b/helm-charts/splunk-otel-collector/templates/_helpers.tpl index d1225374da..f6bd70f86f 100644 --- a/helm-charts/splunk-otel-collector/templates/_helpers.tpl +++ b/helm-charts/splunk-otel-collector/templates/_helpers.tpl @@ -308,3 +308,17 @@ compatibility with the old config group name: "otelK8sClusterReceiver". {{- deepCopy .Values.otelK8sClusterReceiver | mustMergeOverwrite (deepCopy .Values.clusterReceiver) | toYaml }} {{- end }} {{- end -}} + +{{/* +"clusterReceiverServiceName" for the eks/fargate cluster receiver statefulSet +*/}} +{{- define "splunk-otel-collector.clusterReceiverServiceName" -}} +{{ printf "%s-k8s-cluster-receiver" ( include "splunk-otel-collector.fullname" . ) | trunc 63 | trimSuffix "-" }} +{{- end -}} + +{{/* +"clusterReceiverNodeDiscovererScript" for the eks/fargate cluster receiver statefulSet initContainer +*/}} +{{- define "splunk-otel-collector.clusterReceiverNodeDiscovererScript" -}} +{{ printf "%s-cr-node-discoverer-script" ( include "splunk-otel-collector.fullname" . ) | trunc 63 | trimSuffix "-" }} +{{- end -}} diff --git a/helm-charts/splunk-otel-collector/templates/clusterRole.yaml b/helm-charts/splunk-otel-collector/templates/clusterRole.yaml index d22d68aa46..d43de509c2 100644 --- a/helm-charts/splunk-otel-collector/templates/clusterRole.yaml +++ b/helm-charts/splunk-otel-collector/templates/clusterRole.yaml @@ -86,6 +86,14 @@ rules: - get - list - watch +{{- if eq (include "splunk-otel-collector.distribution" .) "eks/fargate" }} +- apiGroups: + - "" + resources: + - nodes + verbs: + - patch +{{- end }} {{- with .Values.rbac.customRules }} {{ toYaml . }} {{- end }} diff --git a/helm-charts/splunk-otel-collector/templates/config/_common.tpl b/helm-charts/splunk-otel-collector/templates/config/_common.tpl index 79557d5d1c..daa1207df3 100644 --- a/helm-charts/splunk-otel-collector/templates/config/_common.tpl +++ b/helm-charts/splunk-otel-collector/templates/config/_common.tpl @@ -69,7 +69,7 @@ resourcedetection: - env {{- if hasPrefix "gke" (include "splunk-otel-collector.distribution" .) }} - gke - {{- else if eq (include "splunk-otel-collector.distribution" .) "eks" }} + {{- else if hasPrefix "eks" (include "splunk-otel-collector.distribution" .) }} - eks {{- else if eq (include "splunk-otel-collector.distribution" .) "aks" }} - aks diff --git a/helm-charts/splunk-otel-collector/templates/config/_otel-k8s-cluster-receiver-config.tpl b/helm-charts/splunk-otel-collector/templates/config/_otel-k8s-cluster-receiver-config.tpl index dc34a23ccd..478301a1e2 100644 --- a/helm-charts/splunk-otel-collector/templates/config/_otel-k8s-cluster-receiver-config.tpl +++ b/helm-charts/splunk-otel-collector/templates/config/_otel-k8s-cluster-receiver-config.tpl @@ -11,6 +11,14 @@ extensions: memory_ballast: size_mib: ${SPLUNK_BALLAST_SIZE_MIB} + {{- if eq (include "splunk-otel-collector.distribution" .) "eks/fargate" }} + # k8s_observer w/ pod and node detection for eks/fargate deployment + k8s_observer: + auth_type: serviceAccount + observe_pods: true + observe_nodes: true + {{- end }} + receivers: # Prometheus receiver scraping metrics from the pod itself, both otel and fluentd prometheus/k8s_cluster_receiver: @@ -42,6 +50,26 @@ receivers: - reason: FailedCreate involvedObjectKind: Job {{- end }} + {{- if eq (include "splunk-otel-collector.distribution" .) "eks/fargate" }} + # dynamically created kubeletstats receiver to report all Fargate "node" kubelet stats + # with exception of collector "node's" own since Fargate forbids connection. + receiver_creator: + receivers: + kubeletstats: + rule: type == "k8s.node" && name contains "fargate" + config: + auth_type: serviceAccount + collection_interval: 10s + endpoint: "`endpoint`:`kubelet_endpoint_port`" + extra_metadata_labels: + - container.id + metric_groups: + - container + - pod + - node + watch_observers: + - k8s_observer + {{- end }} processors: {{- include "splunk-otel-collector.otelMemoryLimiterConfig" . | nindent 2 }} @@ -80,12 +108,6 @@ processors: - action: insert key: metric_source value: kubernetes - # XXX: Added so that Smart Agent metrics and OTel metrics don't map to the same MTS identity - # (same metric and dimension names and values) after mappings are applied. This would be - # the case if somebody uses the same cluster name from Smart Agent and OTel in the same org. - - action: insert - key: receiver - value: k8scluster - action: upsert key: k8s.cluster.name value: {{ .Values.clusterName }} @@ -95,6 +117,15 @@ processors: value: {{ .value }} {{- end }} + resource/k8s_cluster: + attributes: + # XXX: Added so that Smart Agent metrics and OTel metrics don't map to the same MTS identity + # (same metric and dimension names and values) after mappings are applied. This would be + # the case if somebody uses the same cluster name from Smart Agent and OTel in the same org. + - action: insert + key: receiver + value: k8scluster + exporters: {{- if eq (include "splunk-otel-collector.o11yMetricsEnabled" $) "true" }} signalfx: @@ -125,11 +156,27 @@ service: telemetry: metrics: address: 0.0.0.0:8889 + {{- if eq (include "splunk-otel-collector.distribution" .) "eks/fargate" }} + extensions: [health_check, memory_ballast, k8s_observer] + {{- else }} extensions: [health_check, memory_ballast] + {{- end }} pipelines: # k8s metrics pipeline metrics: receivers: [k8s_cluster] + processors: [memory_limiter, batch, resource, resource/k8s_cluster] + exporters: + {{- if (eq (include "splunk-otel-collector.o11yMetricsEnabled" .) "true") }} + - signalfx + {{- end }} + {{- if (eq (include "splunk-otel-collector.platformMetricsEnabled" $) "true") }} + - splunk_hec/platform_metrics + {{- end }} + + {{- if eq (include "splunk-otel-collector.distribution" .) "eks/fargate" }} + metrics/eks: + receivers: [receiver_creator] processors: [memory_limiter, batch, resource] exporters: {{- if (eq (include "splunk-otel-collector.o11yMetricsEnabled" .) "true") }} @@ -138,6 +185,7 @@ service: {{- if (eq (include "splunk-otel-collector.platformMetricsEnabled" $) "true") }} - splunk_hec/platform_metrics {{- end }} + {{- end }} {{- if or (eq (include "splunk-otel-collector.splunkO11yEnabled" $) "true") (eq (include "splunk-otel-collector.platformMetricsEnabled" $) "true") }} # Pipeline for metrics collected about the collector pod itself. diff --git a/helm-charts/splunk-otel-collector/templates/configmap-agent.yaml b/helm-charts/splunk-otel-collector/templates/configmap-agent.yaml index 306c2b557a..56de122fd3 100644 --- a/helm-charts/splunk-otel-collector/templates/configmap-agent.yaml +++ b/helm-charts/splunk-otel-collector/templates/configmap-agent.yaml @@ -1,5 +1,8 @@ {{ $agent := fromYaml (include "splunk-otel-collector.agent" .) }} -{{ if $agent.enabled }} +{{/* +Fargate doesn't support daemonsets so never use for that platform +*/}} +{{- if and $agent.enabled (ne (include "splunk-otel-collector.distribution" .) "eks/fargate") }} apiVersion: v1 kind: ConfigMap metadata: diff --git a/helm-charts/splunk-otel-collector/templates/configmap-cluster-receiver-node-discoverer-script.yaml b/helm-charts/splunk-otel-collector/templates/configmap-cluster-receiver-node-discoverer-script.yaml new file mode 100644 index 0000000000..175428334a --- /dev/null +++ b/helm-charts/splunk-otel-collector/templates/configmap-cluster-receiver-node-discoverer-script.yaml @@ -0,0 +1,16 @@ +{{ $clusterReceiver := fromYaml (include "splunk-otel-collector.clusterReceiver" .) }} +{{ if and $clusterReceiver.enabled (eq (include "splunk-otel-collector.metricsEnabled" .) "true") (eq (include "splunk-otel-collector.distribution" .) "eks/fargate") }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "splunk-otel-collector.clusterReceiverNodeDiscovererScript" . }} + labels: + {{- include "splunk-otel-collector.commonLabels" . | nindent 4 }} + app: {{ template "splunk-otel-collector.name" . }} + chart: {{ template "splunk-otel-collector.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: + script: | + {{- (.Files.Get "scripts/init-eks-fargate-cluster-receiver.sh") | nindent 4 }} +{{- end }} diff --git a/helm-charts/splunk-otel-collector/templates/daemonset.yaml b/helm-charts/splunk-otel-collector/templates/daemonset.yaml index d6279ae3dd..742a195cb8 100644 --- a/helm-charts/splunk-otel-collector/templates/daemonset.yaml +++ b/helm-charts/splunk-otel-collector/templates/daemonset.yaml @@ -1,5 +1,8 @@ {{ $agent := fromYaml (include "splunk-otel-collector.agent" .) }} -{{- if $agent.enabled }} +{{/* +Fargate doesn't support daemonsets so never use for that platform +*/}} +{{- if and $agent.enabled (ne (include "splunk-otel-collector.distribution" .) "eks/fargate") }} apiVersion: apps/v1 kind: DaemonSet metadata: diff --git a/helm-charts/splunk-otel-collector/templates/deployment-cluster-receiver.yaml b/helm-charts/splunk-otel-collector/templates/deployment-cluster-receiver.yaml index 1004068a24..d306767587 100644 --- a/helm-charts/splunk-otel-collector/templates/deployment-cluster-receiver.yaml +++ b/helm-charts/splunk-otel-collector/templates/deployment-cluster-receiver.yaml @@ -1,7 +1,12 @@ {{ $clusterReceiver := fromYaml (include "splunk-otel-collector.clusterReceiver" .) }} {{- if and $clusterReceiver.enabled (eq (include "splunk-otel-collector.metricsEnabled" .) "true") }} apiVersion: apps/v1 -kind: Deployment +{{- /* +eks/fargate distributions use a two-replica StatefulSet instead of a single node deployment. +The first replica monitors all fargate node kubelets (except its own) via k8s_observer and kubeletstats receiver. +The second replica monitors the first replica's kubelet and the cluster. +*/}} +kind: {{- if eq (include "splunk-otel-collector.distribution" .) "eks/fargate" }} StatefulSet {{- else }} Deployment {{- end }} metadata: name: {{ template "splunk-otel-collector.fullname" . }}-k8s-cluster-receiver labels: @@ -17,7 +22,11 @@ metadata: {{- toYaml $clusterReceiver.annotations | nindent 4 }} {{- end }} spec: - replicas: 1 + replicas: {{- if eq (include "splunk-otel-collector.distribution" .) "eks/fargate" }} 2 {{- else }} 1 {{- end }} + {{- if eq (include "splunk-otel-collector.distribution" .) "eks/fargate" }} + serviceName: {{ template "splunk-otel-collector.clusterReceiverServiceName" . }} + podManagementPolicy: Parallel + {{- end }} selector: matchLabels: app: {{ template "splunk-otel-collector.name" . }} @@ -52,14 +61,48 @@ spec: tolerations: {{ toYaml $clusterReceiver.tolerations | nindent 8 }} {{- end }} - {{- if $clusterReceiver.affinity }} + {{- if or $clusterReceiver.affinity (eq (include "splunk-otel-collector.distribution" .) "eks/fargate") }} affinity: - {{- toYaml $clusterReceiver.affinity | nindent 8 }} + {{- $clusterReceiverPodAntiAffinity := ` + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: component + operator: In + values: + - otel-k8s-cluster-receiver + topologyKey: kubernetes.io/hostname + ` }} + {{- $clusterReceiver.affinity | mustMergeOverwrite (fromYaml $clusterReceiverPodAntiAffinity) | toYaml | nindent 8 }} {{- end }} {{- if $clusterReceiver.securityContext }} securityContext: {{ toYaml $clusterReceiver.securityContext | nindent 8 }} {{- end }} + {{- if eq (include "splunk-otel-collector.distribution" .) "eks/fargate" }} + initContainers: + - name: cluster-receiver-node-discoverer + image: public.ecr.aws/amazonlinux/amazonlinux:latest + imagePullPolicy: IfNotPresent + command: ["bash", "-c", "/splunk-scripts/init-eks-fargate-cluster-receiver.sh"] + env: + - name: K8S_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: K8S_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + volumeMounts: + - name: init-eks-fargate-cluster-receiver-script + mountPath: /splunk-scripts + - name: messages + mountPath: /splunk-messages + - mountPath: /conf + name: collector-configmap + {{- end }} containers: - name: otel-collector command: @@ -70,8 +113,12 @@ spec: - --config=C:\\conf\relay.yaml {{- else }} - /otelcol + {{- if eq (include "splunk-otel-collector.distribution" .) "eks/fargate" }} + - --config=/splunk-messages/config.yaml + {{- else }} - --config=/conf/relay.yaml {{- end }} + {{- end }} image: {{ template "splunk-otel-collector.image.otelcol" . }} imagePullPolicy: {{ .Values.image.otelcol.pullPolicy }} env: @@ -134,6 +181,10 @@ spec: volumeMounts: - mountPath: {{ .Values.isWindows | ternary "C:\\conf" "/conf" }} name: collector-configmap + {{- if eq (include "splunk-otel-collector.distribution" .) "eks/fargate" }} + - mountPath: /splunk-messages + name: messages + {{- end }} {{- if $clusterReceiver.extraVolumeMounts }} {{- toYaml $clusterReceiver.extraVolumeMounts | nindent 8 }} {{- end }} @@ -145,6 +196,17 @@ spec: items: - key: relay path: relay.yaml + {{- if eq (include "splunk-otel-collector.distribution" .) "eks/fargate" }} + - name: init-eks-fargate-cluster-receiver-script + configMap: + name: {{ template "splunk-otel-collector.clusterReceiverNodeDiscovererScript" . }} + items: + - key: script + path: init-eks-fargate-cluster-receiver.sh + mode: 0555 + - name: messages + emptyDir: {} + {{- end }} {{- if $clusterReceiver.extraVolumes }} {{- toYaml $clusterReceiver.extraVolumes | nindent 6 }} {{- end }} diff --git a/helm-charts/splunk-otel-collector/templates/service-cluster-receiver-stateful-set.yaml b/helm-charts/splunk-otel-collector/templates/service-cluster-receiver-stateful-set.yaml new file mode 100644 index 0000000000..e561f750f5 --- /dev/null +++ b/helm-charts/splunk-otel-collector/templates/service-cluster-receiver-stateful-set.yaml @@ -0,0 +1,14 @@ +{{- if eq (include "splunk-otel-collector.distribution" .) "eks/fargate" }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ template "splunk-otel-collector.clusterReceiverServiceName" . }} + labels: + app: {{ template "splunk-otel-collector.name" . }} +spec: + clusterIP: None + selector: + app: {{ template "splunk-otel-collector.name" . }} + component: otel-k8s-cluster-receiver +{{- end }} diff --git a/helm-charts/splunk-otel-collector/values.schema.json b/helm-charts/splunk-otel-collector/values.schema.json index 0639373dd9..9eca5291ad 100644 --- a/helm-charts/splunk-otel-collector/values.schema.json +++ b/helm-charts/splunk-otel-collector/values.schema.json @@ -197,6 +197,7 @@ "type": "string", "enum": [ "eks", + "eks/fargate", "gke", "gke/autopilot", "aks", diff --git a/helm-charts/splunk-otel-collector/values.yaml b/helm-charts/splunk-otel-collector/values.yaml index d8e77875e4..6870b9dc51 100644 --- a/helm-charts/splunk-otel-collector/values.yaml +++ b/helm-charts/splunk-otel-collector/values.yaml @@ -125,10 +125,11 @@ cloudProvider: "" ################################################################################ # Kubernetes distribution being run. Leave empty for other. +# - "aks" (Azure Kubernetes Service) # - "eks" (Amazon Elastic Kubernetes Service) +# - "eks/fargate" (Amazon Elastic Kubernetes Service with Fargate profiles ) # - "gke" (Google Kubernetes Engine / Standard mode) # - "gke/autopilot" (Google Kubernetes Engine / Autopilot mode) -# - "aks" (Azure Kubernetes Service) # - "openshift" (RedHat OpenShift) ################################################################################ diff --git a/rendered/manifests/agent-only/configmap-cluster-receiver.yaml b/rendered/manifests/agent-only/configmap-cluster-receiver.yaml index 0050ec98de..7bb4d8dcef 100644 --- a/rendered/manifests/agent-only/configmap-cluster-receiver.yaml +++ b/rendered/manifests/agent-only/configmap-cluster-receiver.yaml @@ -36,9 +36,6 @@ data: - action: insert key: metric_source value: kubernetes - - action: insert - key: receiver - value: k8scluster - action: upsert key: k8s.cluster.name value: CHANGEME @@ -56,6 +53,11 @@ data: - action: insert key: k8s.namespace.name value: ${K8S_NAMESPACE} + resource/k8s_cluster: + attributes: + - action: insert + key: receiver + value: k8scluster resourcedetection: detectors: - env @@ -87,6 +89,7 @@ data: - memory_limiter - batch - resource + - resource/k8s_cluster receivers: - k8s_cluster metrics/collector: diff --git a/rendered/manifests/agent-only/deployment-cluster-receiver.yaml b/rendered/manifests/agent-only/deployment-cluster-receiver.yaml index 346b9b288e..e89a8abb2e 100644 --- a/rendered/manifests/agent-only/deployment-cluster-receiver.yaml +++ b/rendered/manifests/agent-only/deployment-cluster-receiver.yaml @@ -30,7 +30,7 @@ spec: component: otel-k8s-cluster-receiver release: default annotations: - checksum/config: 95fad8a7a34350631ceacc2fc8498d3ae05d1be9df4fd9e71dd6036be4fa1919 + checksum/config: fe6a43ddd66a904c3e515232f6581738fba02d015ac9e5a55b98122b120e4bf2 spec: serviceAccountName: default-splunk-otel-collector nodeSelector: diff --git a/rendered/manifests/eks-fargate/clusterRole.yaml b/rendered/manifests/eks-fargate/clusterRole.yaml new file mode 100644 index 0000000000..d993a88e65 --- /dev/null +++ b/rendered/manifests/eks-fargate/clusterRole.yaml @@ -0,0 +1,89 @@ +--- +# Source: splunk-otel-collector/templates/clusterRole.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: default-splunk-otel-collector + labels: + app.kubernetes.io/name: splunk-otel-collector + helm.sh/chart: splunk-otel-collector-0.43.0 + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/instance: default + app.kubernetes.io/version: "0.43.0" + app: splunk-otel-collector + chart: splunk-otel-collector-0.43.0 + release: default + heritage: Helm +rules: +- apiGroups: + - "" + resources: + - events + - namespaces + - namespaces/status + - nodes + - nodes/spec + - nodes/stats + - nodes/proxy + - pods + - pods/status + - persistentvolumeclaims + - persistentvolumes + - 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 +- nonResourceURLs: + - /metrics + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - nodes + verbs: + - patch diff --git a/rendered/manifests/eks-fargate/clusterRoleBinding.yaml b/rendered/manifests/eks-fargate/clusterRoleBinding.yaml new file mode 100644 index 0000000000..bb0b10518f --- /dev/null +++ b/rendered/manifests/eks-fargate/clusterRoleBinding.yaml @@ -0,0 +1,24 @@ +--- +# Source: splunk-otel-collector/templates/clusterRoleBinding.yaml +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: default-splunk-otel-collector + labels: + app.kubernetes.io/name: splunk-otel-collector + helm.sh/chart: splunk-otel-collector-0.43.0 + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/instance: default + app.kubernetes.io/version: "0.43.0" + app: splunk-otel-collector + chart: splunk-otel-collector-0.43.0 + release: default + heritage: Helm +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: default-splunk-otel-collector +subjects: +- kind: ServiceAccount + name: default-splunk-otel-collector + namespace: default diff --git a/rendered/manifests/eks-fargate/configmap-cluster-receiver-node-discoverer-script.yaml b/rendered/manifests/eks-fargate/configmap-cluster-receiver-node-discoverer-script.yaml new file mode 100644 index 0000000000..06c2bb1435 --- /dev/null +++ b/rendered/manifests/eks-fargate/configmap-cluster-receiver-node-discoverer-script.yaml @@ -0,0 +1,62 @@ +--- +# Source: splunk-otel-collector/templates/configmap-cluster-receiver-node-discoverer-script.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: default-splunk-otel-collector-cr-node-discoverer-script + labels: + app.kubernetes.io/name: splunk-otel-collector + helm.sh/chart: splunk-otel-collector-0.43.0 + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/instance: default + app.kubernetes.io/version: "0.43.0" + app: splunk-otel-collector + chart: splunk-otel-collector-0.43.0 + release: default + heritage: Helm +data: + script: | + #! /usr/bin/bash + set -ex + + echo "Downloading yq" + curl -L -o yq https://github.com/mikefarah/yq/releases/download/v4.16.2/yq_linux_amd64 + ACTUAL=$(sha256sum yq | awk '{print $1}') + if [ "${ACTUAL}" != "5c911c4da418ae64af5527b7ee36e77effb85de20c2ce732ed14c7f72743084d" ]; then + echo "will not attempt to use yq with unexpected sha256 (${ACTUAL} != 5c911c4da418ae64af5527b7ee36e77effb85de20c2ce732ed14c7f72743084d)" + exit 1 + fi + chmod a+x yq + + # If we are the first pod (cluster receiver), set the kubelet stats node filter to only follow labelled nodes. + # This node label will be set by the second pod. + if [[ "${K8S_POD_NAME}" == *-0 ]]; then + echo "will configure kubelet stats receiver to follow other StatefulSet replica's node, as well as use cluster receiver." + ./yq e '.receivers.receiver_creator.receivers.kubeletstats.rule = .receivers.receiver_creator.receivers.kubeletstats.rule + " && labels[\"splunk-otel-eks-fargate-kubeletstats-receiver-node\"] == \"true\""' /conf/relay.yaml >/splunk-messages/config.yaml + ./yq e -i '.extensions.k8s_observer.observe_pods = false' /splunk-messages/config.yaml + exit 0 + fi + + # Else we are the second pod (wide kubelet stats) label our node to be monitored by the first pod and disable the k8s_cluster receiver. + # Update our config to not monitor ourselves + echo "Labelling our fargate node to denote it hosts the cluster receiver" + + # download kubectl (verifying checksum) + curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.20.4/2021-04-12/bin/linux/amd64/kubectl + ACTUAL=$(sha256sum kubectl | awk '{print $1}') + if [ "${ACTUAL}" != "e84ff8c607b2a10f635c312403f9ede40a045404957e55adcf3d663f9e32c630" ]; then + echo "will not attempt to use kubectl with unexpected sha256 (${ACTUAL} != e84ff8c607b2a10f635c312403f9ede40a045404957e55adcf3d663f9e32c630)" + exit 1 + fi + chmod a+x kubectl + # label node + ./kubectl label nodes $K8S_NODE_NAME splunk-otel-eks-fargate-kubeletstats-receiver-node=true + + echo "Disabling k8s_cluster receiver for this instance" + # strip k8s_cluster and its pipeline + ./yq e 'del(.service.pipelines.metrics)' /conf/relay.yaml >/splunk-messages/config.yaml + ./yq e -i 'del(.receivers.k8s_cluster)' /splunk-messages/config.yaml + + # set kubelet stats to not monitor ourselves (all other kubelets) + echo "Ensuring k8s_observer-based kubeletstats receivers won't monitor own node to avoid Fargate network limitation." + ./yq e -i '.receivers.receiver_creator.receivers.kubeletstats.rule = .receivers.receiver_creator.receivers.kubeletstats.rule + " && not ( name contains \"${K8S_NODE_NAME}\" )"' /splunk-messages/config.yaml diff --git a/rendered/manifests/eks-fargate/configmap-cluster-receiver.yaml b/rendered/manifests/eks-fargate/configmap-cluster-receiver.yaml new file mode 100644 index 0000000000..b5ae606bdc --- /dev/null +++ b/rendered/manifests/eks-fargate/configmap-cluster-receiver.yaml @@ -0,0 +1,140 @@ +--- +# Source: splunk-otel-collector/templates/configmap-cluster-receiver.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: default-splunk-otel-collector-otel-k8s-cluster-receiver + labels: + app.kubernetes.io/name: splunk-otel-collector + helm.sh/chart: splunk-otel-collector-0.43.0 + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/instance: default + app.kubernetes.io/version: "0.43.0" + app: splunk-otel-collector + chart: splunk-otel-collector-0.43.0 + release: default + heritage: Helm +data: + relay: | + exporters: + signalfx: + access_token: ${SPLUNK_OBSERVABILITY_ACCESS_TOKEN} + api_url: http://default-splunk-otel-collector:6060 + ingest_url: http://default-splunk-otel-collector:9943 + timeout: 10s + extensions: + health_check: null + k8s_observer: + auth_type: serviceAccount + observe_nodes: true + observe_pods: true + memory_ballast: + size_mib: ${SPLUNK_BALLAST_SIZE_MIB} + processors: + batch: null + memory_limiter: + check_interval: 2s + limit_mib: ${SPLUNK_MEMORY_LIMIT_MIB} + resource: + attributes: + - action: insert + key: metric_source + value: kubernetes + - action: upsert + key: k8s.cluster.name + value: CHANGEME + resource/add_collector_k8s: + attributes: + - action: insert + key: k8s.node.name + value: ${K8S_NODE_NAME} + - action: insert + key: k8s.pod.name + value: ${K8S_POD_NAME} + - action: insert + key: k8s.pod.uid + value: ${K8S_POD_UID} + - action: insert + key: k8s.namespace.name + value: ${K8S_NAMESPACE} + resource/k8s_cluster: + attributes: + - action: insert + key: receiver + value: k8scluster + resourcedetection: + detectors: + - env + - eks + - ec2 + - system + override: false + timeout: 10s + receivers: + k8s_cluster: + auth_type: serviceAccount + metadata_exporters: + - signalfx + prometheus/k8s_cluster_receiver: + config: + scrape_configs: + - job_name: otel-k8s-cluster-receiver + scrape_interval: 10s + static_configs: + - targets: + - ${K8S_POD_IP}:8889 + receiver_creator: + receivers: + kubeletstats: + config: + auth_type: serviceAccount + collection_interval: 10s + endpoint: '`endpoint`:`kubelet_endpoint_port`' + extra_metadata_labels: + - container.id + metric_groups: + - container + - pod + - node + rule: type == "k8s.node" && name contains "fargate" + watch_observers: + - k8s_observer + service: + extensions: + - health_check + - memory_ballast + - k8s_observer + pipelines: + metrics: + exporters: + - signalfx + processors: + - memory_limiter + - batch + - resource + - resource/k8s_cluster + receivers: + - k8s_cluster + metrics/collector: + exporters: + - signalfx + processors: + - memory_limiter + - batch + - resource + - resource/add_collector_k8s + - resourcedetection + receivers: + - prometheus/k8s_cluster_receiver + metrics/eks: + exporters: + - signalfx + processors: + - memory_limiter + - batch + - resource + receivers: + - receiver_creator + telemetry: + metrics: + address: 0.0.0.0:8889 diff --git a/rendered/manifests/eks-fargate/configmap-gateway.yaml b/rendered/manifests/eks-fargate/configmap-gateway.yaml new file mode 100644 index 0000000000..6c727d97a7 --- /dev/null +++ b/rendered/manifests/eks-fargate/configmap-gateway.yaml @@ -0,0 +1,192 @@ +--- +# Source: splunk-otel-collector/templates/configmap-gateway.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: default-splunk-otel-collector-otel-collector + labels: + app.kubernetes.io/name: splunk-otel-collector + helm.sh/chart: splunk-otel-collector-0.43.0 + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/instance: default + app.kubernetes.io/version: "0.43.0" + app: splunk-otel-collector + chart: splunk-otel-collector-0.43.0 + release: default + heritage: Helm +data: + relay: | + exporters: + sapm: + access_token: ${SPLUNK_OBSERVABILITY_ACCESS_TOKEN} + endpoint: https://ingest.CHANGEME.signalfx.com/v2/trace + signalfx: + access_token: ${SPLUNK_OBSERVABILITY_ACCESS_TOKEN} + api_url: https://api.CHANGEME.signalfx.com + ingest_url: https://ingest.CHANGEME.signalfx.com + extensions: + health_check: null + http_forwarder: + egress: + endpoint: https://api.CHANGEME.signalfx.com + memory_ballast: + size_mib: ${SPLUNK_BALLAST_SIZE_MIB} + zpages: null + processors: + batch: null + filter/logs: + logs: + exclude: + resource_attributes: + - key: splunk.com/exclude + value: "true" + k8sattributes: + extract: + annotations: + - from: pod + key: splunk.com/sourcetype + - from: namespace + key: splunk.com/exclude + tag_name: splunk.com/exclude + - from: pod + key: splunk.com/exclude + tag_name: splunk.com/exclude + - from: namespace + key: splunk.com/index + tag_name: com.splunk.index + - from: pod + key: splunk.com/index + tag_name: com.splunk.index + labels: + - key: app + metadata: + - k8s.namespace.name + - k8s.node.name + - k8s.pod.name + - k8s.pod.uid + pod_association: + - from: resource_attribute + name: k8s.pod.uid + - from: resource_attribute + name: k8s.pod.ip + - from: resource_attribute + name: ip + - from: connection + - from: resource_attribute + name: host.name + memory_limiter: + check_interval: 2s + limit_mib: ${SPLUNK_MEMORY_LIMIT_MIB} + resource/add_cluster_name: + attributes: + - action: upsert + key: k8s.cluster.name + value: CHANGEME + resource/add_collector_k8s: + attributes: + - action: insert + key: k8s.node.name + value: ${K8S_NODE_NAME} + - action: insert + key: k8s.pod.name + value: ${K8S_POD_NAME} + - action: insert + key: k8s.pod.uid + value: ${K8S_POD_UID} + - action: insert + key: k8s.namespace.name + value: ${K8S_NAMESPACE} + resource/logs: + attributes: + - action: upsert + from_attribute: k8s.pod.annotations.splunk.com/sourcetype + key: com.splunk.sourcetype + - action: delete + key: k8s.pod.annotations.splunk.com/sourcetype + - action: delete + key: splunk.com/exclude + resourcedetection: + detectors: + - env + - eks + - ec2 + - system + override: false + timeout: 10s + receivers: + jaeger: + protocols: + grpc: + endpoint: 0.0.0.0:14250 + thrift_http: + endpoint: 0.0.0.0:14268 + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + http: + endpoint: 0.0.0.0:4318 + prometheus/collector: + config: + scrape_configs: + - job_name: otel-collector + scrape_interval: 10s + static_configs: + - targets: + - ${K8S_POD_IP}:8889 + signalfx: + access_token_passthrough: true + endpoint: 0.0.0.0:9943 + zipkin: + endpoint: 0.0.0.0:9411 + service: + extensions: + - health_check + - memory_ballast + - zpages + - http_forwarder + pipelines: + logs/signalfx-events: + exporters: + - signalfx + processors: + - memory_limiter + - batch + receivers: + - signalfx + metrics: + exporters: + - signalfx + processors: + - memory_limiter + - batch + - resource/add_cluster_name + receivers: + - otlp + - signalfx + metrics/collector: + exporters: + - signalfx + processors: + - memory_limiter + - batch + - resource/add_cluster_name + - resource/add_collector_k8s + - resourcedetection + receivers: + - prometheus/collector + traces: + exporters: + - sapm + processors: + - memory_limiter + - batch + - k8sattributes + - resource/add_cluster_name + receivers: + - otlp + - jaeger + - zipkin + telemetry: + metrics: + address: 0.0.0.0:8889 diff --git a/rendered/manifests/eks-fargate/deployment-cluster-receiver.yaml b/rendered/manifests/eks-fargate/deployment-cluster-receiver.yaml new file mode 100644 index 0000000000..1982419d0a --- /dev/null +++ b/rendered/manifests/eks-fargate/deployment-cluster-receiver.yaml @@ -0,0 +1,140 @@ +--- +# Source: splunk-otel-collector/templates/deployment-cluster-receiver.yaml +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: default-splunk-otel-collector-k8s-cluster-receiver + labels: + app.kubernetes.io/name: splunk-otel-collector + helm.sh/chart: splunk-otel-collector-0.43.0 + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/instance: default + app.kubernetes.io/version: "0.43.0" + app: splunk-otel-collector + component: otel-k8s-cluster-receiver + chart: splunk-otel-collector-0.43.0 + release: default + heritage: Helm + app.kubernetes.io/component: otel-k8s-cluster-receiver +spec: + replicas: 2 + serviceName: default-splunk-otel-collector-k8s-cluster-receiver + podManagementPolicy: Parallel + selector: + matchLabels: + app: splunk-otel-collector + component: otel-k8s-cluster-receiver + release: default + template: + metadata: + labels: + app: splunk-otel-collector + component: otel-k8s-cluster-receiver + release: default + annotations: + checksum/config: 6bae8b72d7e224b89e1decd55ee30ad1a945976c7b250db54e8bba13790c4536 + spec: + serviceAccountName: default-splunk-otel-collector + nodeSelector: + kubernetes.io/os: linux + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: component + operator: In + values: + - otel-k8s-cluster-receiver + topologyKey: kubernetes.io/hostname + initContainers: + - name: cluster-receiver-node-discoverer + image: public.ecr.aws/amazonlinux/amazonlinux:latest + imagePullPolicy: IfNotPresent + command: ["bash", "-c", "/splunk-scripts/init-eks-fargate-cluster-receiver.sh"] + env: + - name: K8S_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: K8S_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + volumeMounts: + - name: init-eks-fargate-cluster-receiver-script + mountPath: /splunk-scripts + - name: messages + mountPath: /splunk-messages + - mountPath: /conf + name: collector-configmap + containers: + - name: otel-collector + command: + - /otelcol + - --config=/splunk-messages/config.yaml + image: quay.io/signalfx/splunk-otel-collector:0.43.0 + imagePullPolicy: IfNotPresent + env: + - name: SPLUNK_MEMORY_TOTAL_MIB + value: "500" + - name: K8S_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: K8S_POD_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: K8S_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: K8S_POD_UID + valueFrom: + fieldRef: + fieldPath: metadata.uid + - name: K8S_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: SPLUNK_OBSERVABILITY_ACCESS_TOKEN + valueFrom: + secretKeyRef: + name: splunk-otel-collector + key: splunk_observability_access_token + readinessProbe: + httpGet: + path: / + port: 13133 + livenessProbe: + httpGet: + path: / + port: 13133 + resources: + limits: + cpu: 200m + memory: 500Mi + volumeMounts: + - mountPath: /conf + name: collector-configmap + - mountPath: /splunk-messages + name: messages + terminationGracePeriodSeconds: 600 + volumes: + - name: collector-configmap + configMap: + name: default-splunk-otel-collector-otel-k8s-cluster-receiver + items: + - key: relay + path: relay.yaml + - name: init-eks-fargate-cluster-receiver-script + configMap: + name: default-splunk-otel-collector-cr-node-discoverer-script + items: + - key: script + path: init-eks-fargate-cluster-receiver.sh + mode: 0555 + - name: messages + emptyDir: {} diff --git a/rendered/manifests/eks-fargate/deployment-gateway.yaml b/rendered/manifests/eks-fargate/deployment-gateway.yaml new file mode 100644 index 0000000000..bbc7325ffe --- /dev/null +++ b/rendered/manifests/eks-fargate/deployment-gateway.yaml @@ -0,0 +1,121 @@ +--- +# Source: splunk-otel-collector/templates/deployment-gateway.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: default-splunk-otel-collector + labels: + app.kubernetes.io/name: splunk-otel-collector + helm.sh/chart: splunk-otel-collector-0.43.0 + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/instance: default + app.kubernetes.io/version: "0.43.0" + app: splunk-otel-collector + component: otel-collector + chart: splunk-otel-collector-0.43.0 + release: default + heritage: Helm + app.kubernetes.io/component: otel-collector +spec: + replicas: 3 + selector: + matchLabels: + app: splunk-otel-collector + component: otel-collector + release: default + template: + metadata: + labels: + app: splunk-otel-collector + component: otel-collector + release: default + annotations: + checksum/config: e4244516eb9109cf1d80da5e64d70d1c465bdff47cb0adff728726175d8a87e2 + spec: + serviceAccountName: default-splunk-otel-collector + nodeSelector: + kubernetes.io/os: linux + containers: + - name: otel-collector + command: + - /otelcol + - --config=/conf/relay.yaml + image: quay.io/signalfx/splunk-otel-collector:0.43.0 + imagePullPolicy: IfNotPresent + env: + - name: SPLUNK_MEMORY_TOTAL_MIB + value: "8192" + - name: K8S_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: K8S_POD_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: K8S_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: K8S_POD_UID + valueFrom: + fieldRef: + fieldPath: metadata.uid + - name: K8S_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: SPLUNK_OBSERVABILITY_ACCESS_TOKEN + valueFrom: + secretKeyRef: + name: splunk-otel-collector + key: splunk_observability_access_token + ports: + - name: http-forwarder + containerPort: 6060 + protocol: TCP + - name: jaeger-grpc + containerPort: 14250 + protocol: TCP + - name: jaeger-thrift + containerPort: 14268 + protocol: TCP + - name: otlp + containerPort: 4317 + protocol: TCP + - name: otlp-http + containerPort: 4318 + protocol: TCP + - name: otlp-http-old + containerPort: 55681 + protocol: TCP + - name: signalfx + containerPort: 9943 + protocol: TCP + - name: zipkin + containerPort: 9411 + protocol: TCP + readinessProbe: + httpGet: + path: / + port: 13133 + livenessProbe: + httpGet: + path: / + port: 13133 + resources: + limits: + cpu: 4 + memory: 8Gi + volumeMounts: + - mountPath: /conf + name: collector-configmap + terminationGracePeriodSeconds: 600 + volumes: + - name: collector-configmap + configMap: + name: default-splunk-otel-collector-otel-collector + items: + - key: relay + path: relay.yaml diff --git a/rendered/manifests/eks-fargate/secret.yaml b/rendered/manifests/eks-fargate/secret.yaml new file mode 100644 index 0000000000..6495f93518 --- /dev/null +++ b/rendered/manifests/eks-fargate/secret.yaml @@ -0,0 +1,19 @@ +--- +# Source: splunk-otel-collector/templates/secret.yaml +apiVersion: v1 +kind: Secret +metadata: + name: splunk-otel-collector + labels: + app.kubernetes.io/name: splunk-otel-collector + helm.sh/chart: splunk-otel-collector-0.43.0 + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/instance: default + app.kubernetes.io/version: "0.43.0" + app: splunk-otel-collector + chart: splunk-otel-collector-0.43.0 + release: default + heritage: Helm +type: Opaque +data: + splunk_observability_access_token: Q0hBTkdFTUU= diff --git a/rendered/manifests/eks-fargate/service-cluster-receiver-stateful-set.yaml b/rendered/manifests/eks-fargate/service-cluster-receiver-stateful-set.yaml new file mode 100644 index 0000000000..7b4caba456 --- /dev/null +++ b/rendered/manifests/eks-fargate/service-cluster-receiver-stateful-set.yaml @@ -0,0 +1,13 @@ +--- +# Source: splunk-otel-collector/templates/service-cluster-receiver-stateful-set.yaml +apiVersion: v1 +kind: Service +metadata: + name: default-splunk-otel-collector-k8s-cluster-receiver + labels: + app: splunk-otel-collector +spec: + clusterIP: None + selector: + app: splunk-otel-collector + component: otel-k8s-cluster-receiver diff --git a/rendered/manifests/eks-fargate/service.yaml b/rendered/manifests/eks-fargate/service.yaml new file mode 100644 index 0000000000..4625227452 --- /dev/null +++ b/rendered/manifests/eks-fargate/service.yaml @@ -0,0 +1,57 @@ +--- +# Source: splunk-otel-collector/templates/service.yaml +apiVersion: v1 +kind: Service +metadata: + name: default-splunk-otel-collector + labels: + app.kubernetes.io/name: splunk-otel-collector + helm.sh/chart: splunk-otel-collector-0.43.0 + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/instance: default + app.kubernetes.io/version: "0.43.0" + app: splunk-otel-collector + component: otel-collector + chart: splunk-otel-collector-0.43.0 + release: default + heritage: Helm + app.kubernetes.io/component: otel-collector +spec: + type: ClusterIP + ports: + - name: http-forwarder + port: 6060 + targetPort: http-forwarder + protocol: TCP + - name: jaeger-grpc + port: 14250 + targetPort: jaeger-grpc + protocol: TCP + - name: jaeger-thrift + port: 14268 + targetPort: jaeger-thrift + protocol: TCP + - name: otlp + port: 4317 + targetPort: otlp + protocol: TCP + - name: otlp-http + port: 4318 + targetPort: otlp-http + protocol: TCP + - name: otlp-http-old + port: 55681 + targetPort: otlp-http-old + protocol: TCP + - name: signalfx + port: 9943 + targetPort: signalfx + protocol: TCP + - name: zipkin + port: 9411 + targetPort: zipkin + protocol: TCP + selector: + app: splunk-otel-collector + component: otel-collector + release: default diff --git a/rendered/manifests/eks-fargate/serviceAccount.yaml b/rendered/manifests/eks-fargate/serviceAccount.yaml new file mode 100644 index 0000000000..f78e2b88a6 --- /dev/null +++ b/rendered/manifests/eks-fargate/serviceAccount.yaml @@ -0,0 +1,16 @@ +--- +# Source: splunk-otel-collector/templates/serviceAccount.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: default-splunk-otel-collector + labels: + app.kubernetes.io/name: splunk-otel-collector + helm.sh/chart: splunk-otel-collector-0.43.0 + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/instance: default + app.kubernetes.io/version: "0.43.0" + app: splunk-otel-collector + chart: splunk-otel-collector-0.43.0 + release: default + heritage: Helm diff --git a/rendered/manifests/metrics-only/configmap-cluster-receiver.yaml b/rendered/manifests/metrics-only/configmap-cluster-receiver.yaml index 0050ec98de..7bb4d8dcef 100644 --- a/rendered/manifests/metrics-only/configmap-cluster-receiver.yaml +++ b/rendered/manifests/metrics-only/configmap-cluster-receiver.yaml @@ -36,9 +36,6 @@ data: - action: insert key: metric_source value: kubernetes - - action: insert - key: receiver - value: k8scluster - action: upsert key: k8s.cluster.name value: CHANGEME @@ -56,6 +53,11 @@ data: - action: insert key: k8s.namespace.name value: ${K8S_NAMESPACE} + resource/k8s_cluster: + attributes: + - action: insert + key: receiver + value: k8scluster resourcedetection: detectors: - env @@ -87,6 +89,7 @@ data: - memory_limiter - batch - resource + - resource/k8s_cluster receivers: - k8s_cluster metrics/collector: diff --git a/rendered/manifests/metrics-only/deployment-cluster-receiver.yaml b/rendered/manifests/metrics-only/deployment-cluster-receiver.yaml index 346b9b288e..e89a8abb2e 100644 --- a/rendered/manifests/metrics-only/deployment-cluster-receiver.yaml +++ b/rendered/manifests/metrics-only/deployment-cluster-receiver.yaml @@ -30,7 +30,7 @@ spec: component: otel-k8s-cluster-receiver release: default annotations: - checksum/config: 95fad8a7a34350631ceacc2fc8498d3ae05d1be9df4fd9e71dd6036be4fa1919 + checksum/config: fe6a43ddd66a904c3e515232f6581738fba02d015ac9e5a55b98122b120e4bf2 spec: serviceAccountName: default-splunk-otel-collector nodeSelector: diff --git a/rendered/manifests/otel-logs/configmap-cluster-receiver.yaml b/rendered/manifests/otel-logs/configmap-cluster-receiver.yaml index 0050ec98de..7bb4d8dcef 100644 --- a/rendered/manifests/otel-logs/configmap-cluster-receiver.yaml +++ b/rendered/manifests/otel-logs/configmap-cluster-receiver.yaml @@ -36,9 +36,6 @@ data: - action: insert key: metric_source value: kubernetes - - action: insert - key: receiver - value: k8scluster - action: upsert key: k8s.cluster.name value: CHANGEME @@ -56,6 +53,11 @@ data: - action: insert key: k8s.namespace.name value: ${K8S_NAMESPACE} + resource/k8s_cluster: + attributes: + - action: insert + key: receiver + value: k8scluster resourcedetection: detectors: - env @@ -87,6 +89,7 @@ data: - memory_limiter - batch - resource + - resource/k8s_cluster receivers: - k8s_cluster metrics/collector: diff --git a/rendered/manifests/otel-logs/deployment-cluster-receiver.yaml b/rendered/manifests/otel-logs/deployment-cluster-receiver.yaml index 346b9b288e..e89a8abb2e 100644 --- a/rendered/manifests/otel-logs/deployment-cluster-receiver.yaml +++ b/rendered/manifests/otel-logs/deployment-cluster-receiver.yaml @@ -30,7 +30,7 @@ spec: component: otel-k8s-cluster-receiver release: default annotations: - checksum/config: 95fad8a7a34350631ceacc2fc8498d3ae05d1be9df4fd9e71dd6036be4fa1919 + checksum/config: fe6a43ddd66a904c3e515232f6581738fba02d015ac9e5a55b98122b120e4bf2 spec: serviceAccountName: default-splunk-otel-collector nodeSelector: