diff --git a/argocd/applications/gitlab-production/prometheus-application.yaml b/argocd/applications/gitlab-production/prometheus-application.yaml new file mode 100644 index 0000000..fb03995 --- /dev/null +++ b/argocd/applications/gitlab-production/prometheus-application.yaml @@ -0,0 +1,93 @@ +# Declare the application to manage cert-manager +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: gitlab-production-prometheus + namespace: argocd +spec: + revisionHistoryLimit: 2 + project: default + source: + chart: kube-prometheus-stack + repoURL: https://prometheus-community.github.io/helm-charts + targetRevision: v41.3.2 + helm: + releaseName: prometheus + # The crds must be manually applied to avoid the following error: + # one or more objects failed to apply, reason: CustomResourceDefinition.apiextensions.k8s.io "prometheuses.monitoring.coreos.com" is invalid: metadata.annotations: Too long: must have at most 262144 bytes + # it should be possible to fix this error + # The commands to run can be found on the operator page: + # https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack + skipCrds: true + values: | + + alertmanager: + enabled: true # Temporary for tests + grafana: + enabled: true # Temporary before federation with pergamon + service: + port: 3000 + type: LoadBalancer + loadBalancerIP: 10.224.0.100 + annotations: + service.beta.kubernetes.io/azure-load-balancer-internal: "true" + prometheus: + service: + annotations: + type: LoadBalancer + loadBalancerIP: 10.224.0.100 + annotations: + service.beta.kubernetes.io/azure-load-balancer-internal: "true" + prometheusSpec: + storageSpec: # Make the data persistent across the redeployments + volumeClaimTemplate: + spec: + storageClassName: default + resources: + requests: + storage: 10Gi + podMonitorSelectorNilUsesHelmValues: false + serviceMonitorSelectorNilUsesHelmValues: false + prometheusExternalLabelName: euwest_gitlab_production + externalLabels: + environment: production + infrastructure: kubernetes + domain: production + cluster: euwest-gitlab-production + thanos: + # thanos-objstore-config-secret is installed in namespace cattle-monitoring-system + # see k8s-private-data:archive-production/thanos-objstore-config-secret.yaml. And + # https://prometheus-operator.dev/docs/operator/thanos/#configuring-thanos-object-storage + objectStorageConfig: + key: thanos.yaml + name: thanos-objstore-config-secret + thanosIngress: + enabled: true + ingressClassName: nginx + hosts: ["gitlab-thanos.internal.softwareheritage.org"] + loadBalancerIP: 10.224.0.100 + pathType: Prefix + annotations: + kubernetes.io/tls-acme: "true" + nginx.ingress.kubernetes.io/backend-protocol: GRPC + destination: + server: https://192.168.200.4 + namespace: monitoring + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - RespectIgnoreDifferences=true + ignoreDifferences: + - group: '*' + kind: Service + name: prometheus-kube-prometheus-kube-controller-manager + jqPathExpressions: + - .metadata.labels."app.kubernetes.io/instance" + - .spec.ports[] | select(.name == "http-metrics") + - group: '*' + kind: CustomResourceDefinition + name: prometheuses.monitoring.coreos.com + jqPathExpressions: + - .metadata.annotations."controller-gen.kubebuilder.io/version"