Documentation
¶
Index ¶
- Constants
- func GetLicenseJSONFromEnv() (string, error)
- func GetLicenseSecretFromEnv() (*corev1.Secret, error)
- func GetLicenseSecretYAMLFromEnv() (string, error)
- type Addon
- func (a *Addon) Delete(ctx context.Context, cluster clusters.Cluster) error
- func (a *Addon) Dependencies(ctx context.Context, cluster clusters.Cluster) []clusters.AddonName
- func (a *Addon) Deploy(ctx context.Context, cluster clusters.Cluster) error
- func (a *Addon) DumpDiagnostics(ctx context.Context, cluster clusters.Cluster) (map[string][]byte, 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) WithControllerImage(repo, tag string) *Builder
- func (b *Builder) WithDBLess() *Builder
- func (b *Builder) WithLogLevel(level string) *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) WithProxyEnvVar(name, value string) *Builder
- func (b *Builder) WithProxyImage(repo, tag string) *Builder
- func (b *Builder) WithProxyImagePullSecret(server, username, password, email string) *Builder
- func (b *Builder) WithProxyServiceType(serviceType corev1.ServiceType) *Builder
- type DBMode
- type License
- type LicenseData
- type LicensePayload
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.7.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" // ProxyPullSecretName is the name of the Secret used by the WithProxyImagePullSecret() builder ProxyPullSecretName = "proxy-pull" )
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 // DefaultTCPServicePort indicates the default open port that will be used for TCP traffic. DefaultTCPServicePort = 8888 // DefaultTLSServicePort indicates the default open port that will be used for TLS traffic. DefaultTLSServicePort = 8899 // DefaultProxyNodePort indicates the default NodePort that will be used for // the proxy when applicable. DefaultProxyNodePort = 30080 )
const LicenseDataEnvVar = "KONG_LICENSE_DATA"
LicenseDataEnvVar is the environment variable where the Kong enterprise license will be stored if available for tests.
Variables ¶
This section is empty.
Functions ¶
func GetLicenseJSONFromEnv ¶ added in v0.9.1
GetLicenseJSONFromEnv retrieves the license data from the environment and validates it, returning the resulting JSON string.
func GetLicenseSecretFromEnv ¶ added in v0.9.1
GetLicenseSecretFromEnv retrieves the license data from the environment and validates it, returning a Kubernetes Secret object containing the license.
func GetLicenseSecretYAMLFromEnv ¶ added in v0.9.1
GetLicenseSecretYAMLFromEnv retrieves the license data from the environment and validates it, returning a Kubernetes Secret manifest containing the license.
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) Dependencies ¶ added in v0.11.0
func (*Addon) DumpDiagnostics ¶ added in v0.17.0
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) WithControllerImage ¶ added in v0.15.0
WithControllerImage configures the ingress controller container image name and tag.
func (*Builder) WithDBLess ¶
WithDBLess configures the resulting Addon to deploy a DBLESS proxy backend.
func (*Builder) WithLogLevel ¶ added in v0.17.0
WithLogLevel sets the proxy log level
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) WithProxyEnvVar ¶ added in v0.20.0
WithProxyEnvVar sets an arbitrary proxy/Kong container environment variable to a string value. The name must be the lowercase kong.conf style with no KONG_ prefix.
func (*Builder) WithProxyImage ¶ added in v0.7.0
WithProxyImage configures the container image name and tag for the Kong proxy.
func (*Builder) WithProxyImagePullSecret ¶ added in v0.16.0
func (*Builder) WithProxyServiceType ¶ added in v0.20.0
func (b *Builder) WithProxyServiceType(serviceType corev1.ServiceType) *Builder
WithProxyServiceType indicates which Service type to use for ingress traffic. The default type is LoadBalancer.
type DBMode ¶
type DBMode string
DBMode indicate which storage backend the Kong Proxy should be deployed with (e.g. DBLESS, Postgres, e.t.c.)
type License ¶ added in v0.9.1
type License struct {
Data LicenseData `json:"license"`
}
func GetLicenseFromEnv ¶ added in v0.9.1
GetLicenseFromEnv retrieves the license data from the environment and validates it, returning the resulting *License object.
type LicenseData ¶ added in v0.9.1
type LicenseData struct { Payload LicensePayload `json:"payload"` Signature string `json:"signature"` Version string `json:"version"` }
type LicensePayload ¶ added in v0.9.1
type LicensePayload struct { AdminSeats string `json:"admin_seats"` Customer string `json:"customer"` DataPlanes string `json:"dataplanes"` CreationDate string `json:"license_creation_date"` ExpirationDate string `json:"license_expiration_date"` Key string `json:"license_key"` ProductSubscription string `json:"product_subscription"` SupportPlan string `json:"support_plan"` }