Sha256: 890351241348fa4f9c2e63f84bc04332f67488a6de6aa4c7011f56d494a2c94c

Contents?: true

Size: 1.72 KB

Versions: 7

Compression:

Stored size: 1.72 KB

Contents

module Kubes::Compiler::Dsl::Syntax
  class Service < Resource
    # kubectl explain service.spec
    fields :clusterIP,                 # <string>
           :externalIPs,               # <[]string>
           :externalName,              # <string>
           :externalTrafficPolicy,     # <string>
           :healthCheckNodePort,       # <integer>
           :ipFamily,                  # <string>
           :loadBalancerIP,            # <string>
           :loadBalancerSourceRanges,  # <[]string>
           :ports,                     # <[]Object>
           :publishNotReadyAddresses,  # <boolean>
           "selector:hash",            # <map[string]string>
           :sessionAffinity,           # <string>
           :sessionAffinityConfig,     # <Object>
           :type                       # <string>

    # kubectl explain service.spec.ports
    fields :nodePort,   # <integer>
           :port,       # <integer> -required-
           :portName,   # <string>  (originally named port)
           :protocol,   # <string>
           :targetPort  # <string>

    def default_apiVersion
      "v1"
    end

    def default_selector
      labels
    end

    def default_spec
      {
        ports: ports,
        selector: selector,
        type: type,
      }
    end

    def default_type
      "ClusterIP"
    end

    def default_ports
      [
        nodePort: nodePort,    # <integer>
        port: port,            # <integer> -required-
        name: portName,        # <string>  (originally named port)
        protocol: protocol,    # <string>
        targetPort: targetPort # <string>
      ]
    end

    def default_port
      80
    end

    def default_protocol
      "TCP"
    end

    def default_targetPort
      80
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
kubes-0.2.6 lib/kubes/compiler/dsl/syntax/service.rb
kubes-0.2.5 lib/kubes/compiler/dsl/syntax/service.rb
kubes-0.2.4 lib/kubes/compiler/dsl/syntax/service.rb
kubes-0.2.3 lib/kubes/compiler/dsl/syntax/service.rb
kubes-0.2.2 lib/kubes/compiler/dsl/syntax/service.rb
kubes-0.2.1 lib/kubes/compiler/dsl/syntax/service.rb
kubes-0.2.0 lib/kubes/compiler/dsl/syntax/service.rb