recipes

package
v0.5.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Recipe01 = `` /* 180-byte string literal not displayed */
View Source
const Recipe02 = `` /* 285-byte string literal not displayed */
View Source
const Recipe02A = `` /* 208-byte string literal not displayed */

TODO clarify that this allows ingress from outside the cluster

View Source
const Recipe03 = `` /* 176-byte string literal not displayed */
View Source
const Recipe04 = `` /* 237-byte string literal not displayed */
View Source
const Recipe05 = `` /* 254-byte string literal not displayed */
View Source
const Recipe06 = `` /* 279-byte string literal not displayed */
View Source
const Recipe07 = `` /* 502-byte string literal not displayed */
View Source
const Recipe08 = `` /* 198-byte string literal not displayed */

TODO clarify that this allows ingress from outside the cluster

View Source
const Recipe09 = `` /* 310-byte string literal not displayed */
View Source
const Recipe10 = `` /* 524-byte string literal not displayed */
View Source
const Recipe11_1 = `` /* 181-byte string literal not displayed */
View Source
const Recipe11_2 = `` /* 304-byte string literal not displayed */
View Source
const Recipe12 = `` /* 181-byte string literal not displayed */
View Source
const Recipe14 = `` /* 328-byte string literal not displayed */

Variables

View Source
var Resources01 = &Resources{
	Namespaces: map[string]map[string]string{
		"x":       {},
		"default": {},
		"y":       {},
	},
	Pods: []*Pod{
		NewPod("x", "a", nil, "", container),
		NewPod("x", "b", nil, "", container),
		NewPod("x", "c", nil, "", container),
		NewPod("default", "a", nil, "", container),
		NewPod("default", "b", map[string]string{"app": "web"}, "", container),
		NewPod("default", "c", nil, "", container),
		NewPod("y", "a", nil, "", container),
		NewPod("y", "b", nil, "", container),
		NewPod("y", "c", nil, "", container),
	},
}
View Source
var Resources02 = &Resources{
	Namespaces: map[string]map[string]string{
		"x":       {},
		"default": {},
		"y":       {},
	},
	Pods: []*Pod{
		NewPod("x", "a", nil, "", container),
		NewPod("x", "b", map[string]string{"app": "bookstore"}, "", container),
		NewPod("x", "c", nil, "", container),
		NewPod("default", "a", map[string]string{"app": "bookstore"}, "", container),
		NewPod("default", "b", map[string]string{"app": "bookstore", "role": "api"}, "", container),
		NewPod("default", "c", map[string]string{"role": "api"}, "", container),
		NewPod("y", "a", nil, "", container),
		NewPod("y", "b", nil, "", container),
		NewPod("y", "c", map[string]string{"app": "bookstore"}, "", container),
	},
}
View Source
var Resources02A = &Resources{
	Namespaces: map[string]map[string]string{
		"x":       {},
		"default": {},
		"y":       {},
	},
	Pods: []*Pod{
		NewPod("x", "a", nil, "", container),
		NewPod("x", "b", nil, "", container),
		NewPod("x", "c", nil, "", container),
		NewPod("default", "a", nil, "", container),
		NewPod("default", "b", map[string]string{"app": "web"}, "", container),
		NewPod("default", "c", nil, "", container),
		NewPod("y", "a", nil, "", container),
		NewPod("y", "b", nil, "", container),
		NewPod("y", "c", nil, "", container),
	},
}
View Source
var Resources03 = &Resources{
	Namespaces: map[string]map[string]string{
		"x":       {},
		"default": {},
		"y":       {},
	},
	Pods: []*Pod{
		NewPod("x", "a", nil, "", container),
		NewPod("x", "b", nil, "", container),
		NewPod("x", "c", nil, "", container),
		NewPod("default", "a", nil, "", container),
		NewPod("default", "b", nil, "", container),
		NewPod("default", "c", nil, "", container),
		NewPod("y", "a", nil, "", container),
		NewPod("y", "b", nil, "", container),
		NewPod("y", "c", nil, "", container),
	},
}
View Source
var Resources04 = &Resources{
	Namespaces: map[string]map[string]string{
		"x":         {},
		"default":   {},
		"secondary": {},
	},
	Pods: []*Pod{
		NewPod("x", "a", nil, "", container),
		NewPod("x", "b", nil, "", container),
		NewPod("x", "c", nil, "", container),
		NewPod("default", "a", nil, "", container),
		NewPod("default", "b", nil, "", container),
		NewPod("default", "c", nil, "", container),
		NewPod("secondary", "a", nil, "", container),
		NewPod("secondary", "b", nil, "", container),
		NewPod("secondary", "c", nil, "", container),
	},
}
View Source
var Resources05 = &Resources{
	Namespaces: map[string]map[string]string{
		"x":       {},
		"default": {},
		"y":       {},
	},
	Pods: []*Pod{
		NewPod("x", "a", nil, "", container),
		NewPod("x", "b", nil, "", container),
		NewPod("x", "c", nil, "", container),
		NewPod("default", "a", nil, "", container),
		NewPod("default", "b", map[string]string{"app": "web"}, "", container),
		NewPod("default", "c", nil, "", container),
		NewPod("y", "a", nil, "", container),
		NewPod("y", "b", nil, "", container),
		NewPod("y", "c", nil, "", container),
	},
}
View Source
var Resources06 = &Resources{
	Namespaces: map[string]map[string]string{
		"x":       {"purpose": "production"},
		"default": {},
		"y":       {},
	},
	Pods: []*Pod{
		NewPod("x", "a", nil, "", container),
		NewPod("x", "b", nil, "", container),
		NewPod("x", "c", nil, "", container),
		NewPod("default", "a", nil, "", container),
		NewPod("default", "b", map[string]string{"app": "web"}, "", container),
		NewPod("default", "c", nil, "", container),
		NewPod("y", "a", nil, "", container),
		NewPod("y", "b", nil, "", container),
		NewPod("y", "c", nil, "", container),
	},
}
View Source
var Resources07 = &Resources{
	Namespaces: map[string]map[string]string{
		"x":       {"team": "operations"},
		"default": {},
		"y":       {"team": "operations"},
	},
	Pods: []*Pod{
		NewPod("x", "a", map[string]string{"type": "monitoring"}, "", container),
		NewPod("x", "b", nil, "", container),
		NewPod("x", "c", nil, "", container),
		NewPod("default", "a", map[string]string{"type": "monitoring"}, "", container),
		NewPod("default", "b", map[string]string{"app": "web"}, "", container),
		NewPod("default", "c", nil, "", container),
		NewPod("y", "a", map[string]string{"type": "monitoring"}, "", container),
		NewPod("y", "b", nil, "", container),
		NewPod("y", "c", nil, "", container),
	},
}
View Source
var Resources08 = &Resources{
	Namespaces: map[string]map[string]string{
		"x":       {},
		"default": {},
		"y":       {},
	},
	Pods: []*Pod{
		NewPod("x", "a", nil, "", container),
		NewPod("x", "b", nil, "", container),
		NewPod("x", "c", nil, "", container),
		NewPod("default", "a", nil, "", container),
		NewPod("default", "b", map[string]string{"app": "web"}, "", container),
		NewPod("default", "c", nil, "", container),
		NewPod("y", "a", nil, "", container),
		NewPod("y", "b", nil, "", container),
		NewPod("y", "c", nil, "", container),
	},
}
View Source
var Resources09 = &Resources{
	Namespaces: map[string]map[string]string{
		"x":       {},
		"default": {},
		"y":       {},
	},
	Pods: []*Pod{
		NewPod("x", "a", map[string]string{"role": "monitoring"}, "", cont5000),
		NewPod("x", "b", nil, "", cont5000),
		NewPod("x", "c", nil, "", cont5000),
		NewPod("default", "a", map[string]string{"role": "monitoring"}, "", cont5000),
		NewPod("default", "b", map[string]string{"app": "apiserver"}, "", cont5000),
		NewPod("default", "c", nil, "", cont5000),
		NewPod("y", "a", map[string]string{"role": "monitoring"}, "", cont5000),
		NewPod("y", "b", nil, "", cont5000),
		NewPod("y", "c", nil, "", cont5000),
	},
}

TODO this example could be improved by adding some probes over a different port

View Source
var Resources10 = &Resources{
	Namespaces: map[string]map[string]string{
		"x":       {},
		"default": {},
		"y":       {},
	},
	Pods: []*Pod{
		NewPod("x", "a", nil, "", container),
		NewPod("x", "b", nil, "", container),
		NewPod("x", "c", nil, "", container),
		NewPod("default", "a", map[string]string{"app": "bookstore", "role": "search"}, "", container),
		NewPod("default", "b", map[string]string{"app": "bookstore", "role": "db"}, "", container),
		NewPod("default", "c", map[string]string{"app": "bookstore", "role": "api"}, "", container),
		NewPod("default", "d", map[string]string{"app": "inventory", "role": "web"}, "", container),
		NewPod("y", "a", map[string]string{"app": "bookstore", "role": "search"}, "", container),
		NewPod("y", "b", map[string]string{"app": "bookstore", "role": "api"}, "", container),
		NewPod("y", "c", map[string]string{"app": "inventory", "role": "web"}, "", container),
	},
}
View Source
var Resources11_1 = &Resources{
	Namespaces: map[string]map[string]string{
		"x":       {},
		"default": {},
		"y":       {},
	},
	Pods: []*Pod{
		NewPod("x", "a", nil, "", container),
		NewPod("x", "b", nil, "", container),
		NewPod("x", "c", nil, "", container),
		NewPod("default", "a", nil, "", container),
		NewPod("default", "b", map[string]string{"app": "foo"}, "", container),
		NewPod("default", "c", nil, "", container),
		NewPod("y", "a", nil, "", container),
		NewPod("y", "b", nil, "", container),
		NewPod("y", "c", nil, "", container),
	},
}
View Source
var Resources11_2 = &Resources{
	Namespaces: map[string]map[string]string{
		"x":       {},
		"default": {},
		"y":       {},
	},
	Pods: []*Pod{
		NewPod("x", "a", nil, "", container),
		NewPod("x", "b", nil, "", container),
		NewPod("x", "c", nil, "", container),
		NewPod("default", "a", nil, "", container),
		NewPod("default", "b", map[string]string{"app": "foo"}, "", container),
		NewPod("default", "c", nil, "", container),
		NewPod("y", "a", nil, "", container),
		NewPod("y", "b", nil, "", container),
		NewPod("y", "c", nil, "", container),
	},
}
View Source
var Resources12 = &Resources{
	Namespaces: map[string]map[string]string{
		"x":       {},
		"default": {},
		"y":       {},
	},
	Pods: []*Pod{
		NewPod("x", "a", nil, "", container),
		NewPod("x", "b", nil, "", container),
		NewPod("x", "c", nil, "", container),
		NewPod("default", "a", nil, "", container),
		NewPod("default", "b", nil, "", container),
		NewPod("default", "c", nil, "", container),
		NewPod("y", "a", nil, "", container),
		NewPod("y", "b", nil, "", container),
		NewPod("y", "c", nil, "", container),
	},
}
View Source
var Resources14 = &Resources{
	Namespaces: map[string]map[string]string{
		"x":       {},
		"default": {},
		"y":       {},
	},
	Pods: []*Pod{
		NewPod("x", "a", nil, "", container),
		NewPod("x", "b", nil, "", container),
		NewPod("x", "c", nil, "", container),
		NewPod("default", "a", nil, "", container),
		NewPod("default", "b", nil, "", container),
		NewPod("default", "c", nil, "", container),
		NewPod("y", "a", nil, "", container),
		NewPod("y", "b", nil, "", container),
		NewPod("y", "c", nil, "", container),
	},
}

Functions

func Run

func Run()

Types

type Recipe

type Recipe struct {
	PolicyYamls []string
	Resources   *probe.Resources
	Protocol    v1.Protocol
	Port        int
}

func (*Recipe) Policies

func (r *Recipe) Policies() []*networkingv1.NetworkPolicy

func (*Recipe) RunProbe

func (r *Recipe) RunProbe() *probe.Table

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL