lib/metatron/templates/deployment.rb in metatron-0.2.3 vs lib/metatron/templates/deployment.rb in metatron-0.2.4
- old
+ new
@@ -6,11 +6,11 @@
class Deployment < Template
include Concerns::Annotated
include Concerns::Namespaced
include Concerns::PodProducer
- attr_accessor :replicas, :additional_labels
+ attr_accessor :replicas, :additional_labels, :strategy
def initialize(name, replicas: 2)
super(name)
@api_version = "apps/v1"
@replicas = replicas
@@ -21,17 +21,17 @@
apiVersion:,
kind:,
metadata: {
name:,
labels: { "#{label_namespace}/name": name }.merge(additional_labels)
- }.merge(formatted_annotations),
+ }.merge(formatted_annotations).merge(formatted_namespace),
spec: {
replicas:,
- strategy: { type: "RollingUpdate", rollingUpdate: { maxSurge: 2, maxUnavailable: 0 } },
+ strategy:,
selector: {
matchLabels: { "#{label_namespace}/name": name }.merge(additional_pod_labels)
}
- }.merge(pod_template)
+ }.merge(pod_template).compact
}
end
end
end
end