diff --git a/gitops/argocd/charts/dora/github/Chart.yaml b/gitops/argocd/charts/dora/github/Chart.yaml new file mode 100644 index 0000000000..b82fc33002 --- /dev/null +++ b/gitops/argocd/charts/dora/github/Chart.yaml @@ -0,0 +1,26 @@ +--- +# Copyright (C) Nicolas Lamirault +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v2 +type: application +name: dora-github +version: 1.0.0 +appVersion: 1.0.0 +dependencies: +- name: opentelemetry-collector + repository: https://open-telemetry.github.io/opentelemetry-helm-charts + version: 0.108.0 diff --git a/gitops/argocd/charts/dora/github/templates/github-credentials.yaml b/gitops/argocd/charts/dora/github/templates/github-credentials.yaml new file mode 100644 index 0000000000..844f73b39b --- /dev/null +++ b/gitops/argocd/charts/dora/github/templates/github-credentials.yaml @@ -0,0 +1,37 @@ +# Copyright (C) Nicolas Lamirault +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +--- +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/external-secrets.io/externalsecret_v1beta1.json +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + labels: + {{- include "opentelemetry-collector.labels" (index $.Subcharts "opentelemetry-collector") | nindent 4 }} + name: otel-github-credentials + namespace: {{ .Release.Namespace }} +spec: + refreshInterval: "1h" + secretStoreRef: + kind: ClusterSecretStore + name: akeyless + target: + name: otel-github-credentials + creationPolicy: Owner + data: + - secretKey: OTEL_GITHUB_PAT + remoteRef: + key: OTEL_GITHUB_PAT diff --git a/gitops/argocd/charts/dora/github/values-k3s-homelab.yaml b/gitops/argocd/charts/dora/github/values-k3s-homelab.yaml new file mode 100644 index 0000000000..ef68c1dd75 --- /dev/null +++ b/gitops/argocd/charts/dora/github/values-k3s-homelab.yaml @@ -0,0 +1,24 @@ +--- +# Copyright (C) Nicolas Lamirault +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +opentelemetry-collector: + resources: + limits: + # cpu: 250m + memory: 512Mi + requests: + memory: 100Mi \ No newline at end of file diff --git a/gitops/argocd/charts/dora/github/values.yaml b/gitops/argocd/charts/dora/github/values.yaml new file mode 100644 index 0000000000..67a373dc70 --- /dev/null +++ b/gitops/argocd/charts/dora/github/values.yaml @@ -0,0 +1,83 @@ +--- +# Copyright (C) Nicolas Lamirault +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +opentelemetry-collector: + additionalLabels: + portefaix.xyz/version: v0.54.0 + + mode: "deployment" + + image: + repository: otel/opentelemetry-collector-contrib + + extraEnvsFrom: + - name: OTEL_GITHUB_PAT + valueFrom: + secretKeyRef: + name: otel-github-credentials + key: OTEL_GITHUB_PAT + + config: + extensions: + health_check: + endpoint: ${env:MY_POD_IP}:13133 + bearertokenauth/github: + token: ${env:OTEL_GITHUB_PAT} + + receivers: + github/portefaix: + initial_delay: 1s + collection_interval: 60s + scrapers: + github: + auth: + authenticator: bearertokenauth/github + github_org: portefaix + search_query: org:portefaix + metrics: + vcs.repository.contributor.count: + enabled: true + git.repository.cve.count: + enabled: true + + processors: + resource/portefaix: + attributes: + - key: team.name + value: portefaix + action: upsert + + exporters: + debug: + verbosity: detailed + # prometheus: + # endpoint: 0.0.0.0:9090 + + service: + extensions: + - health_check + - bearertokenauth/github + pipelines: + metrics: + receivers: + - github/portefaix + processors: + - resource/portefaix + exporters: + - debug + - otlp + # - prometheus