diff --git a/.gitignore b/.gitignore index 22d0d82..47a49ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ vendor +auth diff --git a/manifests/alertmanager-alertmanager.yaml b/manifests/alertmanager-alertmanager.yaml index c8d7024..5e1d1af 100644 --- a/manifests/alertmanager-alertmanager.yaml +++ b/manifests/alertmanager-alertmanager.yaml @@ -6,6 +6,20 @@ metadata: name: main namespace: monitoring spec: + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchExpressions: + - key: alertmanager + operator: In + values: + - main + namespaces: + - monitoring + topologyKey: kubernetes.io/hostname + weight: 100 baseImage: carlosedp/alertmanager nodeSelector: beta.kubernetes.io/os: linux diff --git a/manifests/prometheus-prometheus.yaml b/manifests/prometheus-prometheus.yaml index db7f96d..2b57e7d 100644 --- a/manifests/prometheus-prometheus.yaml +++ b/manifests/prometheus-prometheus.yaml @@ -6,6 +6,20 @@ metadata: name: k8s namespace: monitoring spec: + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchExpressions: + - key: prometheus + operator: In + values: + - k8s + namespaces: + - monitoring + topologyKey: kubernetes.io/hostname + weight: 100 alerting: alertmanagers: - name: alertmanager-main diff --git a/operator_stack.jsonnet b/operator_stack.jsonnet index 42abbee..c271ebd 100644 --- a/operator_stack.jsonnet +++ b/operator_stack.jsonnet @@ -1,7 +1,7 @@ local k = import 'ksonnet/ksonnet.beta.3/k.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-kubeadm.libsonnet') + (import 'image_sources_versions.jsonnet') +