From 99e04ab74bc9272bb02291c5d10b1d2f963b4a90 Mon Sep 17 00:00:00 2001 From: bravecobra <391353+bravecobra@users.noreply.github.com> Date: Sun, 4 Jul 2021 13:23:02 +0200 Subject: [PATCH] Feature/argocd (#30) * Added argocd config * Added dependencies update * Disabled ES and Kibana * Updated docs --- .gitignore | 1 + docs/installation-argocd.md | 38 + ...stallation.md => installation-skaffold.md} | 3 +- docs/preparation/cli.md | 12 + mkdocs.yml | 4 +- src/argocd/argo/argo-values.yaml | 160 + .../cert-manager/crds/cluster-issuer.yaml | 8 + src/argocd/argo/traefik/crds/cert-store.yaml | 9 + src/argocd/argo/traefik/crds/dashboard.yaml | 17 + .../crds/http-redirect-middleware.yaml | 7 + .../argo/traefik/crds/traefik-cert.yaml | 16 + src/argocd/argo/traefik/traefik-values.yaml | 89 + .../infrastructure/base/consul/Chart.yaml | 29 + .../base/consul/templates/consul-cert.yaml | 13 + .../infrastructure/base/consul/values.yaml | 87 + .../infrastructure/base/coredns/coredns.yaml | 35 + .../base/coredns/test-dns-job.yaml | 13 + .../base/elasticsearch/Chart.yaml | 29 + .../templates/elasticsearch-ingress.yaml | 24 + .../templates/elasticsearch.yaml | 36 + .../templates/kibana-ingress.yaml | 24 + .../base/elasticsearch/templates/kibana.yaml | 46 + .../templates/serviceaccount.yaml | 14 + .../base/elasticsearch/values.yaml | 0 .../base/identityserver4-admin/Chart.yaml | 29 + .../base/identityserver4-admin/values.yaml | 112 + .../base/infrastructure-app/Chart.yaml | 23 + .../infrastructure-app/templates/consul.yaml | 24 + .../templates/elasticsearch.yaml | 24 + .../templates/identityserver4-admin.yaml | 24 + .../infrastructure-app/templates/jaeger.yaml | 24 + .../infrastructure-app/templates/loki.yaml | 24 + .../templates/namespaces.yml | 69 + .../templates/prometheus.yaml | 24 + .../base/infrastructure-app/values.yaml | 6 + .../infrastructure/base/jaeger/Chart.yaml | 29 + .../base/jaeger/files/readme.md | 9 + .../base/jaeger/templates/all-in-one.yaml | 35 + .../templates/jaeger-admin-service.yaml | 18 + .../base/jaeger/templates/jaeger-cert.yaml | 13 + .../infrastructure/base/jaeger/values.yaml | 10 + .../infrastructure/base/loki/Chart.yaml | 32 + .../infrastructure/base/loki/values.yaml | 26 + .../infrastructure/base/prometheus/Chart.yaml | 29 + .../files/jaeger-grafana-dashboard.json | 2669 +++++++++++++++++ .../files/loki-monitor-dashboard.json | 2385 +++++++++++++++ .../files/loki-promtail-dashboard.json | 409 +++ .../files/traefik-grafana-dashboard.json | 1416 +++++++++ .../templates/jaeger-grafana-dashboard.yaml | 11 + .../prometheus/templates/jaeger-monitor.yaml | 18 + .../templates/loki-monitor-dashboard.yaml | 11 + .../templates/loki-promtail-dashboard.yaml | 11 + .../prometheus/templates/prometheus-cert.yaml | 14 + .../templates/traefik-grafana-dashboard.yaml | 11 + .../prometheus/templates/traefik-monitor.yaml | 21 + .../prometheus/templates/traefik-rules.yaml | 21 + .../base/prometheus/values.yaml | 67 + .../infrastructure/root/argocd/Chart.lock | 6 + .../infrastructure/root/argocd/Chart.yaml | 7 + .../infrastructure/root/argocd/values.yaml | 161 + .../root/cert-manager/Chart.lock | 6 + .../root/cert-manager/Chart.yaml | 7 + .../templates/cluster-issuer.yaml | 8 + .../root/cert-manager/values.yaml | 2 + .../infrastructure/root/root-app/Chart.yaml | 3 + .../root/root-app/templates/argocd.yaml | 24 + .../root/root-app/templates/cert-manager.yaml | 24 + .../root/root-app/templates/root-app.yaml | 20 + .../root/root-app/templates/traefik.yaml | 24 + .../infrastructure/root/root-app/values.yaml | 6 + .../infrastructure/root/traefik/Chart.lock | 6 + .../infrastructure/root/traefik/Chart.yaml | 7 + .../root/traefik/templates/cert-store.yaml | 9 + .../root/traefik/templates/dashboard.yaml | 17 + .../templates/http-redirect-middleware.yaml | 7 + .../root/traefik/templates/traefik-cert.yaml | 16 + .../infrastructure/root/traefik/values.yaml | 90 + src/argocd/install.ps1 | 39 + .../003-ingressroute.yaml | 3 +- .../test-traefik-ingress/004-test-deploy.yaml | 3 +- .../005-testdeploy-route.yaml | 66 +- src/skaffold/skaffold.yaml | 1 - 82 files changed, 8884 insertions(+), 40 deletions(-) create mode 100644 docs/installation-argocd.md rename docs/{installation.md => installation-skaffold.md} (97%) create mode 100644 src/argocd/argo/argo-values.yaml create mode 100644 src/argocd/argo/cert-manager/crds/cluster-issuer.yaml create mode 100644 src/argocd/argo/traefik/crds/cert-store.yaml create mode 100644 src/argocd/argo/traefik/crds/dashboard.yaml create mode 100644 src/argocd/argo/traefik/crds/http-redirect-middleware.yaml create mode 100644 src/argocd/argo/traefik/crds/traefik-cert.yaml create mode 100644 src/argocd/argo/traefik/traefik-values.yaml create mode 100644 src/argocd/infrastructure/base/consul/Chart.yaml create mode 100644 src/argocd/infrastructure/base/consul/templates/consul-cert.yaml create mode 100644 src/argocd/infrastructure/base/consul/values.yaml create mode 100644 src/argocd/infrastructure/base/coredns/coredns.yaml create mode 100644 src/argocd/infrastructure/base/coredns/test-dns-job.yaml create mode 100644 src/argocd/infrastructure/base/elasticsearch/Chart.yaml create mode 100644 src/argocd/infrastructure/base/elasticsearch/templates/elasticsearch-ingress.yaml create mode 100644 src/argocd/infrastructure/base/elasticsearch/templates/elasticsearch.yaml create mode 100644 src/argocd/infrastructure/base/elasticsearch/templates/kibana-ingress.yaml create mode 100644 src/argocd/infrastructure/base/elasticsearch/templates/kibana.yaml create mode 100644 src/argocd/infrastructure/base/elasticsearch/templates/serviceaccount.yaml create mode 100644 src/argocd/infrastructure/base/elasticsearch/values.yaml create mode 100644 src/argocd/infrastructure/base/identityserver4-admin/Chart.yaml create mode 100644 src/argocd/infrastructure/base/identityserver4-admin/values.yaml create mode 100644 src/argocd/infrastructure/base/infrastructure-app/Chart.yaml create mode 100644 src/argocd/infrastructure/base/infrastructure-app/templates/consul.yaml create mode 100644 src/argocd/infrastructure/base/infrastructure-app/templates/elasticsearch.yaml create mode 100644 src/argocd/infrastructure/base/infrastructure-app/templates/identityserver4-admin.yaml create mode 100644 src/argocd/infrastructure/base/infrastructure-app/templates/jaeger.yaml create mode 100644 src/argocd/infrastructure/base/infrastructure-app/templates/loki.yaml create mode 100644 src/argocd/infrastructure/base/infrastructure-app/templates/namespaces.yml create mode 100644 src/argocd/infrastructure/base/infrastructure-app/templates/prometheus.yaml create mode 100644 src/argocd/infrastructure/base/infrastructure-app/values.yaml create mode 100644 src/argocd/infrastructure/base/jaeger/Chart.yaml create mode 100644 src/argocd/infrastructure/base/jaeger/files/readme.md create mode 100644 src/argocd/infrastructure/base/jaeger/templates/all-in-one.yaml create mode 100644 src/argocd/infrastructure/base/jaeger/templates/jaeger-admin-service.yaml create mode 100644 src/argocd/infrastructure/base/jaeger/templates/jaeger-cert.yaml create mode 100644 src/argocd/infrastructure/base/jaeger/values.yaml create mode 100644 src/argocd/infrastructure/base/loki/Chart.yaml create mode 100644 src/argocd/infrastructure/base/loki/values.yaml create mode 100644 src/argocd/infrastructure/base/prometheus/Chart.yaml create mode 100644 src/argocd/infrastructure/base/prometheus/files/jaeger-grafana-dashboard.json create mode 100644 src/argocd/infrastructure/base/prometheus/files/loki-monitor-dashboard.json create mode 100644 src/argocd/infrastructure/base/prometheus/files/loki-promtail-dashboard.json create mode 100644 src/argocd/infrastructure/base/prometheus/files/traefik-grafana-dashboard.json create mode 100644 src/argocd/infrastructure/base/prometheus/templates/jaeger-grafana-dashboard.yaml create mode 100644 src/argocd/infrastructure/base/prometheus/templates/jaeger-monitor.yaml create mode 100644 src/argocd/infrastructure/base/prometheus/templates/loki-monitor-dashboard.yaml create mode 100644 src/argocd/infrastructure/base/prometheus/templates/loki-promtail-dashboard.yaml create mode 100644 src/argocd/infrastructure/base/prometheus/templates/prometheus-cert.yaml create mode 100644 src/argocd/infrastructure/base/prometheus/templates/traefik-grafana-dashboard.yaml create mode 100644 src/argocd/infrastructure/base/prometheus/templates/traefik-monitor.yaml create mode 100644 src/argocd/infrastructure/base/prometheus/templates/traefik-rules.yaml create mode 100644 src/argocd/infrastructure/base/prometheus/values.yaml create mode 100644 src/argocd/infrastructure/root/argocd/Chart.lock create mode 100644 src/argocd/infrastructure/root/argocd/Chart.yaml create mode 100644 src/argocd/infrastructure/root/argocd/values.yaml create mode 100644 src/argocd/infrastructure/root/cert-manager/Chart.lock create mode 100644 src/argocd/infrastructure/root/cert-manager/Chart.yaml create mode 100644 src/argocd/infrastructure/root/cert-manager/templates/cluster-issuer.yaml create mode 100644 src/argocd/infrastructure/root/cert-manager/values.yaml create mode 100644 src/argocd/infrastructure/root/root-app/Chart.yaml create mode 100644 src/argocd/infrastructure/root/root-app/templates/argocd.yaml create mode 100644 src/argocd/infrastructure/root/root-app/templates/cert-manager.yaml create mode 100644 src/argocd/infrastructure/root/root-app/templates/root-app.yaml create mode 100644 src/argocd/infrastructure/root/root-app/templates/traefik.yaml create mode 100644 src/argocd/infrastructure/root/root-app/values.yaml create mode 100644 src/argocd/infrastructure/root/traefik/Chart.lock create mode 100644 src/argocd/infrastructure/root/traefik/Chart.yaml create mode 100644 src/argocd/infrastructure/root/traefik/templates/cert-store.yaml create mode 100644 src/argocd/infrastructure/root/traefik/templates/dashboard.yaml create mode 100644 src/argocd/infrastructure/root/traefik/templates/http-redirect-middleware.yaml create mode 100644 src/argocd/infrastructure/root/traefik/templates/traefik-cert.yaml create mode 100644 src/argocd/infrastructure/root/traefik/values.yaml create mode 100644 src/argocd/install.ps1 diff --git a/.gitignore b/.gitignore index 9c5bb3b2..3d334f41 100644 --- a/.gitignore +++ b/.gitignore @@ -85,3 +85,4 @@ certs.yaml site/ cacerts.yaml src/terraform/.terraform.lock.hcl +charts/ diff --git a/docs/installation-argocd.md b/docs/installation-argocd.md new file mode 100644 index 00000000..dd2994ee --- /dev/null +++ b/docs/installation-argocd.md @@ -0,0 +1,38 @@ +# Installation + +## Local DNS + +Since we running completely locally, we want to add some entries to the hosts file to forward domainnames to our locally running cluster. +Open `C:\Windows\system32\drivers\etc\hosts` in an editor as `Administrator` and add the following entries + +```text +127.0.0.1 k8s.local infrastructure.k8s.local traefik.infrastructure.k8s.local +127.0.0.1 jaeger.infrastructure.k8s.local prometheus.infrastructure.k8s.local grafana.infrastructure.k8s.local +127.0.0.1 seq.infrastructure.k8s.local +127.0.0.1 consul.infrastructure.k8s.local vault.infrastructure.k8s.local +127.0.0.1 es.infrastructure.k8s.local kibana.infrastructure.k8s.local +127.0.0.1 login.k8s.local admin.login.k8s.local api.login.k8s.local +127.0.0.1 argo.k8s.local +``` + +## Generating the CA certificate k8s secret with mkcert + +We use self-signed certificates instead of LetsEncrypt as the latter would require either a proper DNS domain which is publically available or an publically accessible HTTP endpoint. Neither might be an option in a local development setup, so we'll go with the self-signed option for now. We could extend it further later on. + +To be able to generate the certficates for `k8s.local` and `*.k8s.local`, we'll use `cert-manager` and provide it with the CA certificate from [mkcert](https://github.com/FiloSottile/mkcert) which you can install easily with `choco install mkcert`. The certificates will be created by `cert-manager` and as the CA is available on our local machine through mkcert, those will also be valid in the local browser (only). + +```powershell +# execute under elevated Administrator privileges +mkcert --install +copy $env:LOCALAPPDATA\mkcert\rootCA.pem ./src/certs/cacerts.crt +copy $env:LOCALAPPDATA\mkcert\rootCA-key.pem ./src/certs/cacerts.key + +# Create a k8s secret manifest containing the CA Root certificate of mkcert +kubectl create secret tls ca-key-pair --namespace=cert-manager --cert=./src/certs/cacerts.crt --key=./src/certs/cacerts.key --dry-run=client -o yaml > ./src/argocd/base/cert-manager/crds/cacerts.yaml +``` + +Next run the installer: + +```powershell +./src/argocd/install.ps1 +``` diff --git a/docs/installation.md b/docs/installation-skaffold.md similarity index 97% rename from docs/installation.md rename to docs/installation-skaffold.md index 0706b08e..3da61c29 100644 --- a/docs/installation.md +++ b/docs/installation-skaffold.md @@ -2,7 +2,7 @@ ## Local DNS -Since we running completely locally, we want to add some entries to the hosts file. +Since we running completely locally, we want to add some entries to the hosts file to forward domainnames to our locally running cluster. Open `C:\Windows\system32\drivers\etc\hosts` in an editor as `Administrator` and add the following entries ```text @@ -33,6 +33,7 @@ kubectl create secret tls ca-key-pair --namespace=cert-manager --cert=./src/cert ## Adding helm repo's ```powershell +helm repo add argo https://argoproj.github.io/argo-helm helm repo add hashicorp https://helm.releases.hashicorp.com helm repo add jaegertracing https://jaegertracing.github.io/helm-charts helm repo add bitnami https://charts.bitnami.com/bitnami diff --git a/docs/preparation/cli.md b/docs/preparation/cli.md index f1e72b4c..cef751b1 100644 --- a/docs/preparation/cli.md +++ b/docs/preparation/cli.md @@ -1,5 +1,7 @@ # Installing commandline tools +## Choco + Install/download the CLIs. ```powershell @@ -10,3 +12,13 @@ choco install kubernetes-cli choco install kubernetes-helm choco install skaffold ``` + +## Installing the argoCD CLI + +Follow the [guide](https://argoproj.github.io/argo-cd/cli_installation/) + +For 2.0.3 and env variable needs to be set holding the name of the executable. This is missing from the docs. + +```powershell +$env:ARGOCD_BINARY_NAME = 'argocd' +``` diff --git a/mkdocs.yml b/mkdocs.yml index 25687531..489e26b6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -13,7 +13,9 @@ nav: - Minikube: './preparation/minikube.md' - Kind: './preparation/kind.md' - Testing Ingress: './preparation/test-ingress-controller.md' - - Install: './installation.md' + - Install: + - Skaffold: './installation-skaffold.md' + - ArgoCD: './installation-argocd.md' - About: - 'License': 'license.md' - 'Release Notes': 'release-notes.md' diff --git a/src/argocd/argo/argo-values.yaml b/src/argocd/argo/argo-values.yaml new file mode 100644 index 00000000..b7ad1c4b --- /dev/null +++ b/src/argocd/argo/argo-values.yaml @@ -0,0 +1,160 @@ +global: + image: + tag: v2.0.3 +server: + # resources: + # limits: + # cpu: 200m + # memory: 256Mi + # requests: + # cpu: 100m + # memory: 128Mi + ingress: + enabled: true + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web, websecure + traefik.ingress.kubernetes.io/router.middlewares: default-redirect-http@kubernetescrd + labels: {} + hosts: + - argo.k8s.local + paths: + - / + extraPaths: + - path: /* + pathType: Prefix + backend: + service: + name: argocd-server + port: + number: 443 + tls: + - secretName: argocd-tls-certificate + hosts: + - argo.k8s.local + https: true + ingressGrpc: + enabled: true + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web, websecure + traefik.ingress.kubernetes.io/router.middlewares: default-redirect-http@kubernetescrd + labels: {} + hosts: + - argo.k8s.local + paths: + - / + extraPaths: + - path: /* + pathType: Prefix + backend: + service: + name: argocd-server + port: + number: 443 + tls: + - secretName: argocd-tls-certificate + hosts: + - argo.k8s.local + https: true + extraArgs: [] + # - --insecure + certificate: + enabled: true + domain: argo.k8s.local + issuer: + kind: ClusterIssuer + name: selfsigned-ca-issuer + additionalHosts: [] + secretName: argocd-tls-certificate + config: + url: https://argo.k8s.local + repositories: | + - type: helm + name: stable + url: https://charts.helm.sh/stable + - type: helm + name: argo-cd + url: https://argoproj.github.io/argo-helm + - type: helm + name: cert-manager + url: https://charts.jetstack.io + - type: helm + name: traefik + url: https://helm.traefik.io/traefik + resource.customizations: | + argoproj.io/Application: + health.lua: | + hs = {} + hs.status = "Progressing" + hs.message = "" + if obj.status ~= nil then + if obj.status.health ~= nil then + hs.status = obj.status.health.status + if obj.status.health.message ~= nil then + hs.message = obj.status.health.message + end + end + end + return hs + jaegertracing.io/Jaeger: + health.lua: | + hs = {} + hs.status = "Healthy" + return hs + admissionregistration.k8s.io/ValidatingWebhookConfiguration: + ignoreDifferences: | + jsonPointers: + - /webhooks/0/clientConfig/caBundle + - /webhooks/1/clientConfig/caBundle + - /webhooks/2/clientConfig/caBundle + - /webhooks/3/clientConfig/caBundle + - /webhooks/4/clientConfig/caBundle + - /webhooks/5/clientConfig/caBundle + - /webhooks/6/clientConfig/caBundle + - /webhooks/7/clientConfig/caBundle + - /webhooks/8/clientConfig/caBundle + - /webhooks/9/clientConfig/caBundle + admissionregistration.k8s.io/MutatingWebhookConfiguration: + ignoreDifferences: | + jsonPointers: + - /webhooks/0/clientConfig/caBundle + - /webhooks/1/clientConfig/caBundle + - /webhooks/2/clientConfig/caBundle + - /webhooks/3/clientConfig/caBundle + - /webhooks/4/clientConfig/caBundle + - /webhooks/5/clientConfig/caBundle + - /webhooks/6/clientConfig/caBundle + - /webhooks/7/clientConfig/caBundle + +# controller: + # resources: + # limits: + # cpu: 500m + # memory: 1Gi + # requests: + # cpu: 250m + # memory: 500Mi +dex: + enabled: false + # resources: + # limits: + # cpu: 50m + # memory: 64Mi + # requests: + # cpu: 10m + # memory: 32Mi +# redis: + # resources: + # limits: + # cpu: 200m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 64Mi +# repoServer: + # resources: + # limits: + # cpu: 50m + # memory: 128Mi + # requests: + # cpu: 10m + # memory: 64Mi \ No newline at end of file diff --git a/src/argocd/argo/cert-manager/crds/cluster-issuer.yaml b/src/argocd/argo/cert-manager/crds/cluster-issuer.yaml new file mode 100644 index 00000000..2cb7fd34 --- /dev/null +++ b/src/argocd/argo/cert-manager/crds/cluster-issuer.yaml @@ -0,0 +1,8 @@ +apiVersion: cert-manager.io/v1 +kind: ClusterIssuer +metadata: + name: selfsigned-ca-issuer + namespace: cert-manager +spec: + ca: + secretName: ca-key-pair \ No newline at end of file diff --git a/src/argocd/argo/traefik/crds/cert-store.yaml b/src/argocd/argo/traefik/crds/cert-store.yaml new file mode 100644 index 00000000..a8bab184 --- /dev/null +++ b/src/argocd/argo/traefik/crds/cert-store.yaml @@ -0,0 +1,9 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: TLSStore +metadata: + name: default + namespace: traefik + +spec: + defaultCertificate: + secretName: traefik-cert \ No newline at end of file diff --git a/src/argocd/argo/traefik/crds/dashboard.yaml b/src/argocd/argo/traefik/crds/dashboard.yaml new file mode 100644 index 00000000..ad978671 --- /dev/null +++ b/src/argocd/argo/traefik/crds/dashboard.yaml @@ -0,0 +1,17 @@ +# dashboard.yaml +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: dashboard + namespace: traefik +spec: + entryPoints: + - websecure + routes: + - match: Host(`traefik.infrastructure.k8s.local`) && (PathPrefix(`/dashboard`) || PathPrefix(`/api`)) + kind: Rule + services: + - name: api@internal + kind: TraefikService + tls: + - secretName: traefik-cert diff --git a/src/argocd/argo/traefik/crds/http-redirect-middleware.yaml b/src/argocd/argo/traefik/crds/http-redirect-middleware.yaml new file mode 100644 index 00000000..3e65399a --- /dev/null +++ b/src/argocd/argo/traefik/crds/http-redirect-middleware.yaml @@ -0,0 +1,7 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: Middleware +metadata: + name: redirect-http +spec: + redirectScheme: + scheme: https \ No newline at end of file diff --git a/src/argocd/argo/traefik/crds/traefik-cert.yaml b/src/argocd/argo/traefik/crds/traefik-cert.yaml new file mode 100644 index 00000000..ed22fc71 --- /dev/null +++ b/src/argocd/argo/traefik/crds/traefik-cert.yaml @@ -0,0 +1,16 @@ +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: traefik-cert + namespace: traefik +spec: + secretName: traefik-cert + issuerRef: + name: selfsigned-ca-issuer + kind: ClusterIssuer + commonName: traefik-cert + dnsNames: + - k8s.local + - '*.k8s.local' + - '*.infrastructure.k8s.local' + - '*.login.k8s.local' \ No newline at end of file diff --git a/src/argocd/argo/traefik/traefik-values.yaml b/src/argocd/argo/traefik/traefik-values.yaml new file mode 100644 index 00000000..b7ba61de --- /dev/null +++ b/src/argocd/argo/traefik/traefik-values.yaml @@ -0,0 +1,89 @@ +dashboard: + enabled: true + domain: traefik.infrastructure.k8s.local +# deployment: +# podAnnotations: +# "consul.hashicorp.com/connect-inject": "true" +# "consul.hashicorp.com/connect-service-port": "8000" +# "consul.hashicorp.com/transparent-proxy": "true" +additionalArguments: + - "--metrics.prometheus=true" + - "--tracing.jaeger=true" + - "--tracing.jaeger.samplingServerURL=http://jaeger-agent.jaeger.svc:5778/sampling" + - "--tracing.jaeger.localAgentHostPort=jaeger-agent.jaeger.svc:6831" + - "--serversTransport.insecureSkipVerify=true" + - "--providers.kubernetesingress=true" + - "--providers.kubernetesingress.ingressendpoint" + - "--providers.kubernetesingress.ingressendpoint.ip=172.18.0.2" + +logs: + access: + enabled: true + format: json + general: + format: json + level: INFO + +kubernetes: + namespaces: + - default + - kube-system + +ports: + websecure: + tls: + enabled: true + +volumes: + - name: traefik-cert + mountPath: "/certs" + type: secret + +ingressClass: +# # true is not unit-testable yet, pending https://github.com/rancher/helm-unittest/pull/12 + enabled: true + isDefaultClass: true +# # Use to force a networking.k8s.io API Version for certain CI/CD applications. E.g. "v1beta1" + fallbackApiVersion: "v1beta1" + +ingressRoute: + dashboard: + enabled: true + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web, websecure + traefik.ingress.kubernetes.io/router.middlewares: default-redirect-http@kubernetescrd +providers: + kubernetesCRD: + enabled: true + namespaces: [] + kubernetesIngress: + enabled: true + namespaces: [] + +service: + enabled: true + type: ClusterIP + spec: + # externalTrafficPolicy: Cluster + # clusterIP: 172.18.0.2 + externalIPs: [ + 172.18.0.2 + ] + +tls: + certificates: + - certFile: /certs/tls.crt + keyFile: /certs/tls.key + stores: + default: + defaultCertificate: + certFile: /certs/tls.crt + keyFile: /certs/tls.key + +# consul: +# enabled: true +# endpoint: "consul-consul-server:8500" +# datacenter: datacenter1 +# watch: true +# exposedByDefault: true +# prefix: traefik diff --git a/src/argocd/infrastructure/base/consul/Chart.yaml b/src/argocd/infrastructure/base/consul/Chart.yaml new file mode 100644 index 00000000..e8f0050d --- /dev/null +++ b/src/argocd/infrastructure/base/consul/Chart.yaml @@ -0,0 +1,29 @@ +apiVersion: v2 +name: consul +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "0.1.0" + +dependencies: + - name: consul + version: 0.31.1 + repository: https://helm.releases.hashicorp.com diff --git a/src/argocd/infrastructure/base/consul/templates/consul-cert.yaml b/src/argocd/infrastructure/base/consul/templates/consul-cert.yaml new file mode 100644 index 00000000..fe25d3cd --- /dev/null +++ b/src/argocd/infrastructure/base/consul/templates/consul-cert.yaml @@ -0,0 +1,13 @@ +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: consul-cert + namespace: consul +spec: + secretName: consul-cert + issuerRef: + name: selfsigned-ca-issuer + kind: ClusterIssuer + commonName: consul-cert + dnsNames: + - 'consul.infrastructure.k8s.local' diff --git a/src/argocd/infrastructure/base/consul/values.yaml b/src/argocd/infrastructure/base/consul/values.yaml new file mode 100644 index 00000000..203afaec --- /dev/null +++ b/src/argocd/infrastructure/base/consul/values.yaml @@ -0,0 +1,87 @@ +consul: + # Choose an optional name for the datacenter + global: + datacenter: datacenter1 + tls: + enabled: true + verify: false + acls: + manageSystemACLs: true + + # Enable the Consul Web UI via a NodePort + ui: + enabled: true + # service: + # enabled: true + # type: 'NodePort' + ingress: + enabled: true + hosts: + - host: consul.infrastructure.k8s.local + paths: + - / + passHostHeader: true + backend: + serviceName: consul-consul-ui + servicePort: 443 + tls: + - hosts: + - consul.infrastructure.k8s.local + secretName: consul-cert + annotations: | + traefik.ingress.kubernetes.io/router.entrypoints: web, websecure + traefik.ingress.kubernetes.io/router.middlewares: default-redirect-http@kubernetescrd + + # Enable Connect for secure communication between nodes + connectInject: + enabled: true + aclBindingRuleSelector: "" # https://github.com/hashicorp/consul-helm/issues/242 + # Enable CRD Controller + controller: + enabled: true + + # ingressGateways: + # enabled: true + # defaults: + # replicas: 1 #default = 2, but they cannot be on the same node. there is only one node on docker-desktop + # affinitiy: null + # service: + # type: 'NodePort' + # ports: + # - port: 8080 + # nodePort: null + # - port: 8443 + # nodePort: null + # gateways: + # - name: ingress-gateway + # service: + # type: LoadBalancer + + # client: + # affinity: | + # nodeAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # nodeSelectorTerms: + # - matchExpressions: + # - key: node-role.kubernetes.io/master + # operator: DoesNotExist + + # Use only one Consul server for local development + server: + replicas: 1 + bootstrapExpect: 1 + disruptionBudget: + enabled: true + maxUnavailable: 0 + updatePartition: 0 + # extraConfig: | + # { + # "ui_config": { + # "content_path": "/consul" + # } + # } + + # syncCatalog: + # enabled: true + # k8sAllowNamespaces: ['webshop'] + # k8sDenyNamespaces: ['kube-system', 'kube-public'] \ No newline at end of file diff --git a/src/argocd/infrastructure/base/coredns/coredns.yaml b/src/argocd/infrastructure/base/coredns/coredns.yaml new file mode 100644 index 00000000..e437632a --- /dev/null +++ b/src/argocd/infrastructure/base/coredns/coredns.yaml @@ -0,0 +1,35 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: coredns + namespace: kube-system +data: + Corefile: | + # consul:53 { + # log + # errors + # cache 30 + # forward . 10.96.153.138 + # } + .:53 { + errors + health { + lameduck 5s + } + rewrite name login.k8s.local identityserver4-admin-identity.identityserver4-admin.svc.cluster.local + rewrite name admin.login.k8s.local identityserver4-admin-admin.identityserver4-admin.svc.cluster.local + ready + kubernetes cluster.local in-addr.arpa ip6.arpa { + pods insecure + fallthrough in-addr.arpa ip6.arpa + ttl 30 + } + prometheus :9153 + forward . /etc/resolv.conf { + max_concurrent 1000 + } + cache 30 + loop + reload + loadbalance + } diff --git a/src/argocd/infrastructure/base/coredns/test-dns-job.yaml b/src/argocd/infrastructure/base/coredns/test-dns-job.yaml new file mode 100644 index 00000000..4f131a7a --- /dev/null +++ b/src/argocd/infrastructure/base/coredns/test-dns-job.yaml @@ -0,0 +1,13 @@ +# apiVersion: batch/v1 +# kind: Job +# metadata: +# name: dns +# spec: +# template: +# spec: +# containers: +# - name: dns +# image: anubhavmishra/tiny-tools +# command: ['dig', 'consul.service.datacenter1.consul'] +# restartPolicy: Never +# backoffLimit: 4 \ No newline at end of file diff --git a/src/argocd/infrastructure/base/elasticsearch/Chart.yaml b/src/argocd/infrastructure/base/elasticsearch/Chart.yaml new file mode 100644 index 00000000..ad40ee38 --- /dev/null +++ b/src/argocd/infrastructure/base/elasticsearch/Chart.yaml @@ -0,0 +1,29 @@ +apiVersion: v2 +name: elastic-operator +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "0.1.0" + +dependencies: + - name: eck-operator + version: 1.6.0 + repository: https://helm.elastic.co diff --git a/src/argocd/infrastructure/base/elasticsearch/templates/elasticsearch-ingress.yaml b/src/argocd/infrastructure/base/elasticsearch/templates/elasticsearch-ingress.yaml new file mode 100644 index 00000000..c730ea18 --- /dev/null +++ b/src/argocd/infrastructure/base/elasticsearch/templates/elasticsearch-ingress.yaml @@ -0,0 +1,24 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: elasticsearch + namespace: elasticsearch + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web, websecure + traefik.ingress.kubernetes.io/router.middlewares: default-redirect-http@kubernetescrd +spec: + rules: + - host: es.infrastructure.k8s.local + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: elastic-es-es-http + port: + number: 9200 + tls: + - secretName: traefik-cert + hosts: + - es.infrastructure.k8s.local diff --git a/src/argocd/infrastructure/base/elasticsearch/templates/elasticsearch.yaml b/src/argocd/infrastructure/base/elasticsearch/templates/elasticsearch.yaml new file mode 100644 index 00000000..d36e4232 --- /dev/null +++ b/src/argocd/infrastructure/base/elasticsearch/templates/elasticsearch.yaml @@ -0,0 +1,36 @@ +apiVersion: elasticsearch.k8s.elastic.co/v1 +kind: Elasticsearch +metadata: + name: elastic-es + namespace: elasticsearch +spec: + version: 7.12.1 + http: + tls: + selfSignedCertificate: + disabled: true + nodeSets: + - name: default + count: 1 + config: + node.store.allow_mmap: false + podTemplate: + metadata: + annotations: + consul.hashicorp.com/connect-service: "elastic-es" + consul.hashicorp.com/connect-inject: "true" + consul.hashicorp.com/connect-service-port: "http" + spec: + automountServiceAccountToken: true + serviceAccount: elastic-es + containers: + - name: elasticsearch + env: + - name: ES_JAVA_OPTS + value: -Xms1g -Xmx1g + resources: + requests: + memory: 1Gi + cpu: 0.5 + limits: + memory: 1Gi \ No newline at end of file diff --git a/src/argocd/infrastructure/base/elasticsearch/templates/kibana-ingress.yaml b/src/argocd/infrastructure/base/elasticsearch/templates/kibana-ingress.yaml new file mode 100644 index 00000000..67492ba2 --- /dev/null +++ b/src/argocd/infrastructure/base/elasticsearch/templates/kibana-ingress.yaml @@ -0,0 +1,24 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: kibana + namespace: elasticsearch + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web, websecure + traefik.ingress.kubernetes.io/router.middlewares: default-redirect-http@kubernetescrd +spec: + rules: + - host: kibana.infrastructure.k8s.local + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: elastic-kb-kb-http + port: + number: 5601 + tls: + - secretName: traefik-cert + hosts: + - kibana.infrastructure.k8s.local diff --git a/src/argocd/infrastructure/base/elasticsearch/templates/kibana.yaml b/src/argocd/infrastructure/base/elasticsearch/templates/kibana.yaml new file mode 100644 index 00000000..58b63451 --- /dev/null +++ b/src/argocd/infrastructure/base/elasticsearch/templates/kibana.yaml @@ -0,0 +1,46 @@ +apiVersion: kibana.k8s.elastic.co/v1 +kind: Kibana +metadata: + name: elastic-kb + namespace: elasticsearch +spec: + version: 7.12.1 + count: 1 + http: + tls: + selfSignedCertificate: + disabled: true + elasticsearchRef: # This connection does not go through the mesh + name: elastic-es + # config: + # elasticsearch.hosts: + # - http://127.0.0.1:9200 + # elasticsearch.username: elastic + # elasticsearch.ssl.verificationMode: none + podTemplate: + metadata: + annotations: + consul.hashicorp.com/connect-service: "elastic-kb" + consul.hashicorp.com/connect-inject: "true" + consul.hashicorp.com/connect-service-port: "http" + # consul.hashicorp.com/connect-service-upstreams: "elastic-es:9200" + spec: + automountServiceAccountToken: true + serviceAccount: elastic-kb + containers: + - name: kibana + env: + - name: NODE_OPTIONS + value: "--max-old-space-size=2048" + # - name: ELASTICSEARCH_PASSWORD + # valueFrom: + # secretKeyRef: + # name: elastic-es-es-elastic-user + # key: elastic + resources: + requests: + memory: 1Gi + cpu: 0.5 + limits: + memory: 1Gi + cpu: 1 \ No newline at end of file diff --git a/src/argocd/infrastructure/base/elasticsearch/templates/serviceaccount.yaml b/src/argocd/infrastructure/base/elasticsearch/templates/serviceaccount.yaml new file mode 100644 index 00000000..1fb0d50b --- /dev/null +++ b/src/argocd/infrastructure/base/elasticsearch/templates/serviceaccount.yaml @@ -0,0 +1,14 @@ +# Service account for the Elasticsearch service (for ACL enforcement) +apiVersion: v1 +kind: ServiceAccount +metadata: + name: elastic-es + namespace: elasticsearch + +--- +# Service account for the Kibana service (for ACL enforcement) +apiVersion: v1 +kind: ServiceAccount +metadata: + name: elastic-kb + namespace: elasticsearch \ No newline at end of file diff --git a/src/argocd/infrastructure/base/elasticsearch/values.yaml b/src/argocd/infrastructure/base/elasticsearch/values.yaml new file mode 100644 index 00000000..e69de29b diff --git a/src/argocd/infrastructure/base/identityserver4-admin/Chart.yaml b/src/argocd/infrastructure/base/identityserver4-admin/Chart.yaml new file mode 100644 index 00000000..2b541b1b --- /dev/null +++ b/src/argocd/infrastructure/base/identityserver4-admin/Chart.yaml @@ -0,0 +1,29 @@ +apiVersion: v2 +name: identityserver4-admin +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "0.1.0" + +dependencies: + - name: identityserver4admin + version: 0.4.0 + repository: https://bravecobra.github.io/identityserver4.admin-helm/charts/ diff --git a/src/argocd/infrastructure/base/identityserver4-admin/values.yaml b/src/argocd/infrastructure/base/identityserver4-admin/values.yaml new file mode 100644 index 00000000..e09c912c --- /dev/null +++ b/src/argocd/infrastructure/base/identityserver4-admin/values.yaml @@ -0,0 +1,112 @@ +identityserver4admin: + seed: + defaultAdmin: + password: Password_123 + email: your.email@gmail.com + + certificates: + certManager: + enabled: true + issuerRef: + name: selfsigned-ca-issuer + kind: ClusterIssuer + + admin: + protocol: https + domainName: admin.login.k8s.local + ssl: + enabled: true + secretName: identityserver4-cert-admin + service: + type: ClusterIP + port: 443 + serviceAccount: + name: identityserver4-identityserver4admin + podAnnotations: + "consul.hashicorp.com/connect-inject": "true" + "consul.hashicorp.com/connect-service": "identityserver4-identityserver4admin-admin" + ingress: + enabled: true + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web, websecure + traefik.ingress.kubernetes.io/router.middlewares: default-redirect-http@kubernetescrd + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: admin.login.k8s.local + paths: + - path: / + backend: + serviceName: identityserver4-admin + servicePort: 443 + tls: + - secretName: traefik-cert + hosts: + - admin.login.k8s.local + identity: + protocol: https + domainName: login.k8s.local + ssl: + enabled: true + secretName: identityserver4-cert-identity + service: + type: ClusterIP + port: 443 + serviceAccount: + name: identityserver4-identityserver4admin + podAnnotations: + "consul.hashicorp.com/connect-inject": "true" + "consul.hashicorp.com/connect-service": "identityserver4-identityserver4admin-identity" + ingress: + enabled: true + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web, websecure + traefik.ingress.kubernetes.io/router.middlewares: default-redirect-http@kubernetescrd + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: login.k8s.local + paths: + - path: / + backend: + serviceName: identityserver4-identity + servicePort: 443 + tls: + - secretName: traefik-cert + hosts: + - login.k8s.local + api: + enabled: true + protocol: https + domainName: api.login.k8s.local + ssl: + enabled: true + secretName: identityserver4-cert-api + service: + type: ClusterIP + port: 443 + serviceAccount: + name: identityserver4-identityserver4admin + podAnnotations: + "consul.hashicorp.com/connect-inject": "true" + "consul.hashicorp.com/connect-service": "identityserver4-identityserver4admin-api" + ingress: + enabled: true + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web, websecure + traefik.ingress.kubernetes.io/router.middlewares: default-redirect-http@kubernetescrd + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: api.login.k8s.local + paths: + - path: / + backend: + serviceName: identityserver4-api + servicePort: 443 + tls: + - secretName: traefik-cert + hosts: + - api.login.k8s.local + mssql: + MSSQL_MEMORY_LIMIT_MB: 1024 \ No newline at end of file diff --git a/src/argocd/infrastructure/base/infrastructure-app/Chart.yaml b/src/argocd/infrastructure/base/infrastructure-app/Chart.yaml new file mode 100644 index 00000000..21fa8606 --- /dev/null +++ b/src/argocd/infrastructure/base/infrastructure-app/Chart.yaml @@ -0,0 +1,23 @@ +apiVersion: v2 +name: infrastructure-app +description: Applications + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +appVersion: "1.0" \ No newline at end of file diff --git a/src/argocd/infrastructure/base/infrastructure-app/templates/consul.yaml b/src/argocd/infrastructure/base/infrastructure-app/templates/consul.yaml new file mode 100644 index 00000000..3e2aff11 --- /dev/null +++ b/src/argocd/infrastructure/base/infrastructure-app/templates/consul.yaml @@ -0,0 +1,24 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: consul + namespace: argocd + annotations: + argocd.argoproj.io/sync-wave: "-3" + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + destination: + namespace: consul + server: {{ .Values.spec.destination.server }} + project: default + source: + path: src/argocd/infrastructure/base/consul + repoURL: {{ .Values.spec.source.repoURL }} + targetRevision: {{ .Values.spec.source.targetRevision }} + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true diff --git a/src/argocd/infrastructure/base/infrastructure-app/templates/elasticsearch.yaml b/src/argocd/infrastructure/base/infrastructure-app/templates/elasticsearch.yaml new file mode 100644 index 00000000..c93693f0 --- /dev/null +++ b/src/argocd/infrastructure/base/infrastructure-app/templates/elasticsearch.yaml @@ -0,0 +1,24 @@ +# apiVersion: argoproj.io/v1alpha1 +# kind: Application +# metadata: +# name: elasticsearch +# namespace: argocd +# annotations: +# argocd.argoproj.io/sync-wave: "2" +# finalizers: +# - resources-finalizer.argocd.argoproj.io +# spec: +# destination: +# namespace: elasticsearch +# server: {{ .Values.spec.destination.server }} +# project: default +# source: +# path: src/argocd/infrastructure/base/elasticsearch +# repoURL: {{ .Values.spec.source.repoURL }} +# targetRevision: {{ .Values.spec.source.targetRevision }} +# syncPolicy: +# automated: +# prune: true +# selfHeal: true +# syncOptions: +# - CreateNamespace=true diff --git a/src/argocd/infrastructure/base/infrastructure-app/templates/identityserver4-admin.yaml b/src/argocd/infrastructure/base/infrastructure-app/templates/identityserver4-admin.yaml new file mode 100644 index 00000000..13316776 --- /dev/null +++ b/src/argocd/infrastructure/base/infrastructure-app/templates/identityserver4-admin.yaml @@ -0,0 +1,24 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: identityserver4-admin + namespace: argocd + annotations: + argocd.argoproj.io/sync-wave: "1" + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + destination: + namespace: identityserver4-admin + server: {{ .Values.spec.destination.server }} + project: default + source: + path: src/argocd/infrastructure/base/identityserver4-admin + repoURL: {{ .Values.spec.source.repoURL }} + targetRevision: {{ .Values.spec.source.targetRevision }} + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true diff --git a/src/argocd/infrastructure/base/infrastructure-app/templates/jaeger.yaml b/src/argocd/infrastructure/base/infrastructure-app/templates/jaeger.yaml new file mode 100644 index 00000000..82618701 --- /dev/null +++ b/src/argocd/infrastructure/base/infrastructure-app/templates/jaeger.yaml @@ -0,0 +1,24 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: jaeger + namespace: argocd + annotations: + argocd.argoproj.io/sync-wave: "-1" + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + destination: + namespace: jaeger + server: {{ .Values.spec.destination.server }} + project: default + source: + path: src/argocd/infrastructure/base/jaeger + repoURL: {{ .Values.spec.source.repoURL }} + targetRevision: {{ .Values.spec.source.targetRevision }} + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true diff --git a/src/argocd/infrastructure/base/infrastructure-app/templates/loki.yaml b/src/argocd/infrastructure/base/infrastructure-app/templates/loki.yaml new file mode 100644 index 00000000..5262c1be --- /dev/null +++ b/src/argocd/infrastructure/base/infrastructure-app/templates/loki.yaml @@ -0,0 +1,24 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: loki + namespace: argocd + annotations: + argocd.argoproj.io/sync-wave: "-2" + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + destination: + namespace: loki + server: {{ .Values.spec.destination.server }} + project: default + source: + path: src/argocd/infrastructure/base/loki + repoURL: {{ .Values.spec.source.repoURL }} + targetRevision: {{ .Values.spec.source.targetRevision }} + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true diff --git a/src/argocd/infrastructure/base/infrastructure-app/templates/namespaces.yml b/src/argocd/infrastructure/base/infrastructure-app/templates/namespaces.yml new file mode 100644 index 00000000..cd4d6e3b --- /dev/null +++ b/src/argocd/infrastructure/base/infrastructure-app/templates/namespaces.yml @@ -0,0 +1,69 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: infrastructure + annotations: + app: infrastructure + argocd.argoproj.io/sync-wave: "-4" + labels: + app: infrastructure +--- +apiVersion: v1 +kind: Namespace +metadata: + name: loki + annotations: + app: loki + argocd.argoproj.io/sync-wave: "-4" + labels: + app: loki +--- +apiVersion: v1 +kind: Namespace +metadata: + name: prometheus + annotations: + app: prometheus + argocd.argoproj.io/sync-wave: "-4" + labels: + app: prometheus +--- +apiVersion: v1 +kind: Namespace +metadata: + name: jaeger + annotations: + app: jaeger + argocd.argoproj.io/sync-wave: "-4" + labels: + app: jaeger +--- +apiVersion: v1 +kind: Namespace +metadata: + name: elasticsearch + annotations: + app: elasticsearch + argocd.argoproj.io/sync-wave: "-4" + labels: + app: elasticsearch +--- +apiVersion: v1 +kind: Namespace +metadata: + name: identityserver4-admin + annotations: + app: identityserver4-admin + argocd.argoproj.io/sync-wave: "-4" + labels: + app: identityserver4-admin +--- +apiVersion: v1 +kind: Namespace +metadata: + name: consul + annotations: + app: consul + argocd.argoproj.io/sync-wave: "-4" + labels: + app: consul \ No newline at end of file diff --git a/src/argocd/infrastructure/base/infrastructure-app/templates/prometheus.yaml b/src/argocd/infrastructure/base/infrastructure-app/templates/prometheus.yaml new file mode 100644 index 00000000..6eb9cda5 --- /dev/null +++ b/src/argocd/infrastructure/base/infrastructure-app/templates/prometheus.yaml @@ -0,0 +1,24 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: prometheus + namespace: argocd + annotations: + argocd.argoproj.io/sync-wave: "-2" + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + destination: + namespace: prometheus + server: {{ .Values.spec.destination.server }} + project: default + source: + path: src/argocd/infrastructure/base/prometheus + repoURL: {{ .Values.spec.source.repoURL }} + targetRevision: {{ .Values.spec.source.targetRevision }} + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true diff --git a/src/argocd/infrastructure/base/infrastructure-app/values.yaml b/src/argocd/infrastructure/base/infrastructure-app/values.yaml new file mode 100644 index 00000000..04a67134 --- /dev/null +++ b/src/argocd/infrastructure/base/infrastructure-app/values.yaml @@ -0,0 +1,6 @@ +spec: + destination: + server: https://kubernetes.default.svc + source: + repoURL: https://github.com/bravecobra/k8s-dev-infrastructure + targetRevision: feature/argocd \ No newline at end of file diff --git a/src/argocd/infrastructure/base/jaeger/Chart.yaml b/src/argocd/infrastructure/base/jaeger/Chart.yaml new file mode 100644 index 00000000..bb849e62 --- /dev/null +++ b/src/argocd/infrastructure/base/jaeger/Chart.yaml @@ -0,0 +1,29 @@ +apiVersion: v2 +name: jaeger-operator +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "0.1.0" + +dependencies: + - name: jaeger-operator + version: 2.21.1 + repository: https://jaegertracing.github.io/helm-charts diff --git a/src/argocd/infrastructure/base/jaeger/files/readme.md b/src/argocd/infrastructure/base/jaeger/files/readme.md new file mode 100644 index 00000000..b70c2878 --- /dev/null +++ b/src/argocd/infrastructure/base/jaeger/files/readme.md @@ -0,0 +1,9 @@ +# Jaeger dashboard + +> This resources was created by generating it from the json file that was fetched from grafama after import it as dashboard `10001`, adding and annotating the resource. + +```powershell +kubectl apply configmap jaeger-dashboard --from-file=jaeger-dashboard.json=./src/skaffold/crds/jaeger/jaeger-grafana-dashboard.json -n infrastructure -o yaml > ./src/skaffold/crds/jaeger/jaeger-grafana-dashboard.yaml +kubectl label --overwrite -f ./src/skaffold/crds/jaeger/jaeger-grafana-dashboard.yaml grafana_dashboard=1 +kubectl annotate --overwrite -f ./src/skaffold/crds/jaeger/jaeger-grafana-dashboard.yaml k8s-sidecar-target-directory=/tmp/dashboards/Infrastructure +``` diff --git a/src/argocd/infrastructure/base/jaeger/templates/all-in-one.yaml b/src/argocd/infrastructure/base/jaeger/templates/all-in-one.yaml new file mode 100644 index 00000000..18ca3072 --- /dev/null +++ b/src/argocd/infrastructure/base/jaeger/templates/all-in-one.yaml @@ -0,0 +1,35 @@ +apiVersion: jaegertracing.io/v1 +kind: Jaeger +metadata: + name: jaeger + namespace: jaeger +spec: + annotations: + "consul.hashicorp.com/connect-inject": "true" + "consul.hashicorp.com/connect-service-port": "6831" + "consul.hashicorp.com/transparent-proxy": "true" + ingress: + enabled: true + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web, websecure + traefik.ingress.kubernetes.io/router.middlewares: default-redirect-http@kubernetescrd + hosts: + - jaeger.infrastructure.k8s.local + path: / + pathType: Prefix + tls: + - secretName: jaeger-cert + hosts: + - jaeger.infrastructure.k8s.local + allInOne: + options: + query: + base-path: /jaeger +agent: + podAnnotations: + "consul.hashicorp.com/connect-inject": "true" + "consul.hashicorp.com/transparent-proxy": "true" +query: + podAnnotations: + "consul.hashicorp.com/connect-inject": "true" + "consul.hashicorp.com/transparent-proxy": "true" diff --git a/src/argocd/infrastructure/base/jaeger/templates/jaeger-admin-service.yaml b/src/argocd/infrastructure/base/jaeger/templates/jaeger-admin-service.yaml new file mode 100644 index 00000000..933e84bf --- /dev/null +++ b/src/argocd/infrastructure/base/jaeger/templates/jaeger-admin-service.yaml @@ -0,0 +1,18 @@ +kind: Service +apiVersion: v1 +metadata: + name: jaeger-admin + labels: + app: jaeger + namespace: jaeger +spec: + selector: + app: jaeger + app.kubernetes.io/component: all-in-one + app.kubernetes.io/instance: jaeger + app.kubernetes.io/managed-by: jaeger-operator + app.kubernetes.io/name: jaeger + app.kubernetes.io/part-of: jaeger + ports: + - name: admin-http + port: 14269 diff --git a/src/argocd/infrastructure/base/jaeger/templates/jaeger-cert.yaml b/src/argocd/infrastructure/base/jaeger/templates/jaeger-cert.yaml new file mode 100644 index 00000000..e6b960ba --- /dev/null +++ b/src/argocd/infrastructure/base/jaeger/templates/jaeger-cert.yaml @@ -0,0 +1,13 @@ +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: jaeger-cert + namespace: jaeger +spec: + secretName: jaeger-cert + issuerRef: + name: selfsigned-ca-issuer + kind: ClusterIssuer + commonName: jaeger-cert + dnsNames: + - 'jaeger.infrastructure.k8s.local' diff --git a/src/argocd/infrastructure/base/jaeger/values.yaml b/src/argocd/infrastructure/base/jaeger/values.yaml new file mode 100644 index 00000000..f34550ae --- /dev/null +++ b/src/argocd/infrastructure/base/jaeger/values.yaml @@ -0,0 +1,10 @@ +jaeger-operator: + agent: + podAnnotations: + "consul.hashicorp.com/connect-inject": "true" + query: + podAnnotations: + "consul.hashicorp.com/connect-inject": "true" + rbac: + create: true + clusterRole: true \ No newline at end of file diff --git a/src/argocd/infrastructure/base/loki/Chart.yaml b/src/argocd/infrastructure/base/loki/Chart.yaml new file mode 100644 index 00000000..0dea00f9 --- /dev/null +++ b/src/argocd/infrastructure/base/loki/Chart.yaml @@ -0,0 +1,32 @@ +apiVersion: v2 +name: loki +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "0.1.0" + +dependencies: + - name: loki + version: 2.5.0 + repository: https://grafana.github.io/helm-charts + - name: promtail + version: 3.5.1 + repository: https://grafana.github.io/helm-charts diff --git a/src/argocd/infrastructure/base/loki/values.yaml b/src/argocd/infrastructure/base/loki/values.yaml new file mode 100644 index 00000000..0d0da6d3 --- /dev/null +++ b/src/argocd/infrastructure/base/loki/values.yaml @@ -0,0 +1,26 @@ +loki: + podAnnotations: + "consul.hashicorp.com/connect-inject": "true" + "consul.hashicorp.com/connect-service-port": "3100" + "consul.hashicorp.com/transparent-proxy": "true" + + tracing: + jaegerAgentHost: jaeger-agent.jaeger.svc.cluster.local + + serviceMonitor: + enabled: true + additionalLabels: + release: "prometheus" + +promtail: + config: + lokiAddress: http://loki.loki.svc.cluster.local:3100/loki/api/v1/push + + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "http-metrics" + + serviceMonitor: + enabled: true + labels: + release: "prometheus" \ No newline at end of file diff --git a/src/argocd/infrastructure/base/prometheus/Chart.yaml b/src/argocd/infrastructure/base/prometheus/Chart.yaml new file mode 100644 index 00000000..0a3b82d9 --- /dev/null +++ b/src/argocd/infrastructure/base/prometheus/Chart.yaml @@ -0,0 +1,29 @@ +apiVersion: v2 +name: prometheus +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "0.1.0" + +dependencies: + - name: kube-prometheus-stack + version: 16.0.1 + repository: https://prometheus-community.github.io/helm-charts diff --git a/src/argocd/infrastructure/base/prometheus/files/jaeger-grafana-dashboard.json b/src/argocd/infrastructure/base/prometheus/files/jaeger-grafana-dashboard.json new file mode 100644 index 00000000..ae8af861 --- /dev/null +++ b/src/argocd/infrastructure/base/prometheus/files/jaeger-grafana-dashboard.json @@ -0,0 +1,2669 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Dashboard for monitoring jaeger running in a k8s environment. Works with 1.9+. Feedbacks? Please send to luong.vo@employmenthero.com", + "editable": false, + "gnetId": 10001, + "graphTooltip": 0, + "id": 30, + "links": [], + "panels": [ + { + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 32, + "panels": [], + "title": "Jaeger Collector", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 1 + }, + "hiddenSeries": false, + "id": 34, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(jaeger_collector_spans_received_total[5m]))", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Spans Received/sec", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 1 + }, + "hiddenSeries": false, + "id": 36, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "jaeger_collector_in_queue_latency_sum / jaeger_collector_in_queue_latency_count", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Average in-queue latency (sec)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 1 + }, + "hiddenSeries": false, + "id": 42, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "jaeger_collector_batch_size", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Batch Size (spans)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 8 + }, + "hiddenSeries": false, + "id": 38, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "jaeger_collector_queue_length", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Queue Length (Spans)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 8 + }, + "hiddenSeries": false, + "id": 40, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(jaeger_collector_spans_dropped_total[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Spans Dropped/sec", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 8 + }, + "hiddenSeries": false, + "id": 44, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "jaeger_collector_save_latency_sum / jaeger_collector_save_latency_count", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Span save latency (sec)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 15 + }, + "id": 30, + "panels": [], + "repeat": null, + "title": "Jaeger Agent", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 8, + "x": 0, + "y": 16 + }, + "hiddenSeries": false, + "id": 8, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(jaeger_agent_thrift_udp_server_packets_processed_total[5m])) by (protocol)", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "jaeger_agent_thrift_udp_server_packets_processed/sec", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 8, + "x": 8, + "y": 16 + }, + "hiddenSeries": false, + "id": 20, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "avg(jaeger_agent_thrift_udp_server_packet_size) by (protocol)", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "avg(jaeger_agent_thrift_udp_server_packet_size)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 8, + "x": 16, + "y": 16 + }, + "hiddenSeries": false, + "id": 24, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "avg(jaeger_agent_thrift_udp_server_queue_size) by (protocol)", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "jaeger_agent_thrift_udp_server_queue_size", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 8, + "x": 0, + "y": 22 + }, + "hiddenSeries": false, + "id": 26, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(jaeger_agent_thrift_udp_server_read_errors_total[5m])) by (protocol)", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "jaeger_agent_thrift_udp_server_read_errors/sec", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 8, + "x": 8, + "y": 22 + }, + "hiddenSeries": false, + "id": 22, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(jaeger_agent_thrift_udp_server_packets_dropped_total[5m])) by (protocol)", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "jaeger_agent_thrift_udp_server_packets_dropped/sec", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 8, + "x": 16, + "y": 22 + }, + "hiddenSeries": false, + "id": 28, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(jaeger_agent_thrift_udp_t_processor_handler_errors_total[5m])) by (protocol)", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "jaeger_agent_thrift_udp_t_processor_handler_errors/sec", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 8, + "x": 0, + "y": 28 + }, + "hiddenSeries": false, + "id": 6, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(jaeger_agent_reporter_batches_submitted_total[5m])) by (format)", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "jaeger_agent_tchannel_reporter_batches_submitted/sec", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 8, + "x": 8, + "y": 28 + }, + "hiddenSeries": false, + "id": 16, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(jaeger_agent_reporter_spans_submitted_total[5m])) by (format)", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "jaeger_agent_tchannel_reporter_spans_submitted/sec", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 8, + "x": 16, + "y": 28 + }, + "hiddenSeries": false, + "id": 12, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "avg(jaeger_agent_reporter_batch_size) by (format)", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "avg(jaeger_agent_tchannel_reporter_batch_size)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 8, + "x": 0, + "y": 34 + }, + "hiddenSeries": false, + "id": 4, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(jaeger_agent_http_server_requests_total[5m])) by (type)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "jaeger_agent_http_server_requests/sec", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 8, + "x": 8, + "y": 34 + }, + "hiddenSeries": false, + "id": 14, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(jaeger_agent_reporter_batches_failures_total[5m])) by (format)", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "jaeger_agent_tchannel_reporter_batches_failures/sec", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 8, + "x": 16, + "y": 34 + }, + "hiddenSeries": false, + "id": 18, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(jaeger_agent_reporter_spans_failures_total[5m])) by (format)", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "jaeger_agent_tchannel_reporter_spans_failures/sec", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 8, + "x": 0, + "y": 40 + }, + "hiddenSeries": false, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(jaeger_agent_http_server_errors_total[5m])) by (source, status)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{source}}.{{status}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "jaeger_agent_http_server_errors/sec", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 16, + "x": 8, + "y": 40 + }, + "hiddenSeries": false, + "id": 10, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(jaeger_agent_collector_proxy_total) by (endpoint,protocol,result)", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "total(jaeger_agent_collector_proxy)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 46 + }, + "id": 46, + "panels": [], + "title": "Jaeger Query", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 47 + }, + "hiddenSeries": false, + "id": 48, + "legend": { + "avg": false, + "current": false, + "hideEmpty": true, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "(jaeger_rpc_request_latency_sum / jaeger_rpc_request_latency_count)*1000", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Average request latency (milliseconds)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 54 + }, + "hiddenSeries": false, + "id": 50, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(jaeger_rpc_http_requests_total[5m]))*60", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "All requests (/min)", + "refId": "A" + }, + { + "expr": "sum(rate(jaeger_rpc_http_requests_total{status_code=~\"2xx\"}[5m]))*60", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "2xx Requests (/min)", + "refId": "B" + }, + { + "expr": "sum(rate(jaeger_rpc_http_requests_total{status_code!=\"2xx\"}[5m]))*60", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Non-2xx Requests (/min)", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Requests/min (All requests)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 54 + }, + "hiddenSeries": false, + "id": 52, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(jaeger_rpc_http_requests_total{endpoint=~\"/api/traces\"}[5m]))*60", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "All requests (/min)", + "refId": "A" + }, + { + "expr": "sum(rate(jaeger_rpc_http_requests_total{endpoint=~\"/api/traces\",status_code=~\"2xx\"}[5m]))*60", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "2xx Requests (/min)", + "refId": "B" + }, + { + "expr": "sum(rate(jaeger_rpc_http_requests_total{endpoint=~\"/api/traces\",status_code!=\"2xx\"}[5m]))*60", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Non-2xx Requests (/min)", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Requests/min (endpoint=\"/api/traces\")", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 54 + }, + "hiddenSeries": false, + "id": 54, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(jaeger_rpc_http_requests_total{endpoint=~\"/api/traces/-traceID-\"}[5m]))*60", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "All requests (/min)", + "refId": "A" + }, + { + "expr": "sum(rate(jaeger_rpc_http_requests_total{endpoint=~\"/api/traces/-traceID-\",status_code=~\"2xx\"}[5m]))*60", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "2xx Requests (/min)", + "refId": "B" + }, + { + "expr": "sum(rate(jaeger_rpc_http_requests_total{endpoint=~\"/api/traces/-traceID-\",status_code!=\"2xx\"}[5m]))*60", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Non-2xx Requests (/min)", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Requests/min (endpoint=\"/api/traces/-traceID-\")", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 61 + }, + "hiddenSeries": false, + "id": 56, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(jaeger_rpc_http_requests_total{endpoint=~\"/api/services/-service-/operations\"}[5m]))*60", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "All requests (/min)", + "refId": "A" + }, + { + "expr": "sum(rate(jaeger_rpc_http_requests_total{endpoint=~\"/api/services/-service-/operations\",status_code=~\"2xx\"}[5m]))*60", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "2xx Requests (/min)", + "refId": "B" + }, + { + "expr": "sum(rate(jaeger_rpc_http_requests_total{endpoint=~\"/api/services/-service-/operations\",status_code!=\"2xx\"}[5m]))*60", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Non-2xx Requests (/min)", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Requests/min (endpoint=\"/api/services/-service-/operations\")", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 61 + }, + "hiddenSeries": false, + "id": 58, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(jaeger_rpc_http_requests_total{endpoint=~\"/api/services\"}[5m]))*60", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "All requests (/min)", + "refId": "A" + }, + { + "expr": "sum(rate(jaeger_rpc_http_requests_total{endpoint=~\"/api/services\",status_code=~\"2xx\"}[5m]))*60", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "2xx Requests (/min)", + "refId": "B" + }, + { + "expr": "sum(rate(jaeger_rpc_http_requests_total{endpoint=~\"/api/services\",status_code!=\"2xx\"}[5m]))*60", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Non-2xx Requests (/min)", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Requests/min (endpoint=\"/api/services\")", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": false, + "schemaVersion": 27, + "style": "dark", + "tags": [ + "jaeger" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-15m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Jaeger Dashboard", + "uid": "zLOi95xmk", + "version": 2 +} \ No newline at end of file diff --git a/src/argocd/infrastructure/base/prometheus/files/loki-monitor-dashboard.json b/src/argocd/infrastructure/base/prometheus/files/loki-monitor-dashboard.json new file mode 100644 index 00000000..8a0b45f8 --- /dev/null +++ b/src/argocd/infrastructure/base/prometheus/files/loki-monitor-dashboard.json @@ -0,0 +1,2385 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": false, + "iconColor": "rgba(0, 211, 255, 1)", + "limit": 100, + "name": "Annotations & Alerts", + "showIn": 0, + "type": "dashboard" + } + ] + }, + "description": "This dashboard can be used to detect issues on the Loki stack, when deployed in Kubernetes. Shows: some error metrics published by Promtail/Loki. Error and warning logs emitted by Promtail/Loki. Memory and CPU usage of Promtail/Loki compared against the Kubernetes memory/cpu limits and requests.", + "editable": true, + "gnetId": 14055, + "graphTooltip": 0, + "id": 31, + "links": [], + "panels": [ + { + "dashboardFilter": "", + "dashboardTags": [], + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "folderId": null, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 987, + "limit": "100", + "nameFilter": "", + "onlyAlertsOnDashboard": true, + "pluginVersion": "7.3.5", + "show": "current", + "sortOrder": 3, + "stateFilter": [], + "timeFrom": null, + "timeShift": null, + "title": "Summary of alerts status", + "type": "alertlist" + }, + { + "collapsed": false, + "datasource": "Prometheus", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 6 + }, + "id": 435, + "panels": [], + "title": "Problems in the Loki Stack", + "type": "row" + }, + { + "alert": { + "alertRuleTags": {}, + "conditions": [ + { + "evaluator": { + "params": [ + 0 + ], + "type": "gt" + }, + "operator": { + "type": "and" + }, + "query": { + "params": [ + "A", + "5m", + "now" + ] + }, + "reducer": { + "params": [], + "type": "avg" + }, + "type": "query" + } + ], + "executionErrorState": "keep_state", + "for": "5m", + "frequency": "1m", + "handler": 1, + "name": "Loki has emitted error/warning messages in the last 5m", + "noDataState": "no_data", + "notifications": [] + }, + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "description": "Total number of messages logged by Loki itself", + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 5, + "w": 9, + "x": 0, + "y": 7 + }, + "hiddenSeries": false, + "id": 10, + "interval": "1m", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": false, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.5", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "debug", + "color": "#C0D8FF" + }, + { + "alias": "info", + "color": "#5794F2" + }, + { + "alias": "warn", + "color": "#FF9830" + }, + { + "alias": "error", + "color": "#C4162A" + } + ], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(log_messages_total{app=\"loki\",level=~\"error|warn\"}[1m])) by (level)\n", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{level}}", + "refId": "A" + }, + { + "expr": "log_messages_total", + "format": "time_series", + "hide": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "B" + } + ], + "thresholds": [ + { + "colorMode": "critical", + "fill": true, + "line": true, + "op": "gt", + "value": 0, + "visible": true + } + ], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Number of error/warning messages logged by Loki itself", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "datasource": "Loki", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 15, + "x": 9, + "y": 7 + }, + "id": 511, + "options": { + "dedupStrategy": "none", + "showLabels": false, + "showTime": false, + "sortOrder": "Descending", + "wrapLogMessage": false + }, + "pluginVersion": "7.3.5", + "targets": [ + { + "expr": "{app=\"loki\"} | logfmt | level=\"warn\" or level=\"error\"", + "legendFormat": "", + "refId": "A" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Error/warning messages logged by Loki itself", + "type": "logs" + }, + { + "alert": { + "alertRuleTags": {}, + "conditions": [ + { + "evaluator": { + "params": [ + 0 + ], + "type": "gt" + }, + "operator": { + "type": "and" + }, + "query": { + "params": [ + "A", + "5m", + "now" + ] + }, + "reducer": { + "params": [], + "type": "avg" + }, + "type": "query" + } + ], + "executionErrorState": "keep_state", + "for": "5m", + "frequency": "1m", + "handler": 1, + "name": "Promtail has emitted error/warning messages in the last 5m", + "noDataState": "no_data", + "notifications": [] + }, + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "description": "Total number of messages logged by Promtail", + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 5, + "w": 9, + "x": 0, + "y": 12 + }, + "hiddenSeries": false, + "id": 106, + "interval": "1m", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": false, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.5", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "debug", + "color": "#C0D8FF" + }, + { + "alias": "info", + "color": "#5794F2" + }, + { + "alias": "warn", + "color": "#FF9830" + }, + { + "alias": "error", + "color": "#C4162A" + } + ], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(log_messages_total{app_kubernetes_io_name=\"promtail\",level=~\"error|warn\"}[1m])) by (level)\n", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{level}}", + "refId": "A" + } + ], + "thresholds": [ + { + "colorMode": "critical", + "fill": true, + "line": true, + "op": "gt", + "value": 0, + "visible": true + } + ], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Error/warning messages logged by Promtail", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "datasource": "Loki", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 15, + "x": 9, + "y": 12 + }, + "id": 586, + "options": { + "dedupStrategy": "none", + "showLabels": false, + "showTime": false, + "sortOrder": "Descending", + "wrapLogMessage": false + }, + "pluginVersion": "7.3.5", + "targets": [ + { + "expr": "{app=\"promtail\"} | logfmt | level=\"warn\" or level=\"error\"", + "legendFormat": "", + "refId": "A" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Error/warning messages logged by Promtail", + "type": "logs" + }, + { + "alert": { + "alertRuleTags": {}, + "conditions": [ + { + "evaluator": { + "params": [ + 0.01 + ], + "type": "gt" + }, + "operator": { + "type": "and" + }, + "query": { + "params": [ + "A", + "5m", + "now" + ] + }, + "reducer": { + "params": [], + "type": "max" + }, + "type": "query" + } + ], + "executionErrorState": "keep_state", + "for": "5m", + "frequency": "1m", + "handler": 1, + "name": "Loki distributor has failed to send batches to ingesters", + "noDataState": "no_data", + "notifications": [] + }, + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 5, + "w": 24, + "x": 0, + "y": 17 + }, + "hiddenSeries": false, + "id": 676, + "interval": "1m", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.5", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(loki_distributor_ingester_append_failures_total[1m])*60", + "instant": false, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [ + { + "colorMode": "critical", + "fill": true, + "line": true, + "op": "gt", + "value": 0.01, + "visible": true + } + ], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Loki (distributor) - failed batch appends sent to ingesters", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "alert": { + "alertRuleTags": {}, + "conditions": [ + { + "evaluator": { + "params": [ + 0.01 + ], + "type": "gt" + }, + "operator": { + "type": "and" + }, + "query": { + "params": [ + "A", + "5m", + "now" + ] + }, + "reducer": { + "params": [], + "type": "max" + }, + "type": "query" + } + ], + "executionErrorState": "keep_state", + "for": "5m", + "frequency": "1m", + "handler": 1, + "name": "Promtail has dropped logs in the last 5m", + "noDataState": "no_data", + "notifications": [] + }, + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "description": "Number of log entries dropped because failed to be sent to the Loki ingester after all retries.", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 5, + "w": 24, + "x": 0, + "y": 22 + }, + "hiddenSeries": false, + "id": 677, + "interval": "1m", + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.5", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(promtail_dropped_entries_total[1m])*60", + "instant": false, + "interval": "", + "legendFormat": "pod={{kubernetes_pod_name}}, instance={{instance}}", + "refId": "A" + } + ], + "thresholds": [ + { + "colorMode": "critical", + "fill": true, + "line": true, + "op": "gt", + "value": 0.01, + "visible": true + } + ], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Promtail - dropped log entries", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "datasource": "Prometheus", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 27 + }, + "id": 47, + "panels": [], + "title": "Logging activity", + "type": "row" + }, + { + "alert": { + "alertRuleTags": {}, + "conditions": [ + { + "evaluator": { + "params": [ + 5000 + ], + "type": "gt" + }, + "operator": { + "type": "and" + }, + "query": { + "params": [ + "A", + "1m", + "now" + ] + }, + "reducer": { + "params": [], + "type": "avg" + }, + "type": "query" + } + ], + "executionErrorState": "keep_state", + "for": "5m", + "frequency": "1m", + "handler": 1, + "name": "The number of streams in Loki is above 5000", + "noDataState": "no_data", + "notifications": [] + }, + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "description": "The total number of streams created per tenant.\nThis should not increase after startup.", + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 28 + }, + "hiddenSeries": false, + "id": 78, + "legend": { + "avg": false, + "current": true, + "max": false, + "min": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.5", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "loki_ingester_memory_streams", + "interval": "", + "legendFormat": "Streams", + "refId": "A" + } + ], + "thresholds": [ + { + "colorMode": "critical", + "fill": true, + "line": true, + "op": "gt", + "value": 5000, + "visible": true + } + ], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Number of Streams in Loki", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "description": "The total number of log entries received per tenant (not necessarily of lines, as an entry can have more than one line of text).", + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 34 + }, + "hiddenSeries": false, + "id": 56, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.5", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(loki_distributor_lines_received_total[1m])", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Loki (distributor) - log entries received per second", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "alert": { + "alertRuleTags": {}, + "conditions": [ + { + "evaluator": { + "params": [ + 1000000 + ], + "type": "gt" + }, + "operator": { + "type": "and" + }, + "query": { + "params": [ + "A", + "5m", + "now" + ] + }, + "reducer": { + "params": [], + "type": "avg" + }, + "type": "query" + } + ], + "executionErrorState": "keep_state", + "for": "1m", + "frequency": "1m", + "handler": 1, + "name": "Quantity of data received by the Loki ingester is suspiciously high", + "noDataState": "no_data", + "notifications": [] + }, + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "description": "The total number of uncompressed bytes received per tenant.\n", + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 40 + }, + "hiddenSeries": false, + "id": 137, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.5", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(loki_distributor_bytes_received_total[1m]))", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [ + { + "colorMode": "critical", + "fill": true, + "line": true, + "op": "gt", + "value": 1000000, + "visible": true + } + ], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Bytes received in ingester per second", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "decbytes", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "datasource": "Prometheus", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 46 + }, + "id": 18, + "panels": [], + "title": "Memory usage", + "type": "row" + }, + { + "alert": { + "alertRuleTags": {}, + "conditions": [ + { + "evaluator": { + "params": [ + 80 + ], + "type": "gt" + }, + "operator": { + "type": "and" + }, + "query": { + "params": [ + "A", + "5m", + "now" + ] + }, + "reducer": { + "params": [], + "type": "avg" + }, + "type": "query" + } + ], + "executionErrorState": "keep_state", + "for": "1m", + "frequency": "1m", + "handler": 1, + "name": "Loki memory usage is above 80% of the defined limit", + "noDataState": "no_data", + "notifications": [] + }, + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "decimals": 2, + "description": "Percentage of actual usage over configured limit", + "editable": true, + "error": false, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 0, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 47 + }, + "hiddenSeries": false, + "id": 247, + "isNew": true, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sideWidth": 200, + "sort": "current", + "sortDesc": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.5", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "100 * max by(pod,container) (container_memory_working_set_bytes{container!=\"\",container!=\"POD\",pod=~\"loki.*\"})\n/\non (pod,container) group_left kube_pod_container_resource_limits_memory_bytes{pod=~\"loki.*\"}", + "hide": false, + "interval": "", + "legendFormat": "Usage (pod={{pod}}, container={{container}}, name={{name}})", + "refId": "A" + } + ], + "thresholds": [ + { + "colorMode": "critical", + "fill": true, + "line": true, + "op": "gt", + "value": 80, + "visible": true + } + ], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Loki memory usage (% of Kubernetes memory limit)", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 2, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:241", + "format": "percent", + "label": null, + "logBase": 1, + "max": "100", + "min": "0", + "show": true + }, + { + "$$hashKey": "object:242", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "decimals": 2, + "editable": true, + "error": false, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 0, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 53 + }, + "hiddenSeries": false, + "id": 25, + "isNew": true, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sideWidth": 200, + "sort": "current", + "sortDesc": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.5", + "pointradius": 5, + "points": false, + "renderer": "flot", + "repeat": null, + "seriesOverrides": [ + { + "alias": "Limit", + "color": "rgba(255, 255, 255, 0.56)", + "dashes": true + }, + { + "alias": "Request", + "color": "rgba(255, 255, 255, 0.78)" + }, + { + "alias": "Usage", + "fill": 1 + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "container_memory_working_set_bytes{container!=\"\",container!=\"POD\",pod=~\"loki.*\"}", + "interval": "10s", + "intervalFactor": 1, + "legendFormat": "Usage (pod={{pod}}, container={{container}})", + "metric": "container_memory_usage:sort_desc", + "refId": "A", + "step": 10 + }, + { + "expr": "min(kube_pod_container_resource_limits_memory_bytes{pod=~\"loki.*\"})", + "interval": "", + "legendFormat": "Limit", + "refId": "B" + }, + { + "expr": "min(kube_pod_container_resource_requests_memory_bytes{pod=~\"loki.*\"})", + "interval": "", + "legendFormat": "Request", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Loki memory usage vs Kubernetes limit and request", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 2, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:581", + "format": "bytes", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "$$hashKey": "object:582", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "alert": { + "alertRuleTags": {}, + "conditions": [ + { + "evaluator": { + "params": [ + 80 + ], + "type": "gt" + }, + "operator": { + "type": "and" + }, + "query": { + "params": [ + "A", + "5m", + "now" + ] + }, + "reducer": { + "params": [], + "type": "avg" + }, + "type": "query" + } + ], + "executionErrorState": "keep_state", + "for": "5m", + "frequency": "1m", + "handler": 1, + "name": "Promtail memory usage is above 80% of the defined limit", + "noDataState": "no_data", + "notifications": [] + }, + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "decimals": 2, + "description": "Percentage of actual usage over configured limit", + "editable": true, + "error": false, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 0, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 59 + }, + "hiddenSeries": false, + "id": 772, + "isNew": true, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sideWidth": 200, + "sort": "current", + "sortDesc": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.5", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "100* max by(pod,container) (container_memory_working_set_bytes{container!=\"\",container!=\"POD\",pod=~\"promtail.*\"})\n/\non (pod,container) (kube_pod_container_resource_limits_memory_bytes{pod=~\"promtail.*\"})", + "hide": false, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": [ + { + "colorMode": "critical", + "fill": true, + "line": true, + "op": "gt", + "value": 80, + "visible": true + } + ], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Promtail memory usage (% of Kubernetes memory limit)", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 2, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:335", + "format": "percent", + "label": null, + "logBase": 1, + "max": "100", + "min": "0", + "show": true + }, + { + "$$hashKey": "object:336", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "decimals": 2, + "editable": true, + "error": false, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 0, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 65 + }, + "hiddenSeries": false, + "id": 1103, + "isNew": true, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sideWidth": 200, + "sort": "current", + "sortDesc": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.5", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "Limit", + "color": "rgba(255, 255, 255, 0.56)", + "dashes": true + }, + { + "alias": "Request", + "color": "rgba(255, 255, 255, 0.78)" + }, + { + "alias": "Usage", + "fill": 1 + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "container_memory_working_set_bytes{container!=\"\",container!=\"POD\",pod=~\"promtail.*\"}", + "interval": "10s", + "intervalFactor": 1, + "legendFormat": "Usage (pod={{pod}}, container={{container}})", + "metric": "container_memory_usage:sort_desc", + "refId": "A", + "step": 10 + }, + { + "expr": "min(kube_pod_container_resource_limits_memory_bytes{pod=~\"promtail.*\"})", + "interval": "", + "legendFormat": "Limit", + "refId": "B" + }, + { + "expr": "min(kube_pod_container_resource_requests_memory_bytes{pod=~\"promtail.*\"})", + "interval": "", + "legendFormat": "Request", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Promtail memory usage vs Kubernetes limit and request", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 2, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:581", + "format": "bytes", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "$$hashKey": "object:582", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "datasource": "Prometheus", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 71 + }, + "id": 8, + "panels": [], + "title": "CPU Usage", + "type": "row" + }, + { + "alert": { + "alertRuleTags": {}, + "conditions": [ + { + "evaluator": { + "params": [ + 80 + ], + "type": "gt" + }, + "operator": { + "type": "and" + }, + "query": { + "params": [ + "A", + "5m", + "now" + ] + }, + "reducer": { + "params": [], + "type": "avg" + }, + "type": "query" + } + ], + "executionErrorState": "keep_state", + "for": "1m", + "frequency": "1m", + "handler": 1, + "name": "Loki CPU usage is above 80% of the defined limit", + "noDataState": "no_data", + "notifications": [] + }, + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "decimals": 3, + "description": "percentage of configured limit", + "editable": true, + "error": false, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 0, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 72 + }, + "height": "", + "hiddenSeries": false, + "id": 347, + "isNew": true, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sort": null, + "sortDesc": null, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.5", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "100* rate(container_cpu_usage_seconds_total{container!=\"POD\",container!=\"\",pod=~\"loki.*\"}[1m])\n/\non (pod,container) kube_pod_container_resource_limits_cpu_cores{container=\"loki\"}", + "interval": "10s", + "intervalFactor": 1, + "legendFormat": "", + "metric": "container_cpu", + "refId": "A", + "step": 10 + } + ], + "thresholds": [ + { + "colorMode": "critical", + "fill": true, + "line": true, + "op": "gt", + "value": 80, + "visible": true + } + ], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Loki CPU usage (% of Kubernetes CPU limit)", + "tooltip": { + "msResolution": true, + "shared": true, + "sort": 2, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:413", + "format": "percent", + "label": "cores", + "logBase": 1, + "max": "100", + "min": "0", + "show": true + }, + { + "$$hashKey": "object:414", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "decimals": 3, + "description": "", + "editable": true, + "error": false, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 0, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 78 + }, + "height": "", + "hiddenSeries": false, + "id": 6, + "isNew": true, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sort": null, + "sortDesc": null, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.5", + "pointradius": 5, + "points": false, + "renderer": "flot", + "repeat": null, + "seriesOverrides": [ + { + "alias": "CPU Limit", + "color": "rgba(255, 255, 255, 0.46)", + "dashes": true + }, + { + "alias": "CPU Request", + "color": "rgba(255, 255, 255, 0.54)" + }, + { + "alias": "Usage", + "fill": 1 + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(container_cpu_usage_seconds_total{container!=\"\",container!=\"POD\",pod=~\"loki.*\"}[1m])", + "interval": "10s", + "intervalFactor": 1, + "legendFormat": "CPU Usage (pod={{pod}}, container={{container}})", + "metric": "container_cpu", + "refId": "A", + "step": 10 + }, + { + "expr": "min(kube_pod_container_resource_limits_cpu_cores{pod=~\"loki.*\"})", + "interval": "", + "legendFormat": "CPU Limit", + "refId": "B" + }, + { + "expr": "min(kube_pod_container_resource_requests_cpu_cores{pod=~\"loki.*\"})", + "hide": false, + "interval": "", + "legendFormat": "CPU Request", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Loki CPU usage vs Kubernetes limit and request", + "tooltip": { + "msResolution": true, + "shared": true, + "sort": 2, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:666", + "format": "none", + "label": "cores", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "$$hashKey": "object:667", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "alert": { + "alertRuleTags": {}, + "conditions": [ + { + "evaluator": { + "params": [ + 80 + ], + "type": "gt" + }, + "operator": { + "type": "and" + }, + "query": { + "params": [ + "A", + "5m", + "now" + ] + }, + "reducer": { + "params": [], + "type": "avg" + }, + "type": "query" + } + ], + "executionErrorState": "keep_state", + "for": "5m", + "frequency": "1m", + "handler": 1, + "name": "Promtail CPU usage is above 80% of the defined limit", + "noDataState": "no_data", + "notifications": [] + }, + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "decimals": 3, + "description": "percentage of configured limit", + "editable": true, + "error": false, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 0, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 84 + }, + "height": "", + "hiddenSeries": false, + "id": 910, + "isNew": true, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sort": null, + "sortDesc": null, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.5", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "100 * rate(container_cpu_usage_seconds_total{container!=\"\",container!=\"POD\",pod=~\"promtail.*\"}[1m])\n/\non (pod,container) kube_pod_container_resource_limits_cpu_cores{pod=~\"promtail.*\"}", + "interval": "10s", + "intervalFactor": 1, + "legendFormat": "", + "metric": "container_cpu", + "refId": "A", + "step": 10 + } + ], + "thresholds": [ + { + "colorMode": "critical", + "fill": true, + "line": true, + "op": "gt", + "value": 80, + "visible": true + } + ], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Promtail CPU usage (% of Kubernetes limit)", + "tooltip": { + "msResolution": true, + "shared": true, + "sort": 2, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:231", + "format": "percent", + "label": "cores", + "logBase": 1, + "max": "100", + "min": "0", + "show": true + }, + { + "$$hashKey": "object:232", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "decimals": 3, + "description": "", + "editable": true, + "error": false, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 0, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 90 + }, + "height": "", + "hiddenSeries": false, + "id": 1104, + "isNew": true, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sort": null, + "sortDesc": null, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.5", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "CPU Limit", + "color": "rgba(255, 255, 255, 0.46)", + "dashes": true + }, + { + "alias": "CPU Request", + "color": "rgba(255, 255, 255, 0.54)" + }, + { + "alias": "Usage", + "fill": 1 + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(container_cpu_usage_seconds_total{container!=\"\",container!=\"POD\",pod=~\"promtail.*\"}[1m])", + "interval": "10s", + "intervalFactor": 1, + "legendFormat": "CPU Usage (pod={{pod}}, container={{container}})", + "metric": "container_cpu", + "refId": "A", + "step": 10 + }, + { + "expr": "min(kube_pod_container_resource_limits_cpu_cores{pod=~\"promtail.*\"})", + "interval": "", + "legendFormat": "CPU Limit", + "refId": "B" + }, + { + "expr": "min(kube_pod_container_resource_requests_cpu_cores{pod=~\"promtail.*\"})", + "hide": false, + "interval": "", + "legendFormat": "CPU Request", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Promtail CPU usage vs Kubernetes limit and request", + "tooltip": { + "msResolution": true, + "shared": true, + "sort": 2, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:666", + "format": "none", + "label": "cores", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "$$hashKey": "object:667", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": "1m", + "schemaVersion": 27, + "style": "dark", + "tags": [ + "tools", + "loki" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-24h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Loki stack monitoring (Promtail, Loki)", + "uid": "loki_stack_monitoring_quortex", + "version": 1 +} \ No newline at end of file diff --git a/src/argocd/infrastructure/base/prometheus/files/loki-promtail-dashboard.json b/src/argocd/infrastructure/base/prometheus/files/loki-promtail-dashboard.json new file mode 100644 index 00000000..047f27e2 --- /dev/null +++ b/src/argocd/infrastructure/base/prometheus/files/loki-promtail-dashboard.json @@ -0,0 +1,409 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "an example for loki and promtail.", + "editable": true, + "gnetId": 10004, + "graphTooltip": 1, + "id": 30, + "links": [], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 2, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.5", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum (rate(loki_distributor_bytes_received_total[5m]))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Bytes Receiced", + "refId": "B" + }, + { + "expr": "sum (rate(loki_distributor_lines_received_total[5m]))", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "Lines Received", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Loki", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 9 + }, + "hiddenSeries": false, + "id": 3, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.5", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "lag", + "yaxis": 2 + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum (rate(promtail_read_bytes_total[5m]))", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "read", + "refId": "B" + }, + { + "expr": "sum (rate(promtail_sent_bytes_total[5m]))", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "sent", + "refId": "C" + }, + { + "expr": "sum (rate(promtail_encoded_bytes_total[5m]))", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "encoded", + "refId": "D" + }, + { + "expr": "sum(promtail_file_bytes_total - promtail_read_bytes_total)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "lag", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Promtail", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 18 + }, + "hiddenSeries": false, + "id": 5, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sideWidth": null, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "7.5.5", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "promtail_file_bytes_total - promtail_read_bytes_total > 100000", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{path}}", + "refId": "A" + }, + { + "expr": "promtail_file_bytes_total - promtail_read_bytes_total < -100000", + "format": "time_series", + "hide": true, + "intervalFactor": 1, + "legendFormat": "{{path}}", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Lag", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": "5s", + "schemaVersion": 27, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Loki-Promtail", + "uid": "htcadXCiz", + "version": 1 +} \ No newline at end of file diff --git a/src/argocd/infrastructure/base/prometheus/files/traefik-grafana-dashboard.json b/src/argocd/infrastructure/base/prometheus/files/traefik-grafana-dashboard.json new file mode 100644 index 00000000..1cc52347 --- /dev/null +++ b/src/argocd/infrastructure/base/prometheus/files/traefik-grafana-dashboard.json @@ -0,0 +1,1416 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Simple dashboard for Traefik 2", + "editable": true, + "gnetId": 11462, + "graphTooltip": 0, + "id": 43, + "iteration": 1619877456583, + "links": [], + "panels": [ + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "format": "s", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 6, + "w": 3, + "x": 0, + "y": 0 + }, + "id": 22, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "time() - process_start_time_seconds{job=\"$job\"}", + "format": "time_series", + "intervalFactor": 2, + "refId": "A" + } + ], + "thresholds": "", + "title": "Uptime", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#37872D", + "#37872D", + "#C4162A" + ], + "datasource": "Prometheus", + "decimals": 0, + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 6, + "w": 3, + "x": 3, + "y": 0 + }, + "id": 26, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "200%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "sum(increase(traefik_service_requests_total{code=\"404\",protocol=~\"$protocol\"}[$interval]))", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "", + "metric": "traefik_requests_total", + "refId": "A", + "step": 60 + } + ], + "thresholds": "0,1", + "title": "404 Error Count", + "type": "singlestat", + "valueFontSize": "200%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "max" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#37872D", + "#C4162A", + "#C4162A" + ], + "datasource": "Prometheus", + "decimals": 0, + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 6, + "w": 3, + "x": 6, + "y": 0 + }, + "id": 32, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "200%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false, + "ymax": null, + "ymin": null + }, + "tableColumn": "", + "targets": [ + { + "expr": "sum(increase(traefik_service_requests_total{code=\"503\",protocol=~\"$protocol\"}[$interval]))", + "refId": "A" + } + ], + "thresholds": "0,1", + "timeFrom": null, + "timeShift": null, + "title": "503 Error count", + "type": "singlestat", + "valueFontSize": "200%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "max" + }, + { + "aliasColors": {}, + "breakPoint": "50%", + "cacheTimeout": null, + "combine": { + "label": "Others", + "threshold": 0 + }, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fontSize": "80%", + "format": "short", + "gridPos": { + "h": 6, + "w": 4, + "x": 9, + "y": 0 + }, + "id": 18, + "interval": null, + "legend": { + "percentage": true, + "show": true, + "sort": null, + "sortDesc": null, + "values": true + }, + "legendType": "Right side", + "links": [], + "maxDataPoints": 3, + "nullPointMode": "connected", + "pieType": "pie", + "strokeWidth": 1, + "targets": [ + { + "expr": "topk(5, sum(traefik_service_requests_total{protocol=~\"$protocol\"}) by (code))", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{code}}", + "refId": "A" + } + ], + "title": "Top 5 $protocol return code", + "type": "grafana-piechart-panel", + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "format": "ms", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 6, + "w": 4, + "x": 13, + "y": 0 + }, + "id": 20, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "expr": "sum(traefik_entrypoint_request_duration_seconds_sum) / sum(traefik_entrypoint_requests_total) * 1000", + "format": "time_series", + "intervalFactor": 2, + "refId": "A" + } + ], + "thresholds": "", + "title": "Average response time", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 7, + "x": 17, + "y": 0 + }, + "hiddenSeries": false, + "id": 14, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(traefik_service_request_duration_seconds_sum{protocol=~\"$protocol\"}) / sum(traefik_entrypoint_requests_total{protocol=~\"$protocol\"}) * 1000", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "Average response time (ms)", + "refId": "A", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Average response time", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "ms", + "label": null, + "logBase": 10, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "decimals": 0, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 6 + }, + "hiddenSeries": false, + "id": 10, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(increase(traefik_service_requests_total{code=\"404\",method=\"GET\",protocol=~\"$protocol\"}[$interval])) by (service)", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{service}} ", + "refId": "A", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Bad Status Code Count", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 6 + }, + "hiddenSeries": false, + "hideTimeOverride": false, + "id": 4, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": true, + "min": true, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(traefik_service_requests_total[$interval]))", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "Total requests", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Total requests", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "decimals": 0, + "format": "short", + "label": "", + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 10, + "x": 0, + "y": 12 + }, + "hiddenSeries": false, + "id": 8, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "expr": "process_open_fds{job=~\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{ instance }}", + "refId": "A", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Used sockets", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "decimals": 0, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 14, + "x": 10, + "y": 12 + }, + "hiddenSeries": false, + "id": 24, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(traefik_service_requests_total{protocol=~\"http|https\"}[$interval])) by (service)", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{service}} ", + "refId": "A", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Access to services", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 7, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 18 + }, + "hiddenSeries": false, + "id": 30, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": false, + "rightSide": true, + "show": true, + "sort": "avg", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "expr": "sum(traefik_entrypoint_open_connections) by (method)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{ method }}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "ENTRYPOINT - Open Connections", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 7, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 18 + }, + "hiddenSeries": false, + "id": 28, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": false, + "rightSide": true, + "show": true, + "sort": "avg", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "expr": "sum(traefik_service_open_connections) by (method)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{ method }}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "SERVICE - Open Connections", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "decimals": 0, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 25 + }, + "hiddenSeries": false, + "id": 12, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "/^[^234].*/", + "transform": "negative-Y" + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(increase(traefik_service_requests_total{protocol=~\"$protocol\"}[$interval])) by (code)", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{code}}", + "refId": "A", + "step": 120 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Status Code Count ", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": "", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": false, + "schemaVersion": 27, + "style": "dark", + "tags": [ + "traefik", + "load-balancer", + "docker", + "prometheus" + ], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "selected": false, + "text": "traefik-dashboard", + "value": "traefik-dashboard" + }, + "datasource": "Prometheus", + "definition": "", + "description": null, + "error": null, + "hide": 0, + "includeAll": false, + "label": "Job:", + "multi": false, + "name": "job", + "options": [], + "query": { + "query": "label_values(job)", + "refId": "Prometheus-job-Variable-Query" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 2, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": "Prometheus", + "definition": "label_values(traefik_service_requests_total, protocol)", + "description": null, + "error": null, + "hide": 0, + "includeAll": true, + "label": "Service:", + "multi": true, + "name": "protocol", + "options": [], + "query": { + "query": "label_values(traefik_service_requests_total, protocol)", + "refId": "Prometheus-protocol-Variable-Query" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "auto": true, + "auto_count": 30, + "auto_min": "10s", + "current": { + "selected": false, + "text": "auto", + "value": "$__auto_interval_interval" + }, + "description": null, + "error": null, + "hide": 0, + "label": "Interval", + "name": "interval", + "options": [ + { + "selected": true, + "text": "auto", + "value": "$__auto_interval_interval" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "10m", + "value": "10m" + }, + { + "selected": false, + "text": "30m", + "value": "30m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, + { + "selected": false, + "text": "6h", + "value": "6h" + }, + { + "selected": false, + "text": "12h", + "value": "12h" + }, + { + "selected": false, + "text": "1d", + "value": "1d" + }, + { + "selected": false, + "text": "7d", + "value": "7d" + }, + { + "selected": false, + "text": "14d", + "value": "14d" + }, + { + "selected": false, + "text": "30d", + "value": "30d" + } + ], + "query": "1m,10m,30m,1h,6h,12h,1d,7d,14d,30d", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" + } + ] + }, + "time": { + "from": "now-3h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Traefik 2", + "uid": "3ipsWfViz", + "version": 2 +} \ No newline at end of file diff --git a/src/argocd/infrastructure/base/prometheus/templates/jaeger-grafana-dashboard.yaml b/src/argocd/infrastructure/base/prometheus/templates/jaeger-grafana-dashboard.yaml new file mode 100644 index 00000000..9fb81091 --- /dev/null +++ b/src/argocd/infrastructure/base/prometheus/templates/jaeger-grafana-dashboard.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: jaeger-dashboard + namespace: jaeger + labels: + grafana_dashboard: "1" + annotations: + k8s-sidecar-target-directory: /tmp/dashboards/Infrastructure +data: + {{ (.Files.Glob "files/jaeger-grafana-dashboard.json").AsConfig | nindent 2}} diff --git a/src/argocd/infrastructure/base/prometheus/templates/jaeger-monitor.yaml b/src/argocd/infrastructure/base/prometheus/templates/jaeger-monitor.yaml new file mode 100644 index 00000000..b3157297 --- /dev/null +++ b/src/argocd/infrastructure/base/prometheus/templates/jaeger-monitor.yaml @@ -0,0 +1,18 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: jaeger + namespace: jaeger + labels: + app: jaeger + release: prometheus +spec: + jobLabel: jaeger-metrics + selector: + matchLabels: + app: jaeger + namespaceSelector: + matchNames: + - jaeger + endpoints: + - port: admin-http \ No newline at end of file diff --git a/src/argocd/infrastructure/base/prometheus/templates/loki-monitor-dashboard.yaml b/src/argocd/infrastructure/base/prometheus/templates/loki-monitor-dashboard.yaml new file mode 100644 index 00000000..d0fb801e --- /dev/null +++ b/src/argocd/infrastructure/base/prometheus/templates/loki-monitor-dashboard.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: loki-monitor-dashboard + namespace: loki + labels: + grafana_dashboard: "1" + annotations: + k8s-sidecar-target-directory: /tmp/dashboards/Infrastructure +data: + {{ (.Files.Glob "files/loki-monitor-dashboard.json" ).AsConfig | nindent 2 }} diff --git a/src/argocd/infrastructure/base/prometheus/templates/loki-promtail-dashboard.yaml b/src/argocd/infrastructure/base/prometheus/templates/loki-promtail-dashboard.yaml new file mode 100644 index 00000000..64e8129e --- /dev/null +++ b/src/argocd/infrastructure/base/prometheus/templates/loki-promtail-dashboard.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: loki-promtail-dashboard + namespace: loki + labels: + grafana_dashboard: "1" + annotations: + k8s-sidecar-target-directory: /tmp/dashboards/Infrastructure +data: + {{ (.Files.Glob "files/loki-promtail-dashboard.json").AsConfig | nindent 2}} diff --git a/src/argocd/infrastructure/base/prometheus/templates/prometheus-cert.yaml b/src/argocd/infrastructure/base/prometheus/templates/prometheus-cert.yaml new file mode 100644 index 00000000..fdc0e466 --- /dev/null +++ b/src/argocd/infrastructure/base/prometheus/templates/prometheus-cert.yaml @@ -0,0 +1,14 @@ +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: prometheus-cert + namespace: prometheus +spec: + secretName: prometheus-cert + issuerRef: + name: selfsigned-ca-issuer + kind: ClusterIssuer + commonName: prometheus-cert + dnsNames: + - 'prometheus.infrastructure.k8s.local' + - 'grafana.infrastructure.k8s.local' diff --git a/src/argocd/infrastructure/base/prometheus/templates/traefik-grafana-dashboard.yaml b/src/argocd/infrastructure/base/prometheus/templates/traefik-grafana-dashboard.yaml new file mode 100644 index 00000000..92ab8d07 --- /dev/null +++ b/src/argocd/infrastructure/base/prometheus/templates/traefik-grafana-dashboard.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: traefik-dashboard + namespace: traefik + labels: + grafana_dashboard: "1" + annotations: + k8s-sidecar-target-directory: /tmp/dashboards/Infrastructure +data: + {{ (.Files.Glob "files/traefik-grafana-dashboard.json").AsConfig | nindent 2}} diff --git a/src/argocd/infrastructure/base/prometheus/templates/traefik-monitor.yaml b/src/argocd/infrastructure/base/prometheus/templates/traefik-monitor.yaml new file mode 100644 index 00000000..db527cb6 --- /dev/null +++ b/src/argocd/infrastructure/base/prometheus/templates/traefik-monitor.yaml @@ -0,0 +1,21 @@ + +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: traefik + namespace: traefik + labels: + app: traefik + release: prometheus +spec: + jobLabel: traefik-metrics + selector: + matchLabels: + app.kubernetes.io/instance: traefik + app.kubernetes.io/name: traefik-dashboard + namespaceSelector: + matchNames: + - traefik + endpoints: + - port: traefik + path: /metrics diff --git a/src/argocd/infrastructure/base/prometheus/templates/traefik-rules.yaml b/src/argocd/infrastructure/base/prometheus/templates/traefik-rules.yaml new file mode 100644 index 00000000..fe73bbe2 --- /dev/null +++ b/src/argocd/infrastructure/base/prometheus/templates/traefik-rules.yaml @@ -0,0 +1,21 @@ +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + annotations: + meta.helm.sh/release-name: prometheus + meta.helm.sh/release-namespace: prometheus + labels: + app: kube-prometheus-stack + release: prometheus + name: traefik-alert-rules + namespace: traefik +spec: + groups: + - name: Traefik + rules: + - alert: TooManyRequest + expr: avg(traefik_entrypoint_open_connections{job="traefik-dashboard",namespace="default"}) + > 5 + for: 1m + labels: + severity: critical \ No newline at end of file diff --git a/src/argocd/infrastructure/base/prometheus/values.yaml b/src/argocd/infrastructure/base/prometheus/values.yaml new file mode 100644 index 00000000..b8f6c54d --- /dev/null +++ b/src/argocd/infrastructure/base/prometheus/values.yaml @@ -0,0 +1,67 @@ +kube-prometheus-stack: + prometheus-node-exporter: + hostRootFsMount: false + + kubeApiServer: + enabled: true + tlsConfig: + serverName: kubernetes + insecureSkipVerify: true + + prometheus: + prometheusSpec: + podMetadata: + annotations: + "consul.hashicorp.com/connect-inject": 'true' + "consul.hashicorp.com/connect-service": "prometheus-kube-prometheus-prometheus" + "consul.hashicorp.com/transparent-proxy": "true" + ingress: + enabled: true + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web, websecure + traefik.ingress.kubernetes.io/router.middlewares: default-redirect-http@kubernetescrd + hosts: + - prometheus.infrastructure.k8s.local + path: / + pathType: Prefix + tls: + - secretName: prometheus-cert + hosts: + - prometheus.infrastructure.k8s.local + + grafana: + defaultDashboardsEnabled: true + sidecar: + dashboards: + searchNamespace: ALL + enabled: true + label: grafana_dashboard + folder: /tmp/dashboards + provider: + foldersFromFilesStructure: true + annotations: + k8s-sidecar-target-directory: /tmp/dashboards/Infrastructure/Kubernetes + ingress: + enabled: true + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web, websecure + traefik.ingress.kubernetes.io/router.middlewares: default-redirect-http@kubernetescrd + hosts: + - grafana.infrastructure.k8s.local + path: / + pathType: Prefix + tls: + - secretName: prometheus-cert + hosts: + - grafana.infrastructure.k8s.local + additionalDataSources: + - name: Loki + access: proxy + orgId: 1 + type: loki + url: http://loki.loki.svc.cluster.local:3100 + version: 1 + plugins: + - grafana-piechart-panel + - digrich-bubblechart-panel + - grafana-clock-panel diff --git a/src/argocd/infrastructure/root/argocd/Chart.lock b/src/argocd/infrastructure/root/argocd/Chart.lock new file mode 100644 index 00000000..4574204e --- /dev/null +++ b/src/argocd/infrastructure/root/argocd/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: argo-cd + repository: https://argoproj.github.io/argo-helm + version: 3.6.10 +digest: sha256:3f902ed5a71c88a8027115cf29b4f3672dfce8535c622ed15e78b4f662806d81 +generated: "2021-06-27T18:59:48.955673+02:00" diff --git a/src/argocd/infrastructure/root/argocd/Chart.yaml b/src/argocd/infrastructure/root/argocd/Chart.yaml new file mode 100644 index 00000000..88ab2953 --- /dev/null +++ b/src/argocd/infrastructure/root/argocd/Chart.yaml @@ -0,0 +1,7 @@ +apiVersion: v2 +name: argocd +version: 1.0.0 +dependencies: + - name: argo-cd + version: 3.6.10 + repository: https://argoproj.github.io/argo-helm \ No newline at end of file diff --git a/src/argocd/infrastructure/root/argocd/values.yaml b/src/argocd/infrastructure/root/argocd/values.yaml new file mode 100644 index 00000000..de7000e7 --- /dev/null +++ b/src/argocd/infrastructure/root/argocd/values.yaml @@ -0,0 +1,161 @@ +argocd: + global: + image: + tag: v2.0.3 + server: + # resources: + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 50m + # memory: 64Mi + ingress: + enabled: true + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web, websecure + traefik.ingress.kubernetes.io/router.middlewares: default-redirect-http@kubernetescrd + labels: {} + hosts: + - argo.k8s.local + paths: + - / + extraPaths: + - path: /* + pathType: Prefix + backend: + service: + name: argocd-server + port: + number: 443 + tls: + - secretName: argocd-tls-certificate + hosts: + - argo.k8s.local + https: true + ingressGrpc: + enabled: true + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web, websecure + traefik.ingress.kubernetes.io/router.middlewares: default-redirect-http@kubernetescrd + labels: {} + hosts: + - argo.k8s.local + paths: + - / + extraPaths: + - path: /* + pathType: Prefix + backend: + service: + name: argocd-server + port: + number: 443 + tls: + - secretName: argocd-tls-certificate + hosts: + - argo.k8s.local + https: true + extraArgs: [] + # - --insecure + certificate: + enabled: true + domain: argo.k8s.local + issuer: + kind: ClusterIssuer + name: selfsigned-ca-issuer + additionalHosts: [] + secretName: argocd-tls-certificate + config: + url: https://argo.k8s.local + repositories: | + - type: helm + name: stable + url: https://charts.helm.sh/stable + - type: helm + name: argo-cd + url: https://argoproj.github.io/argo-helm + - type: helm + name: cert-manager + url: https://charts.jetstack.io + - type: helm + name: traefik + url: https://helm.traefik.io/traefik + resource.customizations: | + argoproj.io/Application: + health.lua: | + hs = {} + hs.status = "Progressing" + hs.message = "" + if obj.status ~= nil then + if obj.status.health ~= nil then + hs.status = obj.status.health.status + if obj.status.health.message ~= nil then + hs.message = obj.status.health.message + end + end + end + return hs + jaegertracing.io/Jaeger: + health.lua: | + hs = {} + hs.status = "Healthy" + return hs + admissionregistration.k8s.io/ValidatingWebhookConfiguration: + ignoreDifferences: | + jsonPointers: + - /webhooks/0/clientConfig/caBundle + - /webhooks/1/clientConfig/caBundle + - /webhooks/2/clientConfig/caBundle + - /webhooks/3/clientConfig/caBundle + - /webhooks/4/clientConfig/caBundle + - /webhooks/5/clientConfig/caBundle + - /webhooks/6/clientConfig/caBundle + - /webhooks/7/clientConfig/caBundle + - /webhooks/8/clientConfig/caBundle + - /webhooks/9/clientConfig/caBundle + admissionregistration.k8s.io/MutatingWebhookConfiguration: + ignoreDifferences: | + jsonPointers: + - /webhooks/0/clientConfig/caBundle + - /webhooks/1/clientConfig/caBundle + - /webhooks/2/clientConfig/caBundle + - /webhooks/3/clientConfig/caBundle + - /webhooks/4/clientConfig/caBundle + - /webhooks/5/clientConfig/caBundle + - /webhooks/6/clientConfig/caBundle + - /webhooks/7/clientConfig/caBundle + + controller: + # resources: + # limits: + # cpu: 500m + # memory: 512Mi + # requests: + # cpu: 250m + # memory: 256Mi + dex: + enabled: false + # resources: + # limits: + # cpu: 50m + # memory: 64Mi + # requests: + # cpu: 10m + # memory: 32Mi + redis: + resources: + # limits: + # cpu: 200m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 64Mi + repoServer: + resources: + # limits: + # cpu: 50m + # memory: 128Mi + # requests: + # cpu: 10m + # memory: 64Mi \ No newline at end of file diff --git a/src/argocd/infrastructure/root/cert-manager/Chart.lock b/src/argocd/infrastructure/root/cert-manager/Chart.lock new file mode 100644 index 00000000..170fe9e3 --- /dev/null +++ b/src/argocd/infrastructure/root/cert-manager/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: cert-manager + repository: https://charts.jetstack.io + version: v1.4.0 +digest: sha256:acaf0ad6d57efc0273aa2c62ae479981c3d6fd9f96fe17b67403019a0bfc01d1 +generated: "2021-06-27T19:45:52.0545515+02:00" diff --git a/src/argocd/infrastructure/root/cert-manager/Chart.yaml b/src/argocd/infrastructure/root/cert-manager/Chart.yaml new file mode 100644 index 00000000..4487b1b7 --- /dev/null +++ b/src/argocd/infrastructure/root/cert-manager/Chart.yaml @@ -0,0 +1,7 @@ +apiVersion: v2 +name: cert-manager +version: 1.0.0 +dependencies: + - name: cert-manager + version: v1.4.0 + repository: https://charts.jetstack.io \ No newline at end of file diff --git a/src/argocd/infrastructure/root/cert-manager/templates/cluster-issuer.yaml b/src/argocd/infrastructure/root/cert-manager/templates/cluster-issuer.yaml new file mode 100644 index 00000000..2cb7fd34 --- /dev/null +++ b/src/argocd/infrastructure/root/cert-manager/templates/cluster-issuer.yaml @@ -0,0 +1,8 @@ +apiVersion: cert-manager.io/v1 +kind: ClusterIssuer +metadata: + name: selfsigned-ca-issuer + namespace: cert-manager +spec: + ca: + secretName: ca-key-pair \ No newline at end of file diff --git a/src/argocd/infrastructure/root/cert-manager/values.yaml b/src/argocd/infrastructure/root/cert-manager/values.yaml new file mode 100644 index 00000000..914d041e --- /dev/null +++ b/src/argocd/infrastructure/root/cert-manager/values.yaml @@ -0,0 +1,2 @@ +cert-manager: + installCRDs: false \ No newline at end of file diff --git a/src/argocd/infrastructure/root/root-app/Chart.yaml b/src/argocd/infrastructure/root/root-app/Chart.yaml new file mode 100644 index 00000000..303962b4 --- /dev/null +++ b/src/argocd/infrastructure/root/root-app/Chart.yaml @@ -0,0 +1,3 @@ +apiVersion: v2 +name: root +version: 1.0.0 \ No newline at end of file diff --git a/src/argocd/infrastructure/root/root-app/templates/argocd.yaml b/src/argocd/infrastructure/root/root-app/templates/argocd.yaml new file mode 100644 index 00000000..c77f1558 --- /dev/null +++ b/src/argocd/infrastructure/root/root-app/templates/argocd.yaml @@ -0,0 +1,24 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: argocd + namespace: argocd + annotations: + argocd.argoproj.io/sync-wave: "-3" + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + destination: + namespace: argocd + server: {{ .Values.spec.destination.server }} + project: default + source: + path: src/argocd/infrastructure/root/argocd + repoURL: {{ .Values.spec.source.repoURL }} + targetRevision: {{ .Values.spec.source.targetRevision }} + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true \ No newline at end of file diff --git a/src/argocd/infrastructure/root/root-app/templates/cert-manager.yaml b/src/argocd/infrastructure/root/root-app/templates/cert-manager.yaml new file mode 100644 index 00000000..fd3c1528 --- /dev/null +++ b/src/argocd/infrastructure/root/root-app/templates/cert-manager.yaml @@ -0,0 +1,24 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: cert-manager + namespace: argocd + annotations: + argocd.argoproj.io/sync-wave: "-3" + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + destination: + namespace: cert-manager + server: {{ .Values.spec.destination.server }} + project: default + source: + path: src/argocd/infrastructure/root/cert-manager + repoURL: {{ .Values.spec.source.repoURL }} + targetRevision: {{ .Values.spec.source.targetRevision }} + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true \ No newline at end of file diff --git a/src/argocd/infrastructure/root/root-app/templates/root-app.yaml b/src/argocd/infrastructure/root/root-app/templates/root-app.yaml new file mode 100644 index 00000000..d4f5b16b --- /dev/null +++ b/src/argocd/infrastructure/root/root-app/templates/root-app.yaml @@ -0,0 +1,20 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: root + namespace: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + destination: + server: {{ .Values.spec.destination.server }} + namespace: default + project: default + source: + path: src/argocd/infrastructure/root/root-app + repoURL: {{ .Values.spec.source.repoURL }} + targetRevision: {{ .Values.spec.source.targetRevision }} + syncPolicy: + automated: + prune: true + selfHeal: true \ No newline at end of file diff --git a/src/argocd/infrastructure/root/root-app/templates/traefik.yaml b/src/argocd/infrastructure/root/root-app/templates/traefik.yaml new file mode 100644 index 00000000..a9c13eb7 --- /dev/null +++ b/src/argocd/infrastructure/root/root-app/templates/traefik.yaml @@ -0,0 +1,24 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: traefik + namespace: argocd + annotations: + argocd.argoproj.io/sync-wave: "-3" + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + destination: + namespace: traefik + server: {{ .Values.spec.destination.server }} + project: default + source: + path: src/argocd/infrastructure/root/traefik + repoURL: {{ .Values.spec.source.repoURL }} + targetRevision: {{ .Values.spec.source.targetRevision }} + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true \ No newline at end of file diff --git a/src/argocd/infrastructure/root/root-app/values.yaml b/src/argocd/infrastructure/root/root-app/values.yaml new file mode 100644 index 00000000..04a67134 --- /dev/null +++ b/src/argocd/infrastructure/root/root-app/values.yaml @@ -0,0 +1,6 @@ +spec: + destination: + server: https://kubernetes.default.svc + source: + repoURL: https://github.com/bravecobra/k8s-dev-infrastructure + targetRevision: feature/argocd \ No newline at end of file diff --git a/src/argocd/infrastructure/root/traefik/Chart.lock b/src/argocd/infrastructure/root/traefik/Chart.lock new file mode 100644 index 00000000..3a9302da --- /dev/null +++ b/src/argocd/infrastructure/root/traefik/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: traefik + repository: https://helm.traefik.io/traefik + version: 9.19.2 +digest: sha256:8f23541e7f7581b8e928ea7a58b10619d50023fd6e58a66e55d4da1782e2ecf6 +generated: "2021-06-27T20:22:47.3922475+02:00" diff --git a/src/argocd/infrastructure/root/traefik/Chart.yaml b/src/argocd/infrastructure/root/traefik/Chart.yaml new file mode 100644 index 00000000..7bc64e31 --- /dev/null +++ b/src/argocd/infrastructure/root/traefik/Chart.yaml @@ -0,0 +1,7 @@ +apiVersion: v2 +name: traefik +version: 1.0.0 +dependencies: + - name: traefik + version: 9.19.2 + repository: https://helm.traefik.io/traefik \ No newline at end of file diff --git a/src/argocd/infrastructure/root/traefik/templates/cert-store.yaml b/src/argocd/infrastructure/root/traefik/templates/cert-store.yaml new file mode 100644 index 00000000..a8bab184 --- /dev/null +++ b/src/argocd/infrastructure/root/traefik/templates/cert-store.yaml @@ -0,0 +1,9 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: TLSStore +metadata: + name: default + namespace: traefik + +spec: + defaultCertificate: + secretName: traefik-cert \ No newline at end of file diff --git a/src/argocd/infrastructure/root/traefik/templates/dashboard.yaml b/src/argocd/infrastructure/root/traefik/templates/dashboard.yaml new file mode 100644 index 00000000..ad978671 --- /dev/null +++ b/src/argocd/infrastructure/root/traefik/templates/dashboard.yaml @@ -0,0 +1,17 @@ +# dashboard.yaml +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: dashboard + namespace: traefik +spec: + entryPoints: + - websecure + routes: + - match: Host(`traefik.infrastructure.k8s.local`) && (PathPrefix(`/dashboard`) || PathPrefix(`/api`)) + kind: Rule + services: + - name: api@internal + kind: TraefikService + tls: + - secretName: traefik-cert diff --git a/src/argocd/infrastructure/root/traefik/templates/http-redirect-middleware.yaml b/src/argocd/infrastructure/root/traefik/templates/http-redirect-middleware.yaml new file mode 100644 index 00000000..3e65399a --- /dev/null +++ b/src/argocd/infrastructure/root/traefik/templates/http-redirect-middleware.yaml @@ -0,0 +1,7 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: Middleware +metadata: + name: redirect-http +spec: + redirectScheme: + scheme: https \ No newline at end of file diff --git a/src/argocd/infrastructure/root/traefik/templates/traefik-cert.yaml b/src/argocd/infrastructure/root/traefik/templates/traefik-cert.yaml new file mode 100644 index 00000000..ed22fc71 --- /dev/null +++ b/src/argocd/infrastructure/root/traefik/templates/traefik-cert.yaml @@ -0,0 +1,16 @@ +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: traefik-cert + namespace: traefik +spec: + secretName: traefik-cert + issuerRef: + name: selfsigned-ca-issuer + kind: ClusterIssuer + commonName: traefik-cert + dnsNames: + - k8s.local + - '*.k8s.local' + - '*.infrastructure.k8s.local' + - '*.login.k8s.local' \ No newline at end of file diff --git a/src/argocd/infrastructure/root/traefik/values.yaml b/src/argocd/infrastructure/root/traefik/values.yaml new file mode 100644 index 00000000..956d7c80 --- /dev/null +++ b/src/argocd/infrastructure/root/traefik/values.yaml @@ -0,0 +1,90 @@ +traefik: + dashboard: + enabled: true + domain: traefik.infrastructure.k8s.local + # deployment: + # podAnnotations: + # "consul.hashicorp.com/connect-inject": "true" + # "consul.hashicorp.com/connect-service-port": "8000" + # "consul.hashicorp.com/transparent-proxy": "true" + additionalArguments: + - "--metrics.prometheus=true" + - "--tracing.jaeger=true" + - "--tracing.jaeger.samplingServerURL=http://jaeger-agent.jaeger.svc:5778/sampling" + - "--tracing.jaeger.localAgentHostPort=jaeger-agent.jaeger.svc:6831" + - "--serversTransport.insecureSkipVerify=true" + - "--providers.kubernetesingress=true" + - "--providers.kubernetesingress.ingressendpoint" + - "--providers.kubernetesingress.ingressendpoint.ip=172.18.0.2" + + logs: + access: + enabled: true + format: json + general: + format: json + level: INFO + + kubernetes: + namespaces: + - default + - kube-system + + ports: + websecure: + tls: + enabled: true + + volumes: + - name: traefik-cert + mountPath: "/certs" + type: secret + + ingressClass: + # # true is not unit-testable yet, pending https://github.com/rancher/helm-unittest/pull/12 + enabled: true + isDefaultClass: true + # # Use to force a networking.k8s.io API Version for certain CI/CD applications. E.g. "v1beta1" + fallbackApiVersion: "v1beta1" + + ingressRoute: + dashboard: + enabled: true + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web, websecure + traefik.ingress.kubernetes.io/router.middlewares: default-redirect-http@kubernetescrd + providers: + kubernetesCRD: + enabled: true + namespaces: [] + kubernetesIngress: + enabled: true + namespaces: [] + + service: + enabled: true + type: ClusterIP + spec: + # externalTrafficPolicy: Cluster + # clusterIP: 172.18.0.2 + externalIPs: [ + 172.18.0.2 + ] + + tls: + certificates: + - certFile: /certs/tls.crt + keyFile: /certs/tls.key + stores: + default: + defaultCertificate: + certFile: /certs/tls.crt + keyFile: /certs/tls.key + + # consul: + # enabled: true + # endpoint: "consul-consul-server:8500" + # datacenter: datacenter1 + # watch: true + # exposedByDefault: true + # prefix: traefik diff --git a/src/argocd/install.ps1 b/src/argocd/install.ps1 new file mode 100644 index 00000000..9377436f --- /dev/null +++ b/src/argocd/install.ps1 @@ -0,0 +1,39 @@ +## setup CA Root from mkcert +Copy-Item $env:LOCALAPPDATA\mkcert\rootCA.pem ./src/certs/cacerts.crt +Copy-Item $env:LOCALAPPDATA\mkcert\rootCA-key.pem ./src/certs/cacerts.key +kubectl create secret tls ca-key-pair --namespace=cert-manager --cert=./src/certs/cacerts.crt --key=./src/certs/cacerts.key --dry-run=client -o yaml > ./src/argocd/argo/cert-manager/crds/cacerts.yaml + +## Install cert-manager +helm repo add jetstack https://charts.jetstack.io +helm repo add argo https://argoproj.github.io/argo-helm +helm repo add traefik https://helm.traefik.io/traefik +helm repo update + +kubectl create namespace cert-manager +kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.3.1/cert-manager.crds.yaml +helm upgrade --install --wait cert-manager jetstack/cert-manager -n cert-manager --set installCRDs=false + +kubectl apply -f ./src/argocd/argo/cert-manager/crds/cacerts.yaml +kubectl apply -f ./src/argocd/argo/cert-manager/crds/cluster-issuer.yaml +Start-Sleep -Seconds 10 + +## install traefik as ingress-controller +kubectl create namespace traefik +helm upgrade --install --wait traefik traefik/traefik -n traefik -f ./src/argocd/argo/traefik/traefik-values.yaml + +kubectl apply -f ./src/argocd/argo/traefik/crds/ + +## install argocd +kubectl create namespace argocd +helm upgrade --install --wait argocd argo/argo-cd -n argocd -f ./src/argocd/argo/argo-values.yaml + +kubectl apply -f ./src/argocd/infrastructure/base/coredns/coredns.yaml + +$argopass = kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d +argocd login argo.k8s.local:443 --grpc-web --username admin --password $argopass +argocd app create root --grpc-web --repo=https://github.com/bravecobra/k8s-dev-infrastructure --path=src/argocd/infrastructure/root/root-app --revision=develop --dest-server=https://kubernetes.default.svc --dest-namespace=default --self-heal --auto-prune --sync-option CreateNamespace=true --sync-policy=automated +argocd app create infrastructure --grpc-web --repo=https://github.com/bravecobra/k8s-dev-infrastructure --path=src/argocd/infrastructure/base/infrastructure-app --revision=develop --dest-server=https://kubernetes.default.svc --dest-namespace=infrastructure --self-heal --auto-prune --sync-option CreateNamespace=true --sync-policy=automated + +# $elasticpass = kubectl -n elasticsearch get secret elastic-es-es-elastic-user -o jsonpath="{.data.elastic}" | base64 -d + +Write-Host "Argo admin pass: $argopass" diff --git a/src/clusters/test-traefik-ingress/003-ingressroute.yaml b/src/clusters/test-traefik-ingress/003-ingressroute.yaml index 3bae48dd..6c489998 100644 --- a/src/clusters/test-traefik-ingress/003-ingressroute.yaml +++ b/src/clusters/test-traefik-ingress/003-ingressroute.yaml @@ -18,8 +18,7 @@ metadata: namespace: kube-system spec: externalIPs: - - 172.18.0.4 - - 192.168.49.2 + - 172.18.0.2 externalTrafficPolicy: Cluster ports: - name: web diff --git a/src/clusters/test-traefik-ingress/004-test-deploy.yaml b/src/clusters/test-traefik-ingress/004-test-deploy.yaml index 8942ee89..c04fc92e 100644 --- a/src/clusters/test-traefik-ingress/004-test-deploy.yaml +++ b/src/clusters/test-traefik-ingress/004-test-deploy.yaml @@ -61,5 +61,4 @@ spec: - path: /bar backend: serviceName: bar-service - servicePort: 5678 ---- + servicePort: 5678 \ No newline at end of file diff --git a/src/clusters/test-traefik-ingress/005-testdeploy-route.yaml b/src/clusters/test-traefik-ingress/005-testdeploy-route.yaml index dae8fd9f..53d79bad 100644 --- a/src/clusters/test-traefik-ingress/005-testdeploy-route.yaml +++ b/src/clusters/test-traefik-ingress/005-testdeploy-route.yaml @@ -1,33 +1,33 @@ -# apiVersion: traefik.containo.us/v1alpha1 -# kind: IngressRoute -# metadata: -# name: "testdeploy-foo-ingressroute" -# namespace: default -# spec: -# entryPoints: -# - web -# routes: -# - match: PathPrefix(`/foo`) -# kind: Rule -# namespace: infrastructure -# services: -# - name: foo-service -# port: 5678 -# path: / -# --- -# apiVersion: traefik.containo.us/v1alpha1 -# kind: IngressRoute -# metadata: -# name: "testdeploy-bar-ingressroute" -# namespace: default -# spec: -# entryPoints: -# - web -# routes: -# - match: PathPrefix(`/bar`) -# kind: Rule -# namespace: infrastructure -# services: -# - name: bar-service -# port: 5678 -# path: / +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: "testdeploy-foo-ingressroute" + namespace: default +spec: + entryPoints: + - web + routes: + - match: PathPrefix(`/foo`) + kind: Rule + namespace: infrastructure + services: + - name: foo-service + port: 5678 + path: / +--- +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: "testdeploy-bar-ingressroute" + namespace: default +spec: + entryPoints: + - web + routes: + - match: PathPrefix(`/bar`) + kind: Rule + namespace: infrastructure + services: + - name: bar-service + port: 5678 + path: / diff --git a/src/skaffold/skaffold.yaml b/src/skaffold/skaffold.yaml index cf75501e..b52e478e 100644 --- a/src/skaffold/skaffold.yaml +++ b/src/skaffold/skaffold.yaml @@ -2,7 +2,6 @@ apiVersion: skaffold/v2beta16 kind: Config metadata: name: devinfra -build: profiles: - name: minikube activation: