k8s

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REWRITE_HOST_KEY = "nginx.ingress.kubernetes.io/upstream-vhost"
	REWRITE_PATH_KEY = "nginx.ingress.kubernetes.io/rewrite-target"
	USE_REGEX_KEY    = "nginx.ingress.kubernetes.io/use-regex"
	SERVICE_PROTOCOL = "nginx.ingress.kubernetes.io/backend-protocol"
)
View Source
const (
	HEPA_BEGIN              = "###HEPA-AUTO-BEGIN###\n"
	HEPA_END                = "###HEPA-AUTO-END###\n"
	INGRESS_NS              = "ingress-nginx"
	SYSTEM_NS               = "kube-system"
	GATEWAY_SVC_NAME        = "api-gateway"
	INGRESS_APP_LABEL       = "app.kubernetes.io/name=ingress-nginx"
	INGRESS_APP_LABEL_NEW   = "app=ingress-nginx"
	INGRESS_CONFIG_NAME     = "nginx-configuration"
	INGRESS_CONFIG_NAME_NEW = "ingress-nginx-controller"
	LOC_SNIPPET_KEY         = "nginx.ingress.kubernetes.io/configuration-snippet"
	MAIN_SNIPPET_KEY        = "main-snippet"
	HTTP_SNIPPET_KEY        = "http-snippet"
	SERVER_SNIPPET_KEY      = "server-snippet"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendProtocl

type BackendProtocl string
const (
	HTTP  BackendProtocl = "http"
	HTTPS BackendProtocl = "https"
	GRPC  BackendProtocl = "grpc"
	GRPCS BackendProtocl = "grpcs"
	FCGI  BackendProtocl = "fastcgi"
)

type IngressBackend

type IngressBackend union_interface.IngressBackend

type IngressRoute

type IngressRoute union_interface.IngressRoute

type K8SAdapter

type K8SAdapter interface {
	IsGatewaySupportHttps(namespace string) (bool, error)
	MakeGatewaySupportHttps(namespace string) error
	MakeGatewaySupportMesh(namespace string) error
	CountIngressController() (int, error)
	CheckDomainExist(name string) (bool, error)
	DeleteIngress(namespace, name string) error
	CreateOrUpdateIngress(namespace, name string, routes []IngressRoute, backend IngressBackend, options ...RouteOptions) (bool, error)
	SetUpstreamHost(namespace, name, host string) error
	SetRewritePath(namespace, name, target string) error
	EnableRegex(namespace, name string) error
	CheckIngressExist(namespace, name string) (bool, error)
	UpdateIngressAnnotaion(namespace, name string, annotaion map[string]*string, snippet *string) error
	UpdateIngressConroller(options map[string]*string, mainSnippet, httpSnippet, serverSnippet *string) error
}

func NewAdapter

func NewAdapter(clusterKey string) (K8SAdapter, error)

type K8SAdapterImpl

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

func (*K8SAdapterImpl) CheckDomainExist

func (impl *K8SAdapterImpl) CheckDomainExist(domain string) (bool, error)

func (*K8SAdapterImpl) CheckIngressExist

func (impl *K8SAdapterImpl) CheckIngressExist(namespace, name string) (bool, error)

func (*K8SAdapterImpl) CountIngressController

func (impl *K8SAdapterImpl) CountIngressController() (count int, err error)

func (*K8SAdapterImpl) CreateOrUpdateIngress

func (impl *K8SAdapterImpl) CreateOrUpdateIngress(namespace, name string, routes []IngressRoute, backend IngressBackend, options ...RouteOptions) (bool, error)

func (*K8SAdapterImpl) DeleteIngress

func (impl *K8SAdapterImpl) DeleteIngress(namespace, name string) error

func (*K8SAdapterImpl) EnableRegex

func (impl *K8SAdapterImpl) EnableRegex(namespace, name string) error

func (*K8SAdapterImpl) IsGatewaySupportHttps

func (impl *K8SAdapterImpl) IsGatewaySupportHttps(namespace string) (bool, error)

func (*K8SAdapterImpl) MakeGatewaySupportHttps

func (impl *K8SAdapterImpl) MakeGatewaySupportHttps(namespace string) error

func (*K8SAdapterImpl) MakeGatewaySupportMesh

func (impl *K8SAdapterImpl) MakeGatewaySupportMesh(namespace string) error

func (*K8SAdapterImpl) SetRewritePath

func (impl *K8SAdapterImpl) SetRewritePath(namespace, name, target string) error

func (*K8SAdapterImpl) SetUpstreamHost

func (impl *K8SAdapterImpl) SetUpstreamHost(namespace, name, host string) error

func (*K8SAdapterImpl) UpdateIngressAnnotaion

func (impl *K8SAdapterImpl) UpdateIngressAnnotaion(namespace, name string, annotaion map[string]*string, snippet *string) error

func (*K8SAdapterImpl) UpdateIngressConroller

func (impl *K8SAdapterImpl) UpdateIngressConroller(options map[string]*string, mainSnippet, httpSnippet, serverSnippet *string) (err error)

type RouteOptions

type RouteOptions struct {
	RewriteHost         *string
	RewritePath         *string
	UseRegex            bool
	EnableTLS           bool
	BackendProtocol     *BackendProtocl
	InjectRuntimeDomain bool
	Annotations         map[string]*string
	LocationSnippet     *string
}

Jump to

Keyboard shortcuts

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