Sha256: f8491bc1f90b9b0cd2bf5c2fee9249642a52a35b8a41ccdc68e968a4d55ac12c

Contents?: true

Size: 813 Bytes

Versions: 2

Compression:

Stored size: 813 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(name)
        @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.7.0 lib/metatron/templates/daemon_set.rb
metatron-0.6.1 lib/metatron/templates/daemon_set.rb