Sha256: 7364dfeb0e0debcb56b25442828bfc64c913677e184a29532c2f1b63d812a446
Contents?: true
Size: 1.95 KB
Versions: 3
Compression:
Stored size: 1.95 KB
Contents
# frozen_string_literal: true module Metatron module Templates # The DaemonSet Kubernetes resource class DaemonSet < Template include Concerns::Annotated include Concerns::PodProducer attr_accessor :replicas, :additional_labels def initialize(name) super(name) @api_version = "apps/v1" end # rubocop:disable Metrics/MethodLength # rubocop:disable Metrics/AbcSize def render { apiVersion:, kind:, metadata: { name:, labels: { "#{label_namespace}/name": name }.merge(additional_labels) }.merge(formatted_annotations), spec: { selector: { matchLabels: { "#{label_namespace}/name": name }.merge(additional_pod_labels) }, template: { metadata: { labels: { "#{label_namespace}/name": name }.merge(additional_pod_labels) }.merge(formatted_pod_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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
metatron-0.1.8 | lib/metatron/templates/daemon_set.rb |
metatron-0.1.7 | lib/metatron/templates/daemon_set.rb |
metatron-0.1.6 | lib/metatron/templates/daemon_set.rb |