Documentation ¶
Overview ¶
Package adapter_template_kubernetes is a generated protocol buffer package.
The `kubernetes` template holds data that controls the production of Kubernetes-specific attributes.
Example config:
```yaml apiVersion: "config.istio.io/v1alpha2" kind: kubernetes metadata:
name: attributes namespace: istio-system
spec:
# Pass the required attribute data to the adapter source_uid: source.uid | "" source_ip: source.ip | ip("0.0.0.0") # default to unspecified ip addr destination_uid: destination.uid | "" destination_ip: destination.ip | ip("0.0.0.0") # default to unspecified ip addr attribute_bindings: # Fill the new attributes from the adapter produced output. # $out refers to an instance of OutputTemplate message source.ip: $out.source_pod_ip source.labels: $out.source_labels source.namespace: $out.source_namespace source.service: $out.source_service source.serviceAccount: $out.source_service_account_name destination.ip: $out.destination_pod_ip destination.labels: $out.destination_labels destination.namespace: $out.destination_mamespace destination.service: $out.destination_service destination.serviceAccount: $out.destination_service_account_name
```
The `kubernetes` template represents data used to generate kubernetes-derived attributes.
The values provided controls the manner in which the kubernetesenv adapter discovers and generates values related to pod information. Next ID: 8
It is generated from these files:
mixer/adapter/kubernetesenv/template/template_handler_service.proto
It has these top-level messages:
InstanceParam
Index ¶
- Constants
- Variables
- type Handler
- type HandlerBuilder
- type Instance
- type InstanceParam
- func (*InstanceParam) Descriptor() ([]byte, []int)
- func (m *InstanceParam) Marshal() (dAtA []byte, err error)
- func (m *InstanceParam) MarshalTo(dAtA []byte) (int, error)
- func (*InstanceParam) ProtoMessage()
- func (m *InstanceParam) Reset()
- func (m *InstanceParam) Size() (n int)
- func (this *InstanceParam) String() string
- func (m *InstanceParam) Unmarshal(dAtA []byte) error
- type Output
- func (o *Output) SetDestinationContainerName(val string)
- func (o *Output) SetDestinationHostIp(val net.IP)
- func (o *Output) SetDestinationLabels(val map[string]string)
- func (o *Output) SetDestinationNamespace(val string)
- func (o *Output) SetDestinationOwner(val string)
- func (o *Output) SetDestinationPodIp(val net.IP)
- func (o *Output) SetDestinationPodName(val string)
- func (o *Output) SetDestinationServiceAccountName(val string)
- func (o *Output) SetDestinationWorkloadName(val string)
- func (o *Output) SetDestinationWorkloadNamespace(val string)
- func (o *Output) SetDestinationWorkloadUid(val string)
- func (o *Output) SetSourceHostIp(val net.IP)
- func (o *Output) SetSourceLabels(val map[string]string)
- func (o *Output) SetSourceNamespace(val string)
- func (o *Output) SetSourceOwner(val string)
- func (o *Output) SetSourcePodIp(val net.IP)
- func (o *Output) SetSourcePodName(val string)
- func (o *Output) SetSourceServiceAccountName(val string)
- func (o *Output) SetSourceWorkloadName(val string)
- func (o *Output) SetSourceWorkloadNamespace(val string)
- func (o *Output) SetSourceWorkloadUid(val string)
- func (o *Output) WasSet(field string) bool
Constants ¶
const TemplateName = "kubernetes"
Fully qualified name of the template
Variables ¶
var ( ErrInvalidLengthTemplateHandlerService = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTemplateHandlerService = fmt.Errorf("proto: integer overflow") )
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface { adapter.Handler // HandleKubernetes is called by Mixer at request time to deliver instances to // to an adapter. GenerateKubernetesAttributes(context.Context, *Instance) (*Output, error) }
Handler must be implemented by adapter code if it wants to process data associated with the 'kubernetes' template.
Mixer uses this interface to call into the adapter at request time in order to dispatch created instances to the adapter. Adapters take the incoming instances and do what they need to achieve their primary function.
type HandlerBuilder ¶
type HandlerBuilder interface { adapter.HandlerBuilder }
HandlerBuilder must be implemented by adapters if they want to process data associated with the 'kubernetes' template.
Mixer uses this interface to call into the adapter at configuration time to configure it with adapter-specific configuration as well as all template-specific type information.
type Instance ¶
type Instance struct { // Name of the instance as specified in configuration. Name string // Source pod's uid. Must be of the form: "kubernetes://pod.namespace" SourceUid string // Source pod's ip. SourceIp net.IP // Destination pod's uid. Must be of the form: "kubernetes://pod.namespace" DestinationUid string // Destination pod's ip. DestinationIp net.IP // Destination container's port number. DestinationPort int64 }
Instance is constructed by Mixer for the 'kubernetes' template.
The `kubernetes` template represents data used to generate kubernetes-derived attributes.
The values provided controls the manner in which the kubernetesenv adapter discovers and generates values related to pod information. Next ID: 8
type InstanceParam ¶
type InstanceParam struct { // Source pod's uid. Must be of the form: "kubernetes://pod.namespace" SourceUid string `protobuf:"bytes,1,opt,name=source_uid,json=sourceUid,proto3" json:"source_uid,omitempty"` // Source pod's ip. SourceIp string `protobuf:"bytes,2,opt,name=source_ip,json=sourceIp,proto3" json:"source_ip,omitempty"` // Destination pod's uid. Must be of the form: "kubernetes://pod.namespace" DestinationUid string `protobuf:"bytes,3,opt,name=destination_uid,json=destinationUid,proto3" json:"destination_uid,omitempty"` // Destination pod's ip. DestinationIp string `protobuf:"bytes,4,opt,name=destination_ip,json=destinationIp,proto3" json:"destination_ip,omitempty"` // Destination container's port number. DestinationPort string `protobuf:"bytes,7,opt,name=destination_port,json=destinationPort,proto3" json:"destination_port,omitempty"` // Attribute names to expression mapping. These expressions can use the fields from the output object // returned by the attribute producing adapters using $out.<fieldName> notation. For example: // source.ip : $out.source_pod_ip // In the above example, source.ip attribute will be added to the existing attribute list and its value will be set to // the value of source_pod_ip field of the output returned by the adapter. AttributeBindings map[string]string `` /* 200-byte string literal not displayed */ }
Represents instance configuration schema for 'kubernetes' template.
func (*InstanceParam) Descriptor ¶
func (*InstanceParam) Descriptor() ([]byte, []int)
func (*InstanceParam) Marshal ¶
func (m *InstanceParam) Marshal() (dAtA []byte, err error)
func (*InstanceParam) ProtoMessage ¶
func (*InstanceParam) ProtoMessage()
func (*InstanceParam) Reset ¶
func (m *InstanceParam) Reset()
func (*InstanceParam) Size ¶
func (m *InstanceParam) Size() (n int)
func (*InstanceParam) String ¶
func (this *InstanceParam) String() string
func (*InstanceParam) Unmarshal ¶
func (m *InstanceParam) Unmarshal(dAtA []byte) error
type Output ¶
type Output struct { // Refers to source pod ip address. attribute_bindings can refer to this field using $out.source_pod_ip SourcePodIp net.IP // Refers to source pod name. attribute_bindings can refer to this field using $out.source_pod_name SourcePodName string // Refers to source pod labels. attribute_bindings can refer to this field using $out.source_labels SourceLabels map[string]string // Refers to source pod namespace. attribute_bindings can refer to this field using $out.source_namespace SourceNamespace string // Refers to source pod service account name. attribute_bindings can refer to this field using $out.source_service_account_name SourceServiceAccountName string // Refers to source pod host ip address. attribute_bindings can refer to this field using $out.source_host_ip SourceHostIp net.IP // Refers to the Istio workload identifier for the source pod. Attribute_bindings can refer to this field using $out.source_workload_uid SourceWorkloadUid string // Refers to the Istio workload name for the source pod. Attribute_bindings can refer to this field using $out.source_workload_name SourceWorkloadName string // Refers to the Istio workload namespace for the source pod. Attribute_bindings can refer to this field using $out.source_workload_namespace SourceWorkloadNamespace string // Refers to the (controlling) owner of the source pod. Attribute_bindings can refer to this field using $out.source_owner SourceOwner string // Refers to destination pod ip address. attribute_bindings can refer to this field using $out.destination_pod_ip DestinationPodIp net.IP // Refers to destination pod name. attribute_bindings can refer to this field using $out.destination_pod_name DestinationPodName string // Refers to destination container name. attribute_bindings can refer to this field using $out.destination_container_name DestinationContainerName string // Refers to destination pod labels. attribute_bindings can refer to this field using $out.destination_labels DestinationLabels map[string]string // Refers to destination pod namespace. attribute_bindings can refer to this field using $out.destination_namespace DestinationNamespace string // Refers to destination pod service account name. attribute_bindings can refer to this field using $out.destination_service_account_name DestinationServiceAccountName string // Refers to destination pod host ip address. attribute_bindings can refer to this field using $out.destination_host_ip DestinationHostIp net.IP // Refers to the (controlling) owner of the destination pod. Attribute_bindings can refer to this field using $out.destination_owner DestinationOwner string // Refers to the Istio workload identifier for the destination pod. Attribute_bindings can refer to this field using $out.destination_workload_uid DestinationWorkloadUid string // Refers to the Istio workload name for the destination pod. Attribute_bindings can refer to this field using $out.destination_workload_name DestinationWorkloadName string // Refers to the Istio workload name for the destination pod. Attribute_bindings can refer to this field using $out.destination_workload_namespace DestinationWorkloadNamespace string // contains filtered or unexported fields }
Output struct is returned by the attribute producing adapters that handle this template.
OutputTemplate refers to the output from the adapter. It is used inside the attribute_binding section of the config to assign values to the generated attributes using the `$out.<field name of the OutputTemplate>` syntax. Next ID: 31