Class: Kubes::Compiler::Dsl::Syntax::Service

Inherits:
Resource
  • Object
show all
Defined in:
lib/kubes/compiler/dsl/syntax/service.rb

Instance Attribute Summary

Attributes inherited from Resource

#kind_from_block

Instance Method Summary collapse

Methods inherited from Resource

#default_kind, #default_metadata, #default_result, #default_result_append, #default_top, #field, #top

Methods included from Util::Normalize

#extract_type, #normalize_kind

Instance Method Details

#default_apiVersionObject



26
27
28
# File 'lib/kubes/compiler/dsl/syntax/service.rb', line 26

def default_apiVersion
  "v1"
end

#default_portObject



67
68
69
# File 'lib/kubes/compiler/dsl/syntax/service.rb', line 67

def default_port
  80
end

#default_portsObject



57
58
59
60
61
62
63
64
65
# File 'lib/kubes/compiler/dsl/syntax/service.rb', line 57

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

#default_protocolObject



71
72
73
# File 'lib/kubes/compiler/dsl/syntax/service.rb', line 71

def default_protocol
  "TCP"
end

#default_selectorObject



30
31
32
# File 'lib/kubes/compiler/dsl/syntax/service.rb', line 30

def default_selector
  labels
end

#default_specObject



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/kubes/compiler/dsl/syntax/service.rb', line 34

def default_spec
  {
    clusterIP: clusterIP,
    externalIPs: externalIPs,
    externalName: externalName,
    externalTrafficPolicy: externalTrafficPolicy,
    healthCheckNodePort: healthCheckNodePort,
    ipFamily: ipFamily,
    loadBalancerIP: loadBalancerIP,
    loadBalancerSourceRanges: loadBalancerSourceRanges,
    ports: ports,
    publishNotReadyAddresses: publishNotReadyAddresses,
    selector: selector,
    sessionAffinity: sessionAffinity,
    sessionAffinityConfig: sessionAffinityConfig,
    type: type,
  }
end

#default_targetPortObject



75
76
77
# File 'lib/kubes/compiler/dsl/syntax/service.rb', line 75

def default_targetPort
  80
end

#default_typeObject



53
54
55
# File 'lib/kubes/compiler/dsl/syntax/service.rb', line 53

def default_type
  "ClusterIP"
end