Added anti-affinity to Prometheus and alertmanager

This commit is contained in:
CarlosEDP 2019-02-04 18:07:37 -02:00
parent 7f9f0b8b83
commit 61f5a2927b
4 changed files with 30 additions and 1 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
vendor vendor
auth

View File

@ -6,6 +6,20 @@ metadata:
name: main name: main
namespace: monitoring namespace: monitoring
spec: spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: alertmanager
operator: In
values:
- main
namespaces:
- monitoring
topologyKey: kubernetes.io/hostname
weight: 100
baseImage: carlosedp/alertmanager baseImage: carlosedp/alertmanager
nodeSelector: nodeSelector:
beta.kubernetes.io/os: linux beta.kubernetes.io/os: linux

View File

@ -6,6 +6,20 @@ metadata:
name: k8s name: k8s
namespace: monitoring namespace: monitoring
spec: spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: prometheus
operator: In
values:
- k8s
namespaces:
- monitoring
topologyKey: kubernetes.io/hostname
weight: 100
alerting: alerting:
alertmanagers: alertmanagers:
- name: alertmanager-main - name: alertmanager-main

View File

@ -1,7 +1,7 @@
local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet'; local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet';
local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') + local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') +
// (import 'kube-prometheus/kube-prometheus-anti-affinity.libsonnet') + (import 'kube-prometheus/kube-prometheus-anti-affinity.libsonnet') +
(import 'kube-prometheus/kube-prometheus-kops-coredns.libsonnet') + (import 'kube-prometheus/kube-prometheus-kops-coredns.libsonnet') +
(import 'kube-prometheus/kube-prometheus-kubeadm.libsonnet') + (import 'kube-prometheus/kube-prometheus-kubeadm.libsonnet') +
(import 'image_sources_versions.jsonnet') + (import 'image_sources_versions.jsonnet') +