Documentation
¶
Overview ¶
Package api holds typed subsets of the cilium.io/v2 resources the Cilium projector reads. Types decode only the fields projection interprets; field meaning follows the upstream Cilium API.
Index ¶
- type Decoded
- func Decode[T any](object *unstructured.Unstructured) (Decoded[T], error)
- func EndpointObject(object *unstructured.Unstructured) (Decoded[Endpoint], error)
- func NodeObject(object *unstructured.Unstructured) (Decoded[Node], error)
- func PolicyObject(object *unstructured.Unstructured) (Decoded[Policy], error)
- type EgressRule
- type Endpoint
- type EndpointIdentity
- type EndpointPolicy
- type EndpointRealizedPolicy
- type EndpointStatus
- type IngressRule
- type Node
- type NodeAddress
- type NodeIPAM
- type NodeSpec
- type Policy
- type PortProtocol
- type PortRule
- type Rule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoded ¶
type Decoded[T any] struct { Value T }
Decoded wraps a typed provider object decoded from its unstructured form.
func Decode ¶
func Decode[T any](object *unstructured.Unstructured) (Decoded[T], error)
Decode round-trips object through JSON into T. Unknown fields are ignored; a field with the wrong JSON type is an error.
func EndpointObject ¶
func EndpointObject(object *unstructured.Unstructured) (Decoded[Endpoint], error)
EndpointObject decodes a CiliumEndpoint.
func NodeObject ¶
func NodeObject(object *unstructured.Unstructured) (Decoded[Node], error)
NodeObject decodes a CiliumNode.
func PolicyObject ¶
func PolicyObject(object *unstructured.Unstructured) (Decoded[Policy], error)
PolicyObject decodes a Cilium policy object.
type EgressRule ¶
type EgressRule struct {
ToPorts []PortRule `json:"toPorts,omitempty"`
}
EgressRule holds the port rules of one egress section.
type Endpoint ¶
type Endpoint struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Status EndpointStatus `json:"status,omitempty"`
}
Endpoint is a CiliumEndpoint, named after the Pod it represents.
type EndpointIdentity ¶
type EndpointIdentity struct {
ID int64 `json:"id,omitempty"`
}
EndpointIdentity is the numeric Cilium security identity.
type EndpointPolicy ¶
type EndpointPolicy struct {
Realized EndpointRealizedPolicy `json:"realized,omitempty"`
}
EndpointPolicy holds the policy state the agent realized.
type EndpointRealizedPolicy ¶
type EndpointRealizedPolicy struct {
PolicyEnabled string `json:"policy-enabled,omitempty"`
}
EndpointRealizedPolicy reports the agent's realized policy-enabled mode. It is recorded verbatim, not interpreted as proof of enforcement.
type EndpointStatus ¶
type EndpointStatus struct {
ID int64 `json:"id,omitempty"`
State string `json:"state,omitempty"`
Identity EndpointIdentity `json:"identity,omitempty"`
Policy EndpointPolicy `json:"policy,omitempty"`
}
EndpointStatus is the agent-reported endpoint state.
type IngressRule ¶
type IngressRule struct {
ToPorts []PortRule `json:"toPorts,omitempty"`
}
IngressRule holds the port rules of one ingress section.
type Node ¶
type Node struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec NodeSpec `json:"spec,omitempty"`
}
Node is a CiliumNode, named after the Kubernetes Node it represents.
type NodeAddress ¶
NodeAddress is one typed node address.
type NodeIPAM ¶
type NodeIPAM struct {
PodCIDRs []string `json:"podCIDRs,omitempty"`
}
NodeIPAM holds the Pod CIDRs allocated to the node.
type NodeSpec ¶
type NodeSpec struct {
Addresses []NodeAddress `json:"addresses,omitempty"`
IPAM NodeIPAM `json:"ipam,omitempty"`
}
NodeSpec holds node addresses and IPAM allocation.
type Policy ¶
type Policy struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec *Rule `json:"spec,omitempty"`
Specs []Rule `json:"specs,omitempty"`
}
Policy is a CiliumNetworkPolicy or CiliumClusterwideNetworkPolicy.
type PortProtocol ¶
PortProtocol is one port and optional protocol. Port may be a number, range, or name.
type PortRule ¶
type PortRule struct {
Ports []PortProtocol `json:"ports,omitempty"`
Rules json.RawMessage `json:"rules,omitempty"`
}
PortRule is one toPorts entry. Rules is kept raw only to detect L7 rules; its contents are never interpreted or copied to the graph.
type Rule ¶
type Rule struct {
EndpointSelector metav1.LabelSelector `json:"endpointSelector"`
Ingress []IngressRule `json:"ingress,omitempty"`
Egress []EgressRule `json:"egress,omitempty"`
}
Rule is one policy rule. Only selectors and port-level structure are decoded; peer selectors are not interpreted.
func (Rule) HasL7Rules ¶
HasL7Rules reports whether any port rule carries a non-empty L7 section. Such rules are excluded from CNI summaries.