diff options
Diffstat (limited to 'f3s/argocd-apps')
| -rw-r--r-- | f3s/argocd-apps/alloy.yaml | 130 | ||||
| -rw-r--r-- | f3s/argocd-apps/loki.yaml | 86 |
2 files changed, 216 insertions, 0 deletions
diff --git a/f3s/argocd-apps/alloy.yaml b/f3s/argocd-apps/alloy.yaml new file mode 100644 index 0000000..c5574b1 --- /dev/null +++ b/f3s/argocd-apps/alloy.yaml @@ -0,0 +1,130 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: alloy + namespace: cicd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: default + source: + repoURL: https://grafana.github.io/helm-charts + chart: alloy + targetRevision: 0.3.2 + helm: + releaseName: alloy + valuesObject: + alloy: + service: + ports: + otlp-grpc: + enabled: true + port: 4317 + targetPort: 4317 + protocol: TCP + otlp-http: + enabled: true + port: 4318 + targetPort: 4318 + protocol: TCP + + configMap: + content: | + discovery.kubernetes "pods" { + role = "pod" + } + + discovery.relabel "pods" { + targets = discovery.kubernetes.pods.targets + + rule { + source_labels = ["__meta_kubernetes_namespace"] + target_label = "namespace" + } + + rule { + source_labels = ["__meta_kubernetes_pod_name"] + target_label = "pod" + } + + rule { + source_labels = ["__meta_kubernetes_pod_container_name"] + target_label = "container" + } + + rule { + source_labels = ["__meta_kubernetes_pod_label_app"] + target_label = "app" + } + } + + loki.source.kubernetes "pods" { + targets = discovery.relabel.pods.output + forward_to = [loki.write.default.receiver] + } + + loki.write "default" { + endpoint { + url = "http://loki.monitoring.svc.cluster.local:3100/loki/api/v1/push" + } + } + + // ======================================== + // TRACES COLLECTION + // ======================================== + + // OTLP receiver for traces via gRPC and HTTP + otelcol.receiver.otlp "default" { + grpc { + endpoint = "0.0.0.0:4317" + } + + http { + endpoint = "0.0.0.0:4318" + } + + output { + traces = [otelcol.processor.batch.default.input] + } + } + + // Batch processor for efficient trace forwarding + otelcol.processor.batch "default" { + timeout = "5s" + send_batch_size = 100 + send_batch_max_size = 200 + + output { + traces = [otelcol.exporter.otlp.tempo.input] + } + } + + // OTLP exporter to send traces to Tempo + otelcol.exporter.otlp "tempo" { + client { + endpoint = "tempo.monitoring.svc.cluster.local:4317" + + tls { + insecure = true + } + + compression = "gzip" + } + } + + destination: + server: https://kubernetes.default.svc + namespace: monitoring + + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=false + retry: + limit: 3 + backoff: + duration: 5s + factor: 2 + maxDuration: 1m diff --git a/f3s/argocd-apps/loki.yaml b/f3s/argocd-apps/loki.yaml new file mode 100644 index 0000000..c7985c2 --- /dev/null +++ b/f3s/argocd-apps/loki.yaml @@ -0,0 +1,86 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: loki + namespace: cicd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: default + source: + repoURL: https://grafana.github.io/helm-charts + chart: loki + targetRevision: 6.6.3 + helm: + releaseName: loki + valuesObject: + deploymentMode: SingleBinary + + loki: + auth_enabled: false + commonConfig: + replication_factor: 1 + storage: + type: filesystem + schemaConfig: + configs: + - from: "2024-01-01" + store: tsdb + object_store: filesystem + schema: v13 + index: + prefix: index_ + period: 24h + + singleBinary: + replicas: 1 + extraVolumes: + - name: loki-data + persistentVolumeClaim: + claimName: loki-data-pvc + extraVolumeMounts: + - name: loki-data + mountPath: /var/loki + persistence: + enabled: false + + read: + replicas: 0 + + write: + replicas: 0 + + backend: + replicas: 0 + + gateway: + enabled: false + + chunksCache: + enabled: false + + resultsCache: + enabled: false + + lokiCanary: + enabled: false + + test: + enabled: false + + destination: + server: https://kubernetes.default.svc + namespace: monitoring + + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=false + retry: + limit: 3 + backoff: + duration: 5s + factor: 2 + maxDuration: 1m |
