Sha256: 952397842d279122d24dc1cce6c25ef46271f02341494eedb01ef6e946ff0f60
Contents?: true
Size: 970 Bytes
Versions: 15
Compression:
Stored size: 970 Bytes
Contents
# frozen_string_literal: true module Metatron module Templates # The Deployment Kubernetes resource class Deployment < Template include Concerns::Annotated include Concerns::Namespaced include Concerns::PodProducer attr_accessor :replicas, :additional_labels, :strategy def initialize(name, replicas: 2) super(name) @api_version = "apps/v1" @replicas = replicas end def render { apiVersion:, kind:, metadata: { name:, labels: { "#{label_namespace}/name": name }.merge(additional_labels) }.merge(formatted_annotations).merge(formatted_namespace), spec: { replicas:, strategy:, selector: { matchLabels: { "#{label_namespace}/name": name }.merge(additional_pod_labels) } }.merge(pod_template).compact } end end end end
Version data entries
15 entries across 15 versions & 1 rubygems