Sha256: 60dcfe3ce2c12df86be16d02972fdf352f84c793af41d68cd4517f3c87e2c4aa

Contents?: true

Size: 807 Bytes

Versions: 2

Compression:

Stored size: 807 Bytes

Contents

# frozen_string_literal: true

module Metatron
  module Templates
    # The DaemonSet Kubernetes resource
    class DaemonSet < Template
      include Concerns::Annotated
      include Concerns::Namespaced
      include Concerns::PodProducer

      attr_accessor :replicas, :additional_labels

      def initialize(name)
        super
        @api_version = "apps/v1"
      end

      def render
        {
          apiVersion:,
          kind:,
          metadata: {
            name:,
            labels: base_labels.merge(additional_labels)
          }.merge(formatted_annotations).merge(formatted_namespace),
          spec: {
            selector: {
              matchLabels: base_labels.merge(additional_pod_labels)
            }
          }.merge(pod_template)
        }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
metatron-0.8.2 lib/metatron/templates/daemon_set.rb
metatron-0.8.0 lib/metatron/templates/daemon_set.rb