Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertRawExtensionToStruct(raw runtime.RawExtension, out interface{}) error
- type BasicRuleMiddleware
- type Gateway
- type GatewayConfig
- type GatewayReconciler
- type JWTRuleMiddleware
- type Middleware
- type Middlewares
- type OauthEndpoint
- type OauthRulerMiddleware
- type RateLimitRuleMiddleware
- type Redis
- type RouteReconciler
Constants ¶
const ( AppImageName = "jkaninda/goma-gateway" ExtraConfigPath = "/etc/goma/extra/" BasicAuth = "basic" // basic authentication middlewares JWTAuth = "jwt" // JWT authentication middlewares OAuth = "oauth" RateLimit = "rateLimit" BelongsTo = "goma-gateway" GatewayConfigVersion = "1.0" FinalizerName = "finalizer.gomaproj.jonaskaninda.com" ConfigName = "goma.yml" )
Variables ¶
var (
ReplicaCount int32 = 1
)
Functions ¶
func ConvertRawExtensionToStruct ¶
func ConvertRawExtensionToStruct(raw runtime.RawExtension, out interface{}) error
Types ¶
type BasicRuleMiddleware ¶
type Gateway ¶
type Gateway struct { // SSLCertFile SSL Certificate file SSLCertFile string `yaml:"sslCertFile"` // SSLKeyFile SSL Private key file SSLKeyFile string `yaml:"sslKeyFile"` // Redis contains redis database details Redis Redis `yaml:"redis"` // WriteTimeout defines proxy write timeout WriteTimeout int `yaml:"writeTimeout"` // ReadTimeout defines proxy read timeout ReadTimeout int `yaml:"readTimeout"` // IdleTimeout defines proxy idle timeout IdleTimeout int `yaml:"idleTimeout"` LogLevel string `yaml:"logLevel"` Cors gomaprojv1beta1.Cors `yaml:"cors"` // DisableHealthCheckStatus enable and disable routes health check DisableHealthCheckStatus bool `yaml:"disableHealthCheckStatus"` // DisableRouteHealthCheckError allows enabling and disabling backend healthcheck errors DisableRouteHealthCheckError bool `yaml:"disableRouteHealthCheckError"` // Disable allows enabling and disabling displaying routes on start DisableDisplayRouteOnStart bool `yaml:"disableDisplayRouteOnStart"` // DisableKeepAlive allows enabling and disabling KeepALive server DisableKeepAlive bool `yaml:"disableKeepAlive"` EnableMetrics bool `yaml:"enableMetrics"` // InterceptErrors holds the status codes to intercept the error from backend InterceptErrors []int `yaml:"interceptErrors,omitempty"` Routes []gomaprojv1beta1.RouteConfig `json:"routes,omitempty" yaml:"routes,omitempty"` }
Gateway contains Goma Proxy Gateway's configs
type GatewayConfig ¶
type GatewayConfig struct { Version string `json:"version" yaml:"version"` Gateway Gateway `json:"gateway" yaml:"gateway"` Middlewares []Middleware `json:"middlewares,omitempty" yaml:"middlewares,omitempty"` }
type GatewayReconciler ¶
GatewayReconciler reconciles a Gateway object
func (*GatewayReconciler) Reconcile ¶
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. the Gateway object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.19.1/pkg/reconcile
func (*GatewayReconciler) SetupWithManager ¶
func (r *GatewayReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type JWTRuleMiddleware ¶
type Middleware ¶
type Middleware struct { // Path contains the name of middlewares and must be unique Name string `json:"name" yaml:"name"` // Type contains authentication types // // basic, jwt, auth0, rateLimit, access Type string `json:"type" yaml:"type"` // Middleware type [basic, jwt, auth0, rateLimit, access] Paths []string `json:"paths" yaml:"paths"` // Protected paths // Rule contains route middleware rule Rule interface{} `json:"rule" yaml:"rule"` }
type Middlewares ¶
type Middlewares struct {
Middlewares []Middleware `json:"middlewares,omitempty" yaml:"middlewares,omitempty"`
}
type OauthEndpoint ¶
type OauthRulerMiddleware ¶
type OauthRulerMiddleware struct { // ClientID is the application's ID. ClientID string `yaml:"clientId"` // ClientSecret is the application's secret. ClientSecret string `yaml:"clientSecret"` // oauth provider google, gitlab, github, amazon, facebook, custom Provider string `yaml:"provider"` // Endpoint contains the resource server's token endpoint Endpoint OauthEndpoint `yaml:"endpoint"` // RedirectURL is the URL to redirect users going through // the OAuth flow, after the resource owner's URLs. RedirectURL string `yaml:"redirectUrl"` // RedirectPath is the PATH to redirect users after authentication, e.g: /my-protected-path/dashboard RedirectPath string `yaml:"redirectPath"` // CookiePath e.g: /my-protected-path or / || by default is applied on a route path CookiePath string `yaml:"cookiePath"` // Scope specifies optional requested permissions. Scopes []string `yaml:"scopes"` // contains filtered or unexported fields State string `yaml:"state"` JWTSecret string `yaml:"jwtSecret"` }
type RateLimitRuleMiddleware ¶
type RouteReconciler ¶
RouteReconciler reconciles a Route object
func (*RouteReconciler) Reconcile ¶
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the Route object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.19.1/pkg/reconcile
func (*RouteReconciler) RestartDeployment ¶
func (r *RouteReconciler) RestartDeployment(ctx context.Context, req ctrl.Request, gateway gomaprojv1beta1.Gateway) error
func (*RouteReconciler) SetupWithManager ¶
func (r *RouteReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.