From 19ec762cb963706c803064f6d46ee680695babe4 Mon Sep 17 00:00:00 2001
From: Larry Rensing <lr699s@att.com>
Date: Thu, 18 May 2017 16:48:10 +0000
Subject: [PATCH] Adding pod disruption budgets to horizon

This PS adds a pod disruption budget to the horizon pod to ensure
one replica of the pod is running.

Change-Id: If366517cff3c790655aba3337ffd5a7ac10e96a5
---
 horizon/templates/pdb.yaml | 9 +++++++++
 horizon/values.yaml        | 4 ++++
 2 files changed, 13 insertions(+)
 create mode 100644 horizon/templates/pdb.yaml

diff --git a/horizon/templates/pdb.yaml b/horizon/templates/pdb.yaml
new file mode 100644
index 0000000000..ad9f7588a6
--- /dev/null
+++ b/horizon/templates/pdb.yaml
@@ -0,0 +1,9 @@
+apiVersion: policy/v1beta1
+kind: PodDisruptionBudget
+metadata:
+  name: horizon
+spec:
+  minAvailable: {{ .Values.pod_disruption_budget.horizon.min_available }}
+  selector:
+    matchLabels:
+      app: horizon
\ No newline at end of file
diff --git a/horizon/values.yaml b/horizon/values.yaml
index 06915318aa..f557faaea0 100644
--- a/horizon/values.yaml
+++ b/horizon/values.yaml
@@ -31,6 +31,10 @@ upgrades:
     max_unavailable: 1
     max_surge: 3
 
+pod_disruption_budget:
+  horizon:
+    min_available: 1
+
 labels:
   node_selector_key: openstack-control-plane
   node_selector_value: enabled