lib/metatron/templates/concerns/pod_producer.rb in metatron-0.1.5 vs lib/metatron/templates/concerns/pod_producer.rb in metatron-0.1.6

- old
+ new

@@ -6,15 +6,15 @@ # A mixin to assist with templating Kubernetes resources that create Pods module PodProducer def self.included(base) # base.extend ClassMethods base.class_eval do - attr_accessor :image, :image_pull_policy, :additional_labels, :env, :envfrom, + attr_accessor :image, :image_pull_policy, :additional_labels, :additional_pod_labels, :resource_limits, :resource_requests, :probes, :ports, :security_context, - :volume_mounts, :volumes, :additional_containers, + :volume_mounts, :volumes, :additional_containers, :env, :envfrom, :container_security_context, :affinity, :termination_grace_period_seconds, - :tolerations + :tolerations, :pod_annotations initializer :pod_producer_initialize alias_method :imagePullPolicy, :image_pull_policy alias_method :volumeMounts, :volume_mounts @@ -38,10 +38,12 @@ @volumes = [] @security_context = {} @container_security_context = {} @additional_containers = [] @additional_labels = {} + @additional_pod_labels = {} + @pod_annotations = {} @termination_grace_period_seconds = 60 @tolerations = [] end def formatted_affinity = affinity && !affinity.empty? ? { affinity: } : {} @@ -54,9 +56,13 @@ if envfrom && !envfrom.empty? { envFrom: envfrom.map { |secret| { secretRef: { name: secret } } } } else {} end + end + + def formatted_pod_annotations + pod_annotations && !pod_annotations.empty? ? { annotations: pod_annotations } : {} end def formatted_ports = ports&.any? ? { ports: } : {} def formatted_security_context