diff --git a/apps/system/grafana/Chart.yaml b/apps/system/grafana/Chart.yaml deleted file mode 100644 index c9084ec..0000000 --- a/apps/system/grafana/Chart.yaml +++ /dev/null @@ -1 +0,0 @@ -name: grafana diff --git a/apps/system/grafana/requirements.yaml b/apps/system/grafana/requirements.yaml deleted file mode 100644 index 60f6d02..0000000 --- a/apps/system/grafana/requirements.yaml +++ /dev/null @@ -1,4 +0,0 @@ -dependencies: -- name: grafana - version: 4.0.3 - repository: '@stable' diff --git a/apps/system/grafana/values.yaml b/apps/system/grafana/values.yaml deleted file mode 100644 index 535b84b..0000000 --- a/apps/system/grafana/values.yaml +++ /dev/null @@ -1,45 +0,0 @@ -grafana: - # 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 - datasources: - datasources.yaml: - apiVersion: 1 - datasources: - - name: Prometheus - type: prometheus - access: proxy - url: http://prometheus-operated.monitoring:9090 - isDefault: true - editable: false diff --git a/apps/system/grafana/.gitignore b/apps/system/monitoring/.gitignore similarity index 100% rename from apps/system/grafana/.gitignore rename to apps/system/monitoring/.gitignore diff --git a/apps/system/monitoring/Chart.yaml b/apps/system/monitoring/Chart.yaml new file mode 100644 index 0000000..3b48228 --- /dev/null +++ b/apps/system/monitoring/Chart.yaml @@ -0,0 +1 @@ +name: monitoring diff --git a/apps/system/monitoring/prometheus.yaml b/apps/system/monitoring/prometheus.yaml deleted file mode 100644 index bc57627..0000000 --- a/apps/system/monitoring/prometheus.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: monitoring.coreos.com/v1 -kind: Prometheus -metadata: - name: prometheus -spec: - version: v2.14.0 - replicas: 1 - securityContext: - runAsUser: 1000 - walCompression: true - storage: - volumeClaimTemplate: - spec: - volumeName: prometheus - resources: - requests: - storage: 10Gi diff --git a/apps/system/prometheus-operator/requirements.yaml b/apps/system/monitoring/requirements.yaml similarity index 100% rename from apps/system/prometheus-operator/requirements.yaml rename to apps/system/monitoring/requirements.yaml diff --git a/apps/system/grafana/templates/volume.yaml b/apps/system/monitoring/templates/grafana-volume.yaml similarity index 100% rename from apps/system/grafana/templates/volume.yaml rename to apps/system/monitoring/templates/grafana-volume.yaml diff --git a/apps/system/grafana/templates/volumeclaim.yaml b/apps/system/monitoring/templates/grafana-volumeclaim.yaml similarity index 100% rename from apps/system/grafana/templates/volumeclaim.yaml rename to apps/system/monitoring/templates/grafana-volumeclaim.yaml diff --git a/apps/system/monitoring/volume.yaml b/apps/system/monitoring/templates/prometheus-volume.yaml similarity index 100% rename from apps/system/monitoring/volume.yaml rename to apps/system/monitoring/templates/prometheus-volume.yaml diff --git a/apps/system/monitoring/templates/servicemonitor-nginx-ingress.yaml b/apps/system/monitoring/templates/servicemonitor-nginx-ingress.yaml new file mode 100644 index 0000000..0f26f09 --- /dev/null +++ b/apps/system/monitoring/templates/servicemonitor-nginx-ingress.yaml @@ -0,0 +1,15 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: nginx-ingress +spec: + namespaceSelector: + matchNames: + - nginx-ingress + selector: + matchLabels: + app: nginx-ingress + component: controller + endpoints: + - port: metrics + interval: 30s diff --git a/apps/system/monitoring/values.yaml b/apps/system/monitoring/values.yaml new file mode 100644 index 0000000..075e05e --- /dev/null +++ b/apps/system/monitoring/values.yaml @@ -0,0 +1,95 @@ +prometheus-operator: + prometheus: + enabled: true + prometheusSpec: + version: v2.14.0 + replicas: 1 + securityContext: + runAsUser: 1000 + walCompression: true + serviceMonitorSelector: + any: true + serviceMonitorNamespaceSelector: + any: true + storage: + volumeClaimTemplate: + spec: + volumeName: prometheus + resources: + requests: + storage: 10Gi + grafana: + enabled: true + # 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 + datasources: + datasources.yaml: + apiVersion: 1 + datasources: + - name: Prometheus + type: prometheus + access: proxy + url: http://prometheus-operated:9090 + isDefault: true + editable: false + alertmanager: + enabled: false + defaultRules: + create: false + kubeControllerManager: + enabled: false + kubeScheduler: + enabled: false + kubeEtcd: + enabled: false + coreDns: + enabled: false + kubeDns: + enabled: false + kubeApiServer: + enabled: false + kubeProxy: + enabled: false + kubeStateMetrics: + enabled: false + nodeExporter: + enabled: false +# because of https://github.com/helm/helm/issues/4490 +kubeStateMetrics: + enabled: false +nodeExporter: + enabled: false +grafana: + enabled: true diff --git a/apps/system/prometheus-operator/.gitignore b/apps/system/prometheus-operator/.gitignore deleted file mode 100644 index 719aed9..0000000 --- a/apps/system/prometheus-operator/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -requirements.lock -charts/ diff --git a/apps/system/prometheus-operator/Chart.yaml b/apps/system/prometheus-operator/Chart.yaml deleted file mode 100644 index e9a1141..0000000 --- a/apps/system/prometheus-operator/Chart.yaml +++ /dev/null @@ -1 +0,0 @@ -name: prometheus-operator diff --git a/apps/system/prometheus-operator/values.yaml b/apps/system/prometheus-operator/values.yaml deleted file mode 100644 index b7fd53a..0000000 --- a/apps/system/prometheus-operator/values.yaml +++ /dev/null @@ -1,34 +0,0 @@ -prometheus-operator: - prometheus: - enabled: false - alertmanager: - enabled: false - grafana: - enabled: false - defaultRules: - create: false - kubeControllerManager: - enabled: false - kubeScheduler: - enabled: false - kubeEtcd: - enabled: false - coreDns: - enabled: false - kubeDns: - enabled: false - kubeApiServer: - enabled: false - kubeProxy: - enabled: false - kubeStateMetrics: - enabled: false - nodeExporter: - enabled: false -# because of https://github.com/helm/helm/issues/4490 -kubeStateMetrics: - enabled: false -nodeExporter: - enabled: false -grafana: - enabled: false diff --git a/main/apps/grafana.yaml b/main/apps/grafana.yaml deleted file mode 100644 index 02434e6..0000000 --- a/main/apps/grafana.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: grafana - namespace: argocd - finalizers: - - resources-finalizer.argocd.argoproj.io -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/apps/prometheus-operator.yaml b/main/apps/prometheus-operator.yaml deleted file mode 100644 index b6d0ea3..0000000 --- a/main/apps/prometheus-operator.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: prometheus-operator - namespace: argocd - finalizers: - - resources-finalizer.argocd.argoproj.io -spec: - destination: - namespace: prometheus-operator - server: https://kubernetes.default.svc - project: default - source: - path: apps/system/prometheus-operator - 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 deleted file mode 100644 index 201d7d3..0000000 --- a/main/namespaces/grafana.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: grafana diff --git a/main/namespaces/prometheus-operator.yaml b/main/namespaces/prometheus-operator.yaml deleted file mode 100644 index a586749..0000000 --- a/main/namespaces/prometheus-operator.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: prometheus-operator