kong

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// KongHelmRepoURL indicates the URL that will be used for pulling Kong Helm charts.
	KongHelmRepoURL = "https://charts.konghq.com"

	// DefaultDBMode indicates which dbmode for the Kong proxy should be used if no other is specified.
	DefaultDBMode = "none"

	// DefaultNamespace is the default namespace where the Kong proxy is expected to be deployed
	DefaultNamespace = "kong-system"

	// DefaultDeploymentName is the default name of the Kong proxy deployment
	DefaultDeploymentName = "ingress-controller"

	// DefaultReleaseName is the Helm release name of the Kong proxy
	DefaultReleaseName = DefaultDeploymentName + "-kong"

	// DefaultAdminServiceName indicates the name of the Service that's serving the Admin API
	DefaultAdminServiceName = DefaultReleaseName + "-admin"

	// DefaultAdminServicePort is the port on the service at which the Kong Admin API can be reached by default.
	DefaultAdminServicePort = 8001

	// DefaultProxyServiceName indicates the name of the Service that's serving the Proxy
	DefaultProxyServiceName = DefaultReleaseName + "-proxy"

	// DefaultProxyTCPServicePort is the port on the service at which the Kong proxy can be reached by default.
	DefaultProxyTCPServicePort = 80

	// DefaultProxyTLSServicePort is the port on the service at which the Kong proxy can be reached by default.
	DefaultProxyTLSServicePort = 443

	// DefaultUDPServiceName provides the name of the LoadBalancer service the proxy uses for UDP traffic.
	// TODO: this is a hack in place to workaround problems in the Kong helm chart when UDP ports are in use:
	//       See: https://github.com/Kong/charts/issues/329
	DefaultUDPServiceName = DefaultReleaseName + "-udp"

	// DefaultUDPServicePort indicates the default open port to be found on the Kong proxy's UDP service.
	DefaultUDPServicePort = 9999
)
View Source
const (
	// AddonName is the unique name of the Kong cluster.Addon
	AddonName clusters.AddonName = "kong"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Addon

type Addon struct {
	// contains filtered or unexported fields
}

Addon is a Kong Proxy addon which can be deployed on a clusters.Cluster.

func New

func New() *Addon

New produces a new clusters.Addon for Kong but uses a very opionated set of default configurations (see the defaults() function for more details). If you need to customize your Kong deployment, use the kong.Builder instead.

func (*Addon) Delete

func (a *Addon) Delete(ctx context.Context, cluster clusters.Cluster) error

func (*Addon) Deploy

func (a *Addon) Deploy(ctx context.Context, cluster clusters.Cluster) error

func (*Addon) Name

func (a *Addon) Name() clusters.AddonName

func (*Addon) Namespace added in v0.2.0

func (a *Addon) Namespace() string

Namespace indicates the operational namespace of Kong addon components, e.g. where the controller and proxy pods live.

func (*Addon) ProxyAdminURL

func (a *Addon) ProxyAdminURL(ctx context.Context, cluster clusters.Cluster) (*url.URL, error)

ProxyAdminURL provides a routable *url.URL for accessing the Kong Admin API.

func (*Addon) ProxyUDPURL

func (a *Addon) ProxyUDPURL(ctx context.Context, cluster clusters.Cluster) (*url.URL, error)

ProxyUDPURL provides a routable *url.URL for accessing the default UDP service for the Kong Proxy.

func (*Addon) ProxyURL

func (a *Addon) ProxyURL(ctx context.Context, cluster clusters.Cluster) (*url.URL, error)

ProxyURL provides a routable *url.URL for accessing the Kong proxy.

func (*Addon) Ready

func (a *Addon) Ready(ctx context.Context, cluster clusters.Cluster) (waitForObjects []runtime.Object, ready bool, err error)

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder is a configuration tool for Kong cluster.Addons

func NewBuilder

func NewBuilder() *Builder

NewBuilder provides a new Builder object for configuring and generating Kong Addon objects which can be deployed to cluster.Clusters

func (*Builder) Build

func (b *Builder) Build() *Addon

Build generates a new kong cluster.Addon which can be loaded and deployed into a test Environment's cluster.Cluster.

func (*Builder) WithControllerDisabled added in v0.2.0

func (b *Builder) WithControllerDisabled() *Builder

WithControllerDisabled configures the Addon in proxy only mode (bring your own control plane).

func (*Builder) WithDBLess

func (b *Builder) WithDBLess() *Builder

WithDBLess configures the resulting Addon to deploy a DBLESS proxy backend.

func (*Builder) WithPostgreSQL

func (b *Builder) WithPostgreSQL() *Builder

WithPostgreSQL configures the resulting Addon to deploy a PostgreSQL proxy backend.

type DBMode

type DBMode string

DBMode indicate which storage backend the Kong Proxy should be deployed with (e.g. DBLESS, Postgres, e.t.c.)

const (
	// DBLESS indicates that the Kong Proxy should be deployed with the DBLESS storage backend.
	DBLESS DBMode = "dbless"

	// PostgreSQL indicates that the Kong Proxy should be deployed with a PostgreSQL storage backend.
	PostgreSQL DBMode = "postgres"
)

Jump to

Keyboard shortcuts

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