types

package
v0.0.0-...-6b10bcf Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	IngressRouteString            string = "route"
	IngressLoadBalancerString     string = "loadbalancer"
	IngressNodePortString         string = "nodeport"
	IngressNginxIngressString     string = "nginx-ingress-v1"
	IngressContourHttpProxyString string = "contour-http-proxy"
	IngressKubernetes             string = "ingress"
	IngressPodmanExternal         string = "external"
	IngressNoneString             string = "none"
)
View Source
const (
	// NamespaceDefault means the VAN is in the  skupper namespace which is applied when not specified by clients
	NamespaceDefault           string = "skupper"
	DefaultVanName             string = "skupper"
	DefaultSiteName            string = "skupper-site"
	ClusterLocalPostfix        string = ".svc.cluster.local"
	SiteConfigMapName          string = "skupper-site"
	NetworkStatusConfigMapName string = "skupper-network-status"
	SiteLeaderLockName         string = "skupper-site-leader"
)
View Source
const (
	TransportDeploymentName       string = "skupper-router"
	TransportComponentName        string = "router"
	TransportContainerName        string = "router"
	ConfigSyncContainerName       string = "config-sync"
	TransportLivenessPort         int32  = 9090
	TransportServiceAccountName   string = "skupper-router"
	TransportRoleName             string = "skupper-router"
	TransportRoleBindingName      string = "skupper-router"
	TransportEnvConfig            string = "QDROUTERD_CONF"
	TransportSaslConfig           string = "skupper-sasl-config"
	TransportConfigFile           string = "skrouterd.json"
	TransportConfigMapName        string = "skupper-internal"
	TransportServiceName          string = "skupper-router"
	LocalTransportServiceName     string = "skupper-router-local"
	RouterMaxFrameSizeDefault     int    = 16384
	RouterMaxSessionFramesDefault int    = 640
)

Transport constants

View Source
const (
	ControllerDeploymentName             string = "skupper-service-controller"
	ControllerComponentName              string = "service-controller"
	ControllerContainerName              string = "service-controller"
	ControllerServiceAccountName         string = "skupper-service-controller"
	ControllerRoleBindingName            string = "skupper-service-controller"
	ControllerClusterRoleBindingNsFormat string = "skupper-service-controller-%s"
	ControllerRoleName                   string = "skupper-service-controller"
	ControllerClusterRoleName            string = "skupper-service-controller-basic"
	ControllerExtendedClusterRoleName    string = "skupper-service-controller-extended"
	ControllerConfigPath                 string = "/etc/messaging/"
	ControllerServiceName                string = "skupper"
	ControllerPodmanContainerName        string = "skupper-controller-podman"
	FlowCollectorContainerName           string = "flow-collector"
	PrometheusDeploymentName             string = "skupper-prometheus"
	PrometheusComponentName              string = "prometheus"
	PrometheusContainerName              string = "prometheus-server"
	PrometheusServiceAccountName         string = "skupper-prometheus"
	PrometheusServiceName                string = "skupper-prometheus"
	PrometheusRoleBindingName            string = "skupper-prometheus"
	PrometheusRoleName                   string = "skupper-prometheus"
)

Controller and Collector constants

View Source
const (
	LocalClientSecret        string = "skupper-local-client"
	LocalServerSecret        string = "skupper-local-server"
	LocalCaSecret            string = "skupper-local-ca"
	SiteServerSecret         string = "skupper-site-server"
	SiteCaSecret             string = "skupper-site-ca"
	ConsoleServerSecret      string = "skupper-console-certs"
	ConsoleUsersSecret       string = "skupper-console-users"
	PrometheusServerSecret   string = "skupper-prometheus-certs"
	OauthRouterConsoleSecret string = "skupper-router-console-certs"
	ServiceCaSecret          string = "skupper-service-ca"
	ServiceClientSecret      string = "skupper-service-client" // Secret that is used in sslProfiles for all http2 connectors with tls enabled
)

Certificates/Secrets constants

View Source
const (
	BaseQualifier               string = "skupper.io"
	InternalQualifier           string = "internal." + BaseQualifier
	AddressQualifier            string = BaseQualifier + "/address"
	PortQualifier               string = BaseQualifier + "/port"
	ProxyQualifier              string = BaseQualifier + "/proxy"
	TargetServiceQualifier      string = BaseQualifier + "/target"
	HeadlessQualifier           string = BaseQualifier + "/headless"
	IngressModeQualifier        string = BaseQualifier + "/ingress"
	CpuRequestAnnotation        string = BaseQualifier + "/cpu-request"
	MemoryRequestAnnotation     string = BaseQualifier + "/memory-request"
	CpuLimitAnnotation          string = BaseQualifier + "/cpu-limit"
	MemoryLimitAnnotation       string = BaseQualifier + "/memory-limit"
	AffinityAnnotation          string = BaseQualifier + "/affinity"
	AntiAffinityAnnotation      string = BaseQualifier + "/anti-affinity"
	NodeSelectorAnnotation      string = BaseQualifier + "/node-selector"
	ControlledQualifier         string = InternalQualifier + "/controlled"
	ServiceQualifier            string = InternalQualifier + "/service"
	OriginQualifier             string = InternalQualifier + "/origin"
	OriginalSelectorQualifier   string = InternalQualifier + "/originalSelector"
	OriginalTargetPortQualifier string = InternalQualifier + "/originalTargetPort"
	OriginalAssignedQualifier   string = InternalQualifier + "/originalAssignedPort"
	InternalTypeQualifier       string = InternalQualifier + "/type"
	InternalMetadataQualifier   string = InternalQualifier + "/metadata"
	SkupperTypeQualifier        string = BaseQualifier + "/type"
	TypeProxyQualifier          string = InternalTypeQualifier + "=proxy"
	SkupperDisabledQualifier    string = InternalQualifier + "/disabled"
	TypeToken                   string = "connection-token"
	TypeClaimRecord             string = "token-claim-record"
	TypeClaimRequest            string = "token-claim"
	TypeGatewayToken            string = "gateway-connection-token"
	TypeTokenQualifier          string = BaseQualifier + "/type=connection-token"
	TypeTokenRequestQualifier   string = BaseQualifier + "/type=connection-token-request"
	TokenGeneratedBy            string = BaseQualifier + "/generated-by"
	SiteVersion                 string = BaseQualifier + "/site-version"
	TokenCost                   string = BaseQualifier + "/cost"
	TokenTemplate               string = BaseQualifier + "/token-template"
	UpdatedAnnotation           string = InternalQualifier + "/updated"
	AnnotationExcludes          string = BaseQualifier + "/exclude-annotations"
	LabelExcludes               string = BaseQualifier + "/exclude-labels"
	ServiceLabels               string = BaseQualifier + "/service-labels"
	ServiceAnnotations          string = BaseQualifier + "/service-annotations"
	ComponentAnnotation         string = BaseQualifier + "/component"
	SiteControllerIgnore        string = InternalQualifier + "/site-controller-ignore"
	RouterComponent             string = "router"
	ClaimExpiration             string = BaseQualifier + "/claim-expiration"
	ClaimsRemaining             string = BaseQualifier + "/claims-remaining"
	ClaimsMade                  string = BaseQualifier + "/claims-made"
	ClaimUrlAnnotationKey       string = BaseQualifier + "/url"
	ClaimPasswordDataKey        string = "password"
	ClaimCaCertDataKey          string = "ca.crt"
	ClaimRequestSelector        string = SkupperTypeQualifier + "=" + TypeClaimRequest
	LastFailedAnnotationKey     string = InternalQualifier + "/last-failed"
	StatusAnnotationKey         string = InternalQualifier + "/status"
	GatewayQualifier            string = InternalQualifier + "/gateway"
	IngressOnlyQualifier        string = BaseQualifier + "/ingress-only"
	TlsCertQualifier            string = BaseQualifier + "/tls-cert"
	TlsTrustQualifier           string = BaseQualifier + "/tls-trust"
)

Skupper qualifiers

View Source
const (
	AppLabel    string = "app.kubernetes.io/name"
	PartOfLabel string = "app.kubernetes.io/part-of"
	AppName     string = "skupper"
)

standard labels

View Source
const (
	ConsolePortName                        string = "console"
	ConsoleDefaultServicePort              int32  = 8080
	ConsoleDefaultServiceTargetPort        int32  = 8080
	FlowCollectorDefaultServicePort        int32  = 8010
	FlowCollectorDefaultServiceTargetPort  int32  = 8010
	ConsoleOpenShiftServicePort            int32  = 8888
	ConsoleOpenShiftOauthServicePort       int32  = 443
	ConsoleOpenShiftOauthServiceTargetPort int32  = 8443
	ConsoleRouteName                       string = "skupper"
	RouterConsoleServiceName               string = "skupper-router-console"
)

Console and vFlow Collector constants

View Source
const (
	ConsoleAuthModeOpenshift ConsoleAuthMode = "openshift"
	ConsoleAuthModeInternal                  = "internal"
	ConsoleAuthModeUnsecured                 = "unsecured"
)
View Source
const (
	ClaimRedemptionPort      int32  = 8081
	ClaimRedemptionPortName  string = "claims"
	ClaimRedemptionRouteName string = "claims"
)
View Source
const (
	PrometheusAuthModeTls       PrometheusAuthMode = "tls"
	PrometheusAuthModeBasic                        = "basic"
	PrometheusAuthModeUnsecured                    = "unsecured"
)
View Source
const (
	PrometheusPortName                       string = "prometheus"
	PrometheusServerDefaultServicePort       int32  = 9090
	PrometheusServerDefaultServiceTargetPort int32  = 9090
	PrometheusRouteName                      string = "skupper-prometheus"
)

Prometheus server constants (note: use console auth mode)

View Source
const (
	AmqpDefaultPort         int32  = 5672
	AmqpsDefaultPort        int32  = 5671
	EdgeRole                string = "edge"
	EdgeRouteName           string = "skupper-edge"
	EdgeListenerPort        int32  = 45671
	InterRouterRole         string = "inter-router"
	InterRouterListenerPort int32  = 55671
	InterRouterRouteName    string = "skupper-inter-router"
	InterRouterProfile      string = "skupper-internal"
	IngressName             string = "skupper"
)

Assembly constants

View Source
const (
	ConsoleIngressPrefix     = "skupper-console"
	ClaimsIngressPrefix      = "skupper-claims"
	InterRouterIngressPrefix = "skupper-inter-router"
	EdgeIngressPrefix        = "skupper-edge"
	PrometheusIngressPrefix  = "skupper-prometheus"
)
View Source
const DefaultFlowTimeoutDuration = time.Minute * 15
View Source
const DefaultTimeoutDuration = time.Second * 120
View Source
const (
	ENV_PLATFORM = "SKUPPER_PLATFORM"
)
View Source
const (
	OpenShiftServingCertSecretName string = "service.alpha.openshift.io/serving-cert-secret-name"
)

OpenShift constants

View Source
const (
	ServiceInterfaceConfigMap string = "skupper-services"
)

Service Interface constants

View Source
const (
	ServiceSyncAddress = "mc/$skupper-service-sync"
)

Service Sync constants

View Source
const (
	SkupperServiceCertPrefix string = "skupper-tls-"
)

Variables

View Source
var ClusterControllerExtendedPolicyRules = []rbacv1.PolicyRule{
	{
		Verbs:     []string{"get", "list", "watch"},
		APIGroups: []string{""},
		Resources: []string{"pods"},
	},
}
View Source
var ClusterControllerPolicyRules = []rbacv1.PolicyRule{
	{
		APIGroups: []string{"skupper.io"},
		Resources: []string{"skupperclusterpolicies"},
		Verbs:     []string{"get", "list", "watch"},
	},
	{
		APIGroups: []string{""},
		Resources: []string{"namespaces"},
		Verbs:     []string{"get"},
	},
	{
		APIGroups: []string{""},
		Resources: []string{"nodes"},
		Verbs:     []string{"get", "list", "watch"},
	},
}
View Source
var ControllerPolicyRule = []rbacv1.PolicyRule{
	{
		Verbs:     []string{"get", "list", "watch", "create", "update", "delete"},
		APIGroups: []string{""},
		Resources: []string{"services", "configmaps", "pods", "secrets"},
	},
	{
		Verbs:     []string{"get", "list", "watch", "create", "update", "delete"},
		APIGroups: []string{"apps"},
		Resources: []string{"deployments", "statefulsets"},
	},
	{
		Verbs:     []string{"get", "list", "watch"},
		APIGroups: []string{"apps"},
		Resources: []string{"daemonsets"},
	},
	{
		Verbs:     []string{"get", "list", "watch"},
		APIGroups: []string{"route.openshift.io"},
		Resources: []string{"routes"},
	},
	{
		Verbs:     []string{"get", "list", "watch"},
		APIGroups: []string{"apps.openshift.io"},
		Resources: []string{"deploymentconfigs"},
	},
	{
		Verbs:     []string{"get", "list", "watch"},
		APIGroups: []string{"networking.k8s.io"},
		Resources: []string{"ingresses"},
	},
}
View Source
var ControllerRoutesCustomHostPolicyRule = []rbacv1.PolicyRule{
	{
		Verbs:     []string{"get", "list", "watch"},
		APIGroups: []string{"route.openshift.io"},
		Resources: []string{"routes/custom-host"},
	},
}
View Source
var TransportPolicyRule = []rbacv1.PolicyRule{
	{
		Verbs:     []string{"get", "list", "watch"},
		APIGroups: []string{""},
		Resources: []string{"secrets", "pods"},
	},

	{
		Verbs:     []string{"get", "list", "watch", "create", "update", "delete"},
		APIGroups: []string{""},
		Resources: []string{"configmaps"},
	},

	{
		Verbs:     []string{"update", "delete"},
		APIGroups: []string{""},
		Resources: []string{"secrets"},
	},

	{
		Verbs:     []string{"get", "list", "watch"},
		APIGroups: []string{""},
		Resources: []string{"services"},
	},
	{
		Verbs:     []string{"get"},
		APIGroups: []string{"apps"},
		Resources: []string{"deployments"},
	},
	{
		Verbs:     []string{"get", "list", "watch"},
		APIGroups: []string{"route.openshift.io"},
		Resources: []string{"routes"},
	},
	{
		Verbs:     []string{"get", "list", "watch"},
		APIGroups: []string{"networking.k8s.io"},
		Resources: []string{"ingresses"},
	},
}
View Source
var TransportPrometheusAnnotations = map[string]string{
	"prometheus.io/port":   "9090",
	"prometheus.io/scrape": "true",
}

Functions

func IsOfLocalOrigin

func IsOfLocalOrigin(origin string) bool

func QualifiedServiceName

func QualifiedServiceName(name string, namespace string) string

func ValidAuthOptions

func ValidAuthOptions(platform Platform) []string

func ValidIngressOptions

func ValidIngressOptions(platform Platform) []string

Types

type AssemblySpec

type AssemblySpec struct {
	Name                  string       `json:"name,omitempty"`
	Mode                  string       `json:"mode,omitempty"`
	Listeners             []Listener   `json:"listeners,omitempty"`
	InterRouterListeners  []Listener   `json:"interRouterListeners,omitempty"`
	EdgeListeners         []Listener   `json:"edgeListeners,omitempty"`
	SslProfiles           []SslProfile `json:"sslProfiles,omitempty"`
	Connectors            []Connector  `json:"connectors,omitempty"`
	InterRouterConnectors []Connector  `json:"interRouterConnectors,omitempty"`
	EdgeConnectors        []Connector  `json:"edgeConnectors,omitempty"`
}

AssemblySpec for the links and connectors that form the VAN topology

type ByServiceInterfaceAddress

type ByServiceInterfaceAddress []ServiceInterface

func (ByServiceInterfaceAddress) Len

func (ByServiceInterfaceAddress) Less

func (a ByServiceInterfaceAddress) Less(i, j int) bool

func (ByServiceInterfaceAddress) Swap

func (a ByServiceInterfaceAddress) Swap(i, j int)

type CertAuthority

type CertAuthority struct {
	Name   string
	Labels map[string]string
}

type ConfigSyncOptions

type ConfigSyncOptions struct {
	Tuning
}

type Connector

type Connector struct {
	Name           string `json:"name,omitempty"`
	Role           string `json:"role,omitempty"`
	Host           string `json:"host"`
	Port           string `json:"port"`
	RouteContainer bool   `json:"routeContainer,omitempty"`
	Cost           int32  `json:"cost,omitempty"`
	VerifyHostname bool   `json:"verifyHostname,omitempty"`
	SslProfile     string `json:"sslProfile,omitempty"`
	LinkCapacity   int32  `json:"linkCapacity,omitempty"`
}

type ConnectorCreateOptions

type ConnectorCreateOptions struct {
	SkupperNamespace string
	Name             string
	Cost             int32
	Secret           *corev1.Secret
}

type ConnectorRemoveOptions

type ConnectorRemoveOptions struct {
	SkupperNamespace string
	Name             string
	ForceCurrent     bool
}

type ConnectorRole

type ConnectorRole string
const (
	ConnectorRoleInterRouter ConnectorRole = "inter-router"
	ConnectorRoleEdge                      = "edge"
)

type ConsoleAuthMode

type ConsoleAuthMode string

type ControllerOptions

type ControllerOptions struct {
	Tuning
	IngressHost        string
	ServiceAnnotations map[string]string
	PodAnnotations     map[string]string
	LoadBalancerIp     string
}

type Credential

type Credential struct {
	CA          string
	Name        string
	Subject     string
	Hosts       []string
	ConnectJson bool
	Post        bool
	Data        map[string][]byte
	Simple      bool `default:"false"`
	Labels      map[string]string
}

type CredentialHandler

type CredentialHandler interface {
	NewCertAuthority(ca CertAuthority) (*corev1.Secret, error)
	DeleteCertAuthority(id string) error
	ListCertAuthorities() ([]CertAuthority, error)
	NewCredential(cred Credential) (*corev1.Secret, error)
	DeleteCredential(id string) error
	ListCredentials() ([]Credential, error)
	GetCredential(id string) (*Credential, error)
	GetSecret(name string) (*corev1.Secret, error)
}

type DeploymentSpec

type DeploymentSpec struct {
	Image               ImageDetails                 `json:"image,omitempty"`
	Replicas            int32                        `json:"replicas,omitempty"`
	Labels              map[string]string            `json:"labels,omitempty"`
	Annotations         map[string]string            `json:"annotations,omitempty"`
	LabelSelector       map[string]string            `json:"labelSelector,omitempty"`
	EnvVar              []corev1.EnvVar              `json:"envVar,omitempty"`
	Ports               []corev1.ContainerPort       `json:"ports,omitempty"`
	Volumes             []corev1.Volume              `json:"volumes,omitempty"`
	VolumeMounts        [][]corev1.VolumeMount       `json:"volumeMounts,omitempty"`
	Roles               []*rbacv1.Role               `json:"roles,omitempty"`
	RoleBindings        []*rbacv1.RoleBinding        `json:"roleBinding,omitempty"`
	ClusterRoles        []*rbacv1.ClusterRole        `json:"clusterRoles,omitempty"`
	ClusterRoleBindings []*rbacv1.ClusterRoleBinding `json:"clusterRoleBinding,omitempty"`
	Routes              []*routev1.Route             `json:"routes,omitempty"`
	ServiceAccounts     []*corev1.ServiceAccount     `json:"serviceAccounts,omitempty"`
	Services            []*corev1.Service            `json:"services,omitempty"`
	Sidecars            []*corev1.Container          `json:"sidecars,omitempty"`
	SecurityContext     *corev1.SecurityContext      `json:"securityContext,omitempty"`
	Affinity            map[string]string            `json:"affinity,omitempty"`
	AntiAffinity        map[string]string            `json:"antiAffinity,omitempty"`
	NodeSelector        map[string]string            `json:"nodeSelector,omitempty"`
	CpuRequest          *resource.Quantity           `json:"cpuRequest,omitempty"`
	MemoryRequest       *resource.Quantity           `json:"memoryRequest,omitempty"`
	CpuLimit            *resource.Quantity           `json:"cpuLimit,omitempty"`
	MemoryLimit         *resource.Quantity           `json:"memoryLimit,omitempty"`
	HostAliases         []corev1.HostAlias           `json:"hostAliases,omitempty"`
}

DeploymentSpec for the VAN router or controller components to run within a cluster

func (*DeploymentSpec) GetCpuLimit

func (s *DeploymentSpec) GetCpuLimit() resource.Quantity

func (*DeploymentSpec) GetCpuRequest

func (s *DeploymentSpec) GetCpuRequest() resource.Quantity

func (*DeploymentSpec) GetMemoryLimit

func (s *DeploymentSpec) GetMemoryLimit() resource.Quantity

func (*DeploymentSpec) GetMemoryRequest

func (s *DeploymentSpec) GetMemoryRequest() resource.Quantity

func (*DeploymentSpec) HasCpuLimit

func (s *DeploymentSpec) HasCpuLimit() bool

func (*DeploymentSpec) HasCpuRequest

func (s *DeploymentSpec) HasCpuRequest() bool

func (*DeploymentSpec) HasMemoryLimit

func (s *DeploymentSpec) HasMemoryLimit() bool

func (*DeploymentSpec) HasMemoryRequest

func (s *DeploymentSpec) HasMemoryRequest() bool

type FlowCollectorOptions

type FlowCollectorOptions struct {
	Tuning
	FlowRecordTtl time.Duration
}

type GatewayEndpoint

type GatewayEndpoint struct {
	Name        string           `json:"name,omitempty" yaml:"name,omitempty"`
	Host        string           `json:"host,omitempty" yaml:"host,omitempty"`
	Loopback    bool             `json:"loopback,omitempty" yaml:"loopback,omitempty"`
	LocalPort   string           `json:"localPort,omitempty" yaml:"local_port,omitempty"`
	Service     ServiceInterface `json:"service,omitempty" yaml:"service,omitempty"`
	TargetPorts []int            `json:"targetPorts,omitempty" yaml:"target_ports,omitempty"`
}

type GatewayInspectResponse

type GatewayInspectResponse struct {
	Name       string
	Type       string
	Url        string
	Version    string
	Connectors map[string]GatewayEndpoint
	Listeners  map[string]GatewayEndpoint
}

type Headless

type Headless struct {
	Name          string             `json:"name" yaml:"name"`
	Size          int                `json:"size" yaml:"size"`
	TargetPorts   map[int]int        `json:"targetPorts,omitempty" yaml:"targetPorts,omitempty"`
	Affinity      map[string]string  `json:"affinity,omitempty" yaml:"affinity,omitempty"`
	AntiAffinity  map[string]string  `json:"antiAffinity,omitempty" yaml:"antiAffinity,omitempty"`
	NodeSelector  map[string]string  `json:"nodeSelector,omitempty" yaml:"nodeSelector,omitempty"`
	CpuRequest    *resource.Quantity `json:"cpuRequest,omitempty" yaml:"cpuRequest,omitempty"`
	MemoryRequest *resource.Quantity `json:"memoryRequest,omitempty" yaml:"memoryRequest,omitempty"`
	CpuLimit      *resource.Quantity `json:"cpuLimit,omitempty" yaml:"cpuLimit,omitempty"`
	MemoryLimit   *resource.Quantity `json:"memoryLimit,omitempty" yaml:"memoryLimit,omitempty"`
}

func (*Headless) GetCpuLimit

func (s *Headless) GetCpuLimit() resource.Quantity

func (*Headless) GetCpuRequest

func (s *Headless) GetCpuRequest() resource.Quantity

func (*Headless) GetMemoryLimit

func (s *Headless) GetMemoryLimit() resource.Quantity

func (*Headless) GetMemoryRequest

func (s *Headless) GetMemoryRequest() resource.Quantity

func (*Headless) HasCpuLimit

func (s *Headless) HasCpuLimit() bool

func (*Headless) HasCpuRequest

func (s *Headless) HasCpuRequest() bool

func (*Headless) HasMemoryLimit

func (s *Headless) HasMemoryLimit() bool

func (*Headless) HasMemoryRequest

func (s *Headless) HasMemoryRequest() bool

type HeadlessV1

type HeadlessV1 struct {
	Name          string             `json:"name"`
	Size          int                `json:"size"`
	TargetPort    int                `json:"targetPort,omitempty"`
	Affinity      map[string]string  `json:"affinity,omitempty"`
	AntiAffinity  map[string]string  `json:"antiAffinity,omitempty"`
	NodeSelector  map[string]string  `json:"nodeSelector,omitempty"`
	CpuRequest    *resource.Quantity `json:"cpuRequest,omitempty"`
	MemoryRequest *resource.Quantity `json:"memoryRequest,omitempty"`
}

type ImageDetails

type ImageDetails struct {
	Name       string `json:"image,omitempty"`
	PullPolicy string `json:"imagePullPolicy,omitempty"`
}

type LinkStatus

type LinkStatus struct {
	Name        string
	Url         string
	Cost        int
	Connected   bool
	Configured  bool
	Description string
	Created     string
}

type Listener

type Listener struct {
	Name             string `json:"name,omitempty"`
	Host             string `json:"host,omitempty"`
	Port             int32  `json:"port"`
	RouteContainer   bool   `json:"routeContainer,omitempty"`
	Http             bool   `json:"http,omitempty"`
	Cost             int32  `json:"cost,omitempty"`
	SslProfile       string `json:"sslProfile,omitempty"`
	SaslMechanisms   string `json:"saslMechanisms,omitempty"`
	AuthenticatePeer bool   `json:"authenticatePeer,omitempty"`
	LinkCapacity     int32  `json:"linkCapacity,omitempty"`
}

type Platform

type Platform string
const (
	PlatformKubernetes Platform = "kubernetes"
	PlatformPodman              = "podman"
)

func (Platform) IsKubernetes

func (p Platform) IsKubernetes() bool

type PrometheusAuthMode

type PrometheusAuthMode string

type PrometheusServerOptions

type PrometheusServerOptions struct {
	Tuning
	ExternalServer string
	AuthMode       string
	User           string
	Password       string
	PodAnnotations map[string]string
}

type Resources

type Resources interface {
	GetCpuRequest() resource.Quantity
	GetMemoryRequest() resource.Quantity
	GetCpuLimit() resource.Quantity
	GetMemoryLimit() resource.Quantity
	HasCpuRequest() bool
	HasMemoryRequest() bool
	HasCpuLimit() bool
	HasMemoryLimit() bool
}

type RouterInspectResponse

type RouterInspectResponse struct {
	Status            RouterStatusSpec
	TransportVersion  string
	ControllerVersion string
	ExposedServices   int
	ConsoleUrl        string
}

type RouterLogConfig

type RouterLogConfig struct {
	Module string
	Level  string
}

type RouterOptions

type RouterOptions struct {
	Tuning
	Logging             []RouterLogConfig
	MaxFrameSize        int
	MaxSessionFrames    int
	DataConnectionCount string
	IngressHost         string
	ServiceAnnotations  map[string]string
	PodAnnotations      map[string]string
	LoadBalancerIp      string
	DisableMutualTLS    bool
}

type RouterSpec

type RouterSpec struct {
	Name                  string          `json:"name,omitempty"`
	Namespace             string          `json:"namespace,omitempty"`
	AuthMode              ConsoleAuthMode `json:"authMode,omitempty"`
	Transport             DeploymentSpec  `json:"transport,omitempty"`
	ConfigSync            DeploymentSpec  `json:"configSync,omitempty"`
	Controller            DeploymentSpec  `json:"controller,omitempty"`
	Collector             DeploymentSpec  `json:"collector,omitempty"`
	PrometheusServer      DeploymentSpec  `json:"prometheusServer,omitempty"`
	RouterConfig          string          `json:"routerConfig,omitempty"`
	Users                 []User          `json:"users,omitempty"`
	CertAuthoritys        []CertAuthority `json:"certAuthoritys,omitempty"`
	TransportCredentials  []Credential    `json:"transportCredentials,omitempty"`
	ControllerCredentials []Credential    `json:"controllerCredentials,omitempty"`
	PrometheusCredentials []Credential    `json:"prometheusCredentials,omitempty"`
}

RouterSpec is the specification of VAN network with router, controller and assembly

type RouterStatusSpec

type RouterStatusSpec struct {
	SiteName               string                  `json:"siteName,omitempty"`
	Mode                   string                  `json:"mode,omitempty"`
	TransportReadyReplicas int32                   `json:"transportReadyReplicas,omitempty"`
	ConnectedSites         TransportConnectedSites `json:"connectedSites,omitempty"`
	BindingsCount          int                     `json:"bindingsCount,omitempty"`
}

type ServiceIngressMode

type ServiceIngressMode string
const (
	ServiceIngressModeAlways ServiceIngressMode = "Always"
	ServiceIngressModeNever  ServiceIngressMode = "Never"
)

type ServiceInterface

type ServiceInterface struct {
	Address                  string                   `json:"address" yaml:"address"`
	Protocol                 string                   `json:"protocol" yaml:"protocol"`
	Ports                    []int                    `json:"ports" yaml:"ports"`
	ExposeIngress            ServiceIngressMode       `json:"exposeIngress" yaml:"exposeIngress"`
	EventChannel             bool                     `json:"eventchannel,omitempty" yaml:"eventchannel,omitempty"`
	Aggregate                string                   `json:"aggregate,omitempty" yaml:"aggregate,omitempty"`
	Headless                 *Headless                `json:"headless,omitempty" yaml:"headless,omitempty"`
	Labels                   map[string]string        `json:"labels,omitempty" yaml:"labels,omitempty"`
	Annotations              map[string]string        `json:"annotations,omitempty" yaml:"annotations,omitempty"`
	Targets                  []ServiceInterfaceTarget `json:"targets" yaml:"targets,omitempty"`
	Origin                   string                   `json:"origin,omitempty" yaml:"origin,omitempty"`
	TlsCredentials           string                   `json:"tlsCredentials,omitempty"`
	TlsCertAuthority         string                   `json:"tlsCertAuthority,omitempty"`
	PublishNotReadyAddresses bool                     `json:"publishNotReadyAddresses,omitempty"`
	BridgeImage              string                   `json:"bridgeImage,omitempty"`
}

func (*ServiceInterface) AddTarget

func (service *ServiceInterface) AddTarget(target *ServiceInterfaceTarget)

func (*ServiceInterface) IsAnnotated

func (service *ServiceInterface) IsAnnotated() bool

func (*ServiceInterface) IsOfLocalOrigin

func (s *ServiceInterface) IsOfLocalOrigin() bool

func (*ServiceInterface) RequiresExternalBridge

func (s *ServiceInterface) RequiresExternalBridge() bool

func (*ServiceInterface) RequiresIngressPortAllocations

func (s *ServiceInterface) RequiresIngressPortAllocations() bool

func (*ServiceInterface) SetIngressMode

func (s *ServiceInterface) SetIngressMode(mode string) error

type ServiceInterfaceCreateOptions

type ServiceInterfaceCreateOptions struct {
	Protocol   string
	Address    string
	Port       int
	TargetPort int
	Headless   bool
}

type ServiceInterfaceHandler

type ServiceInterfaceHandler interface {
	Create(service *ServiceInterface) error
	List() (map[string]*ServiceInterface, error)
	Get(address string) (*ServiceInterface, error)
	Update(service *ServiceInterface) error
	Delete(address string) error
}

type ServiceInterfaceList

type ServiceInterfaceList []ServiceInterface

func (*ServiceInterfaceList) ConvertFrom

func (sl *ServiceInterfaceList) ConvertFrom(updates string) error

type ServiceInterfaceTarget

type ServiceInterfaceTarget struct {
	Name        string      `json:"name,omitempty"`
	Selector    string      `json:"selector,omitempty"`
	TargetPorts map[int]int `json:"targetPorts,omitempty"`
	Service     string      `json:"service,omitempty"`
	Namespace   string      `json:"namespace,omitempty"`
}

type ServiceInterfaceTargetV1

type ServiceInterfaceTargetV1 struct {
	Name       string `json:"name,omitempty"`
	Selector   string `json:"selector,omitempty"`
	TargetPort int    `json:"targetPort,omitempty"`
	Service    string `json:"service,omitempty"`
}

type ServiceInterfaceV1

type ServiceInterfaceV1 struct {
	Address      string                     `json:"address" yaml:"address"`
	Protocol     string                     `json:"protocol" yaml:"protocol"`
	Port         int                        `json:"port" yaml:"port"`
	EventChannel bool                       `json:"eventchannel,omitempty" yaml:"eventchannel,omitempty"`
	Aggregate    string                     `json:"aggregate,omitempty" yaml:"aggregate,omitempty"`
	Headless     *HeadlessV1                `json:"headless,omitempty" yaml:"headless,omitempty"`
	Labels       map[string]string          `json:"labels,omitempty" yaml:"labels,omitempty"`
	Targets      []ServiceInterfaceTargetV1 `json:"targets" yaml:"targets,omitempty"`
	Origin       string                     `json:"origin,omitempty" yaml:"origin,omitempty"`
}

type SiteConfig

type SiteConfig struct {
	Spec      SiteConfigSpec
	Reference SiteConfigReference
}

type SiteConfigReference

type SiteConfigReference struct {
	UID        string
	Name       string
	APIVersion string
	Kind       string
}

type SiteConfigSpec

type SiteConfigSpec struct {
	SkupperName              string
	SkupperNamespace         string
	RouterMode               string
	Routers                  int
	EnableController         bool
	EnableServiceSync        bool
	SiteTtl                  time.Duration
	EnableConsole            bool
	EnableFlowCollector      bool
	EnableRestAPI            bool
	AuthMode                 string
	User                     string
	Password                 string
	Ingress                  string
	IngressAnnotations       map[string]string
	ConsoleIngress           string
	IngressHost              string
	Replicas                 int32
	SiteControlled           bool
	CreateNetworkPolicy      bool
	Annotations              map[string]string
	Labels                   map[string]string
	Router                   RouterOptions
	Controller               ControllerOptions
	ConfigSync               ConfigSyncOptions
	FlowCollector            FlowCollectorOptions
	PrometheusServer         PrometheusServerOptions
	Platform                 Platform
	RunAsUser                int64
	RunAsGroup               int64
	EnableClusterPermissions bool
	EnableSkupperEvents      bool
}

func (*SiteConfigSpec) CheckConsoleIngress

func (s *SiteConfigSpec) CheckConsoleIngress() error

func (*SiteConfigSpec) CheckIngress

func (s *SiteConfigSpec) CheckIngress() error

func (*SiteConfigSpec) GetControllerIngressHost

func (s *SiteConfigSpec) GetControllerIngressHost() string

func (*SiteConfigSpec) GetRouterIngressHost

func (s *SiteConfigSpec) GetRouterIngressHost() string

func (*SiteConfigSpec) IsConsoleIngressContourHttpProxy

func (s *SiteConfigSpec) IsConsoleIngressContourHttpProxy() bool

func (*SiteConfigSpec) IsConsoleIngressKubernetes

func (s *SiteConfigSpec) IsConsoleIngressKubernetes() bool

func (*SiteConfigSpec) IsConsoleIngressLoadBalancer

func (s *SiteConfigSpec) IsConsoleIngressLoadBalancer() bool

func (*SiteConfigSpec) IsConsoleIngressNginxIngress

func (s *SiteConfigSpec) IsConsoleIngressNginxIngress() bool

func (*SiteConfigSpec) IsConsoleIngressNodePort

func (s *SiteConfigSpec) IsConsoleIngressNodePort() bool

func (*SiteConfigSpec) IsConsoleIngressNone

func (s *SiteConfigSpec) IsConsoleIngressNone() bool

func (*SiteConfigSpec) IsConsoleIngressRoute

func (s *SiteConfigSpec) IsConsoleIngressRoute() bool

func (*SiteConfigSpec) IsEdge

func (s *SiteConfigSpec) IsEdge() bool

func (*SiteConfigSpec) IsIngressContourHttpProxy

func (s *SiteConfigSpec) IsIngressContourHttpProxy() bool

func (*SiteConfigSpec) IsIngressKubernetes

func (s *SiteConfigSpec) IsIngressKubernetes() bool

func (*SiteConfigSpec) IsIngressLoadBalancer

func (s *SiteConfigSpec) IsIngressLoadBalancer() bool

func (*SiteConfigSpec) IsIngressNginxIngress

func (s *SiteConfigSpec) IsIngressNginxIngress() bool

func (*SiteConfigSpec) IsIngressNodePort

func (s *SiteConfigSpec) IsIngressNodePort() bool

func (*SiteConfigSpec) IsIngressNone

func (s *SiteConfigSpec) IsIngressNone() bool

func (*SiteConfigSpec) IsIngressPodmanHost

func (s *SiteConfigSpec) IsIngressPodmanHost() bool

func (*SiteConfigSpec) IsIngressRoute

func (s *SiteConfigSpec) IsIngressRoute() bool

type SslProfile

type SslProfile struct {
	Name   string `json:"name,omitempty"`
	Cert   string `json:"cert,omitempty"`
	Key    string `json:"key,omitempty"`
	CaCert string `json:"caCert,omitempty"`
}

type TransportConnectedSites

type TransportConnectedSites struct {
	Direct   int
	Indirect int
	Total    int
	Warnings []string
}

type TransportMode

type TransportMode string

TransportMode describes how a qdr is intended to be deployed, either interior or edge

const (
	// TransportModeInterior means the qdr will participate in inter-router protocol exchanges
	TransportModeInterior TransportMode = "interior"
	// TransportModeEdge means that the qdr will connect to interior routers for network access
	TransportModeEdge TransportMode = "edge"
)

type Tuning

type Tuning struct {
	NodeSelector string
	Affinity     string
	AntiAffinity string
	Cpu          string
	Memory       string
	CpuLimit     string
	MemoryLimit  string
}

type User

type User struct {
	Name     string
	Password string
}

type VanClientInterface

type VanClientInterface interface {
	RouterCreate(ctx context.Context, options SiteConfig) error
	RouterInspect(ctx context.Context) (*RouterInspectResponse, error)
	RouterInspectNamespace(ctx context.Context, namespace string) (*RouterInspectResponse, error)
	RouterRemove(ctx context.Context) error
	RouterUpdateVersion(ctx context.Context, hup bool) (bool, error)
	RouterUpdateVersionInNamespace(ctx context.Context, hup bool, namespace string) (bool, error)
	ConnectorCreateFromFile(ctx context.Context, secretFile string, options ConnectorCreateOptions) (*corev1.Secret, error)
	ConnectorCreateSecretFromData(ctx context.Context, options ConnectorCreateOptions) (*corev1.Secret, error)
	ConnectorCreate(ctx context.Context, secret *corev1.Secret, options ConnectorCreateOptions) error
	ConnectorInspect(ctx context.Context, name string) (*LinkStatus, error)
	ConnectorList(ctx context.Context) ([]LinkStatus, error)
	ConnectorRemove(ctx context.Context, options ConnectorRemoveOptions) error
	ConnectorTokenCreateFromTemplate(ctx context.Context, tokenName string, templateName string) (*corev1.Secret, bool, error)
	ConnectorTokenCreate(ctx context.Context, subject string, namespace string) (*corev1.Secret, bool, error)
	ConnectorTokenCreateFile(ctx context.Context, subject string, secretFile string) error
	TokenClaimCreate(ctx context.Context, name string, password []byte, expiry time.Duration, uses int) (*corev1.Secret, bool, error)
	TokenClaimCreateFile(ctx context.Context, name string, password []byte, expiry time.Duration, uses int, secretFile string) error
	ServiceInterfaceCreate(ctx context.Context, service *ServiceInterface) error
	ServiceInterfaceInspect(ctx context.Context, address string) (*ServiceInterface, error)
	ServiceInterfaceList(ctx context.Context) ([]*ServiceInterface, error)
	ServiceInterfaceRemove(ctx context.Context, address string) error
	ServiceInterfaceUpdate(ctx context.Context, service *ServiceInterface) error
	ServiceInterfaceBind(ctx context.Context, service *ServiceInterface, targetType string, targetName string, targetPorts map[int]int, namespace string) error
	GetHeadlessServiceConfiguration(targetName string, protocol string, address string, ports []int, publishNotReadyAddresses bool, namespace string) (*ServiceInterface, error)
	ServiceInterfaceUnbind(ctx context.Context, targetType string, targetName string, address string, deleteIfNoTargets bool, namespace string) error
	GatewayBind(ctx context.Context, gatewayName string, endpoint GatewayEndpoint) error
	GatewayUnbind(ctx context.Context, gatewayName string, endpoint GatewayEndpoint) error
	GatewayExpose(ctx context.Context, gatewayName string, gatewayType string, endpoint GatewayEndpoint) (string, error)
	GatewayUnexpose(ctx context.Context, gatewayName string, endpoint GatewayEndpoint, deleteLast bool) error
	GatewayForward(ctx context.Context, gatewayName string, endpoint GatewayEndpoint) error
	GatewayUnforward(ctx context.Context, gatewayName string, endpoint GatewayEndpoint) error
	GatewayInit(ctx context.Context, gatewayName string, gatewayType string, configFile string) (string, error)
	GatewayDownload(ctx context.Context, gatewayName string, downloadPath string) (string, error)
	GatewayExportConfig(ctx context.Context, targetGatewayName string, exportGatewayName string, exportPath string) (string, error)
	GatewayGenerateBundle(ctx context.Context, configFile string, bundlePath string) (string, error)
	GatewayInspect(ctx context.Context, gatewayName string) (*GatewayInspectResponse, error)
	GatewayList(ctx context.Context) ([]*GatewayInspectResponse, error)
	GatewayRemove(ctx context.Context, gatewayName string) error
	SiteConfigCreate(ctx context.Context, spec SiteConfigSpec) (*SiteConfig, error)
	SiteConfigUpdate(ctx context.Context, spec SiteConfigSpec) ([]string, error)
	SiteConfigInspect(ctx context.Context, input *corev1.ConfigMap) (*SiteConfig, error)
	SiteConfigRemove(ctx context.Context) error
	SkupperDump(ctx context.Context, tarName string, version string, kubeConfigPath string, kubeConfigContext string) (string, error)
	SkupperEvents(verbose bool) (*bytes.Buffer, error)
	SkupperCheckService(service string, verbose bool) (*bytes.Buffer, error)
	SkupperPolicies(verbose bool) (*bytes.Buffer, error)
	GetNamespace() string
	GetVersion(component string, name string) string
	GetIngressDefault() string
	RevokeAccess(ctx context.Context) error
	NetworkStatus(ctx context.Context) (*network.NetworkStatusInfo, error)
	GetConsoleUrl(namespace string) (string, error)
}

Jump to

Keyboard shortcuts

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