diff --git a/.gitignore b/.gitignore index c03adc7..a4dfe83 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ -charts/*/charts \ No newline at end of file +charts/*/charts +bin +dev +external-dns-aws-credentials diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..faf89a1 --- /dev/null +++ b/Makefile @@ -0,0 +1,185 @@ +LOCALBIN ?= $(shell pwd)/bin +export LOCALBIN +$(LOCALBIN): + mkdir -p $(LOCALBIN) + + +TEMPLATES_DIR := charts +PROVIDER_TEMPLATES_DIR := $(TEMPLATES_DIR)/provider +export PROVIDER_TEMPLATES_DIR +CHARTS_PACKAGE_DIR ?= $(LOCALBIN)/charts +EXTENSION_CHARTS_PACKAGE_DIR ?= $(LOCALBIN)/charts/extensions +$(EXTENSION_CHARTS_PACKAGE_DIR): | $(LOCALBIN) + mkdir -p $(EXTENSION_CHARTS_PACKAGE_DIR) +$(CHARTS_PACKAGE_DIR): | $(LOCALBIN) + rm -rf $(CHARTS_PACKAGE_DIR) + mkdir -p $(CHARTS_PACKAGE_DIR) + +REGISTRY_NAME ?= hmc-local-registry +REGISTRY_PORT ?= 5001 +REGISTRY_REPO ?= oci://127.0.0.1:$(REGISTRY_PORT)/charts +REGISTRY_IS_OCI = $(shell echo $(REGISTRY_REPO) | grep -q oci && echo true || echo false) + +TEMPLATE_FOLDERS = $(patsubst $(TEMPLATES_DIR)/%,%,$(wildcard $(TEMPLATES_DIR)/*)) + +COLLECTORS_VERSION=$(shell $(YQ) '.version' $(TEMPLATES_DIR)/motel-collectors/Chart.yaml) +STORAGE_VERSION=$(shell $(YQ) '.version' $(TEMPLATES_DIR)/motel-storage/Chart.yaml) +USER_EMAIL=$(shell git config user.email) + +STORAGE_DOMAIN = $(USER)-storage.$(MOTEL_DNS) +MOTEL_STORAGE_NAME = motel-storage +MOTEL_STORAGE_NS = motel + +dev: + mkdir -p dev + +lint-chart-%: + $(HELM) dependency update $(TEMPLATES_DIR)/$* + $(HELM) lint --strict $(TEMPLATES_DIR)/$* + +package-chart-%: lint-chart-% + $(HELM) package --destination $(CHARTS_PACKAGE_DIR) $(TEMPLATES_DIR)/$* + +.PHONY: helm-package +helm-package: $(CHARTS_PACKAGE_DIR) $(EXTENSION_CHARTS_PACKAGE_DIR) + @make $(patsubst %,package-chart-%,$(TEMPLATE_FOLDERS)) + +.PHONY: helm-push +helm-push: helm-package + @if [ ! $(REGISTRY_IS_OCI) ]; then \ + repo_flag="--repo"; \ + fi; \ + for chart in $(CHARTS_PACKAGE_DIR)/*.tgz; do \ + base=$$(basename $$chart .tgz); \ + chart_version=$$(echo $$base | grep -o "v\{0,1\}[0-9]\+\.[0-9]\+\.[0-9].*"); \ + chart_name="$${base%-"$$chart_version"}"; \ + echo "Verifying if chart $$chart_name, version $$chart_version already exists in $(REGISTRY_REPO)"; \ + if $(REGISTRY_IS_OCI); then \ + chart_exists=$$($(HELM) pull $$repo_flag $(REGISTRY_REPO)/$$chart_name --version $$chart_version --destination /tmp 2>&1 | grep "not found" || true); \ + else \ + chart_exists=$$($(HELM) pull $$repo_flag $(REGISTRY_REPO) $$chart_name --version $$chart_version --destination /tmp 2>&1 | grep "not found" || true); \ + fi; \ + if [ -z "$$chart_exists" ]; then \ + echo "Chart $$chart_name version $$chart_version already exists in the repository."; \ + fi; \ + if $(REGISTRY_IS_OCI); then \ + echo "Pushing $$chart to $(REGISTRY_REPO)"; \ + $(HELM) push "$$chart" $(REGISTRY_REPO); \ + else \ + if [ ! $$REGISTRY_USERNAME ] && [ ! $$REGISTRY_PASSWORD ]; then \ + echo "REGISTRY_USERNAME and REGISTRY_PASSWORD must be populated to push the chart to an HTTPS repository"; \ + exit 1; \ + else \ + $(HELM) repo add hmc $(REGISTRY_REPO); \ + echo "Pushing $$chart to $(REGISTRY_REPO)"; \ + $(HELM) cm-push "$$chart" $(REGISTRY_REPO) --username $$REGISTRY_USERNAME --password $$REGISTRY_PASSWORD; \ + fi; \ + fi; \ + done + +.PHONY: dev-operators-deploy +dev-operators-deploy: dev ## Deploy motel-operators helm chart to the K8s cluster specified in ~/.kube/config + cp -f $(TEMPLATES_DIR)/motel-operators/values.yaml dev/operators-values.yaml + $(HELM) upgrade -i motel-operators ./charts/motel-operators --create-namespace -n motel -f dev/operators-values.yaml + +.PHONY: dev-collectors-deploy +dev-collectors-deploy: dev ## Deploy motel-collector helm chart to the K8s cluster specified in ~/.kube/config + cp -f $(TEMPLATES_DIR)/motel-collectors/values.yaml dev/collectors-values.yaml + @$(YQ) eval -i '.motel.logs_endpoint = "http://$(MOTEL_STORAGE_NAME)-victoria-logs-single-server.$(MOTEL_STORAGE_NS):9428/insert/opentelemetry/v1/logs"' dev/collectors-values.yaml + @$(YQ) eval -i '.motel.metrics_endpoint = "http://vminsert-cluster.$(MOTEL_STORAGE_NS):8480/insert/0/prometheus/api/v1/write"' dev/collectors-values.yaml + @$(YQ) eval -i '.opencost.opencost.prometheus.external.url = "http://vmselect-cluster.$(MOTEL_STORAGE_NS):8481/select/0/prometheus"' dev/collectors-values.yaml + $(HELM) upgrade -i motel-collectors ./charts/motel-collectors --create-namespace -n motel -f dev/collectors-values.yaml + +.PHONY: dev-storage-deploy +dev-storage-deploy: dev ## Deploy motel-storage helm chart to the K8s cluster specified in ~/.kube/config + cp -f $(TEMPLATES_DIR)/motel-storage/values.yaml dev/storage-values.yaml + @$(YQ) eval -i '.grafana.ingress.enabled = false' dev/storage-values.yaml + @$(YQ) eval -i '.victoriametrics.vmcluster.replicaCount = 1' dev/storage-values.yaml + @$(YQ) eval -i '.global.storageClass = "standard"' dev/storage-values.yaml + @$(YQ) eval -i '.["victoria-logs-single"].server.persistentVolume.storageClassName = "standard"' dev/storage-values.yaml + $(HELM) upgrade -i $(MOTEL_STORAGE_NAME) ./charts/motel-storage --create-namespace -n $(MOTEL_STORAGE_NS) -f dev/storage-values.yaml + +.PHONY: dev-ms-deploy-aws +dev-ms-deploy-aws: dev ## Deploy Mothership helm chart to the K8s cluster specified in ~/.kube/config for a remote storage cluster + cp -f $(TEMPLATES_DIR)/motel-mothership/values.yaml dev/mothership-values.yaml + @$(YQ) eval -i '.hmc.installTemplates = true' dev/mothership-values.yaml + @$(YQ) eval -i '.grafana.logSources = [{"name": "$(USER)-storage", "url": "https://vmauth.$(STORAGE_DOMAIN)/vls", "type": "victoriametrics-logs-datasource", "auth": {"username": "motel", "password": "motel"} }]' dev/mothership-values.yaml + @$(YQ) eval -i '.promxy.config.serverGroups = [{"clusterName": "$(USER)-storage", "targets": ["vmauth.$(STORAGE_DOMAIN):443"], "auth": {"username": "motel", "password": "motel"}}]' dev/mothership-values.yaml + + @$(YQ) eval -i '.hmc.motel.charts.collectors.version = "$(COLLECTORS_VERSION)"' dev/mothership-values.yaml + @$(YQ) eval -i '.hmc.motel.charts.storage.version = "$(STORAGE_VERSION)"' dev/mothership-values.yaml + @if [ "$(REGISTRY_REPO)" = "oci://127.0.0.1:$(REGISTRY_PORT)/charts" ]; then \ + $(YQ) eval -i '.hmc.motel.repo.url = "oci://$(REGISTRY_NAME):5000/charts"' dev/mothership-values.yaml; \ + $(YQ) eval -i '.hmc.motel.repo.insecure = true' dev/mothership-values.yaml; \ + $(YQ) eval -i '.hmc.motel.repo.type = "oci"' dev/mothership-values.yaml; \ + else \ + $(YQ) eval -i '.hmc.motel.repo.url = "$(REGISTRY_REPO)"' dev/mothership-values.yaml; \ + fi; \ + $(HELM) upgrade -i motel ./charts/motel-mothership -n motel --create-namespace -f dev/mothership-values.yaml + +.PHONY: dev-storage-deploy-aws +dev-storage-deploy-aws: dev ## Deploy Regional Managed cluster using HMC + cp -f demo/cluster/aws-storage.yaml dev/aws-storage.yaml + @$(YQ) eval -i '.metadata.name = "$(USER)-aws-storage"' dev/aws-storage.yaml + @$(YQ) '.spec.services[] | select(.name == "motel-storage") | .values' dev/aws-storage.yaml > dev/motel-storage-values.yaml + @$(YQ) eval -i '.["cert-manager"].email = "$(USER_EMAIL)"' dev/motel-storage-values.yaml + @$(YQ) eval -i '.victoriametrics.vmauth.ingress.host = "vmauth.$(STORAGE_DOMAIN)"' dev/motel-storage-values.yaml + @$(YQ) eval -i '.grafana.ingress.host = "grafana.$(STORAGE_DOMAIN)"' dev/motel-storage-values.yaml + @$(YQ) eval -i '.["external-dns"].enabled = true' dev/motel-storage-values.yaml + @$(YQ) eval -i '(.spec.services[] | select(.name == "motel-storage")).values |= load_str("dev/motel-storage-values.yaml")' dev/aws-storage.yaml + kubectl apply -f dev/aws-storage.yaml + +.PHONY: dev-managed-deploy-aws +dev-managed-deploy-aws: dev ## Deploy Regional Managed cluster using HMC + cp -f demo/cluster/aws-managed.yaml dev/aws-managed.yaml + @$(YQ) eval -i '.metadata.name = "$(USER)-aws-managed"' dev/aws-managed.yaml + @$(YQ) '.spec.services[] | select(.name == "motel-collectors") | .values' dev/aws-managed.yaml > dev/motel-managed-values.yaml + @$(YQ) eval -i '.opencost.opencost.prometheus.external.url = "https://vmauth.$(STORAGE_DOMAIN)/vm/select/0/prometheus"' dev/motel-managed-values.yaml + @$(YQ) eval -i '.motel.logs_endpoint = "https://vmauth.$(STORAGE_DOMAIN)/vls/insert/opentelemetry/v1/logs"' dev/motel-managed-values.yaml + @$(YQ) eval -i '.motel.metrics_endpoint = "https://vmauth.$(STORAGE_DOMAIN)/vm/insert/0/prometheus/api/v1/write"' dev/motel-managed-values.yaml + @$(YQ) eval -i '(.spec.services[] | select(.name == "motel-collectors")).values |= load_str("dev/motel-managed-values.yaml")' dev/aws-managed.yaml + kubectl apply -f dev/aws-managed.yaml + +## Tool Binaries +KUBECTL ?= kubectl +CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen-$(CONTROLLER_TOOLS_VERSION) +ENVTEST ?= $(LOCALBIN)/setup-envtest-$(ENVTEST_VERSION) +GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-$(GOLANGCI_LINT_VERSION) +HELM ?= $(LOCALBIN)/helm-$(HELM_VERSION) +export HELM +KIND ?= $(LOCALBIN)/kind-$(KIND_VERSION) +YQ ?= $(LOCALBIN)/yq-$(YQ_VERSION) +export YQ + +## Tool Versions +HELM_VERSION ?= v3.15.1 +YQ_VERSION ?= v4.44.2 + +.PHONY: yq +yq: $(YQ) ## Download yq locally if necessary. +$(YQ): | $(LOCALBIN) + $(call go-install-tool,$(YQ),github.com/mikefarah/yq/v4,${YQ_VERSION}) + +.PHONY: helm +helm: $(HELM) ## Download helm locally if necessary. +HELM_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3" +$(HELM): | $(LOCALBIN) + rm -f $(LOCALBIN)/helm-* + curl -s --fail $(HELM_INSTALL_SCRIPT) | USE_SUDO=false HELM_INSTALL_DIR=$(LOCALBIN) DESIRED_VERSION=$(HELM_VERSION) BINARY_NAME=helm-$(HELM_VERSION) PATH="$(LOCALBIN):$(PATH)" bash + +.PHONY: cli-install +cli-install: yq helm ## Install the necessary CLI tools for deployment, development and testing. + +# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist +# $1 - target path with name of binary (ideally with version) +# $2 - package url which can be installed +# $3 - specific version of package +define go-install-tool +@[ -f $(1) ] || { \ +set -e; \ +package=$(2)@$(3) ;\ +echo "Downloading $${package}" ;\ +GOBIN=$(LOCALBIN) go install $${package} ;\ +if [ ! -f $(1) ]; then mv -f "$$(echo "$(1)" | sed "s/-$(3)$$//")" $(1); fi ;\ +} +endef diff --git a/README.md b/README.md index 314d470..cd980d7 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Mirantis OpenTelemery -This repo contains 3 charts to deploy a monitoring stack using HMC and get metrics into regional clusters, data from which is then aggregated into single grafana interface. -![alt text](motel-arch.png) +This repo contains 4 charts to deploy a monitoring stack using HMC and get metrics into storage clusters, data from which is then aggregated into single grafana interface. +![alt text](docs/otel.png) -## Mothership cluster chart +## Mothership chart * central grafana interface * promxy to forward calls to multiple downstream regional metrics servers * local victoriametrics storage for alerting record rules -* hmc helmchart definitions and service templates to deploy regional and child charts into managedclusters +* hmc helmchart definitions and service templates to deploy storage and collectors charts into managedclusters ### Demo deployment In `demo/demo-mothership-values.yaml` set your target ingress names that you are going to use for your regional clusters, but they can always be changed after the fact @@ -16,7 +16,7 @@ helm repo update helm upgrade -i motel motel/motel-mothership -n hmc-system -f demo/demo-mothership-values.yaml ``` -## Regional cluster chart +## Storage chart * Grafana - region-specific Grafana instance, deployed and configured with grafana-operator * vmcluster - metrics storage, ingestion, querying * vmlogs - logs storage @@ -26,17 +26,17 @@ helm upgrade -i motel motel/motel-mothership -n hmc-system -f demo/demo-mothersh - cert-manager - ingress-nginx -To deploy regional `managedcluster` configure desired ingress names for vmauth and regional Grafana in it's values for the `motel-regional` template. -`demo/cluster/aws-regional.yaml` contains example definitions +To deploy storage `managedcluster` configure desired ingress names for vmauth and regional Grafana in it's values for the `motel-storage` template. +`demo/cluster/aws-storage.yaml` contains example definitions ``` -kubectl apply -f demo/cluster/aws-regional.yaml +kubectl apply -f demo/cluster/aws-storage.yaml # you can check helm chart deployment status using ClusterSummary object: kubectl get clustersummaries.config.projectsveltos.io -n hmc-system ``` -Once the regional managedcluster is ready - retrieve its kubeconfig and get loadbalancer IP/DNS name for your ingress-nginx service. +Once the storage managedcluster is ready - retrieve its kubeconfig and get loadbalancer IP/DNS name for your ingress-nginx service. ``` -kubectl get secret -n hmc-system aws-reg0-kubeconfig -o jsonpath={.data.value} | base64 -d > /tmp/hmc-aws-reg0-kubeconfig.yaml -export KUBECONFIG=/tmp/hmc-aws-reg0-kubeconfig.yaml +kubectl get secret -n hmc-system aws-storage-kubeconfig -o jsonpath={.data.value} | base64 -d > /tmp/hmc-aws-storage-kubeconfig.yaml +export KUBECONFIG=/tmp/hmc-aws-storage-kubeconfig.yaml kubectl get svc -n ingress-nginx ingress-nginx-controller ``` @@ -45,24 +45,27 @@ To simplify this process it is posssible to enable [external-dns](https://kubern Once your domain is resolvable your Grafana and vmauth should be accessible. -## Child cluster chart -* vmagent - scrapes prometheus targets and forwards metrics to regional VictoriaMetrics cluster -* fluentd - collects logs and forwards them to regional VictoriaLogs storage +## Operators chart +* opentelemetry-operator - [OpenTelemetry Operator](https://opentelemetry.io/docs/kubernetes/operator/) +* prometheus-operator-crds - [Prometheus Operator](https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus-operator-crds) -`demo/cluster/aws-child.yaml` contains example definitions +This chart pre-installs all required CRDs to create Opentelemetry Collectors for metrics and logs -To deploy child `managedcluster` configure ingress names for regional vmauth in its values for the `motel-child` template. +## Collectors chart +* opentelemetry-collectors - [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/) configured to monitor logs and metrics and send them to a storage cluster + +To deploy operators and collectors to a `managedcluster` configure ingress names for storage vmauth in its values for the `motel-collectors` template. ``` -kubectl apply -f demo/cluster/aws-child.yaml +kubectl apply -f demo/cluster/aws-managed.yaml # you can check helm chart deployment status using ClusterSummary object: kubectl get clustersummaries.config.projectsveltos.io -n hmc-system ``` -Once your child cluster is up, it should start pushing metrics and logs to your regional one, through ingress domain you've configured. -Check your regional Grafana for results first, then you should be able to see the same cluster in Grafana on the "mothership". +Once your managed clusters are up, it should start pushing metrics and logs to your storage one, through ingress domain you've configured. +Check your storage cluster's Grafana for results first, then you should be able to see the same cluster in Grafana on the "mothership". ### Scaling up -* Deploy more child clusters in a single region and point them to the existing regional victoria stack. +* Deploy more managed clusters in a single region and point them to the existing storage victoria stack. * Repeat the previous two steps for each desired region * Update mothership chart configuration with every deployed regional stack to aggregate the data diff --git a/charts/motel-child/Chart.lock b/charts/motel-child/Chart.lock deleted file mode 100644 index ad7993d..0000000 --- a/charts/motel-child/Chart.lock +++ /dev/null @@ -1,21 +0,0 @@ -dependencies: -- name: victoria-metrics-operator - repository: https://victoriametrics.github.io/helm-charts/ - version: 0.36.0 -- name: prometheus-node-exporter - repository: https://prometheus-community.github.io/helm-charts - version: 4.39.0 -- name: prometheus-operator-crds - repository: https://prometheus-community.github.io/helm-charts - version: 15.0.0 -- name: kube-state-metrics - repository: https://prometheus-community.github.io/helm-charts - version: 5.25.1 -- name: fluent-bit - repository: https://fluent.github.io/helm-charts - version: 0.47.10 -- name: opencost - repository: https://opencost.github.io/opencost-helm-chart - version: 1.42.3 -digest: sha256:841e1f0434b1380f50d9e6f25f0ad29a7402e62a053b3fa52c466882e966974b -generated: "2024-12-11T15:34:53.25708+02:00" diff --git a/charts/motel-child/Chart.yaml b/charts/motel-child/Chart.yaml deleted file mode 100644 index d18102b..0000000 --- a/charts/motel-child/Chart.yaml +++ /dev/null @@ -1,31 +0,0 @@ -apiVersion: v2 -name: motel-child -description: A Helm chart that deploys Grafana, OpenTelemetry, and VictoriaMetrics. -version: 0.1.2 -appVersion: "1.0" -dependencies: - - name: victoria-metrics-operator - version: "0.36.*" - repository: "https://victoriametrics.github.io/helm-charts/" - condition: victoria-metrics-operator.enabled - - name: prometheus-node-exporter - version: "4.39.*" - repository: https://prometheus-community.github.io/helm-charts - condition: prometheus-node-exporter.enabled - - name: prometheus-operator-crds - version: "15.0.*" - repository: https://prometheus-community.github.io/helm-charts - condition: prometheus-operator-crds.enabled - - name: kube-state-metrics - version: "5.25.*" - repository: https://prometheus-community.github.io/helm-charts - condition: kube-state-metrics.enabled - - name: fluent-bit - version: "0.47.*" - repository: https://fluent.github.io/helm-charts - condition: fluent-bit.enabled - - name: opencost - version: "1.42.*" - repository: https://opencost.github.io/opencost-helm-chart - condition: opencost.enabled - diff --git a/charts/motel-child/templates/victoria/fluent-out.yaml b/charts/motel-child/templates/victoria/fluent-out.yaml deleted file mode 100644 index b8f2954..0000000 --- a/charts/motel-child/templates/victoria/fluent-out.yaml +++ /dev/null @@ -1,27 +0,0 @@ -{{- if index .Values "fluent-bit" "enabled" }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: vl-outputs - namespace: {{ .Release.Namespace }} -data: - output_vl.conf: | - [OUTPUT] - Name http - Match kube.* - Host {{ index .Values "fluent-bit" "outputHost" }} - URI {{ index .Values "fluent-bit" "outputURI" | default "/vls/insert/jsonline" }} - port 443 - tls on - compress gzip - format json_lines - json_date_format iso8601 - http_User {{ index .Values "fluent-bit" "outputUsername" }} - http_Passwd {{ index .Values "fluent-bit" "outputPassword" }} - header AccountID 0 - header ProjectID 0 - header VL-Msg-Field log - header VL-Time-Field date - header VL-Stream-Fields stream,kubernetes_pod_name,kubernetes_container_name,kubernetes_namespace_name -{{- end }} \ No newline at end of file diff --git a/charts/motel-child/templates/victoria/scrape/cadvisor.yaml b/charts/motel-child/templates/victoria/scrape/cadvisor.yaml deleted file mode 100644 index 5fedd33..0000000 --- a/charts/motel-child/templates/victoria/scrape/cadvisor.yaml +++ /dev/null @@ -1,36 +0,0 @@ -{{- if (index .Values "victoriametrics" "vmagent" | default dict).enabled | default false }} -apiVersion: operator.victoriametrics.com/v1beta1 -kind: VMNodeScrape -metadata: - name: cadvisor - namespace: {{ .Release.Namespace }} -spec: - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token - honorLabels: true - honorTimestamps: false - interval: 30s - metricRelabelConfigs: - - action: labeldrop - regex: (uid) - - action: labeldrop - regex: (id|name) - - action: drop - regex: (rest_client_request_duration_seconds_bucket|rest_client_request_duration_seconds_sum|rest_client_request_duration_seconds_count) - source_labels: - - __name__ - path: /metrics/cadvisor - relabelConfigs: - - action: labelmap - regex: __meta_kubernetes_node_label_(.+) - - sourceLabels: - - __metrics_path__ - targetLabel: metrics_path - - replacement: kubelet - targetLabel: job - scheme: https - scrapeTimeout: 5s - selector: {} - tlsConfig: - caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt - insecureSkipVerify: true -{{- end }} \ No newline at end of file diff --git a/charts/motel-child/templates/victoria/scrape/kube-state-metrics.yaml b/charts/motel-child/templates/victoria/scrape/kube-state-metrics.yaml deleted file mode 100644 index acac800..0000000 --- a/charts/motel-child/templates/victoria/scrape/kube-state-metrics.yaml +++ /dev/null @@ -1,18 +0,0 @@ -{{- if (index .Values "victoriametrics" "vmagent" | default dict).enabled | default false }} -apiVersion: operator.victoriametrics.com/v1beta1 -kind: VMServiceScrape -metadata: - name: kube-state-metrics - namespace: {{ .Release.Namespace }} -spec: - endpoints: - - honorLabels: true - metricRelabelConfigs: - - action: labeldrop - regex: (uid|container_id|image_id) - port: http - jobLabel: app.kubernetes.io/name - selector: - matchLabels: - app.kubernetes.io/name: kube-state-metrics -{{- end }} \ No newline at end of file diff --git a/charts/motel-child/templates/victoria/scrape/kubelet.yaml b/charts/motel-child/templates/victoria/scrape/kubelet.yaml deleted file mode 100644 index f5bb388..0000000 --- a/charts/motel-child/templates/victoria/scrape/kubelet.yaml +++ /dev/null @@ -1,35 +0,0 @@ -{{- if (index .Values "victoriametrics" "vmagent" | default dict).enabled | default false }} -apiVersion: operator.victoriametrics.com/v1beta1 -kind: VMNodeScrape -metadata: - name: kubelet - namespace: {{ .Release.Namespace }} -spec: - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token - honorLabels: true - honorTimestamps: false - interval: 30s - metricRelabelConfigs: - - action: labeldrop - regex: (uid) - - action: labeldrop - regex: (id|name) - - action: drop - regex: (rest_client_request_duration_seconds_bucket|rest_client_request_duration_seconds_sum|rest_client_request_duration_seconds_count) - source_labels: - - __name__ - relabelConfigs: - - action: labelmap - regex: __meta_kubernetes_node_label_(.+) - - sourceLabels: - - __metrics_path__ - targetLabel: metrics_path - - replacement: kubelet - targetLabel: job - scheme: https - scrapeTimeout: 5s - selector: {} - tlsConfig: - caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt - insecureSkipVerify: true -{{- end }} \ No newline at end of file diff --git a/charts/motel-child/templates/victoria/scrape/node-exporter.yaml b/charts/motel-child/templates/victoria/scrape/node-exporter.yaml deleted file mode 100644 index 6867e24..0000000 --- a/charts/motel-child/templates/victoria/scrape/node-exporter.yaml +++ /dev/null @@ -1,19 +0,0 @@ -{{- if (index .Values "victoriametrics" "vmagent" | default dict).enabled | default false }} -apiVersion: operator.victoriametrics.com/v1beta1 -kind: VMServiceScrape -metadata: - name: prometheus-node-exporter - namespace: {{ .Release.Namespace }} -spec: - endpoints: - - metricRelabelConfigs: - - action: drop - regex: /var/lib/kubelet/pods.+ - source_labels: - - mountpoint - port: metrics - jobLabel: jobLabel - selector: - matchLabels: - app.kubernetes.io/name: prometheus-node-exporter -{{- end }} \ No newline at end of file diff --git a/charts/motel-child/templates/victoria/scrape/probes.yaml b/charts/motel-child/templates/victoria/scrape/probes.yaml deleted file mode 100644 index 0243c67..0000000 --- a/charts/motel-child/templates/victoria/scrape/probes.yaml +++ /dev/null @@ -1,36 +0,0 @@ -{{- if (index .Values "victoriametrics" "vmagent" | default dict).enabled | default false }} -apiVersion: operator.victoriametrics.com/v1beta1 -kind: VMNodeScrape -metadata: - name: k8s-probes - namespace: {{ .Release.Namespace }} -spec: - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token - honorLabels: true - honorTimestamps: false - interval: 30s - metricRelabelConfigs: - - action: labeldrop - regex: (uid) - - action: labeldrop - regex: (id|name) - - action: drop - regex: (rest_client_request_duration_seconds_bucket|rest_client_request_duration_seconds_sum|rest_client_request_duration_seconds_count) - source_labels: - - __name__ - path: /metrics/probes - relabelConfigs: - - action: labelmap - regex: __meta_kubernetes_node_label_(.+) - - sourceLabels: - - __metrics_path__ - targetLabel: metrics_path - - replacement: kubelet - targetLabel: job - scheme: https - scrapeTimeout: 5s - selector: {} - tlsConfig: - caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt - insecureSkipVerify: true -{{- end }} \ No newline at end of file diff --git a/charts/motel-child/templates/victoria/vmagent.yaml b/charts/motel-child/templates/victoria/vmagent.yaml deleted file mode 100644 index 71e7096..0000000 --- a/charts/motel-child/templates/victoria/vmagent.yaml +++ /dev/null @@ -1,42 +0,0 @@ -{{- if (index .Values "victoriametrics" "vmagent" | default dict).enabled | default false }} -apiVersion: operator.victoriametrics.com/v1beta1 -kind: VMAgent -metadata: - name: cluster - namespace: {{ .Release.Namespace }} -spec: - externalLabels: - clusterName: {{ .Values.global.clusterName }} - extraArgs: - promscrape.dropOriginalLabels: "true" - promscrape.streamParse: "true" - image: - tag: v1.105.0 - license: {} - port: "8429" - remoteWrite: - - url: {{ .Values.victoriametrics.vmagent.remoteWriteUrl | quote }} - basicAuth: - username: - key: username - name: vmauth-creds - password: - key: password - name: vmauth-creds - scrapeInterval: 20s - selectAllByDefault: true -{{- if .Values.opencost.enabled | default false }} - inlineScrapeConfig: | - - job_name: opencost - honor_labels: true - scrape_interval: 1m - scrape_timeout: 10s - metrics_path: /metrics - scheme: http - dns_sd_configs: - - names: - - motel-child-opencost.motel-child - type: 'A' - port: 9003 -{{- end }} -{{- end }} diff --git a/charts/motel-child/templates/victoria/vmauth-creds.yaml b/charts/motel-child/templates/victoria/vmauth-creds.yaml deleted file mode 100644 index 796921d..0000000 --- a/charts/motel-child/templates/victoria/vmauth-creds.yaml +++ /dev/null @@ -1,11 +0,0 @@ -{{- if (index .Values "victoriametrics" "vmagent" | default dict).enabled | default false }} -apiVersion: v1 -kind: Secret -metadata: - name: vmauth-creds - namespace: {{ .Release.Namespace }} -type: Opaque -stringData: - username: {{ .Values.victoriametrics.vmagent.remoteUsername | default "motel" | quote }} - password: {{ .Values.victoriametrics.vmagent.remotePassword | default "motel" | quote }} -{{- end }} \ No newline at end of file diff --git a/charts/motel-child/values.yaml b/charts/motel-child/values.yaml deleted file mode 100644 index fb8dac7..0000000 --- a/charts/motel-child/values.yaml +++ /dev/null @@ -1,102 +0,0 @@ -global: - clusterLabel: clusterName - clusterName: hmc-child -prometheus-operator-crds: - enabled: true -kube-state-metrics: - enabled: true -victoria-metrics-operator: - enabled: true - crds: - plain: true -prometheus-node-exporter: - enabled: true - hostNetwork: false - service: - labels: - jobLabel: node-exporter - extraArgs: - - --collector.filesystem.ignored-mount-points=^/(dev|proc|sys|var/lib/docker/.+|var/lib/kubelet/.+)($|/) - - --collector.filesystem.ignored-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)$ -opencost: - enabled: true - opencost: - prometheus: - username: "motel" - password: "motel" - external: - enabled: true - url: "https://vmauth.hmc0.example.net/vm/select/0/prometheus" - internal: - enabled: false - exporter: - defaultClusterId: "hmc-child" - extraEnv: - EMIT_KSM_V1_METRICS: "false" - EMIT_KSM_V1_METRICS_ONLY: "true" -victoriametrics: - enabled: true - vmagent: - enabled: true - remoteWriteUrl: https://vmauth.hmc0.example.net/vm/insert/0/prometheus/api/v1/write - remoteUsername: motel - remotePassword: motel -fluent-bit: - enabled: true - outputHost: vmauth.hmc0.example.net - outputURI: /vls/insert/jsonline - outputUsername: motel - outputPassword: motel - args: - - --workdir=/fluent-bit/etc - - --config=/fluent-bit/etc/conf/fluent-bit.conf - - --enable-hot-reload - extraContainers: | - - name: reloader - image: {{ include "fluent-bit.image" .Values.hotReload.image }} - args: - - {{ printf "-webhook-url=http://localhost:%s/api/v2/reload" (toString .Values.metricsPort) }} - - -volume-dir=/watch/config - - -volume-dir=/watch/outputs - volumeMounts: - - name: config - mountPath: /watch/config - - name: vl-outputs - mountPath: /watch/outputs - daemonSetVolumes: - - name: varlog - hostPath: - path: /var/log - - name: varlibdockercontainers - hostPath: - path: /var/lib/docker/containers - - name: vl-outputs - configMap: - name: vl-outputs - daemonSetVolumeMounts: - - name: varlog - mountPath: /var/log - - name: varlibdockercontainers - mountPath: /var/lib/docker/containers - readOnly: true - - name: vl-outputs - mountPath: /fluent-bit/etc/conf/vl - resources: {} - config: - outputs: | - @INCLUDE /fluent-bit/etc/conf/vl/output_*.conf - filters: | - [FILTER] - Name kubernetes - Match kube.* - Merge_Log On - Keep_Log On - K8S-Logging.Parser On - K8S-Logging.Exclude On - [FILTER] - Name nest - Match * - Wildcard pod_name - Operation lift - Nested_under kubernetes - Add_prefix kubernetes_ diff --git a/charts/motel-collectors/Chart.lock b/charts/motel-collectors/Chart.lock new file mode 100644 index 0000000..498606d --- /dev/null +++ b/charts/motel-collectors/Chart.lock @@ -0,0 +1,12 @@ +dependencies: +- name: prometheus-node-exporter + repository: https://prometheus-community.github.io/helm-charts + version: 4.39.0 +- name: kube-state-metrics + repository: https://prometheus-community.github.io/helm-charts + version: 5.25.1 +- name: opencost + repository: https://opencost.github.io/opencost-helm-chart + version: 1.42.3 +digest: sha256:5d72bb43842150022dccab88096331cfdde00098f6b9e4e7e7067359da949de7 +generated: "2024-12-23T18:30:11.331385+02:00" diff --git a/charts/motel-collectors/Chart.yaml b/charts/motel-collectors/Chart.yaml new file mode 100644 index 0000000..b9f4ffe --- /dev/null +++ b/charts/motel-collectors/Chart.yaml @@ -0,0 +1,18 @@ +apiVersion: v2 +name: motel-collectors +description: A Helm chart that deploys OpenTelemetryCollector resources +version: 0.0.1 +appVersion: "1.0" +dependencies: + - name: prometheus-node-exporter + version: "4.39.*" + repository: https://prometheus-community.github.io/helm-charts + condition: prometheus-node-exporter.enabled + - name: kube-state-metrics + version: "5.25.*" + repository: https://prometheus-community.github.io/helm-charts + condition: kube-state-metrics.enabled + - name: opencost + version: "1.42.*" + repository: https://opencost.github.io/opencost-helm-chart + condition: opencost.enabled diff --git a/charts/motel-collectors/templates/opentelemetry/clusterrolebindings/k8s-cluster-collector.yaml b/charts/motel-collectors/templates/opentelemetry/clusterrolebindings/k8s-cluster-collector.yaml new file mode 100644 index 0000000..79e98c7 --- /dev/null +++ b/charts/motel-collectors/templates/opentelemetry/clusterrolebindings/k8s-cluster-collector.yaml @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ .Release.Name }}-k8s-cluster-collector +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ .Release.Name }}-k8s-cluster-collector +subjects: +- kind: ServiceAccount + name: {{ .Release.Name }}-k8s-cluster-collector + namespace: {{ .Release.Namespace }} diff --git a/charts/motel-collectors/templates/opentelemetry/clusterrolebindings/node-exporter-ta.yaml b/charts/motel-collectors/templates/opentelemetry/clusterrolebindings/node-exporter-ta.yaml new file mode 100644 index 0000000..b74aefe --- /dev/null +++ b/charts/motel-collectors/templates/opentelemetry/clusterrolebindings/node-exporter-ta.yaml @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ .Release.Name }}-node-exporter-ta +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ .Release.Name }}-node-exporter-ta +subjects: +- kind: ServiceAccount + name: {{ .Release.Name }}-node-exporter-ta + namespace: {{ .Release.Namespace }} diff --git a/charts/motel-collectors/templates/opentelemetry/clusterroles/k8s-cluster-collector.yaml b/charts/motel-collectors/templates/opentelemetry/clusterroles/k8s-cluster-collector.yaml new file mode 100644 index 0000000..06cdfcd --- /dev/null +++ b/charts/motel-collectors/templates/opentelemetry/clusterroles/k8s-cluster-collector.yaml @@ -0,0 +1,66 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ .Release.Name }}-k8s-cluster-collector +rules: + - apiGroups: [""] + resources: + - namespaces + - nodes + - nodes/proxy + - nodes/metrics + - nodes/stats + - services + - endpoints + - pods + - events + - secrets + - configmaps + - replicationcontrollers + - resourcequotas + verbs: ["get", "list", "watch"] + - apiGroups: ["monitoring.coreos.com"] + resources: + - servicemonitors + - podmonitors + verbs: ["get", "list", "watch"] + - apiGroups: + - extensions + resources: + - ingresses + verbs: ["get", "list", "watch"] + - apiGroups: + - events.k8s.io + resources: + - events + verbs: ["get", "list", "watch"] + - apiGroups: + - autoscaling + resources: + - horizontalpodautoscalers + verbs: ["get", "list", "watch"] + - apiGroups: + - batch + resources: + - cronjobs + - jobs + 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"] diff --git a/charts/motel-collectors/templates/opentelemetry/clusterroles/node-exporter-ta.yaml b/charts/motel-collectors/templates/opentelemetry/clusterroles/node-exporter-ta.yaml new file mode 100644 index 0000000..d7fbe14 --- /dev/null +++ b/charts/motel-collectors/templates/opentelemetry/clusterroles/node-exporter-ta.yaml @@ -0,0 +1,37 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ .Release.Name }}-node-exporter-ta +rules: + - apiGroups: [""] + resources: + - nodes + - nodes/metrics + - services + - endpoints + - pods + - namespaces + verbs: ["get", "list", "watch"] + - apiGroups: [""] + resources: + - configmaps + verbs: ["get"] + - apiGroups: ["monitoring.coreos.com"] + resources: + - probes + - scrapeconfigs + - servicemonitors + - podmonitors + verbs: ["*"] + - apiGroups: + - discovery.k8s.io + resources: + - endpointslices + verbs: ["get", "list", "watch"] + - apiGroups: + - networking.k8s.io + resources: + - ingresses + verbs: ["get", "list", "watch"] + - nonResourceURLs: ["/metrics"] + verbs: ["get"] diff --git a/charts/motel-collectors/templates/opentelemetry/collector.yaml b/charts/motel-collectors/templates/opentelemetry/collector.yaml new file mode 100644 index 0000000..c64b823 --- /dev/null +++ b/charts/motel-collectors/templates/opentelemetry/collector.yaml @@ -0,0 +1,79 @@ +{{- if .Values.collectors.enabled }} +apiVersion: opentelemetry.io/v1beta1 +kind: OpenTelemetryCollector +metadata: + name: {{ .Release.Name }}-k8s-cluster + namespace: {{ .Release.Namespace }} +spec: + mode: deployment + serviceAccount: "{{ .Release.Name }}-k8s-cluster-collector" + config: + receivers: + k8s_cluster: + allocatable_types_to_report: + - cpu + - memory + - storage + auth_type: serviceAccount + collection_interval: 10s + node_conditions_to_report: + - Ready + - MemoryPressure + - DiskPressure + - NetworkUnavailable + k8sobjects: + auth_type: serviceAccount + objects: + - name: pods + mode: pull + label_selector: environment in (production),tier in (frontend) + field_selector: status.phase=Running + interval: 1m + - exclude_watch_type: + - DELETED + group: events.k8s.io + mode: watch + name: events + + processors: + batch: {} + + exporters: + debug: {} + prometheusremotewrite: + endpoint: {{ .Values.motel.metrics_endpoint }} + tls: + insecure: true + auth: + authenticator: basicauth/client + otlphttp: + auth: + authenticator: basicauth/client + logs_endpoint: {{ .Values.motel.logs_endpoint }} + + extensions: + basicauth/client: + client_auth: + username: motel + password: motel + + service: + extensions: + - basicauth/client + pipelines: + logs: + exporters: + - otlphttp + - debug + processors: + - batch + receivers: + - k8sobjects + metrics: + exporters: + - prometheusremotewrite + processors: + - batch + receivers: + - k8s_cluster +{{- end }} diff --git a/charts/motel-collectors/templates/opentelemetry/node-collector.yaml b/charts/motel-collectors/templates/opentelemetry/node-collector.yaml new file mode 100644 index 0000000..03b4d84 --- /dev/null +++ b/charts/motel-collectors/templates/opentelemetry/node-collector.yaml @@ -0,0 +1,171 @@ +{{- if .Values.collectors.enabled }} +apiVersion: opentelemetry.io/v1beta1 +kind: OpenTelemetryCollector +metadata: + name: {{ .Release.Name}}-node-exporter + namespace: {{ .Release.Namespace }} +spec: + mode: daemonset + volumes: + - name: varlog + hostPath: + path: /var/log + volumeMounts: + - name: varlog + mountPath: /var/log + readOnly: true + serviceAccount: "{{ .Release.Name }}-k8s-cluster-collector" + targetAllocator: + image: "ghcr.io/open-telemetry/opentelemetry-operator/target-allocator:main" + enabled: true + serviceAccount: "{{ .Release.Name }}-node-exporter-ta" + allocationStrategy: per-node + prometheusCR: + enabled: true + podMonitorSelector: {} + scrapeInterval: 10s + serviceMonitorSelector: {} + config: + receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + http: + endpoint: 0.0.0.0:4318 + + filelog: + exclude: + # Exclude logs from all containers named otel-collector + - /var/log/pods/*/otc-container/*.log + include: + - /var/log/pods/*/*/*.log + include_file_name: false + include_file_path: true + operators: + - id: container-parser + max_log_size: 102400 + type: container + - type: regex_parser + id: extract_metadata_from_filepath + regex: '^.*\/(?P[^_]+)_(?P[^_]+)_(?P[a-f0-9\-]{36})\/(?P[^\._]+)\/(?P\d+)\.log$' + parse_from: attributes["log.file.path"] + - type: move + from: attributes.container_name + to: resource["k8s.container.name"] + - type: move + from: attributes.namespace + to: resource["k8s.namespace.name"] + - type: move + from: attributes.pod_name + to: resource["k8s.pod.name"] + - type: move + from: attributes.restart_count + to: resource["k8s.container.restart_count"] + - type: move + from: attributes.uid + to: resource["k8s.pod.uid"] + cache: + size: 128 # default maximum amount of Pods per Node is 110 + retry_on_failure: + enabled: true + start_at: end + + prometheus: + config: + global: + external_labels: + {{ .Values.global.clusterLabel }}: {{ .Values.global.clusterName }} + scrape_configs: + - bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token + job_name: integrations/kubernetes/cadvisor + honor_labels: true + kubernetes_sd_configs: + - role: node + relabel_configs: + - replacement: kubernetes.default.svc.cluster.local:443 + target_label: __address__ + - regex: (.+) + replacement: /api/v1/nodes/$${1}/proxy/metrics/cadvisor + source_labels: + - __meta_kubernetes_node_name + target_label: __metrics_path__ + metric_relabel_configs: + - source_labels: [__name__] + action: keep + regex: 'container_cpu_cfs_periods_total|container_cpu_cfs_throttled_periods_total|container_cpu_usage_seconds_total|container_fs_reads_bytes_total|container_fs_reads_total|container_fs_writes_bytes_total|container_fs_writes_total|container_memory_cache|container_memory_rss|container_memory_swap|container_memory_working_set_bytes|container_network_receive_bytes_total|container_network_receive_packets_dropped_total|container_network_receive_packets_total|container_network_transmit_bytes_total|container_network_transmit_packets_dropped_total|container_network_transmit_packets_total|machine_memory_bytes' + scheme: https + tls_config: + ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt + insecure_skip_verify: false + server_name: kubernetes + + - bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token + job_name: integrations/kubernetes/kubelet + honor_labels: true + kubernetes_sd_configs: + - role: node + relabel_configs: + - replacement: kubernetes.default.svc.cluster.local:443 + target_label: __address__ + - regex: (.+) + replacement: /api/v1/nodes/$${1}/proxy/metrics + source_labels: + - __meta_kubernetes_node_name + target_label: __metrics_path__ + metric_relabel_configs: + - source_labels: [__name__] + action: keep + regex: 'container_cpu_usage_seconds_total|kubelet_certificate_manager_client_expiration_renew_errors|kubelet_certificate_manager_client_ttl_seconds|kubelet_certificate_manager_server_ttl_seconds|kubelet_cgroup_manager_duration_seconds_bucket|kubelet_cgroup_manager_duration_seconds_count|kubelet_node_config_error|kubelet_node_name|kubelet_pleg_relist_duration_seconds_bucket|kubelet_pleg_relist_duration_seconds_count|kubelet_pleg_relist_interval_seconds_bucket|kubelet_pod_start_duration_seconds_bucket|kubelet_pod_start_duration_seconds_count|kubelet_pod_worker_duration_seconds_bucket|kubelet_pod_worker_duration_seconds_count|kubelet_running_container_count|kubelet_running_containers|kubelet_running_pod_count|kubelet_running_pods|kubelet_runtime_operations_errors_total|kubelet_runtime_operations_total|kubelet_server_expiration_renew_errors|kubelet_volume_stats_available_bytes|kubelet_volume_stats_capacity_bytes|kubelet_volume_stats_inodes|kubelet_volume_stats_inodes_used|kubernetes_build_info|namespace_workload_pod|rest_client_requests_total|storage_operation_duration_seconds_count|storage_operation_errors_total|volume_manager_total_volumes' + scheme: https + tls_config: + ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt + insecure_skip_verify: false + server_name: kubernetes + + processors: + + batch: {} + + extensions: + basicauth/client: + client_auth: + username: motel + password: motel + + exporters: + prometheusremotewrite: + endpoint: {{ .Values.motel.metrics_endpoint }} + tls: + insecure: true + auth: + authenticator: basicauth/client + otlphttp: + auth: + authenticator: basicauth/client + logs_endpoint: {{ .Values.motel.logs_endpoint }} + debug: + verbosity: detailed + + service: + extensions: + - basicauth/client + pipelines: + logs: + exporters: + - otlphttp + - debug + processors: + - batch + receivers: + - otlp + - filelog + metrics: + receivers: + - otlp + - prometheus + processors: + - batch + exporters: + - prometheusremotewrite +{{- end }} diff --git a/charts/motel-collectors/templates/opentelemetry/serviceaccounts/k8s-cluster-collector.yaml b/charts/motel-collectors/templates/opentelemetry/serviceaccounts/k8s-cluster-collector.yaml new file mode 100644 index 0000000..274cefd --- /dev/null +++ b/charts/motel-collectors/templates/opentelemetry/serviceaccounts/k8s-cluster-collector.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Release.Name }}-k8s-cluster-collector + namespace: {{ .Release.Namespace }} + diff --git a/charts/motel-collectors/templates/opentelemetry/serviceaccounts/node-exporter-ta.yaml b/charts/motel-collectors/templates/opentelemetry/serviceaccounts/node-exporter-ta.yaml new file mode 100644 index 0000000..c867eca --- /dev/null +++ b/charts/motel-collectors/templates/opentelemetry/serviceaccounts/node-exporter-ta.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Release.Name }}-node-exporter-ta + namespace: {{ .Release.Namespace }} + diff --git a/charts/motel-collectors/values.yaml b/charts/motel-collectors/values.yaml new file mode 100644 index 0000000..abd35d3 --- /dev/null +++ b/charts/motel-collectors/values.yaml @@ -0,0 +1,48 @@ +global: + clusterLabel: clusterName + clusterName: mothership +motel: + logs_endpoint: http://victoria-logs-single-server:9428/insert/opentelemetry/v1/logs + metrics_endpoint: http://vminsert-cluster:8480/insert/0/prometheus/api/v1/write +prometheus-node-exporter: + enabled: true + hostNetwork: false + service: + labels: + jobLabel: node-exporter + extraArgs: + - --collector.filesystem.ignored-mount-points=^/(dev|proc|sys|var/lib/docker/.+|var/lib/kubelet/.+)($|/) + - --collector.filesystem.ignored-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)$ + prometheus: + monitor: + enabled: true + http: + honorLabels: true +kube-state-metrics: + enabled: true + prometheus: + monitor: + enabled: true + http: + honorLabels: true +collectors: + enabled: true +opencost: + enabled: true + opencost: + prometheus: + username: "motel" + password: "motel" + external: + enabled: true + url: "https://vmauth.storage0.example.net/vm/select/0/prometheus" + internal: + enabled: false + metrics: + serviceMonitor: + enabled: true + exporter: + defaultClusterId: "mothership" + extraEnv: + EMIT_KSM_V1_METRICS: "false" + EMIT_KSM_V1_METRICS_ONLY: "true" diff --git a/charts/motel-mothership/Chart.lock b/charts/motel-mothership/Chart.lock index d16b6ef..aa61d21 100644 --- a/charts/motel-mothership/Chart.lock +++ b/charts/motel-mothership/Chart.lock @@ -6,4 +6,4 @@ dependencies: repository: https://victoriametrics.github.io/helm-charts/ version: 0.36.0 digest: sha256:2292ec0cf4531b9d855f474d8e4162ef142c2e2cf18fd1993aacb217003bb3e5 -generated: "2024-12-03T12:02:24.207706+01:00" +generated: "2024-12-20T11:23:39.362094+02:00" diff --git a/charts/motel-mothership/Chart.yaml b/charts/motel-mothership/Chart.yaml index e46ddc3..53fb40e 100644 --- a/charts/motel-mothership/Chart.yaml +++ b/charts/motel-mothership/Chart.yaml @@ -12,4 +12,3 @@ dependencies: version: "0.36.*" repository: "https://victoriametrics.github.io/helm-charts/" condition: victoria-metrics-operator.enabled - diff --git a/charts/motel-mothership/templates/grafana/dashboards/dashboard.yaml b/charts/motel-mothership/templates/grafana/dashboards/dashboard.yaml index 2f6e49a..1b8433f 100644 --- a/charts/motel-mothership/templates/grafana/dashboards/dashboard.yaml +++ b/charts/motel-mothership/templates/grafana/dashboards/dashboard.yaml @@ -5,7 +5,7 @@ {{- $dashboardBase := base $dashboardFile }} {{- $dashboardName := (trimSuffix (ext $dashboardBase) $dashboardBase) -}} {{- $dashboardData := fromYaml (tpl ($.Files.Get $dashboardFile) $ctx) -}} -{{- $dashboardResult := toRawJson $dashboardData -}} +{{- $dashboardResult := toRawJson $dashboardData }} apiVersion: grafana.integreatly.org/v1beta1 kind: GrafanaDashboard metadata: @@ -21,4 +21,4 @@ spec: json: | {{ $dashboardResult | nindent 4 }} --- {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/motel-mothership/templates/grafana/grafana.yaml b/charts/motel-mothership/templates/grafana/grafana.yaml index fe6180a..e543904 100644 --- a/charts/motel-mothership/templates/grafana/grafana.yaml +++ b/charts/motel-mothership/templates/grafana/grafana.yaml @@ -77,4 +77,4 @@ spec: - hosts: - {{ .Values.grafana.ingress.host | quote }} secretName: grafana-cluster-tls -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/motel-mothership/templates/grafana/logs-datasource.yaml b/charts/motel-mothership/templates/grafana/logs-datasource.yaml index 344eca3..ec5b0aa 100644 --- a/charts/motel-mothership/templates/grafana/logs-datasource.yaml +++ b/charts/motel-mothership/templates/grafana/logs-datasource.yaml @@ -1,4 +1,27 @@ {{- if .Values.grafana.enabled }} +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDatasource +metadata: + labels: + app.kubernetes.io/managed-by: Helm + name: victorialogs + namespace: {{ $.Release.Namespace }} +spec: + datasource: + access: proxy + isDefault: false + name: victorialogs + type: "victoriametrics-logs-datasource" + url: "http://vmselect-cluster.{{ .Release.Namespace }}:8481" + basicAuth: true + basicAuthUser: motel + secureJsonData: + basicAuthPassword: motel + instanceSelector: + matchLabels: + dashboards: grafana + resyncPeriod: 5m +--- {{- range .Values.grafana.logSources }} apiVersion: grafana.integreatly.org/v1beta1 kind: GrafanaDatasource @@ -12,7 +35,7 @@ spec: access: proxy isDefault: false name: {{ .name }} - type: {{ .type | default "victoriametrics-logs-datasource " }} + type: {{ .type | default "victoriametrics-logs-datasource" }} url: {{ .url }} basicAuth: true basicAuthUser: {{ .auth.username | quote }} @@ -24,4 +47,4 @@ spec: resyncPeriod: 5m --- {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/motel-mothership/templates/grafana/metrics-datasource.yaml b/charts/motel-mothership/templates/grafana/metrics-datasource.yaml index 9ade3bc..d345ccf 100644 --- a/charts/motel-mothership/templates/grafana/metrics-datasource.yaml +++ b/charts/motel-mothership/templates/grafana/metrics-datasource.yaml @@ -12,9 +12,29 @@ spec: name: promxy type: prometheus access: proxy - url: {{ .Values.grafana.promxyDatasourceUrl | default (printf "http://%s-promxy:8082" .Release.Name) | quote }} + url: "http://{{ .Release.Name }}-promxy:8082" isDefault: true jsonData: tlsSkipVerify: true timeInterval: "5s" -{{- end }} \ No newline at end of file +--- +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDatasource +metadata: + name: victoriametrics + namespace: {{ .Release.Namespace }} +spec: + instanceSelector: + matchLabels: + dashboards: "grafana" + datasource: + name: victoriametrics + type: prometheus + access: proxy + url: "http://vmselect-cluster.{{ .Release.Namespace }}:8481/select/0/prometheus" + isDefault: false + jsonData: + tlsSkipVerify: true + timeInterval: "5s" + +{{- end }} diff --git a/charts/motel-mothership/templates/grafana/rules/rules.yaml b/charts/motel-mothership/templates/grafana/rules/rules.yaml index 1585883..c9530d2 100644 --- a/charts/motel-mothership/templates/grafana/rules/rules.yaml +++ b/charts/motel-mothership/templates/grafana/rules/rules.yaml @@ -1,3 +1,4 @@ +{{- if index .Values "grafana" "enabled" | default false }} {{- if (index .Values "grafana" "alerts" | default dict).enabled | default false }} {{- /* Default rules alias @@ -112,4 +113,5 @@ spec: {{- end }} {{- end }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} +{{- end }} diff --git a/charts/motel-mothership/templates/hmc/cert-manager/svctmpl.yaml b/charts/motel-mothership/templates/hmc/cert-manager/svctmpl.yaml index 9939410..bb9107e 100644 --- a/charts/motel-mothership/templates/hmc/cert-manager/svctmpl.yaml +++ b/charts/motel-mothership/templates/hmc/cert-manager/svctmpl.yaml @@ -2,7 +2,7 @@ apiVersion: hmc.mirantis.com/v1alpha1 kind: ServiceTemplate metadata: - name: cert-manager-1-16-1 + name: cert-manager namespace: hmc-system spec: helm: @@ -11,6 +11,5 @@ spec: kind: HelmChart name: cert-manager namespace: hmc-system - chartVersion: 1.16.1 providers: [] -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/motel-mothership/templates/hmc/motel-child/flux-helm.yaml b/charts/motel-mothership/templates/hmc/motel-child/flux-helm.yaml deleted file mode 100644 index efb0dd7..0000000 --- a/charts/motel-mothership/templates/hmc/motel-child/flux-helm.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- if .Values.hmc.installTemplates }} -apiVersion: source.toolkit.fluxcd.io/v1 -kind: HelmChart -metadata: - name: motel-child - namespace: hmc-system - labels: - hmc.mirantis.com/managed: "true" -spec: - chart: motel-child - interval: 10m0s - reconcileStrategy: ChartVersion - sourceRef: - kind: HelmRepository - name: motel - version: 0.1.2 -{{- end }} diff --git a/charts/motel-mothership/templates/hmc/motel-child/svctmpl.yaml b/charts/motel-mothership/templates/hmc/motel-child/svctmpl.yaml deleted file mode 100644 index d2c77bb..0000000 --- a/charts/motel-mothership/templates/hmc/motel-child/svctmpl.yaml +++ /dev/null @@ -1,16 +0,0 @@ -{{- if .Values.hmc.installTemplates }} -apiVersion: hmc.mirantis.com/v1alpha1 -kind: ServiceTemplate -metadata: - name: motel-child-0-1-2 - namespace: hmc-system -spec: - helm: - chartRef: - apiVersion: source.toolkit.fluxcd.io/v1 - kind: HelmChart - name: motel-child - namespace: hmc-system - chartVersion: 0.1.2 - providers: [] -{{- end }} diff --git a/charts/motel-mothership/templates/hmc/motel-regional/flux-helm.yaml b/charts/motel-mothership/templates/hmc/motel-flux-helm.yaml similarity index 58% rename from charts/motel-mothership/templates/hmc/motel-regional/flux-helm.yaml rename to charts/motel-mothership/templates/hmc/motel-flux-helm.yaml index c7f9cfb..b6fb17c 100644 --- a/charts/motel-mothership/templates/hmc/motel-regional/flux-helm.yaml +++ b/charts/motel-mothership/templates/hmc/motel-flux-helm.yaml @@ -1,17 +1,20 @@ {{- if .Values.hmc.installTemplates }} +{{- range $name, $values := .Values.hmc.motel.charts }} +--- apiVersion: source.toolkit.fluxcd.io/v1 kind: HelmChart metadata: - name: motel-regional + name: motel-{{ $name }} namespace: hmc-system labels: hmc.mirantis.com/managed: "true" spec: - chart: motel-regional + chart: motel-{{ $name }} interval: 10m0s reconcileStrategy: ChartVersion sourceRef: kind: HelmRepository - name: motel - version: 0.1.2 + name: {{ $.Values.hmc.motel.repo.name }} + version: {{ $values.version }} +{{- end }} {{- end }} diff --git a/charts/motel-mothership/templates/hmc/motel-repo.yaml b/charts/motel-mothership/templates/hmc/motel-repo.yaml index 108f09f..1c9efd4 100644 --- a/charts/motel-mothership/templates/hmc/motel-repo.yaml +++ b/charts/motel-mothership/templates/hmc/motel-repo.yaml @@ -3,10 +3,12 @@ apiVersion: source.toolkit.fluxcd.io/v1 kind: HelmRepository metadata: - name: motel + name: {{ .Values.hmc.motel.repo.name }} namespace: hmc-system labels: hmc.mirantis.com/managed: "true" spec: - url: https://mirantis.github.io/motel/ -{{- end }} \ No newline at end of file + url: {{ .Values.hmc.motel.repo.url }} + insecure: {{ .Values.hmc.motel.repo.insecure }} + type: {{ .Values.hmc.motel.repo.type }} +{{- end }} diff --git a/charts/motel-mothership/templates/hmc/motel-regional/svctmpl.yaml b/charts/motel-mothership/templates/hmc/motel-svctmpl.yaml similarity index 69% rename from charts/motel-mothership/templates/hmc/motel-regional/svctmpl.yaml rename to charts/motel-mothership/templates/hmc/motel-svctmpl.yaml index 232fe97..be8ce8e 100644 --- a/charts/motel-mothership/templates/hmc/motel-regional/svctmpl.yaml +++ b/charts/motel-mothership/templates/hmc/motel-svctmpl.yaml @@ -1,16 +1,18 @@ {{- if .Values.hmc.installTemplates }} +{{- range $name, $values := .Values.hmc.motel.charts }} +--- apiVersion: hmc.mirantis.com/v1alpha1 kind: ServiceTemplate metadata: - name: motel-regional-0-1-2 + name: motel-{{ $name }} namespace: hmc-system spec: helm: chartRef: apiVersion: source.toolkit.fluxcd.io/v1 kind: HelmChart - name: motel-regional + name: motel-{{ $name }} namespace: hmc-system - chartVersion: 0.1.2 providers: [] {{- end }} +{{- end }} diff --git a/charts/motel-mothership/templates/promxy/deployment.yaml b/charts/motel-mothership/templates/promxy/deployment.yaml index d67ef20..e368d71 100644 --- a/charts/motel-mothership/templates/promxy/deployment.yaml +++ b/charts/motel-mothership/templates/promxy/deployment.yaml @@ -1,4 +1,4 @@ -{{- if .Values.promxy.deployment.enabled }} +{{- if .Values.promxy.enabled }} apiVersion: apps/v1 kind: Deployment metadata: @@ -15,7 +15,7 @@ metadata: {{- end }} spec: replicas: {{ .Values.promxy.replicaCount }} - {{- if .Values.promxy.deployment.strategy }} + {{- if (.Values.promxy.deployment | default dict).strategy }} strategy: {{- toYaml .Values.promxy.deployment.strategy | nindent 4 }} {{- end }} diff --git a/charts/motel-mothership/templates/victoria/vmalert.yaml b/charts/motel-mothership/templates/victoria/vmalert.yaml index 3d31997..fa94c09 100644 --- a/charts/motel-mothership/templates/victoria/vmalert.yaml +++ b/charts/motel-mothership/templates/victoria/vmalert.yaml @@ -1,4 +1,5 @@ -{{- if (index .Values "victoriametrics" "vmalert" | default dict).enabled | default false }} +{{- if .Values.victoriametrics.enabled }} +{{- if .Values.victoriametrics.vmalert.enabled }} apiVersion: operator.victoriametrics.com/v1beta1 kind: VMAlert metadata: @@ -24,4 +25,5 @@ spec: remoteWrite: url: http://vminsert-cluster.{{ .Release.Namespace }}.svc:8480/insert/0/prometheus/api/v1/write selectAllByDefault: true -{{- end }} \ No newline at end of file +{{- end }} +{{- end }} diff --git a/charts/motel-mothership/templates/victoria/vmcluster.yaml b/charts/motel-mothership/templates/victoria/vmcluster.yaml index a2e7c0a..82706e2 100644 --- a/charts/motel-mothership/templates/victoria/vmcluster.yaml +++ b/charts/motel-mothership/templates/victoria/vmcluster.yaml @@ -1,4 +1,5 @@ -{{- if (index .Values "victoriametrics" "vmcluster" | default dict ).enabled | default false }} +{{- if .Values.victoriametrics.enabled }} +{{- if .Values.victoriametrics.vmcluster.enabled }} apiVersion: operator.victoriametrics.com/v1beta1 kind: VMCluster metadata: @@ -43,4 +44,5 @@ spec: storage: 10Gi storageClassName: {{ .Values.global.storageClass }} storageDataPath: /vm-data -{{- end }} \ No newline at end of file +{{- end }} +{{- end }} diff --git a/charts/motel-mothership/values.yaml b/charts/motel-mothership/values.yaml index 1d6d1ea..9fbc100 100644 --- a/charts/motel-mothership/values.yaml +++ b/charts/motel-mothership/values.yaml @@ -4,8 +4,21 @@ global: clusterName: mothership hmc: installTemplates: false + motel: + repo: + name: motel + url: https://mirantis.github.io/motel/ + insecure: false + type: "default" + charts: + operators: + version: 0.0.1 + collectors: + version: 0.0.1 + storage: + version: 0.1.2 victoriametrics: - enabled: enabled + enabled: true vmcluster: enabled: true replicationFactor: 1 @@ -20,20 +33,19 @@ grafana: host: grafana.example.net alerts: enabled: true - promxyDatasourceUrl: logSources: - - name: hmc0-logs - url: https://vmauth.hmc0.example.net/vls - type: victorialogs-datasource - auth: - username: motel - password: motel - - name: hmc1-logs - url: https://vmauth.hmc1.example.net/vls - type: victorialogs-datasource - auth: - username: motel - password: motel + - name: hmc0-logs + url: https://vmauth.hmc0.example.net/vls + type: victoriametrics-logs-datasource + auth: + username: motel + password: motel + - name: hmc1-logs + url: https://vmauth.hmc1.example.net/vls + type: victoriametrics-logs-datasource + auth: + username: motel + password: motel security: admin_user: motel admin_password: motel @@ -43,8 +55,7 @@ victoria-metrics-operator: plain: true promxy: replicaCount: 1 - deployment: - enabled: true + enabled: true image: repository: quay.io/jacksontj/promxy tag: "latest" @@ -98,4 +109,4 @@ promxy: - vmauth.hmc1.example.net:443 auth: username: motel - password: motel \ No newline at end of file + password: motel diff --git a/charts/motel-operators/Chart.lock b/charts/motel-operators/Chart.lock new file mode 100644 index 0000000..63a9386 --- /dev/null +++ b/charts/motel-operators/Chart.lock @@ -0,0 +1,9 @@ +dependencies: +- name: opentelemetry-operator + repository: https://open-telemetry.github.io/opentelemetry-helm-charts + version: 0.75.1 +- name: prometheus-operator-crds + repository: https://prometheus-community.github.io/helm-charts + version: 15.0.0 +digest: sha256:35405c2f021cfeca8419431246c513a84d6f9fc798ce80a1ac8faea168824ad8 +generated: "2024-12-23T16:12:53.763054+02:00" diff --git a/charts/motel-operators/Chart.yaml b/charts/motel-operators/Chart.yaml new file mode 100644 index 0000000..cac0f6d --- /dev/null +++ b/charts/motel-operators/Chart.yaml @@ -0,0 +1,14 @@ +apiVersion: v2 +name: motel-operators +description: A Helm chart that deploys opentelemetry-operator and prometheus CRDs +version: 0.0.1 +appVersion: "1.0" +dependencies: + - name: opentelemetry-operator + version: "0.75.*" + repository: "https://open-telemetry.github.io/opentelemetry-helm-charts" + condition: opentelemetry-operator.enabled + - name: prometheus-operator-crds + version: "15.0.*" + repository: https://prometheus-community.github.io/helm-charts + condition: prometheus-operator-crds.enabled diff --git a/charts/motel-operators/templates/opentelemetry/clusterrolebindings/opentelemetry-operator-manager.yaml b/charts/motel-operators/templates/opentelemetry/clusterrolebindings/opentelemetry-operator-manager.yaml new file mode 100644 index 0000000..810b1b4 --- /dev/null +++ b/charts/motel-operators/templates/opentelemetry/clusterrolebindings/opentelemetry-operator-manager.yaml @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ .Release.Name }}-opentelemetry-operator-manager +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ .Release.Name }}-opentelemetry-operator-manager +subjects: + - kind: ServiceAccount + name: opentelemetry-operator + namespace: {{ .Release.Namespace }} diff --git a/charts/motel-operators/templates/opentelemetry/clusterroles/opentelemetry-operator-manager.yaml b/charts/motel-operators/templates/opentelemetry/clusterroles/opentelemetry-operator-manager.yaml new file mode 100644 index 0000000..27f6c82 --- /dev/null +++ b/charts/motel-operators/templates/opentelemetry/clusterroles/opentelemetry-operator-manager.yaml @@ -0,0 +1,245 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ .Release.Name }}-opentelemetry-operator-manager + +rules: +- apiGroups: + - "" + resources: + - configmaps + - persistentvolumeclaims + - persistentvolumes + - pods + - serviceaccounts + - services + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - "" + resources: + - events + verbs: + - create + - patch +- apiGroups: + - "" + resources: + - namespaces + verbs: + - list + - watch +- apiGroups: + - apps + resources: + - daemonsets + - deployments + - statefulsets + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - apps + - extensions + resources: + - replicasets + verbs: + - get + - list + - watch +- apiGroups: + - autoscaling + resources: + - horizontalpodautoscalers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - authorization.k8s.io + resources: + - subjectaccessreviews + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - rbac.authorization.k8s.io + resources: + - clusterroles + - clusterrolebindings + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - "" + resources: + - nodes + - namespaces + - secrets + verbs: + - get + - list + - watch +- apiGroups: + - batch + resources: + - jobs + verbs: + - get + - list + - watch +- apiGroups: + - config.openshift.io + resources: + - infrastructures + - infrastructures/status + verbs: + - get + - list + - watch +- apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - create + - get + - list + - update +- apiGroups: + - monitoring.coreos.com + resources: + - podmonitors + - servicemonitors + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - networking.k8s.io + resources: + - ingresses + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - opentelemetry.io + resources: + - instrumentations + verbs: + - get + - list + - patch + - update + - watch +- apiGroups: + - opentelemetry.io + resources: + - opampbridges + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - opentelemetry.io + resources: + - opampbridges/finalizers + verbs: + - update +- apiGroups: + - opentelemetry.io + resources: + - opampbridges/status + verbs: + - get + - patch + - update +- apiGroups: + - opentelemetry.io + resources: + - opentelemetrycollectors + verbs: + - get + - list + - patch + - update + - watch +- apiGroups: + - opentelemetry.io + resources: + - opentelemetrycollectors/finalizers + verbs: + - get + - patch + - update +- apiGroups: + - opentelemetry.io + resources: + - opentelemetrycollectors/status + verbs: + - get + - patch + - update +- apiGroups: + - policy + resources: + - poddisruptionbudgets + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - route.openshift.io + resources: + - routes + - routes/custom-host + verbs: + - create + - delete + - get + - list + - patch + - update + - watch diff --git a/charts/motel-operators/values.yaml b/charts/motel-operators/values.yaml new file mode 100644 index 0000000..f395453 --- /dev/null +++ b/charts/motel-operators/values.yaml @@ -0,0 +1,13 @@ +prometheus-operator-crds: + enabled: true +opentelemetry-operator: + enabled: true + manager: + collectorImage: + repository: "otel/opentelemetry-collector-contrib" + createRbacPermissions: true + clusterRole: + create: false + admissionWebhooks: + autoGenerateCert: + enabled: false diff --git a/charts/motel-regional/templates/_helpers.tpl b/charts/motel-regional/templates/_helpers.tpl deleted file mode 100644 index d9152ca..0000000 --- a/charts/motel-regional/templates/_helpers.tpl +++ /dev/null @@ -1,5 +0,0 @@ -{{- /* VMRule key */ -}} -{{- define "victoria-metrics-k8s-stack.rulegroup.key" -}} - {{- without (regexSplit "[-_.]" .name -1) "exporter" "rules" | join "-" | camelcase | untitle -}} -{{- end -}} - diff --git a/charts/motel-regional/templates/grafana/logs-datasource.yaml b/charts/motel-regional/templates/grafana/logs-datasource.yaml deleted file mode 100644 index b5fbd79..0000000 --- a/charts/motel-regional/templates/grafana/logs-datasource.yaml +++ /dev/null @@ -1,20 +0,0 @@ -{{- if index .Values "grafana" "enabled" | default false }} -apiVersion: grafana.integreatly.org/v1beta1 -kind: GrafanaDatasource -metadata: - labels: - app.kubernetes.io/managed-by: Helm - name: vls - namespace: {{ .Release.Namespace }} -spec: - datasource: - access: proxy - isDefault: true - name: vls - type: victoriametrics-logs-datasource - url: http://{{ .Release.Name }}-victoria-logs-single-server:9428 - instanceSelector: - matchLabels: - dashboards: grafana - resyncPeriod: 5m -{{- end }} \ No newline at end of file diff --git a/charts/motel-regional/templates/grafana/metrics-datasource.yaml b/charts/motel-regional/templates/grafana/metrics-datasource.yaml deleted file mode 100644 index 4061399..0000000 --- a/charts/motel-regional/templates/grafana/metrics-datasource.yaml +++ /dev/null @@ -1,20 +0,0 @@ -{{- if index .Values "grafana" "enabled" | default false }} -apiVersion: grafana.integreatly.org/v1beta1 -kind: GrafanaDatasource -metadata: - name: victoriametrics - namespace: {{ .Release.Namespace }} -spec: - instanceSelector: - matchLabels: - dashboards: "grafana" - datasource: - name: victoriametrics - type: prometheus - access: proxy - url: {{ .Values.grafana.datasource.url }} - isDefault: true - jsonData: - tlsSkipVerify: true - timeInterval: "5s" -{{- end }} \ No newline at end of file diff --git a/charts/motel-regional/templates/victoria/scrape/cadvisor.yaml b/charts/motel-regional/templates/victoria/scrape/cadvisor.yaml deleted file mode 100644 index 5fedd33..0000000 --- a/charts/motel-regional/templates/victoria/scrape/cadvisor.yaml +++ /dev/null @@ -1,36 +0,0 @@ -{{- if (index .Values "victoriametrics" "vmagent" | default dict).enabled | default false }} -apiVersion: operator.victoriametrics.com/v1beta1 -kind: VMNodeScrape -metadata: - name: cadvisor - namespace: {{ .Release.Namespace }} -spec: - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token - honorLabels: true - honorTimestamps: false - interval: 30s - metricRelabelConfigs: - - action: labeldrop - regex: (uid) - - action: labeldrop - regex: (id|name) - - action: drop - regex: (rest_client_request_duration_seconds_bucket|rest_client_request_duration_seconds_sum|rest_client_request_duration_seconds_count) - source_labels: - - __name__ - path: /metrics/cadvisor - relabelConfigs: - - action: labelmap - regex: __meta_kubernetes_node_label_(.+) - - sourceLabels: - - __metrics_path__ - targetLabel: metrics_path - - replacement: kubelet - targetLabel: job - scheme: https - scrapeTimeout: 5s - selector: {} - tlsConfig: - caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt - insecureSkipVerify: true -{{- end }} \ No newline at end of file diff --git a/charts/motel-regional/templates/victoria/scrape/kube-state-metrics.yaml b/charts/motel-regional/templates/victoria/scrape/kube-state-metrics.yaml deleted file mode 100644 index acac800..0000000 --- a/charts/motel-regional/templates/victoria/scrape/kube-state-metrics.yaml +++ /dev/null @@ -1,18 +0,0 @@ -{{- if (index .Values "victoriametrics" "vmagent" | default dict).enabled | default false }} -apiVersion: operator.victoriametrics.com/v1beta1 -kind: VMServiceScrape -metadata: - name: kube-state-metrics - namespace: {{ .Release.Namespace }} -spec: - endpoints: - - honorLabels: true - metricRelabelConfigs: - - action: labeldrop - regex: (uid|container_id|image_id) - port: http - jobLabel: app.kubernetes.io/name - selector: - matchLabels: - app.kubernetes.io/name: kube-state-metrics -{{- end }} \ No newline at end of file diff --git a/charts/motel-regional/templates/victoria/scrape/kubelet.yaml b/charts/motel-regional/templates/victoria/scrape/kubelet.yaml deleted file mode 100644 index f5bb388..0000000 --- a/charts/motel-regional/templates/victoria/scrape/kubelet.yaml +++ /dev/null @@ -1,35 +0,0 @@ -{{- if (index .Values "victoriametrics" "vmagent" | default dict).enabled | default false }} -apiVersion: operator.victoriametrics.com/v1beta1 -kind: VMNodeScrape -metadata: - name: kubelet - namespace: {{ .Release.Namespace }} -spec: - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token - honorLabels: true - honorTimestamps: false - interval: 30s - metricRelabelConfigs: - - action: labeldrop - regex: (uid) - - action: labeldrop - regex: (id|name) - - action: drop - regex: (rest_client_request_duration_seconds_bucket|rest_client_request_duration_seconds_sum|rest_client_request_duration_seconds_count) - source_labels: - - __name__ - relabelConfigs: - - action: labelmap - regex: __meta_kubernetes_node_label_(.+) - - sourceLabels: - - __metrics_path__ - targetLabel: metrics_path - - replacement: kubelet - targetLabel: job - scheme: https - scrapeTimeout: 5s - selector: {} - tlsConfig: - caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt - insecureSkipVerify: true -{{- end }} \ No newline at end of file diff --git a/charts/motel-regional/templates/victoria/scrape/node-exporter.yaml b/charts/motel-regional/templates/victoria/scrape/node-exporter.yaml deleted file mode 100644 index 6867e24..0000000 --- a/charts/motel-regional/templates/victoria/scrape/node-exporter.yaml +++ /dev/null @@ -1,19 +0,0 @@ -{{- if (index .Values "victoriametrics" "vmagent" | default dict).enabled | default false }} -apiVersion: operator.victoriametrics.com/v1beta1 -kind: VMServiceScrape -metadata: - name: prometheus-node-exporter - namespace: {{ .Release.Namespace }} -spec: - endpoints: - - metricRelabelConfigs: - - action: drop - regex: /var/lib/kubelet/pods.+ - source_labels: - - mountpoint - port: metrics - jobLabel: jobLabel - selector: - matchLabels: - app.kubernetes.io/name: prometheus-node-exporter -{{- end }} \ No newline at end of file diff --git a/charts/motel-regional/templates/victoria/scrape/probes.yaml b/charts/motel-regional/templates/victoria/scrape/probes.yaml deleted file mode 100644 index 0243c67..0000000 --- a/charts/motel-regional/templates/victoria/scrape/probes.yaml +++ /dev/null @@ -1,36 +0,0 @@ -{{- if (index .Values "victoriametrics" "vmagent" | default dict).enabled | default false }} -apiVersion: operator.victoriametrics.com/v1beta1 -kind: VMNodeScrape -metadata: - name: k8s-probes - namespace: {{ .Release.Namespace }} -spec: - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token - honorLabels: true - honorTimestamps: false - interval: 30s - metricRelabelConfigs: - - action: labeldrop - regex: (uid) - - action: labeldrop - regex: (id|name) - - action: drop - regex: (rest_client_request_duration_seconds_bucket|rest_client_request_duration_seconds_sum|rest_client_request_duration_seconds_count) - source_labels: - - __name__ - path: /metrics/probes - relabelConfigs: - - action: labelmap - regex: __meta_kubernetes_node_label_(.+) - - sourceLabels: - - __metrics_path__ - targetLabel: metrics_path - - replacement: kubelet - targetLabel: job - scheme: https - scrapeTimeout: 5s - selector: {} - tlsConfig: - caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt - insecureSkipVerify: true -{{- end }} \ No newline at end of file diff --git a/charts/motel-regional/templates/victoria/vmagent.yaml b/charts/motel-regional/templates/victoria/vmagent.yaml deleted file mode 100644 index 21463b6..0000000 --- a/charts/motel-regional/templates/victoria/vmagent.yaml +++ /dev/null @@ -1,21 +0,0 @@ -{{- if (index .Values "victoriametrics" "vmagent" | default dict).enabled | default false }} -apiVersion: operator.victoriametrics.com/v1beta1 -kind: VMAgent -metadata: - name: cluster - namespace: {{ .Release.Namespace }} -spec: - externalLabels: - clusterName: {{ .Values.global.clusterName }} - extraArgs: - promscrape.dropOriginalLabels: "true" - promscrape.streamParse: "true" - image: - tag: v1.105.0 - license: {} - port: "8429" - remoteWrite: - - url: {{ .Values.victoriametrics.vmagent.remoteWriteUrl | quote }} - scrapeInterval: 20s - selectAllByDefault: true -{{- end }} \ No newline at end of file diff --git a/charts/motel-regional/Chart.lock b/charts/motel-storage/Chart.lock similarity index 70% rename from charts/motel-regional/Chart.lock rename to charts/motel-storage/Chart.lock index 61ec799..81596e0 100644 --- a/charts/motel-regional/Chart.lock +++ b/charts/motel-storage/Chart.lock @@ -4,12 +4,12 @@ dependencies: version: v5.15.1 - name: victoria-metrics-operator repository: https://victoriametrics.github.io/helm-charts/ - version: 0.36.0 + version: 0.40.2 - name: victoria-logs-single repository: https://victoriametrics.github.io/helm-charts/ - version: 0.7.3 + version: 0.8.11 - name: external-dns repository: https://kubernetes-sigs.github.io/external-dns/ version: 1.15.0 -digest: sha256:edf812d433522935fede14109a6ee392ff6c4e9f5ce5f3be4d3887dd8772c2e7 -generated: "2024-12-10T16:23:18.455771+02:00" +digest: sha256:244f062828bbc1d6c954b2c54955b6f974a5926dc3f4335fa8ba7a78a8516286 +generated: "2024-12-25T14:23:37.379566969+02:00" diff --git a/charts/motel-regional/Chart.yaml b/charts/motel-storage/Chart.yaml similarity index 88% rename from charts/motel-regional/Chart.yaml rename to charts/motel-storage/Chart.yaml index 9fb87cc..65bd8a4 100644 --- a/charts/motel-regional/Chart.yaml +++ b/charts/motel-storage/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -name: motel-regional +name: motel-storage description: A Helm chart that deploys Grafana, and VictoriaMetrics. version: 0.1.2 appVersion: "1.0" @@ -9,14 +9,14 @@ dependencies: repository: "oci://ghcr.io/grafana/helm-charts" condition: grafana.enabled - name: victoria-metrics-operator - version: "0.36.*" + version: "0.40.*" repository: "https://victoriametrics.github.io/helm-charts/" condition: victoria-metrics-operator.enabled - name: victoria-logs-single - version: "0.7.*" + version: "0.8.*" repository: https://victoriametrics.github.io/helm-charts/ condition: victoria-logs-single.enabled - name: external-dns - version: "1.15.0" + version: "1.15.*" repository: "https://kubernetes-sigs.github.io/external-dns/" condition: external-dns.enabled diff --git a/charts/motel-regional/files/dashboards/kubernetes-views-global.yaml b/charts/motel-storage/files/dashboards/kubernetes-views-global.yaml similarity index 100% rename from charts/motel-regional/files/dashboards/kubernetes-views-global.yaml rename to charts/motel-storage/files/dashboards/kubernetes-views-global.yaml diff --git a/charts/motel-regional/files/dashboards/kubernetes-views-namespaces.yaml b/charts/motel-storage/files/dashboards/kubernetes-views-namespaces.yaml similarity index 100% rename from charts/motel-regional/files/dashboards/kubernetes-views-namespaces.yaml rename to charts/motel-storage/files/dashboards/kubernetes-views-namespaces.yaml diff --git a/charts/motel-regional/files/dashboards/kubernetes-views-nodes.yaml b/charts/motel-storage/files/dashboards/kubernetes-views-nodes.yaml similarity index 100% rename from charts/motel-regional/files/dashboards/kubernetes-views-nodes.yaml rename to charts/motel-storage/files/dashboards/kubernetes-views-nodes.yaml diff --git a/charts/motel-regional/files/dashboards/kubernetes-views-pods.yaml b/charts/motel-storage/files/dashboards/kubernetes-views-pods.yaml similarity index 100% rename from charts/motel-regional/files/dashboards/kubernetes-views-pods.yaml rename to charts/motel-storage/files/dashboards/kubernetes-views-pods.yaml diff --git a/charts/motel-regional/files/dashboards/node-exporter-full.yaml b/charts/motel-storage/files/dashboards/node-exporter-full.yaml similarity index 100% rename from charts/motel-regional/files/dashboards/node-exporter-full.yaml rename to charts/motel-storage/files/dashboards/node-exporter-full.yaml diff --git a/charts/motel-regional/files/dashboards/opencost-cost-reporter-basic-overview.yaml b/charts/motel-storage/files/dashboards/opencost-cost-reporter-basic-overview.yaml similarity index 100% rename from charts/motel-regional/files/dashboards/opencost-cost-reporter-basic-overview.yaml rename to charts/motel-storage/files/dashboards/opencost-cost-reporter-basic-overview.yaml diff --git a/charts/motel-regional/files/dashboards/opencost-cost-reporter-detailed-overview.yaml b/charts/motel-storage/files/dashboards/opencost-cost-reporter-detailed-overview.yaml similarity index 100% rename from charts/motel-regional/files/dashboards/opencost-cost-reporter-detailed-overview.yaml rename to charts/motel-storage/files/dashboards/opencost-cost-reporter-detailed-overview.yaml diff --git a/charts/motel-regional/files/rules/etcd.yaml b/charts/motel-storage/files/rules/etcd.yaml similarity index 100% rename from charts/motel-regional/files/rules/etcd.yaml rename to charts/motel-storage/files/rules/etcd.yaml diff --git a/charts/motel-regional/files/rules/general.rules.yaml b/charts/motel-storage/files/rules/general.rules.yaml similarity index 100% rename from charts/motel-regional/files/rules/general.rules.yaml rename to charts/motel-storage/files/rules/general.rules.yaml diff --git a/charts/motel-regional/files/rules/k8s.rules.container_cpu_limits.yaml b/charts/motel-storage/files/rules/k8s.rules.container_cpu_limits.yaml similarity index 100% rename from charts/motel-regional/files/rules/k8s.rules.container_cpu_limits.yaml rename to charts/motel-storage/files/rules/k8s.rules.container_cpu_limits.yaml diff --git a/charts/motel-regional/files/rules/k8s.rules.container_cpu_requests.yaml b/charts/motel-storage/files/rules/k8s.rules.container_cpu_requests.yaml similarity index 100% rename from charts/motel-regional/files/rules/k8s.rules.container_cpu_requests.yaml rename to charts/motel-storage/files/rules/k8s.rules.container_cpu_requests.yaml diff --git a/charts/motel-regional/files/rules/k8s.rules.container_cpu_usage_seconds_total.yaml b/charts/motel-storage/files/rules/k8s.rules.container_cpu_usage_seconds_total.yaml similarity index 100% rename from charts/motel-regional/files/rules/k8s.rules.container_cpu_usage_seconds_total.yaml rename to charts/motel-storage/files/rules/k8s.rules.container_cpu_usage_seconds_total.yaml diff --git a/charts/motel-regional/files/rules/k8s.rules.container_memory_cache.yaml b/charts/motel-storage/files/rules/k8s.rules.container_memory_cache.yaml similarity index 100% rename from charts/motel-regional/files/rules/k8s.rules.container_memory_cache.yaml rename to charts/motel-storage/files/rules/k8s.rules.container_memory_cache.yaml diff --git a/charts/motel-regional/files/rules/k8s.rules.container_memory_limits.yaml b/charts/motel-storage/files/rules/k8s.rules.container_memory_limits.yaml similarity index 100% rename from charts/motel-regional/files/rules/k8s.rules.container_memory_limits.yaml rename to charts/motel-storage/files/rules/k8s.rules.container_memory_limits.yaml diff --git a/charts/motel-regional/files/rules/k8s.rules.container_memory_requests.yaml b/charts/motel-storage/files/rules/k8s.rules.container_memory_requests.yaml similarity index 100% rename from charts/motel-regional/files/rules/k8s.rules.container_memory_requests.yaml rename to charts/motel-storage/files/rules/k8s.rules.container_memory_requests.yaml diff --git a/charts/motel-regional/files/rules/k8s.rules.container_memory_rss.yaml b/charts/motel-storage/files/rules/k8s.rules.container_memory_rss.yaml similarity index 100% rename from charts/motel-regional/files/rules/k8s.rules.container_memory_rss.yaml rename to charts/motel-storage/files/rules/k8s.rules.container_memory_rss.yaml diff --git a/charts/motel-regional/files/rules/k8s.rules.container_memory_swap.yaml b/charts/motel-storage/files/rules/k8s.rules.container_memory_swap.yaml similarity index 100% rename from charts/motel-regional/files/rules/k8s.rules.container_memory_swap.yaml rename to charts/motel-storage/files/rules/k8s.rules.container_memory_swap.yaml diff --git a/charts/motel-regional/files/rules/k8s.rules.container_memory_working_set_bytes.yaml b/charts/motel-storage/files/rules/k8s.rules.container_memory_working_set_bytes.yaml similarity index 100% rename from charts/motel-regional/files/rules/k8s.rules.container_memory_working_set_bytes.yaml rename to charts/motel-storage/files/rules/k8s.rules.container_memory_working_set_bytes.yaml diff --git a/charts/motel-regional/files/rules/k8s.rules.pod_owner.yaml b/charts/motel-storage/files/rules/k8s.rules.pod_owner.yaml similarity index 100% rename from charts/motel-regional/files/rules/k8s.rules.pod_owner.yaml rename to charts/motel-storage/files/rules/k8s.rules.pod_owner.yaml diff --git a/charts/motel-regional/files/rules/kube-prometheus-general.rules.yaml b/charts/motel-storage/files/rules/kube-prometheus-general.rules.yaml similarity index 100% rename from charts/motel-regional/files/rules/kube-prometheus-general.rules.yaml rename to charts/motel-storage/files/rules/kube-prometheus-general.rules.yaml diff --git a/charts/motel-regional/files/rules/kube-prometheus-node-recording.rules.yaml b/charts/motel-storage/files/rules/kube-prometheus-node-recording.rules.yaml similarity index 100% rename from charts/motel-regional/files/rules/kube-prometheus-node-recording.rules.yaml rename to charts/motel-storage/files/rules/kube-prometheus-node-recording.rules.yaml diff --git a/charts/motel-regional/files/rules/kube-state-metrics.yaml b/charts/motel-storage/files/rules/kube-state-metrics.yaml similarity index 100% rename from charts/motel-regional/files/rules/kube-state-metrics.yaml rename to charts/motel-storage/files/rules/kube-state-metrics.yaml diff --git a/charts/motel-regional/files/rules/kubelet.rules.yaml b/charts/motel-storage/files/rules/kubelet.rules.yaml similarity index 100% rename from charts/motel-regional/files/rules/kubelet.rules.yaml rename to charts/motel-storage/files/rules/kubelet.rules.yaml diff --git a/charts/motel-regional/files/rules/kubernetes-apps.yaml b/charts/motel-storage/files/rules/kubernetes-apps.yaml similarity index 100% rename from charts/motel-regional/files/rules/kubernetes-apps.yaml rename to charts/motel-storage/files/rules/kubernetes-apps.yaml diff --git a/charts/motel-regional/files/rules/kubernetes-resources.yaml b/charts/motel-storage/files/rules/kubernetes-resources.yaml similarity index 100% rename from charts/motel-regional/files/rules/kubernetes-resources.yaml rename to charts/motel-storage/files/rules/kubernetes-resources.yaml diff --git a/charts/motel-regional/files/rules/kubernetes-storage.yaml b/charts/motel-storage/files/rules/kubernetes-storage.yaml similarity index 100% rename from charts/motel-regional/files/rules/kubernetes-storage.yaml rename to charts/motel-storage/files/rules/kubernetes-storage.yaml diff --git a/charts/motel-regional/files/rules/kubernetes-system-apiserver.yaml b/charts/motel-storage/files/rules/kubernetes-system-apiserver.yaml similarity index 100% rename from charts/motel-regional/files/rules/kubernetes-system-apiserver.yaml rename to charts/motel-storage/files/rules/kubernetes-system-apiserver.yaml diff --git a/charts/motel-regional/files/rules/kubernetes-system-kubelet.yaml b/charts/motel-storage/files/rules/kubernetes-system-kubelet.yaml similarity index 100% rename from charts/motel-regional/files/rules/kubernetes-system-kubelet.yaml rename to charts/motel-storage/files/rules/kubernetes-system-kubelet.yaml diff --git a/charts/motel-regional/files/rules/kubernetes-system.yaml b/charts/motel-storage/files/rules/kubernetes-system.yaml similarity index 100% rename from charts/motel-regional/files/rules/kubernetes-system.yaml rename to charts/motel-storage/files/rules/kubernetes-system.yaml diff --git a/charts/motel-regional/files/rules/node-exporter.rules.yaml b/charts/motel-storage/files/rules/node-exporter.rules.yaml similarity index 100% rename from charts/motel-regional/files/rules/node-exporter.rules.yaml rename to charts/motel-storage/files/rules/node-exporter.rules.yaml diff --git a/charts/motel-regional/files/rules/node-exporter.yaml b/charts/motel-storage/files/rules/node-exporter.yaml similarity index 100% rename from charts/motel-regional/files/rules/node-exporter.yaml rename to charts/motel-storage/files/rules/node-exporter.yaml diff --git a/charts/motel-regional/files/rules/node-network.yaml b/charts/motel-storage/files/rules/node-network.yaml similarity index 100% rename from charts/motel-regional/files/rules/node-network.yaml rename to charts/motel-storage/files/rules/node-network.yaml diff --git a/charts/motel-regional/files/rules/node.rules.yaml b/charts/motel-storage/files/rules/node.rules.yaml similarity index 100% rename from charts/motel-regional/files/rules/node.rules.yaml rename to charts/motel-storage/files/rules/node.rules.yaml diff --git a/charts/motel-child/templates/_helpers.tpl b/charts/motel-storage/templates/_helpers.tpl similarity index 100% rename from charts/motel-child/templates/_helpers.tpl rename to charts/motel-storage/templates/_helpers.tpl diff --git a/charts/motel-regional/templates/cert-manager/clusterissuer.yaml b/charts/motel-storage/templates/cert-manager/clusterissuer.yaml similarity index 100% rename from charts/motel-regional/templates/cert-manager/clusterissuer.yaml rename to charts/motel-storage/templates/cert-manager/clusterissuer.yaml diff --git a/charts/motel-regional/templates/grafana/dashboards/dashboard.yaml b/charts/motel-storage/templates/grafana/dashboards/dashboard.yaml similarity index 91% rename from charts/motel-regional/templates/grafana/dashboards/dashboard.yaml rename to charts/motel-storage/templates/grafana/dashboards/dashboard.yaml index 2f6e49a..1b8433f 100644 --- a/charts/motel-regional/templates/grafana/dashboards/dashboard.yaml +++ b/charts/motel-storage/templates/grafana/dashboards/dashboard.yaml @@ -5,7 +5,7 @@ {{- $dashboardBase := base $dashboardFile }} {{- $dashboardName := (trimSuffix (ext $dashboardBase) $dashboardBase) -}} {{- $dashboardData := fromYaml (tpl ($.Files.Get $dashboardFile) $ctx) -}} -{{- $dashboardResult := toRawJson $dashboardData -}} +{{- $dashboardResult := toRawJson $dashboardData }} apiVersion: grafana.integreatly.org/v1beta1 kind: GrafanaDashboard metadata: @@ -21,4 +21,4 @@ spec: json: | {{ $dashboardResult | nindent 4 }} --- {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/motel-storage/templates/grafana/datasources.yaml b/charts/motel-storage/templates/grafana/datasources.yaml new file mode 100644 index 0000000..a1a2196 --- /dev/null +++ b/charts/motel-storage/templates/grafana/datasources.yaml @@ -0,0 +1,30 @@ +{{- if .Values.grafana.enabled }} +{{- range .Values.grafana.datasources }} +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDatasource +metadata: + labels: + app.kubernetes.io/managed-by: Helm + name: {{ .name }} + namespace: {{ $.Release.Namespace }} +spec: + datasource: + access: proxy + isDefault: false + name: {{ .name }} + type: {{ .type }} + url: {{ .url }} + {{- if .auth }} + basicAuth: true + basicAuthUser: {{ .auth.username | quote }} + secureJsonData: + basicAuthPassword: {{ .auth.password | quote }} + {{- end }} + instanceSelector: + matchLabels: + dashboards: grafana + resyncPeriod: 5m +--- +{{- end }} +{{- end }} + diff --git a/charts/motel-regional/templates/grafana/grafana.yaml b/charts/motel-storage/templates/grafana/grafana.yaml similarity index 97% rename from charts/motel-regional/templates/grafana/grafana.yaml rename to charts/motel-storage/templates/grafana/grafana.yaml index 69a69b0..b47b84c 100644 --- a/charts/motel-regional/templates/grafana/grafana.yaml +++ b/charts/motel-storage/templates/grafana/grafana.yaml @@ -54,6 +54,7 @@ spec: security: admin_user: {{ .Values.grafana.security.admin_user | quote }} admin_password: {{ .Values.grafana.security.admin_password | quote }} +{{- if .Values.grafana.ingress.enabled }} ingress: metadata: annotations: @@ -76,4 +77,5 @@ spec: - hosts: - {{ .Values.grafana.ingress.host | quote }} secretName: grafana-cluster-tls -{{- end }} \ No newline at end of file +{{- end }} +{{- end }} diff --git a/charts/motel-regional/templates/grafana/rules/rules.yaml b/charts/motel-storage/templates/grafana/rules/rules.yaml similarity index 98% rename from charts/motel-regional/templates/grafana/rules/rules.yaml rename to charts/motel-storage/templates/grafana/rules/rules.yaml index 1585883..7ec150b 100644 --- a/charts/motel-regional/templates/grafana/rules/rules.yaml +++ b/charts/motel-storage/templates/grafana/rules/rules.yaml @@ -1,3 +1,4 @@ +{{- if .Values.grafana.enabled }} {{- if (index .Values "grafana" "alerts" | default dict).enabled | default false }} {{- /* Default rules alias @@ -112,4 +113,5 @@ spec: {{- end }} {{- end }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} +{{- end }} diff --git a/charts/motel-regional/templates/victoria/vmalert.yaml b/charts/motel-storage/templates/victoria/vmalert.yaml similarity index 88% rename from charts/motel-regional/templates/victoria/vmalert.yaml rename to charts/motel-storage/templates/victoria/vmalert.yaml index 638718c..fd37328 100644 --- a/charts/motel-regional/templates/victoria/vmalert.yaml +++ b/charts/motel-storage/templates/victoria/vmalert.yaml @@ -1,4 +1,5 @@ -{{- if (index .Values "victoriametrics" "vmalert" | default dict).enabled | default false }} +{{- if .Values.victoriametrics.enabled }} +{{- if .Values.victoriametrics.vmalert.enabled }} apiVersion: operator.victoriametrics.com/v1beta1 kind: VMAlert metadata: @@ -24,4 +25,5 @@ spec: remoteWrite: url: http://vminsert-cluster.{{ .Release.Namespace }}.svc:8480/insert/0/prometheus/api/v1/write selectAllByDefault: true -{{- end }} \ No newline at end of file +{{- end }} +{{- end }} diff --git a/charts/motel-regional/templates/victoria/vmauth.yaml b/charts/motel-storage/templates/victoria/vmauth.yaml similarity index 89% rename from charts/motel-regional/templates/victoria/vmauth.yaml rename to charts/motel-storage/templates/victoria/vmauth.yaml index 5a84bb1..442f2ff 100644 --- a/charts/motel-regional/templates/victoria/vmauth.yaml +++ b/charts/motel-storage/templates/victoria/vmauth.yaml @@ -1,3 +1,4 @@ +{{- if .Values.victoriametrics.enabled }} {{- if (index .Values "victoriametrics" "vmauth" | default dict).enabled | default false }} apiVersion: operator.victoriametrics.com/v1beta1 kind: VMAuth @@ -16,4 +17,5 @@ spec: license: {} port: "8427" selectAllByDefault: true -{{- end }} \ No newline at end of file +{{- end }} +{{- end }} diff --git a/charts/motel-regional/templates/victoria/vmcluster.yaml b/charts/motel-storage/templates/victoria/vmcluster.yaml similarity index 91% rename from charts/motel-regional/templates/victoria/vmcluster.yaml rename to charts/motel-storage/templates/victoria/vmcluster.yaml index a2e7c0a..82706e2 100644 --- a/charts/motel-regional/templates/victoria/vmcluster.yaml +++ b/charts/motel-storage/templates/victoria/vmcluster.yaml @@ -1,4 +1,5 @@ -{{- if (index .Values "victoriametrics" "vmcluster" | default dict ).enabled | default false }} +{{- if .Values.victoriametrics.enabled }} +{{- if .Values.victoriametrics.vmcluster.enabled }} apiVersion: operator.victoriametrics.com/v1beta1 kind: VMCluster metadata: @@ -43,4 +44,5 @@ spec: storage: 10Gi storageClassName: {{ .Values.global.storageClass }} storageDataPath: /vm-data -{{- end }} \ No newline at end of file +{{- end }} +{{- end }} diff --git a/charts/motel-regional/templates/victoria/vmuser-creds.yaml b/charts/motel-storage/templates/victoria/vmuser-creds.yaml similarity index 65% rename from charts/motel-regional/templates/victoria/vmuser-creds.yaml rename to charts/motel-storage/templates/victoria/vmuser-creds.yaml index cf6624f..e26c4dc 100644 --- a/charts/motel-regional/templates/victoria/vmuser-creds.yaml +++ b/charts/motel-storage/templates/victoria/vmuser-creds.yaml @@ -1,4 +1,5 @@ -{{- if (index .Values "victoriametrics" "vmauth" | default dict).enabled | default false }} +{{- if .Values.victoriametrics.enabled }} +{{- if .Values.victoriametrics.vmauth.enabled }} apiVersion: v1 kind: Secret metadata: @@ -7,4 +8,5 @@ metadata: type: Opaque stringData: password: {{ .Values.victoriametrics.vmauth.credentials.password | default "motel" }} -{{- end }} \ No newline at end of file +{{- end }} +{{- end }} diff --git a/charts/motel-regional/templates/victoria/vmuser.yaml b/charts/motel-storage/templates/victoria/vmuser.yaml similarity index 87% rename from charts/motel-regional/templates/victoria/vmuser.yaml rename to charts/motel-storage/templates/victoria/vmuser.yaml index 32e3ce1..c87dddd 100644 --- a/charts/motel-regional/templates/victoria/vmuser.yaml +++ b/charts/motel-storage/templates/victoria/vmuser.yaml @@ -1,4 +1,5 @@ -{{- if (index .Values "victoriametrics" "vmauth" | default dict).enabled | default false }} +{{- if .Values.victoriametrics.enabled }} +{{- if .Values.victoriametrics.vmauth.enabled }} apiVersion: operator.victoriametrics.com/v1beta1 kind: VMUser metadata: @@ -25,4 +26,5 @@ spec: passwordRef: key: password name: vmuser-creds -{{- end }} \ No newline at end of file +{{- end }} +{{- end }} diff --git a/charts/motel-regional/values.yaml b/charts/motel-storage/values.yaml similarity index 74% rename from charts/motel-regional/values.yaml rename to charts/motel-storage/values.yaml index 98d7552..faf194e 100644 --- a/charts/motel-regional/values.yaml +++ b/charts/motel-storage/values.yaml @@ -1,7 +1,7 @@ global: clusterLabel: clusterName storageClass: ebs-csi-default-sc - clusterName: regional + clusterName: storage cert-manager: enabled: true email: mail@example.net @@ -11,7 +11,7 @@ external-dns: name: aws env: - name: AWS_SHARED_CREDENTIALS_FILE - value: /etc/aws/credentials/credentials + value: /etc/aws/credentials/external-dns-aws-credentials extraVolumeMounts: - name: aws-credentials mountPath: /etc/aws/credentials @@ -37,14 +37,20 @@ victoriametrics: enabled: false grafana: enabled: true - datasource: - url: http://vmselect-cluster:8481/select/0/prometheus + datasources: + - name: metrics + url: http://vmselect-cluster:8481/select/0/prometheus + type: prometheus + - name: logs + url: http://motel-storage-victoria-logs-single-server:9428 + type: victoriametrics-logs-datasource alerts: enabled: true security: admin_user: motel admin_password: motel ingress: + enabled: true host: grafana.hmc0.example.net victoria-metrics-operator: enabled: true @@ -53,9 +59,8 @@ victoria-metrics-operator: victoria-logs-single: enabled: true server: - persistentVolume: + storage: enabled: true storageClassName: ebs-csi-default-sc fluent-bit: enabled: false - diff --git a/demo/cluster/aws-child.yaml b/demo/cluster/aws-child.yaml deleted file mode 100644 index f344ba1..0000000 --- a/demo/cluster/aws-child.yaml +++ /dev/null @@ -1,45 +0,0 @@ -apiVersion: hmc.mirantis.com/v1alpha1 -kind: ManagedCluster -metadata: - name: aws-child0 - namespace: hmc-system - labels: - motel: "child" -spec: - credential: aws-cluster-identity-cred - config: - clusterIdentity: - name: aws-cluster-identity - namespace: hmc-system - controlPlane: - instanceType: t3.large - controlPlaneNumber: 1 - publicIP: false - region: eu-west-2 - worker: - instanceType: t3.small - workersNumber: 3 - template: aws-standalone-cp-0-0-4 - servicesPriority: 100 - services: - - template: motel-child-0-1-2 - name: motel-child - namespace: motel-child - values: | - opencost: - opencost: - prometheus: - external: - url: "https://vmauth.hmc0.example.net/vm/select/0/prometheus" - exporter: - defaultClusterId: "aws-child0" - victoriametrics: - vmagent: - remoteWriteUrl: https://vmauth.hmc0.example.net/vm/insert/0/prometheus/api/v1/write - remoteUsername: motel - remotePassword: motel - fluent-bit: - enabled: true - outputHost: vmauth.hmc0.example.net - outputUsername: motel - outputPassword: motel diff --git a/demo/cluster/aws-managed.yaml b/demo/cluster/aws-managed.yaml new file mode 100644 index 0000000..64e28a9 --- /dev/null +++ b/demo/cluster/aws-managed.yaml @@ -0,0 +1,50 @@ +apiVersion: hmc.mirantis.com/v1alpha1 +kind: ClusterDeployment +metadata: + name: aws-managed0 + namespace: hmc-system + labels: + motel: "collector" +spec: + credential: aws-cluster-identity-cred + config: + clusterIdentity: + name: aws-cluster-identity + namespace: hmc-system + controlPlane: + instanceType: t3.large + controlPlaneNumber: 1 + publicIP: false + region: us-east-2 + worker: + instanceType: t3.small + workersNumber: 3 + template: aws-standalone-cp-0-0-4 + servicesPriority: 100 + services: + - template: cert-manager + name: cert-manager + namespace: motel + values: | + crds: + enabled: true + - template: motel-operators + name: motel-operators + namespace: motel + - template: motel-collectors + name: motel-collectors + namespace: motel + values: | + global: + clusterName: aws-managed0 + opencost: + enabled: true + opencost: + prometheus: + external: + url: "https://vmauth.storage0.example.net/vm/select/0/prometheus" + exporter: + defaultClusterId: "aws-managed0" + motel: + logs_endpoint: https://vmauth.storage0.example.net/vls/insert/opentelemetry/v1/logs + metrics_endpoint: https://vmauth.storage0.example.net/vm/insert/0/prometheus/api/v1/write diff --git a/demo/cluster/aws-regional.yaml b/demo/cluster/aws-storage.yaml similarity index 77% rename from demo/cluster/aws-regional.yaml rename to demo/cluster/aws-storage.yaml index 9c6b0e5..89b1f3c 100644 --- a/demo/cluster/aws-regional.yaml +++ b/demo/cluster/aws-storage.yaml @@ -1,10 +1,10 @@ apiVersion: hmc.mirantis.com/v1alpha1 -kind: ManagedCluster +kind: ClusterDeployment metadata: - name: aws-reg0 + name: aws-storage0 namespace: hmc-system labels: - motel: "regional" + motel: "storage" spec: credential: aws-cluster-identity-cred config: @@ -15,7 +15,7 @@ spec: instanceType: t3.large controlPlaneNumber: 1 publicIP: true - region: eu-west-2 + region: us-east-2 worker: instanceType: t3.medium workersNumber: 3 @@ -27,23 +27,23 @@ spec: namespace: ingress-nginx - name: cert-manager namespace: cert-manager - template: cert-manager-1-16-1 + template: cert-manager values: | crds: enabled: true - - name: motel-regional + - name: motel-storage namespace: motel - template: motel-regional-0-1-2 + template: motel-storage values: | victoriametrics: vmauth: ingress: - host: vmauth.hmc0.example.net + host: vmauth.storage0.example.net credentials: username: motel password: motel grafana: ingress: - host: grafana.hmc0.example.net + host: grafana.storage0.example.net cert-manager: email: mail@example.net diff --git a/demo/demo-mothership-values.yaml b/demo/demo-mothership-values.yaml index 7de5564..484a7fa 100644 --- a/demo/demo-mothership-values.yaml +++ b/demo/demo-mothership-values.yaml @@ -20,15 +20,13 @@ grafana: host: grafana.example.net alerts: enabled: true - # defaults to promxy url - promxyDatasourceUrl: logSources: - - name: hmc0-logs - url: https://vmauth.hmc0.example.net/vls - type: victorialogs-datasource - auth: - username: motel - password: motel + - name: hmc0-logs + url: https://vmauth.hmc0.example.net/vls + type: victorialogs-datasource + auth: + username: motel + password: motel security: admin_user: motel admin_password: motel @@ -87,4 +85,5 @@ promxy: - vmauth.hmc0.example.net:443 auth: username: motel - password: motel \ No newline at end of file + password: motel + diff --git a/docs/DEV.md b/docs/DEV.md new file mode 100644 index 0000000..dded79b --- /dev/null +++ b/docs/DEV.md @@ -0,0 +1,69 @@ +# Development + +## Prerequisites + +* Make sure that you have a [HMC](https://github.com/Mirantis/hmc/blob/main/docs/dev.md) installed. +It's your "mothership" cluster. + +* DNS to test motel with managed clusters installations + +Install cli tools + +```bash +make cli-install +``` + +## Local deployment (without HMC) + +Install into local clusters these helm charts using Makefile + +```bash +make dev-storage-deploy +make dev-operators-deploy +make dev-collectors-deploy +``` + +When everything up and running you can connect to grafana using port-forwarding + +```bash +kubectl --namespace motel port-forward svc/grafana-vm-service 3000:3000 +``` + +## Managed clusters deployment with HMC in AWS + +Install helm charts into a local registry + +```bash +make helm-push +``` + +Define your DNS zone (automatically managed by external-dns) + +```bash +MOTEL_DNS="dev.example.net" +``` + +Install "mothership" helm chart into your "mothership" cluster + + +```bash +make dev-ms-deploy-aws +``` + +Create "storage" managed cluster using HMC + +```bash +make dev-storage-deploy-aws +``` + +Create "managed" managed cluster using HMC + +```bash +make dev-managed-deploy-aws +``` + +When everything up and running you can connect to grafana using port-forwarding from your "mothership" cluster + +```bash +kubectl --namespace motel port-forward svc/grafana-vm-service 3000:3000 +``` diff --git a/docs/otel.canvas b/docs/otel.canvas new file mode 100644 index 0000000..b1e4ac4 --- /dev/null +++ b/docs/otel.canvas @@ -0,0 +1,115 @@ +{ + "nodes":[ + {"id":"bfb5b9ca6d6173a2","type":"group","x":-2300,"y":-480,"width":1194,"height":1232,"label":"Azure - West Europe - Netherlands"}, + {"id":"8e43733fc60f6285","type":"group","x":-960,"y":-996,"width":920,"height":1234,"label":"HMC Management Cluster"}, + {"id":"c90038fee416518d","type":"group","x":-2300,"y":-1139,"width":1194,"height":617,"label":"AWS eu-central"}, + {"id":"c6eb697ae5a678d0","type":"group","x":-918,"y":-299,"width":858,"height":512,"label":"Mothership stack"}, + {"id":"bea4f3a4119c09db","type":"group","x":-2274,"y":-422,"width":571,"height":552,"label":"ManagedCluster - azure-nl-0"}, + {"id":"cffd281f4d05978c","type":"group","x":-2274,"y":171,"width":571,"height":552,"label":"ManagedCluster - azure-nl-1"}, + {"id":"327c8d02308940c7","type":"group","x":-2274,"y":-1089,"width":571,"height":552,"label":"ManagedCluster - aws-eu-central-0"}, + {"id":"4201a84061be9489","type":"group","x":-918,"y":-927,"width":571,"height":552,"label":"HMC CAPI stack"}, + {"id":"6ad3921b1970c1b2","type":"group","x":-1614,"y":-73,"width":437,"height":371,"label":"k0s azure-nl-0-storage"}, + {"id":"782718b4a48faebe","type":"group","x":-1622,"y":-984,"width":437,"height":342,"label":"k0s aws-eu-central-0-storage"}, + {"id":"d3a6a85b665e3a5b","type":"group","x":-1606,"y":-16,"width":421,"height":310,"label":"Metrics + Logs + Traces"}, + {"id":"1f676e0dcbb8a7d7","type":"group","x":-1614,"y":-927,"width":421,"height":285,"label":"Metrics + Logs + Traces"}, + {"id":"d19bfc8f12eef883","type":"group","x":-2249,"y":-118,"width":233,"height":222,"label":"k8s nodes"}, + {"id":"06c386f945e78f15","type":"group","x":-2249,"y":475,"width":233,"height":222,"label":"k8s nodes"}, + {"id":"7e716b08c55fa44b","type":"group","x":-2249,"y":-785,"width":233,"height":222,"label":"k8s nodes"}, + {"id":"d6c9dafa970b9cc4","type":"group","x":-893,"y":-623,"width":233,"height":222,"label":"k8s nodes"}, + {"id":"c1c97124e5641295","type":"group","x":-2249,"y":-367,"width":233,"height":209,"label":"k8s applications"}, + {"id":"f3fb029ea7397895","type":"group","x":-2249,"y":226,"width":233,"height":209,"label":"k8s applications"}, + {"id":"a7ca46c702d8715d","type":"group","x":-2249,"y":-1034,"width":233,"height":209,"label":"k8s applications"}, + {"id":"dd16ebf98ecac482","type":"group","x":-893,"y":-872,"width":233,"height":209,"label":"k8s applications"}, + {"id":"6c3b2cafa7fc8143","type":"text","text":"## Logs\n`/var/log/pods`","x":-2222,"y":3,"width":182,"height":83,"color":"5"}, + {"id":"b0766d02b5538ddf","type":"text","text":"### Traces\napp traces","x":-2222,"y":-255,"width":182,"height":83,"color":"6"}, + {"id":"6111a4f7a78eb7bd","type":"text","text":"### Metrics\napplication metrics","x":-2222,"y":-337,"width":182,"height":83,"color":"4"}, + {"id":"7abc1cc692bb3a46","type":"text","text":"### Regional grafana browser","x":-1580,"y":-4,"width":352,"height":50}, + {"id":"f10c48b4353d3d09","type":"text","text":"### VMAuth - TLS Ingress","x":-1580,"y":46,"width":352,"height":50}, + {"id":"0fb00da272471950","type":"text","text":"### VictoriaMetrics storage","x":-1580,"y":113,"width":352,"height":50}, + {"id":"27fe631c238e0ff4","type":"text","text":"### Log Storage","x":-1580,"y":163,"width":352,"height":50}, + {"id":"5c83f0e7ca66d14d","type":"text","text":"### Tracing Storage","x":-1580,"y":213,"width":352,"height":50}, + {"id":"f72beca9e606729b","type":"text","text":"### OTEL collector \n* type: daemonset","x":-1962,"y":-8,"width":233,"height":105}, + {"id":"d0296fa5c2663925","type":"text","text":"#### OpenCost\n* Cloud cost metrics","x":-1962,"y":-375,"width":233,"height":76,"color":"4"}, + {"id":"f3e3e80f184e45ce","type":"text","text":"### OTEL collector \n* type: deployment","x":-1962,"y":-264,"width":233,"height":101}, + {"id":"6e7052d446e99e7c","type":"text","text":"### Metrics\n`node-exporter`, `dcgm-exporter`","x":-2222,"y":502,"width":182,"height":83,"color":"4"}, + {"id":"5735f428bf2c02f9","type":"text","text":"## Logs\n`/var/log/pods`","x":-2222,"y":596,"width":182,"height":83,"color":"5"}, + {"id":"2c1b6b70420c1355","type":"text","text":"### OTEL collector \n* type: daemonset","x":-1962,"y":585,"width":233,"height":105}, + {"id":"cec4c01a8914115a","type":"text","text":"#### OpenCost\n* Cloud cost metrics","x":-1962,"y":218,"width":233,"height":76,"color":"4"}, + {"id":"48db2e600fc1a5c4","type":"text","text":"### Metrics\napplication metrics","x":-2222,"y":256,"width":182,"height":83,"color":"4"}, + {"id":"b559d79a90798729","type":"text","text":"### Traces\napp traces","x":-2222,"y":338,"width":182,"height":83,"color":"6"}, + {"id":"ab842c2a6140c8fc","type":"text","text":"### OTEL collector \n* type: deployment","x":-1962,"y":329,"width":233,"height":101}, + {"id":"d7e54b3a37c80bdb","type":"text","text":"### Metrics\n`node-exporter`, `dcgm-exporter`","x":-2222,"y":-91,"width":182,"height":83,"color":"4"}, + {"id":"a385c230e0f57d53","type":"text","text":"### Traces\napp traces","x":-2222,"y":-922,"width":182,"height":83,"color":"6"}, + {"id":"ad36f9c105d696d1","type":"text","text":"## Logs\n`/var/log/pods`","x":-2222,"y":-664,"width":182,"height":83,"color":"5"}, + {"id":"0f3e4cc29997caa2","type":"text","text":"### OTEL collector \n* type: daemonset","x":-1962,"y":-675,"width":233,"height":105}, + {"id":"81dceff8fe95c6f1","type":"text","text":"### Metrics\n`node-exporter`, `dcgm-exporter`","x":-2222,"y":-758,"width":182,"height":83,"color":"4"}, + {"id":"b189ecab7f5bb042","type":"text","text":"### Metrics\napplication metrics","x":-2222,"y":-1004,"width":182,"height":83,"color":"4"}, + {"id":"70f515910e463574","type":"text","text":"#### OpenCost\n* Cloud cost metrics","x":-1962,"y":-1042,"width":233,"height":76,"color":"4"}, + {"id":"1e3c582e13427b83","type":"text","text":"### OTEL collector \n* type: deployment","x":-1962,"y":-931,"width":233,"height":101}, + {"id":"ffbd46b4325da67b","type":"text","text":"### Regional grafana browser","x":-1588,"y":-915,"width":352,"height":50}, + {"id":"5e6cd898c01c027d","type":"text","text":"### VMAuth - TLS Ingress","x":-1588,"y":-865,"width":352,"height":50}, + {"id":"fcd22547a82be451","type":"text","text":"### Tracing Storage","x":-1588,"y":-698,"width":352,"height":50}, + {"id":"3766310daf0ea7f8","type":"text","text":"### VictoriaMetrics storage","x":-1588,"y":-798,"width":352,"height":50}, + {"id":"fa20549072ba5cff","type":"text","text":"### Log Storage","x":-1588,"y":-748,"width":352,"height":50}, + {"id":"f3574dc5e8bd1c15","type":"text","text":"# vmselect/promxy\n\n* Aggregates metrics from multiple regions into a single response","x":-873,"y":-226,"width":352,"height":127,"color":"4"}, + {"id":"8530578eb0f6e5aa","type":"text","text":"#### OpenCost\n* Cloud cost metrics","x":-606,"y":-880,"width":233,"height":76,"color":"4"}, + {"id":"cc6b7b4e3a33f758","type":"text","text":"### Metrics\napplication metrics","x":-866,"y":-842,"width":182,"height":83,"color":"4"}, + {"id":"82a9870d78bfde09","type":"text","text":"### OTEL collector \n* type: deployment","x":-606,"y":-769,"width":233,"height":101}, + {"id":"493123c6cc4760c0","type":"text","text":"### Traces\napp traces","x":-866,"y":-760,"width":182,"height":83,"color":"6"}, + {"id":"66bfabca0934e72f","type":"text","text":"### Metrics\n`node-exporter`, `dcgm-exporter`","x":-866,"y":-596,"width":182,"height":83,"color":"4"}, + {"id":"b908ac6573f93a2a","type":"text","text":"### OTEL collector \n* type: daemonset","x":-606,"y":-513,"width":233,"height":105}, + {"id":"8f594b1646252e10","type":"text","text":"## Logs\n`/var/log/pods`","x":-866,"y":-502,"width":182,"height":83,"color":"5"}, + {"id":"cd461eaf54c7714d","type":"text","text":"# Mothership grafana\n- Aggregates to all regional storage points through a proxy\n- Connects to log & traces storage\n- Monitors local stack\n- Displays historical data","x":-873,"y":-37,"width":348,"height":217}, + {"id":"fe85ebb84757f2d6","type":"text","text":"# Mothership Storage\n* Long-term logs storage\n* Long-term metrics storage\n* Metrics and Tracing storage for local CAPI components\n* Aggregated alerts storage","x":-440,"y":-226,"width":348,"height":250}, + {"id":"7f62449a8ec26038","type":"text","text":"### Tracing Storage","x":-440,"y":121,"width":352,"height":50}, + {"id":"adbca89f9cd1fa82","type":"text","text":"### VictoriaMetrics storage","x":-440,"y":21,"width":352,"height":50}, + {"id":"7543d1f93437fcb6","type":"text","text":"### Long-term Log Storage","x":-440,"y":71,"width":352,"height":50} + ], + "edges":[ + {"id":"dadd5acc423edb4a","fromNode":"6111a4f7a78eb7bd","fromSide":"right","toNode":"f3e3e80f184e45ce","toSide":"left","color":"4"}, + {"id":"5f23dd21c57c0ba5","fromNode":"b0766d02b5538ddf","fromSide":"right","toNode":"f3e3e80f184e45ce","toSide":"left","color":"6"}, + {"id":"49fbf774ddedd551","fromNode":"f3e3e80f184e45ce","fromSide":"right","toNode":"f10c48b4353d3d09","toSide":"left"}, + {"id":"3bef4c3d2179931f","fromNode":"f3e3e80f184e45ce","fromSide":"right","toNode":"f10c48b4353d3d09","toSide":"left"}, + {"id":"150a698da3229da9","fromNode":"f10c48b4353d3d09","fromSide":"right","toNode":"5c83f0e7ca66d14d","toSide":"right","color":"6"}, + {"id":"8dce5018036c3a45","fromNode":"f10c48b4353d3d09","fromSide":"right","toNode":"0fb00da272471950","toSide":"right","color":"4"}, + {"id":"ea557969ea6118ec","fromNode":"f10c48b4353d3d09","fromSide":"right","toNode":"27fe631c238e0ff4","toSide":"right","color":"5"}, + {"id":"b89be3f03f7d5438","fromNode":"7abc1cc692bb3a46","fromSide":"left","toNode":"f10c48b4353d3d09","toSide":"left"}, + {"id":"d351fd3ef96b3993","fromNode":"f3574dc5e8bd1c15","fromSide":"left","toNode":"f10c48b4353d3d09","toSide":"right","color":"4","label":"Metrics"}, + {"id":"3170f35675df7ac7","fromNode":"d7e54b3a37c80bdb","fromSide":"right","toNode":"f72beca9e606729b","toSide":"left","color":"4"}, + {"id":"a13207e42795ee0d","fromNode":"6c3b2cafa7fc8143","fromSide":"right","toNode":"f72beca9e606729b","toSide":"left","color":"6"}, + {"id":"96342806f4ca1a96","fromNode":"d0296fa5c2663925","fromSide":"bottom","toNode":"f3e3e80f184e45ce","toSide":"top","color":"4"}, + {"id":"e0ab2c9c31c1ef08","fromNode":"5735f428bf2c02f9","fromSide":"right","toNode":"2c1b6b70420c1355","toSide":"left","color":"6"}, + {"id":"623e3a56e17d6020","fromNode":"b559d79a90798729","fromSide":"right","toNode":"ab842c2a6140c8fc","toSide":"left","color":"6"}, + {"id":"8e6bfd66206e15cc","fromNode":"6e7052d446e99e7c","fromSide":"right","toNode":"2c1b6b70420c1355","toSide":"left","color":"4"}, + {"id":"138c56c4e9862e60","fromNode":"48db2e600fc1a5c4","fromSide":"right","toNode":"ab842c2a6140c8fc","toSide":"left","color":"4"}, + {"id":"c20915103313d407","fromNode":"cec4c01a8914115a","fromSide":"bottom","toNode":"ab842c2a6140c8fc","toSide":"top","color":"4"}, + {"id":"fe991863dc97511c","fromNode":"ab842c2a6140c8fc","fromSide":"right","toNode":"f10c48b4353d3d09","toSide":"left"}, + {"id":"bc35abdfda35429a","fromNode":"2c1b6b70420c1355","fromSide":"right","toNode":"f10c48b4353d3d09","toSide":"left"}, + {"id":"7550446f5acffb90","fromNode":"cd461eaf54c7714d","fromSide":"left","toNode":"f10c48b4353d3d09","toSide":"right"}, + {"id":"fe19bf8bbdc1a04a","fromNode":"cd461eaf54c7714d","fromSide":"left","toNode":"f10c48b4353d3d09","toSide":"right","color":"5","label":"Logs & Traces"}, + {"id":"bc9b738c72990ef5","fromNode":"cd461eaf54c7714d","fromSide":"left","toNode":"f10c48b4353d3d09","toSide":"right","color":"3"}, + {"id":"4ff9f108ec9a0e68","fromNode":"ffbd46b4325da67b","fromSide":"left","toNode":"5e6cd898c01c027d","toSide":"left"}, + {"id":"b87f832cb364586d","fromNode":"5e6cd898c01c027d","fromSide":"right","toNode":"fcd22547a82be451","toSide":"right","color":"6"}, + {"id":"22aad2722e0094a8","fromNode":"5e6cd898c01c027d","fromSide":"right","toNode":"3766310daf0ea7f8","toSide":"right","color":"4"}, + {"id":"d50ba3cfb44590df","fromNode":"5e6cd898c01c027d","fromSide":"right","toNode":"fa20549072ba5cff","toSide":"right","color":"5"}, + {"id":"aa1d1f359954fe31","fromNode":"f3574dc5e8bd1c15","fromSide":"left","toNode":"5e6cd898c01c027d","toSide":"right","color":"4","label":"Metrics"}, + {"id":"5e18e5afb53eb3c5","fromNode":"cd461eaf54c7714d","fromSide":"left","toNode":"5e6cd898c01c027d","toSide":"right","color":"3","label":"Logs & Traces"}, + {"id":"a2f949989c9962cf","fromNode":"ad36f9c105d696d1","fromSide":"right","toNode":"0f3e4cc29997caa2","toSide":"left","color":"6"}, + {"id":"b2a6de523055c24e","fromNode":"a385c230e0f57d53","fromSide":"right","toNode":"1e3c582e13427b83","toSide":"left","color":"6"}, + {"id":"4f2b39389716e443","fromNode":"b189ecab7f5bb042","fromSide":"right","toNode":"1e3c582e13427b83","toSide":"left","color":"4"}, + {"id":"b240635e221c3044","fromNode":"81dceff8fe95c6f1","fromSide":"right","toNode":"0f3e4cc29997caa2","toSide":"left","color":"4"}, + {"id":"ea3c05a1bc3ae151","fromNode":"70f515910e463574","fromSide":"bottom","toNode":"1e3c582e13427b83","toSide":"top","color":"4"}, + {"id":"e0d5428496351e18","fromNode":"1e3c582e13427b83","fromSide":"right","toNode":"5e6cd898c01c027d","toSide":"left"}, + {"id":"55b8bf469346b76c","fromNode":"0f3e4cc29997caa2","fromSide":"right","toNode":"5e6cd898c01c027d","toSide":"left"}, + {"id":"a2a786e3ecaf94a1","fromNode":"cd461eaf54c7714d","fromSide":"top","toNode":"f3574dc5e8bd1c15","toSide":"bottom","color":"4","label":"Metrics"}, + {"id":"631c273667910073","fromNode":"493123c6cc4760c0","fromSide":"right","toNode":"82a9870d78bfde09","toSide":"left","color":"6"}, + {"id":"ea89b95c52a8e62f","fromNode":"8f594b1646252e10","fromSide":"right","toNode":"b908ac6573f93a2a","toSide":"left","color":"6"}, + {"id":"24108362f937e484","fromNode":"66bfabca0934e72f","fromSide":"right","toNode":"b908ac6573f93a2a","toSide":"left","color":"4"}, + {"id":"f41542cd7cf0299c","fromNode":"cc6b7b4e3a33f758","fromSide":"right","toNode":"82a9870d78bfde09","toSide":"left","color":"4"}, + {"id":"9dba5c8bab888dd1","fromNode":"8530578eb0f6e5aa","fromSide":"bottom","toNode":"82a9870d78bfde09","toSide":"top","color":"4"}, + {"id":"9b5a66b614b604ba","fromNode":"cd461eaf54c7714d","fromSide":"right","toNode":"fe85ebb84757f2d6","toSide":"left","color":"3"}, + {"id":"d86dbf0be9201f4d","fromNode":"b908ac6573f93a2a","fromSide":"right","toNode":"fe85ebb84757f2d6","toSide":"top"}, + {"id":"2b53eb80984fb5b1","fromNode":"82a9870d78bfde09","fromSide":"right","toNode":"fe85ebb84757f2d6","toSide":"top"}, + {"id":"be91a9edd5321fe0","fromNode":"fe85ebb84757f2d6","fromSide":"left","toNode":"f3574dc5e8bd1c15","toSide":"right","color":"4"} + ] +} diff --git a/docs/otel.png b/docs/otel.png new file mode 100644 index 0000000..4fe59f3 Binary files /dev/null and b/docs/otel.png differ diff --git a/motel-arch.png b/motel-arch.png deleted file mode 100644 index 9590349..0000000 Binary files a/motel-arch.png and /dev/null differ