Documentation
¶
Index ¶
- Constants
- type Addon
- func (a *Addon) Delete(ctx context.Context, cluster clusters.Cluster) error
- func (a *Addon) Deploy(ctx context.Context, cluster clusters.Cluster) error
- func (a *Addon) Name() clusters.AddonName
- func (a *Addon) Namespace() string
- func (a *Addon) ProxyAdminURL(ctx context.Context, cluster clusters.Cluster) (*url.URL, error)
- func (a *Addon) ProxyUDPURL(ctx context.Context, cluster clusters.Cluster) (*url.URL, error)
- func (a *Addon) ProxyURL(ctx context.Context, cluster clusters.Cluster) (*url.URL, error)
- func (a *Addon) Ready(ctx context.Context, cluster clusters.Cluster) (waitForObjects []runtime.Object, ready bool, err error)
- type Builder
- func (b *Builder) Build() *Addon
- func (b *Builder) WithControllerDisabled() *Builder
- func (b *Builder) WithDBLess() *Builder
- func (b *Builder) WithLogger(logger *logrus.Logger) *Builder
- func (b *Builder) WithPostgreSQL() *Builder
- func (b *Builder) WithProxyAdminServiceTypeLoadBalancer() *Builder
- func (b *Builder) WithProxyEnterpriseEnabled(licenseJSON string) *Builder
- func (b *Builder) WithProxyEnterpriseSuperAdminPassword(password string) *Builder
- func (b *Builder) WithProxyImage(repo, tag string) *Builder
- type DBMode
Constants ¶
const ( // AddonName is the unique name of the Kong cluster.Addon AddonName clusters.AddonName = "kong" // DefaultEnterpriseImageRepo default kong enterprise image DefaultEnterpriseImageRepo = "kong/kong-gateway" // DefaultEnterpriseImageTag latest kong enterprise image tag DefaultEnterpriseImageTag = "2.5.0.0-alpine" // DefaultEnterpriseLicenseSecretName is the name that will be used by default for the // Kubernetes secret containing the Kong enterprise license that will be // deployed when enterprise mode is enabled. DefaultEnterpriseLicenseSecretName = "kong-enterprise-license" // DefaultEnterpriseAdminPasswordSecretName is the secret name that will be used // by default for the Kubernetes secret that will be deployed containing the // superuser admin password in enterprise mode. DefaultEnterpriseAdminPasswordSecretName = "kong-enterprise-superuser-password" // DefaultAdminGUISessionConfSecretName is the secret name that will be used by // default for the Kbuernetes secret that will be deployed containing the // session configuration for the Kong Admin GUI in enterprise mode. DefaultAdminGUISessionConfSecretName = "kong-session-config" )
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 )
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) Namespace ¶ added in v0.2.0
Namespace indicates the operational namespace of Kong addon components, e.g. where the controller and proxy pods live.
func (*Addon) ProxyAdminURL ¶
ProxyAdminURL provides a routable *url.URL for accessing the Kong Admin API.
func (*Addon) ProxyUDPURL ¶
ProxyUDPURL provides a routable *url.URL for accessing the default UDP service for the Kong Proxy.
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 ¶
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
WithControllerDisabled configures the Addon in proxy only mode (bring your own control plane).
func (*Builder) WithDBLess ¶
WithDBLess configures the resulting Addon to deploy a DBLESS proxy backend.
func (*Builder) WithLogger ¶ added in v0.7.0
WithLogger adds a logger that will provide extra information about the build step of the addon at various configured log levels.
func (*Builder) WithPostgreSQL ¶
WithPostgreSQL configures the resulting Addon to deploy a PostgreSQL proxy backend.
func (*Builder) WithProxyAdminServiceTypeLoadBalancer ¶ added in v0.7.0
WithProxyAdminServiceTypeLoadBalancer sets the Kong proxy's admin API's Kubernetes Service type to a "LoadBalancer" type for access outside of the cluster.
WARNING: Keep in mind that depending on your cluster provider and configuration using this option may expose your admin api endpoint to the internet.
func (*Builder) WithProxyEnterpriseEnabled ¶ added in v0.7.0
WithProxyEnterpriseEnabled configures the resulting Addon to deploy the enterprise version of the Kong proxy. See: https://docs.konghq.com/enterprise/
func (*Builder) WithProxyEnterpriseSuperAdminPassword ¶ added in v0.7.0
WithProxyEnterpriseSuperAdminPassword specify kong admin password
func (*Builder) WithProxyImage ¶ added in v0.7.0
WithProxyImage configures the container image name and tag for the Kong proxy.