Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
notebooks-operations
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
702
Projekty
notebooks-operations
Commits
7bab9458
Commit
7bab9458
authored
6 months ago
by
František Dvořák
Browse files
Options
Downloads
Patches
Plain Diff
Prometheus and Grafana for ENVRI-Hub
parent
5ee732d0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
envri-hub/extra
+1
-0
1 addition, 0 deletions
envri-hub/extra
envri-hub/playbooks/k8s.yaml
+89
-0
89 additions, 0 deletions
envri-hub/playbooks/k8s.yaml
envri-hub/playbooks/notebooks.yaml
+19
-0
19 additions, 0 deletions
envri-hub/playbooks/notebooks.yaml
with
109 additions
and
0 deletions
envri-hub/extra
0 → 120000
+
1
−
0
View file @
7bab9458
../common/extra
\ No newline at end of file
This diff is collapsed.
Click to expand it.
envri-hub/playbooks/k8s.yaml
+
89
−
0
View file @
7bab9458
...
...
@@ -108,3 +108,92 @@
KUBECONFIG
:
/etc/kubernetes/admin.conf
PATH
:
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
when
:
true
# Accounting / monitoring needs
-
name
:
Helm repo add prometheus-community
shell
:
|-
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
when
:
"
'prometheus-community'
not
in
ansible_local.helm_repos
|
map(attribute='name')
|
list"
-
name
:
Prometheus configuration
copy
:
dest
:
/tmp/prometheus.yaml
mode
:
0600
content
:
|
alertmanager:
persistence:
storageClass: csi-sc-cinderplugin
kube-state-metrics:
metricAnnotationsAllowList:
- pods=[hub.jupyter.org/username,egi.eu/primary_group,egi.eu/flavor]
server:
persistentVolume:
storageClass: csi-sc-cinderplugin
-
name
:
Prometheus
vars
:
version
:
25.28.0
# app v2.55.0
config
:
>-
--version={{ version }}
-f /tmp/prometheus.yaml
shell
:
|-
helm status --namespace prometheus prometheus
if [ $? -ne 0 ]; then
kubectl create ns prometheus >/dev/null 2>&1 || true
helm install --namespace prometheus {{ config }} prometheus prometheus-community/prometheus
else
helm upgrade --namespace prometheus {{ config }} prometheus prometheus-community/prometheus
fi
environment
:
KUBECONFIG
:
/etc/kubernetes/admin.conf
PATH
:
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
when
:
true
-
name
:
Grafana configuration
copy
:
dest
:
/tmp/grafana.yaml
mode
:
0640
content
:
|
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: "nginx"
kubernetes.io/tls-acme: "true"
hosts:
- "{{ grafana_hostname }}"
tls:
- hosts:
- "{{ grafana_hostname }}"
secretName: acme-tls-grafana
datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: Server
orgId: 1
url: http://prometheus-server.prometheus.svc.cluster.local
isDefault: true
version: 1
editable: false
sidecar:
dashboards:
enabled: true
-
name
:
Grafana
vars
:
version
:
8.5.11
# app 11.3.0
config
:
>-
--version={{ version }}
-f /tmp/grafana.yaml
shell
:
|-
helm status --namespace grafana grafana
if [ $? -ne 0 ]; then
kubectl create ns grafana
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update
helm install --namespace grafana {{ config }} grafana grafana/grafana
else
helm upgrade --namespace grafana {{ config }} grafana grafana/grafana
fi
environment
:
KUBECONFIG
:
/etc/kubernetes/admin.conf
PATH
:
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
when
:
true
This diff is collapsed.
Click to expand it.
envri-hub/playbooks/notebooks.yaml
+
19
−
0
View file @
7bab9458
...
...
@@ -109,3 +109,22 @@
when
:
true
with_fileglob
:
-
"
../deployments/*.yaml"
# do the extra bits of configuration
# here we should have all the namespaces, pre-requirements in place
# XXX: this won't remove things that are delete from the directory
-
name
:
Copy extra configuration files
copy
:
src
:
"
{{
item
}}"
dest
:
"
/tmp/{{
item
|
basename
}}"
mode
:
0600
with_fileglob
:
-
"
../extra/*.yaml"
-
name
:
Extra configuration
command
:
|-
kubectl apply -f /tmp/{{ item | basename }}
environment
:
KUBECONFIG
:
/etc/kubernetes/admin.conf
with_fileglob
:
-
"
../extra/*.yaml"
when
:
true
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment