Skip to content

Commit

Permalink
Add PodDisruptionBudget for web proc to avoid downtime during cluster…
Browse files Browse the repository at this point in the history
… upgrades or scaling
  • Loading branch information
collimarco committed Nov 8, 2022
1 parent 271d464 commit da1e6f3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/cuber/templates/deployment.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,23 @@ data:
<%= key %>: <%= value.to_s.to_json %>
<%- end -%>

---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: web-pdb
namespace: <%= @options[:app] %>
labels:
app.kubernetes.io/name: <%= @options[:app] %>
app.kubernetes.io/instance: <%= @options[:instance] %>
app.kubernetes.io/version: <%= @options[:release] %>
app.kubernetes.io/managed-by: cuber
spec:
maxUnavailable: "50%"
selector:
matchLabels:
app: web-proc

<%- if @options[:migrate] -%>
---
apiVersion: batch/v1
Expand Down

0 comments on commit da1e6f3

Please sign in to comment.