Class: Kubes::Compiler::Dsl::Syntax::NetworkPolicy
- Inherits:
-
Resource
- Object
- Core::Base
- Resource
- Kubes::Compiler::Dsl::Syntax::NetworkPolicy
show all
- Defined in:
- lib/kubes/compiler/dsl/syntax/network_policy.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
#extract_type, #normalize_kind
Instance Method Details
#default_apiVersion ⇒ Object
19
20
21
|
# File 'lib/kubes/compiler/dsl/syntax/network_policy.rb', line 19
def default_apiVersion
"networking.k8s.io/v1"
end
|
#default_from ⇒ Object
31
32
33
34
35
36
37
|
# File 'lib/kubes/compiler/dsl/syntax/network_policy.rb', line 31
def default_from
[
{ namespaceSelector: { matchLabels: fromNamespace } },
{ podSelector: { matchLabels: fromPod } },
{ ipBlock: fromIpBlock }
]
end
|
#default_spec ⇒ Object
23
24
25
26
27
28
29
|
# File 'lib/kubes/compiler/dsl/syntax/network_policy.rb', line 23
def default_spec
{
podSelector: { matchLabels: matchLabels },
ingress: [from: from],
egress: [to: to],
}
end
|
#default_to ⇒ Object
39
40
41
42
43
44
45
|
# File 'lib/kubes/compiler/dsl/syntax/network_policy.rb', line 39
def default_to
[
{ namespaceSelector: { matchLabels: toNamespace } },
{ podSelector: { matchLabels: toPod } },
{ ipBlock: toIpBlock }
]
end
|