Sha256: 3e7c568874a856b2101447404447c156a3045ac4e89989c00a27ee510df1e988

Contents?: true

Size: 1.37 KB

Versions: 4

Compression:

Stored size: 1.37 KB

Contents

# frozen_string_literal: true

module Metatron
  module Templates
    # Template for basic Pod k8s resource
    class Pod < Template
      include Concerns::Annotated
      include Concerns::PodProducer

      # rubocop:disable Metrics/MethodLength
      # rubocop:disable Metrics/AbcSize
      def render
        {
          apiVersion:,
          kind:,
          metadata: {
            labels: { "#{label_namespace}/name": name }.merge(additional_labels),
            name:
          }.merge(formatted_annotations),
          spec: {
            terminationGracePeriodSeconds:,
            containers: [
              {
                name: "app",
                image:,
                imagePullPolicy:,
                stdin: true,
                tty: true,
                resources: { limits: resource_limits, requests: resource_requests }
              }.merge(probes)
                .merge(formatted_environment)
                .merge(formatted_envfrom)
                .merge(formatted_ports)
                .merge(formatted_volume_mounts)
                .merge(formatted_container_security_context)
            ] + additional_containers
          }.merge(formatted_volumes)
            .merge(formatted_security_context)
            .merge(formatted_tolerations)
        }
      end
      # rubocop:enable Metrics/AbcSize
      # rubocop:enable Metrics/MethodLength
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
metatron-0.1.8 lib/metatron/templates/pod.rb
metatron-0.1.7 lib/metatron/templates/pod.rb
metatron-0.1.6 lib/metatron/templates/pod.rb
metatron-0.1.5 lib/metatron/templates/pod.rb