-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add optional prometheus deployment (#4323)
* enable pagination when expanding experiment in both the home page and the archive page * Revert "enable pagination when expanding experiment in both the home page and the archive page" This reverts commit 5b67273. * Add prometheus deployment as an optional deployment * move prom dir to under third-party * comments * third party folder to the kustomize folder
- Loading branch information
1 parent
1d8abb7
commit 3f9ce57
Showing
8 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
manifests/kustomize/third-party/prometheus/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- prometheus-configmap.yaml | ||
- prometheus-sa.yaml | ||
- prometheus-role.yaml | ||
- prometheus-rolebinding.yaml | ||
- prometheus-service.yaml | ||
- prometheus-deployment.yaml | ||
images: | ||
- name: prom/prometheus |
31 changes: 31 additions & 0 deletions
31
manifests/kustomize/third-party/prometheus/prometheus-configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apiVersion: v1 | ||
data: | ||
prometheus.yml: | | ||
global: | ||
scrape_interval: 15s # By default, scrape targets every 15 seconds. | ||
# Attach these labels to any time series or alerts when communicating with | ||
# external systems (federation, remote storage, Alertmanager). | ||
external_labels: | ||
monitor: 'kubeflow-pipelines-monitor' | ||
# A scrape configuration containing exactly one endpoint to scrape: | ||
# Here it's Prometheus itself. | ||
scrape_configs: | ||
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config. | ||
- job_name: 'prometheus' | ||
# Override the global default and scrape targets from this job every 5 seconds. | ||
scrape_interval: 5s | ||
static_configs: | ||
- targets: ['localhost:9090'] | ||
# Monitoring ml-pipeline (aka Kubeflow Pipelines API server) | ||
- job_name: 'ml-pipeline' | ||
scrape_interval: 60s | ||
static_configs: | ||
- targets: ['ml-pipeline:8888'] | ||
kind: ConfigMap | ||
metadata: | ||
name: prometheus-configmap |
34 changes: 34 additions & 0 deletions
34
manifests/kustomize/third-party/prometheus/prometheus-deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: prometheus | ||
labels: | ||
app: prometheus | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: prometheus | ||
template: | ||
metadata: | ||
labels: | ||
app: prometheus | ||
spec: | ||
containers: | ||
- name: prometheus | ||
image: prom/prometheus | ||
volumeMounts: | ||
- name: config-volume | ||
mountPath: /etc/prometheus/prometheus.yml | ||
subPath: prometheus.yml | ||
args: ["--storage.tsdb.retention.time=7d", # Adjust retention policy if necessary | ||
"--storage.tsdb.retention.size=1GB", | ||
"--config.file=/etc/prometheus/prometheus.yml", | ||
] | ||
ports: | ||
- containerPort: 9090 | ||
volumes: | ||
- name: config-volume | ||
configMap: | ||
name: prometheus-configmap | ||
serviceAccountName: prometheus |
19 changes: 19 additions & 0 deletions
19
manifests/kustomize/third-party/prometheus/prometheus-role.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
labels: | ||
app: prometheus | ||
name: prometheus | ||
rules: | ||
- apiGroups: [""] | ||
resources: | ||
- nodes | ||
- services | ||
- endpoints | ||
- pods | ||
verbs: ["get", "list", "watch"] | ||
- apiGroups: | ||
- extensions | ||
resources: | ||
- ingresses | ||
verbs: ["get", "list", "watch"] |
13 changes: 13 additions & 0 deletions
13
manifests/kustomize/third-party/prometheus/prometheus-rolebinding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
labels: | ||
app: prometheus | ||
name: prometheus | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: prometheus | ||
subjects: | ||
- kind: ServiceAccount | ||
name: prometheus |
5 changes: 5 additions & 0 deletions
5
manifests/kustomize/third-party/prometheus/prometheus-sa.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: prometheus | ||
# namespace: default |
14 changes: 14 additions & 0 deletions
14
manifests/kustomize/third-party/prometheus/prometheus-service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: prometheus | ||
name: prometheus | ||
spec: | ||
selector: | ||
app: prometheus | ||
ports: | ||
- name: promui | ||
protocol: TCP | ||
port: 9090 | ||
targetPort: 9090 |