diff --git a/apps/system/grafana/.gitignore b/apps/system/grafana/.gitignore new file mode 100644 index 0000000..719aed9 --- /dev/null +++ b/apps/system/grafana/.gitignore @@ -0,0 +1,2 @@ +requirements.lock +charts/ diff --git a/apps/system/grafana/Chart.yaml b/apps/system/grafana/Chart.yaml new file mode 100644 index 0000000..7881fd7 --- /dev/null +++ b/apps/system/grafana/Chart.yaml @@ -0,0 +1,2 @@ +name: grafana +version: 0.1 diff --git a/apps/system/grafana/requirements.yaml b/apps/system/grafana/requirements.yaml new file mode 100644 index 0000000..e7073fb --- /dev/null +++ b/apps/system/grafana/requirements.yaml @@ -0,0 +1,4 @@ +dependencies: + - name: grafana + version: '5.2.1' + repository: '@stable' diff --git a/apps/system/monitoring/templates/datasources.yaml b/apps/system/grafana/templates/datasources.yaml similarity index 100% rename from apps/system/monitoring/templates/datasources.yaml rename to apps/system/grafana/templates/datasources.yaml diff --git a/apps/system/monitoring/templates/grafana-volume.yaml b/apps/system/grafana/templates/grafana-volume.yaml similarity index 100% rename from apps/system/monitoring/templates/grafana-volume.yaml rename to apps/system/grafana/templates/grafana-volume.yaml diff --git a/apps/system/monitoring/templates/grafana-volumeclaim.yaml b/apps/system/grafana/templates/grafana-volumeclaim.yaml similarity index 100% rename from apps/system/monitoring/templates/grafana-volumeclaim.yaml rename to apps/system/grafana/templates/grafana-volumeclaim.yaml diff --git a/apps/system/grafana/values.yaml b/apps/system/grafana/values.yaml new file mode 100644 index 0000000..11114ca --- /dev/null +++ b/apps/system/grafana/values.yaml @@ -0,0 +1,69 @@ +grafana: + nameOverride: grafana + fullnameOverride: grafana + defaultDashboardsEnabled: false + enabled: true + serviceMonitor: + selfMonitor: false + # secret grafana should be created manually + # it should contain: + # admin-user + # admin-password + # GF_AUTH_GITHUB_CLIENT_SECRET + admin: + existingSecret: grafana + envFromSecret: grafana + ingress: + enabled: true + annotations: + cert-manager.io/cluster-issuer: letsencrypt + hosts: + - grafana.gorilych.ru + tls: + - hosts: + - grafana.gorilych.ru + secretName: grafana-tls + persistence: + enabled: true + type: pvc + existingClaim: grafana + resources: + #limits: + # cpu: 100m + # memory: 128Mi + requests: + cpu: 50m + memory: 128Mi + grafana.ini: + server: + root_url: https://grafana.gorilych.ru + auth.github: + enabled: true + allow_sign_up: false + client_id: 6494b9ed39a915d9ac20 + # client_secret: in grafana secret + scopes: user:email,read:org + auth_url: https://github.com/login/oauth/authorize + token_url: https://github.com/login/oauth/access_token + api_url: https://api.github.com/user + dashboardProviders: + dashboardproviders.yaml: + apiVersion: 1 + providers: + - name: default + folder: '' + type: file + disableDeletion: false + editable: true + allowUiUpdates: false + options: + path: /var/lib/grafana/dashboards/default + dashboards: + default: + nginx-ingress: + gnetId: 9614 + revision: 1 + datasource: Prometheus + sidecar: + datasources: + enabled: true diff --git a/apps/system/monitoring/values.yaml b/apps/system/monitoring/values.yaml index b399097..5285eed 100644 --- a/apps/system/monitoring/values.yaml +++ b/apps/system/monitoring/values.yaml @@ -29,68 +29,6 @@ prometheus-operator: resources: requests: storage: 10Gi - grafana: - nameOverride: grafana - fullnameOverride: grafana - defaultDashboardsEnabled: false - enabled: true - serviceMonitor: - selfMonitor: false - # secret grafana should be created manually - # it should contain: - # admin-user - # admin-password - # GF_AUTH_GITHUB_CLIENT_SECRET - admin: - existingSecret: grafana - envFromSecret: grafana - ingress: - enabled: true - annotations: - cert-manager.io/cluster-issuer: letsencrypt - hosts: - - grafana.gorilych.ru - tls: - - hosts: - - grafana.gorilych.ru - secretName: grafana-tls - persistence: - enabled: true - type: pvc - existingClaim: grafana - grafana.ini: - server: - root_url: https://grafana.gorilych.ru - auth.github: - enabled: true - allow_sign_up: false - client_id: 6494b9ed39a915d9ac20 - # client_secret: in grafana secret - scopes: user:email,read:org - auth_url: https://github.com/login/oauth/authorize - token_url: https://github.com/login/oauth/access_token - api_url: https://api.github.com/user - dashboardProviders: - dashboardproviders.yaml: - apiVersion: 1 - providers: - - name: default - folder: '' - type: file - disableDeletion: false - editable: true - allowUiUpdates: false - options: - path: /var/lib/grafana/dashboards/default - dashboards: - default: - nginx-ingress: - gnetId: 9614 - revision: 1 - datasource: Prometheus - sidecar: - datasources: - enabled: true alertmanager: enabled: false defaultRules: @@ -121,4 +59,4 @@ kubeStateMetrics: nodeExporter: enabled: false grafana: - enabled: true + enabled: false diff --git a/main/apps/grafana.yaml b/main/apps/grafana.yaml new file mode 100644 index 0000000..883fa17 --- /dev/null +++ b/main/apps/grafana.yaml @@ -0,0 +1,17 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: grafana + namespace: argocd +spec: + destination: + namespace: grafana + server: https://kubernetes.default.svc + project: default + source: + path: apps/system/grafana + repoURL: git@github.com:gorilych/gf-k8s + syncPolicy: + automated: + prune: true + selfHeal: true diff --git a/main/namespaces/grafana.yaml b/main/namespaces/grafana.yaml new file mode 100644 index 0000000..201d7d3 --- /dev/null +++ b/main/namespaces/grafana.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: grafana