blob: 7f27b52c6716558c690d47a3620ef703eaad29c7 [file] [log] [blame]
{%- from "kubernetes/map.jinja" import common with context -%}
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: prometheus-server
namespace: {{ common.addons.prometheus.get('namespace', 'stacklight') }}
labels:
k8s-app: prometheus-server
version: v1
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: Reconcile
spec:
replicas: 2
selector:
matchLabels:
k8s-app: prometheus-server
template:
metadata:
labels:
k8s-app: prometheus-server
version: v1
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]'
spec:
serviceAccountName: prometheus-server
tolerations:
- key: "node-role.kubernetes.io/master"
effect: "NoSchedule"
operator: "Exists"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: In
values: ["true"]
containers:
- name: prometheus
image: {{ common.addons.prometheus.get('image', 'docker-prod-local.artifactory.mirantis.com/openstack-docker/prometheus:stable') }}
env:
- name: PROMETHEUS_BIND_ADDRESS
value: "{{ common.addons.prometheus.server.bind.get('host', '0.0.0.0') }}"
- name: PROMETHEUS_BIND_PORT
value: "{{ common.addons.prometheus.server.bind.get('port', '9090') }}"
- name: PROMETHEUS_CONFIG_DIR
value: "{{ common.addons.prometheus.server.config.get('config_dir', '/etc/prometheus') }}"
- name: PROMETHEUS_DATA_DIR
value: "{{ common.addons.prometheus.server.config.get('data_dir', '/data') }}"
- name: PROMETHEUS_STORAGE_LOCAL_ENGINE
value: "{{ common.addons.prometheus.server.config.get('storage_local_engine', 'persisted') }}"
- name: PROMETHEUS_STORAGE_LOCAL_RETENTION
value: "{{ common.addons.prometheus.server.config.get('storage_local_retention', '360h') }}"
- name: PROMETHEUS_USE_STATIC_DATADIR
value: "{{ common.addons.prometheus.server.config.get('use_static_datadir', 'true') | lower }}"
ports:
- name: webui
containerPort: {{ common.addons.prometheus.server.bind.get('port', '9090') }}
resources:
requests:
memory: {{ common.addons.prometheus.server.resources.requests.get('memory', '500M') }}
limits:
memory: {{ common.addons.prometheus.server.resources.limits.get('memory', '500M') }}
volumeMounts:
- name: prometheus-server-cfg
mountPath: "{{ common.addons.prometheus.server.config.get('config_dir', '/etc/prometheus') }}"
- name: prometheus-server-data
mountPath: "{{ common.addons.prometheus.server.config.get('data_dir', '/data') }}"
volumes:
- name: prometheus-server-cfg
hostPath:
path: "{{ common.addons.prometheus.server.config.get('host_config_dir', '/srv/volumes/local/prometheus/config') }}"
- name: prometheus-server-data
hostPath:
path: "{{ common.addons.prometheus.server.config.get('host_data_dir', '/srv/volumes/local/prometheus/data') }}"