Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(grafana): move grafana.ini to hr #2765

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

jazzlyn
Copy link
Collaborator

@jazzlyn jazzlyn commented Apr 3, 2024

No description provided.

Copy link

sonarqubecloud bot commented Apr 3, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@tyriis-automation
Copy link
Contributor

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ EDITORCONFIG editorconfig-checker 3 0 0.02s
✅ REPOSITORY gitleaks yes no 2.31s
✅ YAML prettier 3 0 0.8s
✅ YAML yamllint 3 0 0.34s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@tyriis-automation
Copy link
Contributor

--- HelmRelease: observability/grafana ConfigMap: observability/grafana

+++ HelmRelease: observability/grafana ConfigMap: observability/grafana

@@ -10,23 +10,33 @@

     app.kubernetes.io/managed-by: Helm
 data:
   plugins: grafana-piechart-panel,grafana-worldmap-panel,grafana-clock-panel,grafana-github-datasource
   grafana.ini: |
     [analytics]
     check_for_updates = true
+    [auth.google]
+    allow_sign_up = true
+    allowed_domains = techtales.io
+    auth_url = https://accounts.google.com/o/oauth2/auth
+    enabled = true
+    scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
+    token_url = https://accounts.google.com/o/oauth2/token
     [grafana_net]
     url = https://grafana.net
     [log]
     mode = console
     [paths]
     data = /var/lib/grafana/
     logs = /var/log/grafana
     plugins = /var/lib/grafana/plugins
     provisioning = /etc/grafana/provisioning
     [server]
     domain = grafana.techtales.io
+    root_url = https://grafana.techtales.io
+    [users]
+    auto_assign_org_role = Admin
   download_dashboards.sh: |
     #!/usr/bin/env sh
     set -euf
 
     curl -skf \
     --connect-timeout 60 \
--- HelmRelease: observability/grafana Deployment: observability/grafana

+++ HelmRelease: observability/grafana Deployment: observability/grafana

@@ -147,25 +147,21 @@

             type: RuntimeDefault
         volumeMounts:
         - name: config
           mountPath: /etc/grafana/grafana.ini
           subPath: grafana.ini
         - name: grafana-contactpoints
-          mountPath: /etc/grafana/alerting/
+          mountPath: /etc/grafana/alerting/contactpoints.yaml
           subPath: contactpoints.yaml
           readOnly: true
         - name: grafana-datasources
-          mountPath: /etc/grafana/datasources/
+          mountPath: /etc/grafana/datasources/datasources.yaml
           subPath: datasources.yaml
           readOnly: true
-        - name: grafana-ini
-          mountPath: /etc/grafana/grafana.ini
-          subPath: grafana.ini
-          readOnly: true
         - name: grafana-policies
-          mountPath: /etc/grafana/alerting/
+          mountPath: /etc/grafana/alerting/policies.yaml
           subPath: policies.yaml
           readOnly: true
         - name: storage
           mountPath: /var/lib/grafana
         - name: sc-dashboard-volume
           mountPath: /tmp/dashboards
@@ -209,12 +205,20 @@

         - name: GF_PATHS_LOGS
           value: /var/log/grafana
         - name: GF_PATHS_PLUGINS
           value: /var/lib/grafana/plugins
         - name: GF_PATHS_PROVISIONING
           value: /etc/grafana/provisioning
+        - name: GF_DATE_FORMATS_USE_BROWSER_LOCALE
+          value: 'true'
+        - name: GF_EXPLORE_ENABLED
+          value: 'true'
+        - name: GF_LOG_LEVEL
+          value: info
+        - name: GF_PANELS_DISABLE_SANITIZE_HTML
+          value: 'true'
         - name: TZ
           value: ${SETTING_TZ}
         envFrom:
         - secretRef:
             name: grafana-env
             optional: false
@@ -236,15 +240,12 @@

       - name: grafana-contactpoints
         configMap:
           name: grafana-contactpoints
       - name: grafana-datasources
         configMap:
           name: grafana-datasources
-      - name: grafana-ini
-        configMap:
-          name: grafana-ini
       - name: grafana-policies
         configMap:
           name: grafana-policies
       - name: dashboards-default
         configMap:
           name: grafana-dashboards-default

@tyriis-automation
Copy link
Contributor

--- kubernetes/talos-flux/apps/observability/grafana/app Kustomization: flux-system/apps-grafana HelmRelease: observability/grafana

+++ kubernetes/talos-flux/apps/observability/grafana/app Kustomization: flux-system/apps-grafana HelmRelease: observability/grafana

@@ -37,36 +37,47 @@

       default:
         Node Exporter for Prometheus Dashboard:
           datasource: Prometheus
           gnetId: 11074
           revision: 9
     env:
+      GF_DATE_FORMATS_USE_BROWSER_LOCALE: 'true'
+      GF_EXPLORE_ENABLED: 'true'
+      GF_LOG_LEVEL: info
+      GF_PANELS_DISABLE_SANITIZE_HTML: 'true'
       TZ: ${SETTING_TZ}
     envFromSecrets:
     - name: grafana-env
     extraConfigmapMounts:
     - configMap: grafana-contactpoints
-      mountPath: /etc/grafana/alerting/
+      mountPath: /etc/grafana/alerting/contactpoints.yaml
       name: grafana-contactpoints
       readOnly: true
       subPath: contactpoints.yaml
     - configMap: grafana-datasources
-      mountPath: /etc/grafana/datasources/
+      mountPath: /etc/grafana/datasources/datasources.yaml
       name: grafana-datasources
       readOnly: true
       subPath: datasources.yaml
-    - configMap: grafana-ini
-      mountPath: /etc/grafana/grafana.ini
-      name: grafana-ini
-      readOnly: true
-      subPath: grafana.ini
     - configMap: grafana-policies
-      mountPath: /etc/grafana/alerting/
+      mountPath: /etc/grafana/alerting/policies.yaml
       name: grafana-policies
       readOnly: true
       subPath: policies.yaml
+    grafana.ini:
+      auth.google:
+        allow_sign_up: true
+        allowed_domains: techtales.io
+        auth_url: https://accounts.google.com/o/oauth2/auth
+        enabled: true
+        scopes: https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
+        token_url: https://accounts.google.com/o/oauth2/token
+      server:
+        root_url: https://grafana.techtales.io
+      users:
+        auto_assign_org_role: Admin
     ingress:
       annotations:
         cert-manager.io/cluster-issuer: letsencrypt-production
         external-dns.alpha.kubernetes.io/target: ${SECRET_CLOUDFLARE_TUNNEL_ID}.cfargotunnel.com
         hajimari.io/enable: 'true'
         hajimari.io/icon: simple-icons:grafana
--- kubernetes/talos-flux/apps/observability/grafana/app Kustomization: flux-system/apps-grafana ConfigMap: observability/grafana-ini

+++ kubernetes/talos-flux/apps/observability/grafana/app Kustomization: flux-system/apps-grafana ConfigMap: observability/grafana-ini

@@ -1,45 +0,0 @@

----
-apiVersion: v1
-data:
-  grafana.ini: |
-    ;https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/
-    [analytics]
-    check_for_updates = false
-    [auth.google]
-    enabled = true
-    allow_sign_up = true
-    allowed_domains = techtales.io
-    auth_url = https://accounts.google.com/o/oauth2/auth
-    scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
-    token_url = https://accounts.google.com/o/oauth2/token
-    [date_formats]
-    use_browser_locale = true
-    [explore]
-    enabled = true
-    [log]
-    mode = console
-    level = info
-    [panels]
-    disable_sanitize_html = true
-    [paths]
-    data = /var/lib/grafana/
-    logs = /var/log/grafana
-    plugins = /var/lib/grafana/plugins
-    provisioning = /etc/grafana/provisioning
-    [server]
-    domain = grafana.techtales.io
-    root_url = https://grafana.techtales.io
-    [users]
-    auto_assign_org_role = Admin
-kind: ConfigMap
-metadata:
-  annotations:
-    kustomize.toolkit.fluxcd.io/substitute: disabled
-  labels:
-    app.kubernetes.io/instance: grafana
-    app.kubernetes.io/name: grafana
-    kustomize.toolkit.fluxcd.io/name: apps-grafana
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: grafana-ini
-  namespace: observability
-

@jazzlyn jazzlyn merged commit 3eda6bf into main Apr 3, 2024
15 checks passed
@jazzlyn jazzlyn deleted the feature/grafana-configmaps-refinement branch April 3, 2024 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant