state

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceKindIngressRoute   = "IngressRoute"
	ResourceKindTraefikService = "TraefikService"
	ResourceKindTLSOption      = "TLSOption"
)

Supported Traefik CRD kinds.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessControlPolicy

type AccessControlPolicy struct {
	Name       string                         `json:"name"`
	Method     string                         `json:"method"`
	JWT        *AccessControlPolicyJWT        `json:"jwt,omitempty"`
	BasicAuth  *AccessControlPolicyBasicAuth  `json:"basicAuth,omitempty"`
	OIDC       *AccessControlPolicyOIDC       `json:"oidc,omitempty"`
	OIDCGoogle *AccessControlPolicyOIDCGoogle `json:"oidcGoogle,omitempty"`
}

AccessControlPolicy describes an Access Control Policy configured within a cluster.

type AccessControlPolicyBasicAuth

type AccessControlPolicyBasicAuth struct {
	Users                    string `json:"users,omitempty"`
	Realm                    string `json:"realm,omitempty"`
	StripAuthorizationHeader bool   `json:"stripAuthorizationHeader,omitempty"`
	ForwardUsernameHeader    string `json:"forwardUsernameHeader,omitempty"`
}

AccessControlPolicyBasicAuth holds the HTTP basic authentication configuration.

type AccessControlPolicyJWT

type AccessControlPolicyJWT struct {
	SigningSecret              string            `json:"signingSecret,omitempty"`
	SigningSecretBase64Encoded bool              `json:"signingSecretBase64Encoded"`
	PublicKey                  string            `json:"publicKey,omitempty"`
	JWKsFile                   string            `json:"jwksFile,omitempty"`
	JWKsURL                    string            `json:"jwksUrl,omitempty"`
	StripAuthorizationHeader   bool              `json:"stripAuthorizationHeader,omitempty"`
	ForwardHeaders             map[string]string `json:"forwardHeaders,omitempty"`
	TokenQueryKey              string            `json:"tokenQueryKey,omitempty"`
	Claims                     string            `json:"claims,omitempty"`
}

AccessControlPolicyJWT describes the settings for JWT authentication within an access control policy.

type AccessControlPolicyOIDC added in v0.6.0

type AccessControlPolicyOIDC struct {
	Issuer   string           `json:"issuer,omitempty"`
	ClientID string           `json:"clientId,omitempty"`
	Secret   *SecretReference `json:"secret,omitempty"`

	RedirectURL string            `json:"redirectUrl,omitempty"`
	LogoutURL   string            `json:"logoutUrl,omitempty"`
	Scopes      []string          `json:"scopes,omitempty"`
	AuthParams  map[string]string `json:"authParams,omitempty"`
	StateCookie *AuthStateCookie  `json:"stateCookie,omitempty"`
	Session     *AuthSession      `json:"session,omitempty"`

	ForwardHeaders map[string]string `json:"forwardHeaders,omitempty"`
	Claims         string            `json:"claims,omitempty"`
}

AccessControlPolicyOIDC holds the OIDC configuration.

type AccessControlPolicyOIDCGoogle added in v0.6.0

type AccessControlPolicyOIDCGoogle struct {
	ClientID string           `json:"clientId,omitempty"`
	Secret   *SecretReference `json:"secret,omitempty"`

	RedirectURL string            `json:"redirectUrl,omitempty"`
	LogoutURL   string            `json:"logoutUrl,omitempty"`
	AuthParams  map[string]string `json:"authParams,omitempty"`
	StateCookie *AuthStateCookie  `json:"stateCookie,omitempty"`
	Session     *AuthSession      `json:"session,omitempty"`

	ForwardHeaders map[string]string `json:"forwardHeaders,omitempty"`
	Emails         []string          `json:"emails,omitempty"`
}

AccessControlPolicyOIDCGoogle holds the Google OIDC configuration.

type AuthSession added in v0.6.0

type AuthSession struct {
	Path     string `json:"path,omitempty"`
	Domain   string `json:"domain,omitempty"`
	SameSite string `json:"sameSite,omitempty"`
	Secure   bool   `json:"secure,omitempty"`
	Refresh  *bool  `json:"refresh,omitempty"`
}

AuthSession carries session and session cookie configuration.

type AuthStateCookie added in v0.6.0

type AuthStateCookie struct {
	Path     string `json:"path,omitempty"`
	Domain   string `json:"domain,omitempty"`
	SameSite string `json:"sameSite,omitempty"`
	Secure   bool   `json:"secure,omitempty"`
}

AuthStateCookie carries the state cookie configuration.

type Cluster

type Cluster struct {
	Ingresses             map[string]*Ingress             `json:"ingresses"`
	IngressRoutes         map[string]*IngressRoute        `json:"ingressRoutes"`
	Services              map[string]*Service             `json:"services"`
	AccessControlPolicies map[string]*AccessControlPolicy `json:"accessControlPolicies"`
	EdgeIngresses         map[string]*EdgeIngress         `json:"edgeIngresses"`
}

Cluster describes a Cluster.

type EdgeIngress added in v0.6.0

type EdgeIngress struct {
	Name      string             `json:"name"`
	Namespace string             `json:"namespace"`
	Status    EdgeIngressStatus  `json:"status"`
	Service   EdgeIngressService `json:"service"`
	ACP       *EdgeIngressACP    `json:"acp,omitempty"`
}

EdgeIngress holds the definition of an EdgeIngress configuration.

type EdgeIngressACP added in v0.6.0

type EdgeIngressACP struct {
	Name string `json:"name"`
}

EdgeIngressACP configures the ACP to use on the Ingress.

type EdgeIngressService added in v0.6.0

type EdgeIngressService struct {
	Name string `json:"name"`
	Port int    `json:"port"`
}

EdgeIngressService configures the service to exposed on the edge.

type EdgeIngressStatus added in v0.6.0

type EdgeIngressStatus string

EdgeIngressStatus is the exposition status of an edge ingress.

const (
	EdgeIngressStatusUp   EdgeIngressStatus = "up"
	EdgeIngressStatusDown EdgeIngressStatus = "down"
)

Possible value of the EdgeIngressStatus.

type Fetcher

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

Fetcher fetches Kubernetes resources and converts them into a filtered and simplified state.

func NewFetcher

func NewFetcher(ctx context.Context, clientSet clientset.Interface, traefikClientSet traefikclientset.Interface, hubClientSet hubclientset.Interface) (*Fetcher, error)

NewFetcher creates a new Fetcher.

func (*Fetcher) FetchState

func (f *Fetcher) FetchState() (*Cluster, error)

FetchState assembles a cluster state from Kubernetes resources.

func (*Fetcher) GetServiceLogs

func (f *Fetcher) GetServiceLogs(ctx context.Context, namespace, name string, lines, maxLen int) ([]byte, error)

GetServiceLogs returns the logs from a service.

type Ingress

type Ingress struct {
	ResourceMeta
	IngressMeta

	IngressClassName *string               `json:"ingressClassName,omitempty"`
	TLS              []netv1.IngressTLS    `json:"tls,omitempty"`
	Rules            []netv1.IngressRule   `json:"rules,omitempty"`
	DefaultBackend   *netv1.IngressBackend `json:"defaultBackend,omitempty"`
	Services         []string              `json:"services,omitempty"`
}

Ingress describes an Kubernetes Ingress.

type IngressMeta

type IngressMeta struct {
	Annotations map[string]string `json:"annotations,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
}

IngressMeta represents the common Ingress metadata properties.

type IngressRoute

type IngressRoute struct {
	ResourceMeta
	IngressMeta

	TLS      *IngressRouteTLS `json:"tls,omitempty"`
	Routes   []Route          `json:"routes,omitempty"`
	Services []string         `json:"services,omitempty"`
}

IngressRoute describes a Traefik IngressRoute.

type IngressRouteTLS

type IngressRouteTLS struct {
	Domains    []traefikv1alpha1.Domain `json:"domains,omitempty"`
	SecretName string                   `json:"secretName,omitempty"`
	Options    *TLSOptionRef            `json:"options,omitempty"`
}

IngressRouteTLS represents a simplified Traefik IngressRoute TLS configuration.

type ResourceMeta

type ResourceMeta struct {
	Kind      string `json:"kind"`
	Group     string `json:"group"`
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

ResourceMeta represents the metadata which identify a Kubernetes resource.

type Route

type Route struct {
	Match    string         `json:"match"`
	Services []RouteService `json:"services,omitempty"`
}

Route represents a Traefik IngressRoute route.

type RouteService

type RouteService struct {
	Namespace  string `json:"namespace"`
	Name       string `json:"name"`
	PortName   string `json:"portName,omitempty"`
	PortNumber int32  `json:"portNumber,omitempty"`
}

RouteService represents a Kubernetes service targeted by a Traefik IngressRoute route.

type SecretReference added in v0.6.0

type SecretReference struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace,omitempty"`
}

SecretReference represents a Secret Reference. It has enough information to retrieve secret in any namespace.

type Service

type Service struct {
	Name          string             `json:"name"`
	Namespace     string             `json:"namespace"`
	Type          corev1.ServiceType `json:"type"`
	Annotations   map[string]string  `json:"annotations,omitempty"`
	ExternalIPs   []string           `json:"externalIPs,omitempty"`
	ExternalPorts []int              `json:"externalPorts,omitempty"`
}

Service describes a Service.

type TLSOptionRef

type TLSOptionRef struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace,omitempty"`
}

TLSOptionRef references TLSOptions.

Jump to

Keyboard shortcuts

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