Documentation ¶
Index ¶
Constants ¶
const ( // DefaultServiceTimeout indicates the amount of time (by default) for // connections, reads and writes to a service over a network should // be given before timing out by default. DefaultServiceTimeout = 60000 // DefaultRetries indicates the number of times a connection should be // retried by default. DefaultRetries = 5 // DefaultHTTPPort is the network port that should be assumed by default // for HTTP traffic to services. DefaultHTTPPort = 80 )
Variables ¶
var MinRegexHeaderKongVersion = semver.MustParse("2.8.0")
MinRegexHeaderKongVersion is the minimum Kong version that supports regex header matches
Functions ¶
func PortDefFromIntStr ¶
func PortDefFromIntStr(is intstr.IntOrString) kongstate.PortDef
func PortDefFromServiceBackendPort ¶
func PortDefFromServiceBackendPort(sbp *networkingv1.ServiceBackendPort) kongstate.PortDef
Types ¶
type Parser ¶ added in v2.3.0
type Parser struct {
// contains filtered or unexported fields
}
Parser parses Kubernetes objects and configurations into their equivalent Kong objects and configurations, producing a complete state configuration for the Kong Admin API.
func NewParser ¶ added in v2.3.0
func NewParser( logger logrus.FieldLogger, storer store.Storer, ) *Parser
NewParser produces a new Parser object provided a logging mechanism and a Kubernetes object store.
func (*Parser) Build ¶ added in v2.3.0
Build creates a Kong configuration from Ingress and Custom resources defined in Kuberentes. It throws an error if there is an error returned from client-go.
func (*Parser) EnableKubernetesObjectReports ¶ added in v2.3.0
func (p *Parser) EnableKubernetesObjectReports()
EnableKubernetesObjectReports turns on object reporting for this parser: each subsequent call to Build() will track the Kubernetes objects which were successfully parsed. Objects tracked this way can be retrieved by calling GenerateKubernetesObjectReport().
func (*Parser) GenerateKubernetesObjectReport ¶ added in v2.3.0
GenerateKubernetesObjectReport provides a list of all the Kubernetes objects that have been successfully parsed as part of Build() calls so far. The objects are consumed: the parser's internal list will be emptied once this method is called, until more builds are run.
func (*Parser) ReportKubernetesObjectUpdate ¶ added in v2.3.0
ReportKubernetesObjectUpdate reports an update to a Kubernetes object if updates have been requested. If the parser has not been configured to report Kubernetes object updates this is a no-op.