k8simpl

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend added in v0.18.0

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

func NewK8SBackend

func NewK8SBackend(
	restConfig *rest.Config,
	k8sCSet *kubernetes.Clientset,
	traefikClient *traefikv1alpha1.TraefikV1alpha1Client,
	certManagerClient *certmanagerv1.Clientset,
	config Config,
) (*Backend, error)

func (*Backend) AttachContainer added in v0.18.0

func (b *Backend) AttachContainer(ctx context.Context, appID string, stdin io.Reader, stdout, stderr io.Writer) error

func (*Backend) AvailableDomains added in v0.18.0

func (b *Backend) AvailableDomains() domain.AvailableDomainSlice

func (*Backend) AvailablePorts added in v0.18.0

func (b *Backend) AvailablePorts() domain.AvailablePortSlice

func (*Backend) Dispose added in v0.18.0

func (b *Backend) Dispose(_ context.Context) error

func (*Backend) ExecContainer added in v0.18.0

func (b *Backend) ExecContainer(ctx context.Context, appID string, cmd []string, stdin io.Reader, stdout, stderr io.Writer) error

func (*Backend) GetContainer added in v0.18.0

func (b *Backend) GetContainer(ctx context.Context, appID string) (*domain.Container, error)

func (*Backend) ListContainers added in v0.18.0

func (b *Backend) ListContainers(ctx context.Context) ([]*domain.Container, error)

func (*Backend) ListenContainerEvents added in v0.18.0

func (b *Backend) ListenContainerEvents() (sub <-chan *domain.ContainerEvent, unsub func())

func (*Backend) Start added in v0.18.0

func (b *Backend) Start(_ context.Context) error

func (*Backend) Synchronize added in v0.18.0

func (b *Backend) Synchronize(ctx context.Context, s *domain.DesiredState) error

type Config

type Config struct {
	Domains []*domainConf `mapstructure:"domains" yaml:"domains"`
	Ports   []*portConf   `mapstructure:"ports" yaml:"ports"`
	SS      struct {
		Namespace string `mapstructure:"namespace" yaml:"namespace"`
		Kind      string `mapstructure:"kind" yaml:"kind"`
		Name      string `mapstructure:"name" yaml:"name"`
		Port      int    `mapstructure:"port" yaml:"port"`
		Scheme    string `mapstructure:"scheme" yaml:"scheme"`
	} `mapstructure:"ss" yaml:"ss"`
	Namespace string       `mapstructure:"namespace" yaml:"namespace"`
	Labels    []*labelConf `mapstructure:"labels" yaml:"labels"`
	TLS       struct {
		// cert-manager note: https://doc.traefik.io/traefik/providers/kubernetes-crd/#letsencrypt-support-with-the-custom-resource-definition-provider
		// needs to enable ingress provider in traefik
		Type    string `mapstructure:"type" yaml:"type"`
		Traefik struct {
			CertResolver string `mapstructure:"certResolver" yaml:"certResolver"`
			Wildcard     struct {
				Domains domain.WildcardDomains `mapstructure:"domains" yaml:"domains"`
			} `mapstructure:"wildcard" yaml:"wildcard"`
		} `mapstructure:"traefik" yaml:"traefik"`
		CertManager struct {
			Issuer struct {
				Name string `mapstructure:"name" yaml:"name"`
				Kind string `mapstructure:"kind" yaml:"kind"`
			} `mapstructure:"issuer" yaml:"issuer"`
			Wildcard struct {
				Domains domain.WildcardDomains `mapstructure:"domains" yaml:"domains"`
			} `mapstructure:"wildcard" yaml:"wildcard"`
		} `mapstructure:"certManager" yaml:"certManager"`
	} `mapstructure:"tls" yaml:"tls"`
	// ImagePullSecret required if registry is private
	ImagePullSecret string `mapstructure:"imagePullSecret" yaml:"imagePullSecret"`
	Scheduling      struct {
		NodeSelector      []*nodeSelector     `mapstructure:"nodeSelector" yaml:"nodeSelector"`
		Tolerations       []*toleration       `mapstructure:"tolerations" yaml:"tolerations"`
		SpreadConstraints []*spreadConstraint `mapstructure:"spreadConstraints" yaml:"spreadConstraints"`
		ForceHosts        []string            `mapstructure:"forceHosts" yaml:"forceHosts"`
	} `mapstructure:"scheduling" yaml:"scheduling"`
	Resources struct {
		Requests struct {
			CPU    string `mapstructure:"cpu" yaml:"cpu"`
			Memory string `mapstructure:"memory" yaml:"memory"`
		} `mapstructure:"requests" yaml:"requests"`
		Limits struct {
			CPU    string `mapstructure:"cpu" yaml:"cpu"`
			Memory string `mapstructure:"memory" yaml:"memory"`
		} `mapstructure:"limits" yaml:"limits"`
	} `mapstructure:"resources" yaml:"resources"`
}

func (*Config) Validate

func (c *Config) Validate() error

Jump to

Keyboard shortcuts

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