gateway

package
v0.0.0-...-04a5965 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: EPL-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GatewayServiceName is the name of the service which through which the gateway can be accessed
	GatewayServiceName = "che-gateway"
	GatewayServicePort = 8080

	GatewayConfigMapNamePrefix = "che-gateway-route-"
)
View Source
const (
	StripPrefixMiddlewareSuffix   = "-strip-prefix"
	HeaderRewriteMiddlewareSuffix = "-header-rewrite"
	AuthMiddlewareSuffix          = "-auth"
	ErrorsMiddlewareSuffix        = "-errors"
	HeadersMiddlewareSuffix       = "-headers"
	RetryMiddlewareSuffix         = "-retry"
)

Variables

This section is empty.

Functions

func DeleteGatewayRouteConfig

func DeleteGatewayRouteConfig(componentName string, deployContext *chetypes.DeployContext) error

func GetConfigmapForGatewayConfig

func GetConfigmapForGatewayConfig(
	deployContext *chetypes.DeployContext,
	componentName string,
	gatewayConfig *TraefikConfig) (corev1.ConfigMap, error)

func SyncGatewayToCluster

func SyncGatewayToCluster(deployContext *chetypes.DeployContext) (bool, error)

SyncGatewayToCluster installs or deletes the gateway based on the custom resource configuration

Types

type GatewayReconciler

type GatewayReconciler struct {
	deploy.Reconcilable
}

func NewGatewayReconciler

func NewGatewayReconciler() *GatewayReconciler

func (*GatewayReconciler) Finalize

func (p *GatewayReconciler) Finalize(ctx *chetypes.DeployContext) bool

func (*GatewayReconciler) Reconcile

type TraefikConfig

type TraefikConfig struct {
	HTTP TraefikConfigHTTP `json:"http"`
}

A representation of the Traefik config as we need it. This is in no way complete but can be used for the purposes we need it for.

func CreateCommonTraefikConfig

func CreateCommonTraefikConfig(componentName string, rule string, priority int, serviceAddr string, stripPrefixes []string) *TraefikConfig

func CreateEmptyTraefikConfig

func CreateEmptyTraefikConfig() *TraefikConfig

func (*TraefikConfig) AddAuth

func (cfg *TraefikConfig) AddAuth(componentName string, authAddress string)

func (*TraefikConfig) AddAuthHeaderRewrite

func (cfg *TraefikConfig) AddAuthHeaderRewrite(componentName string)

func (*TraefikConfig) AddComponent

func (cfg *TraefikConfig) AddComponent(componentName string, rule string, priority int, serviceAddr string, stripPrefixes []string)

func (*TraefikConfig) AddErrors

func (cfg *TraefikConfig) AddErrors(componentName string, status string, service string, query string)

func (*TraefikConfig) AddOpenShiftTokenCheck

func (cfg *TraefikConfig) AddOpenShiftTokenCheck(componentName string)

func (*TraefikConfig) AddResponseHeaders

func (cfg *TraefikConfig) AddResponseHeaders(componentName string, headers map[string]string)

func (*TraefikConfig) AddRetry

func (cfg *TraefikConfig) AddRetry(componentName string, attempts int, initialInterval string)

func (*TraefikConfig) AddStripPrefix

func (cfg *TraefikConfig) AddStripPrefix(componentName string, prefixes []string)

type TraefikConfigErrors

type TraefikConfigErrors struct {
	Status  string `json:"status"`
	Service string `json:"service"`
	Query   string `json:"query"`
}

type TraefikConfigForwardAuth

type TraefikConfigForwardAuth struct {
	Address            string            `json:"address"`
	TrustForwardHeader bool              `json:"trustForwardHeader"`
	TLS                *TraefikConfigTLS `json:"tls,omitempty"`
}

type TraefikConfigForwardingTimeouts

type TraefikConfigForwardingTimeouts struct {
	DialTimeout string `json:"dialTimeout"`
}

type TraefikConfigHTTP

type TraefikConfigHTTP struct {
	Routers           map[string]*TraefikConfigRouter           `json:"routers"`
	Services          map[string]*TraefikConfigService          `json:"services"`
	Middlewares       map[string]*TraefikConfigMiddleware       `json:"middlewares,omitempty"`
	ServersTransports map[string]*TraefikConfigServersTransport `json:"serversTransports,omitempty"`
}

type TraefikConfigHeaders

type TraefikConfigHeaders struct {
	CustomResponseHeaders map[string]string `json:"customResponseHeaders,omitempty"`
}

type TraefikConfigLoadbalancer

type TraefikConfigLoadbalancer struct {
	Servers          []TraefikConfigLoadbalancerServer `json:"servers"`
	ServersTransport string                            `json:"serversTransport,omitempty"`
}

type TraefikConfigLoadbalancerServer

type TraefikConfigLoadbalancerServer struct {
	URL string `json:"url"`
}

type TraefikConfigMiddleware

type TraefikConfigMiddleware struct {
	StripPrefix *TraefikConfigStripPrefix `json:"stripPrefix,omitempty"`
	ForwardAuth *TraefikConfigForwardAuth `json:"forwardAuth,omitempty"`
	Errors      *TraefikConfigErrors      `json:"errors,omitempty"`
	Headers     *TraefikConfigHeaders     `json:"headers,omitempty"`
	Retry       *TraefikConfigRetry       `json:"retry,omitempty"`
	Plugin      *TraefikPlugin            `json:"plugin,omitempty"`
}

type TraefikConfigRetry

type TraefikConfigRetry struct {
	CustomResponseHeaders map[string]string `json:"customResponseHeaders,omitempty"`
	Attempts              int               `json:"attempts,omitempty"`
	InitialInterval       string            `json:"initialInterval,omitempty"`
}

type TraefikConfigRouter

type TraefikConfigRouter struct {
	Rule        string   `json:"rule"`
	Service     string   `json:"service"`
	Middlewares []string `json:"middlewares"`
	Priority    int      `json:"priority"`
}

type TraefikConfigServersTransport

type TraefikConfigServersTransport struct {
	ForwardingTimeouts *TraefikConfigForwardingTimeouts `json:"forwardingTimeouts"`
}

type TraefikConfigService

type TraefikConfigService struct {
	LoadBalancer TraefikConfigLoadbalancer `json:"loadBalancer"`
}

type TraefikConfigStripPrefix

type TraefikConfigStripPrefix struct {
	Prefixes []string `json:"prefixes"`
}

type TraefikConfigTLS

type TraefikConfigTLS struct {
	InsecureSkipVerify bool `json:"insecureSkipVerify"`
}

type TraefikPlugin

type TraefikPlugin struct {
	HeaderRewrite *TraefikPluginHeaderRewrite `json:"header-rewrite,omitempty"`
}

type TraefikPluginHeaderRewrite

type TraefikPluginHeaderRewrite struct {
	From   string `json:"from"`
	To     string `json:"to"`
	Prefix string `json:"prefix"`
}

Jump to

Keyboard shortcuts

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