Documentation ¶
Index ¶
- func CreateResources(kube *kube.Kubernetes, model *PodModel) error
- func KubeContainer(name string, protocol v1.Protocol, port int) v1.Container
- func KubePod(namespace string, name string, labels map[string]string, ...) *v1.Pod
- func NamespaceSpec(name string, labels map[string]string) *v1.Namespace
- func QualifiedServiceAddress(serviceName string, namespace string) string
- func Service(namespace string, pod string, labels map[string]string, ...) *v1.Service
- func ServiceName(namespace string, pod string) string
- type Container
- type KubeProbeJob
- type KubeProbeJobResults
- type Namespace
- type NamespacedPod
- type Peer
- type Pod
- type PodModel
- type PodString
- type ProtocolPort
- type SyntheticProbeResult
- type TruthTable
- func (tt *TruthTable) Compare(other *TruthTable) *TruthTable
- func (tt *TruthTable) Get(from string, to string) bool
- func (tt *TruthTable) IsComplete() bool
- func (tt *TruthTable) Set(from string, to string, value bool)
- func (tt *TruthTable) SetAllFrom(from string, value bool)
- func (tt *TruthTable) SetAllTo(to string, value bool)
- func (tt *TruthTable) Table() *tablewriter.Table
- func (tt *TruthTable) ValueCounts(ignoreLoopback bool) (int, int, int, int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateResources ¶
func CreateResources(kube *kube.Kubernetes, model *PodModel) error
func KubePod ¶
func KubePod(namespace string, name string, labels map[string]string, containers []*Container) *v1.Pod
KubePod returns the kube pod
func QualifiedServiceAddress ¶
QualifiedServiceAddress returns the address that can be used to hit a service from any namespace in the cluster
func QualifiedServiceAddress(serviceName string, namespace string, dnsDomain string) string { return fmt.Sprintf("%s.%s.svc.%s", serviceName, namespace, dnsDomain)
func Service ¶
func Service(namespace string, pod string, labels map[string]string, containers []*Container) *v1.Service
Service returns a kube service spec
func ServiceName ¶
Types ¶
type KubeProbeJob ¶
type KubeProbeJob struct { FromPod *NamespacedPod ToPod *NamespacedPod Port int Protocol v1.Protocol }
func (*KubeProbeJob) ClientCommand ¶
func (pj *KubeProbeJob) ClientCommand() []string
func (*KubeProbeJob) FromContainer ¶
func (pj *KubeProbeJob) FromContainer() string
func (*KubeProbeJob) KubeExecCommand ¶
func (pj *KubeProbeJob) KubeExecCommand() []string
func (*KubeProbeJob) ToAddress ¶
func (pj *KubeProbeJob) ToAddress() string
func (*KubeProbeJob) ToURL ¶
func (pj *KubeProbeJob) ToURL() string
type KubeProbeJobResults ¶
type KubeProbeJobResults struct { Job *KubeProbeJob IsConnected bool Err error Command string }
type NamespacedPod ¶
type NamespacedPod struct { NamespaceName string PodName string Namespace *Namespace Pod *Pod Containers []*Container }
func (*NamespacedPod) PodString ¶
func (np *NamespacedPod) PodString() PodString
func (*NamespacedPod) ServiceName ¶
func (np *NamespacedPod) ServiceName() string
type Peer ¶
Peer is used for matching pods by either or both of the pod's namespace and name.
type PodModel ¶
func NewDefaultModel ¶
func (*PodModel) AllPodStrings ¶
func (*PodModel) AllPods ¶
func (m *PodModel) AllPods() []*NamespacedPod
func (*PodModel) NewTruthTable ¶
func (m *PodModel) NewTruthTable() *TruthTable
type PodString ¶
type PodString string
PodString represents a namespace 'x' + pod 'a' as "x/a".
func NewPodString ¶
NewPodString instantiates a PodString from the given namespace and name.
type ProtocolPort ¶
type SyntheticProbeResult ¶
type SyntheticProbeResult struct { Port *ProtocolPort Policies *matcher.Policy Model *PodModel Ingress *TruthTable Egress *TruthTable Combined *TruthTable }
func RunSyntheticProbe ¶
func RunSyntheticProbe(policies *matcher.Policy, portProtocol *ProtocolPort, model *PodModel) *SyntheticProbeResult
func RunSyntheticProbes ¶
func RunSyntheticProbes(policies *matcher.Policy, ports []*ProtocolPort, model *PodModel) []*SyntheticProbeResult
type TruthTable ¶
type TruthTable struct { Froms []string Tos []string Values map[string]map[string]bool // contains filtered or unexported fields }
TruthTable takes in n items and maintains an n x n table of booleans for each ordered pair
func NewTruthTable ¶
func NewTruthTable(froms []string, tos []string, defaultValue *bool) *TruthTable
NewTruthTable creates a new truth table with froms and tos
func NewTruthTableFromItems ¶
func NewTruthTableFromItems(items []string, defaultValue *bool) *TruthTable
NewTruthTableFromItems creates a new truth table with items
func RunKubeProbe ¶
func RunKubeProbe(k8s *kube.Kubernetes, model *PodModel, port int, protocol v1.Protocol, numberOfWorkers int) *TruthTable
func (*TruthTable) Compare ¶
func (tt *TruthTable) Compare(other *TruthTable) *TruthTable
Compare is used to check two truth tables for equality, returning its result in the form of a third truth table. Both tables are expected to have identical items.
func (*TruthTable) Get ¶
func (tt *TruthTable) Get(from string, to string) bool
Get gets the specified value
func (*TruthTable) IsComplete ¶
func (tt *TruthTable) IsComplete() bool
IsComplete returns true if there's a value set for every single pair of items, otherwise it returns false.
func (*TruthTable) Set ¶
func (tt *TruthTable) Set(from string, to string, value bool)
Set sets the value for from->to
func (*TruthTable) SetAllFrom ¶
func (tt *TruthTable) SetAllFrom(from string, value bool)
SetAllFrom sets all values where from = 'from'
func (*TruthTable) SetAllTo ¶
func (tt *TruthTable) SetAllTo(to string, value bool)
SetAllTo sets all values where to = 'to'
func (*TruthTable) Table ¶
func (tt *TruthTable) Table() *tablewriter.Table