platform

package
v0.70.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCertificateForService added in v0.30.0

func NewCertificateForService(issuer, namespace string, name string) certmanager.Certificate

Types

type CompositeHook

type CompositeHook struct {
	Hooks []ProvisionHook
}

func (CompositeHook) AfterProvision

func (c CompositeHook) AfterProvision(platform *Platform, machine types.Machine) error

func (CompositeHook) AfterTerminate

func (c CompositeHook) AfterTerminate(platform *Platform, machine types.Machine) error

func (CompositeHook) BeforeProvision

func (c CompositeHook) BeforeProvision(platform *Platform, machine *types.VM) error

func (CompositeHook) BeforeTerminate

func (c CompositeHook) BeforeTerminate(platform *Platform, machine types.Machine) error

func (CompositeHook) String

func (c CompositeHook) String() string

type ConsulProvider

type ConsulProvider struct {
	api.Consul
}

func NewConsulProvider

func NewConsulProvider(platform *Platform) ConsulProvider

func (ConsulProvider) AfterProvision

func (consul ConsulProvider) AfterProvision(platform *Platform, machine types.Machine) error

func (ConsulProvider) AfterTerminate

func (consul ConsulProvider) AfterTerminate(platform *Platform, machine types.Machine) error

func (ConsulProvider) BeforeProvision

func (consul ConsulProvider) BeforeProvision(platform *Platform, machine *types.VM) error

func (ConsulProvider) BeforeTerminate

func (consul ConsulProvider) BeforeTerminate(platform *Platform, machine types.Machine) error

func (ConsulProvider) GetControlPlaneEndpoint

func (consul ConsulProvider) GetControlPlaneEndpoint(platform *Platform) (string, error)

func (ConsulProvider) GetExternalEndpoints

func (consul ConsulProvider) GetExternalEndpoints(platform *Platform) ([]string, error)

func (ConsulProvider) String

func (consul ConsulProvider) String() string

type DNSProvider

type DNSProvider struct {
	dns.Client
}

func NewDNSProvider

func NewDNSProvider(client dns.Client) DNSProvider

func (DNSProvider) AfterProvision

func (dns DNSProvider) AfterProvision(platform *Platform, machine types.Machine) error

func (DNSProvider) AfterTerminate

func (dns DNSProvider) AfterTerminate(platform *Platform, machine types.Machine) error

func (DNSProvider) BeforeProvision

func (dns DNSProvider) BeforeProvision(platform *Platform, machine *types.VM) error

func (DNSProvider) BeforeTerminate

func (dns DNSProvider) BeforeTerminate(platform *Platform, machine types.Machine) error

func (DNSProvider) GetControlPlaneEndpoint

func (dns DNSProvider) GetControlPlaneEndpoint(platform *Platform) (string, error)

func (DNSProvider) GetExternalEndpoints

func (dns DNSProvider) GetExternalEndpoints(platform *Platform) ([]string, error)

func (DNSProvider) String

func (dns DNSProvider) String() string

type KindProvider

type KindProvider struct {
}

func (KindProvider) AfterProvision

func (kind KindProvider) AfterProvision(platform *Platform, machine types.Machine) error

func (KindProvider) AfterTerminate

func (kind KindProvider) AfterTerminate(platform *Platform, machine types.Machine) error

func (KindProvider) BeforeProvision

func (kind KindProvider) BeforeProvision(platform *Platform, machine *types.VM) error

func (KindProvider) BeforeTerminate

func (kind KindProvider) BeforeTerminate(platform *Platform, machine types.Machine) error

func (KindProvider) GetControlPlaneEndpoint

func (kind KindProvider) GetControlPlaneEndpoint(platform *Platform) (string, error)

func (KindProvider) GetExternalEndpoints

func (kind KindProvider) GetExternalEndpoints(platform *Platform) ([]string, error)

func (KindProvider) String

func (kind KindProvider) String() string

type MasterDiscovery

type MasterDiscovery interface {
	fmt.Stringer
	GetControlPlaneEndpoint(platform *Platform) (string, error)
	GetExternalEndpoints(platform *Platform) ([]string, error)
}

type NSXProvider

type NSXProvider struct {
	nsxapi.NSXClient
}

func NewNSXProvider

func NewNSXProvider(platform *Platform) (*NSXProvider, error)

func (*NSXProvider) AfterProvision

func (nsx *NSXProvider) AfterProvision(platform *Platform, vm types.Machine) error

func (NSXProvider) AfterTerminate

func (nsx NSXProvider) AfterTerminate(platform *Platform, machine types.Machine) error

func (*NSXProvider) BeforeProvision

func (nsx *NSXProvider) BeforeProvision(platform *Platform, machine *types.VM) error

func (*NSXProvider) BeforeTerminate

func (nsx *NSXProvider) BeforeTerminate(platform *Platform, machine types.Machine) error

func (*NSXProvider) GetControlPlaneEndpoint

func (nsx *NSXProvider) GetControlPlaneEndpoint(platform *Platform) (string, error)

func (*NSXProvider) GetExternalEndpoints

func (nsx *NSXProvider) GetExternalEndpoints(platform *Platform) ([]string, error)

func (*NSXProvider) String

func (nsx *NSXProvider) String() string

type Platform

type Platform struct {
	Cluster types.Cluster
	types.PlatformConfig
	MasterDiscovery MasterDiscovery
	ProvisionHook   ProvisionHook
	logger.Logger

	kommons.Client

	KubeConfigPath string

	// Terminating is true if the cluster is in a terminating state
	Terminating bool
	// contains filtered or unexported fields
}

func (*Platform) ApplyCRD

func (platform *Platform) ApplyCRD(namespace string, specs ...kommons.CRD) error

func (*Platform) ApplySpecs

func (platform *Platform) ApplySpecs(namespace string, specs ...string) error

func (*Platform) Clone

func (platform *Platform) Clone(vm types.VM, config *konfigadm.Config) (types.Machine, error)

func (*Platform) CreateIngressCertificate

func (platform *Platform) CreateIngressCertificate(subDomain string) (*certs.Certificate, error)

func (*Platform) CreateInternalCertificate

func (platform *Platform) CreateInternalCertificate(service string, namespace string, clusterDomain string) (*certs.Certificate, error)

func (*Platform) CreateOrGetWebhookCertificate added in v0.29.0

func (platform *Platform) CreateOrGetWebhookCertificate(namespace, service string) ([]byte, error)

func (*Platform) CreateOrUpdateNamespace

func (platform *Platform) CreateOrUpdateNamespace(name string, labels map[string]string, annotations map[string]string) error

func (*Platform) CreateOrUpdateWorkloadNamespace

func (platform *Platform) CreateOrUpdateWorkloadNamespace(name string, labels map[string]string, annotations map[string]string) error

func (*Platform) CreateTLSSecret

func (platform *Platform) CreateTLSSecret(namespace, subDomain, secretName string) error

func (*Platform) CreateWebhookBuilder added in v0.29.0

func (platform *Platform) CreateWebhookBuilder(namespace, service string, ca []byte) (*kommons.WebhookConfigBuilder, error)

func (*Platform) DefaultNamespaceAnnotations

func (platform *Platform) DefaultNamespaceAnnotations() map[string]string

func (*Platform) DefaultNamespaceLabels

func (platform *Platform) DefaultNamespaceLabels() map[string]string

func (*Platform) DeleteMutatingWebhook added in v0.29.0

func (platform *Platform) DeleteMutatingWebhook(namespace, service string) error

func (*Platform) DeleteNode added in v0.17.14

func (platform *Platform) DeleteNode(name string) error

func (*Platform) DeleteSpecs

func (platform *Platform) DeleteSpecs(namespace string, specs ...string) error

func (*Platform) DeleteValidatingWebhook added in v0.29.0

func (platform *Platform) DeleteValidatingWebhook(namespace, service string) error

func (*Platform) ExposeIngress

func (platform *Platform) ExposeIngress(namespace, service string, port int, annotations map[string]string) error

func (*Platform) GetAPIEndpoint

func (platform *Platform) GetAPIEndpoint() (string, error)

GetAPIEndpoint returns an endpoint for reaching a master node that is reachable on 6443 or an error otherwise

func (*Platform) GetBinary

func (platform *Platform) GetBinary(name string) deps.BinaryFunc

func (*Platform) GetBinaryWithEnv

func (platform *Platform) GetBinaryWithEnv(name string, env map[string]string) deps.BinaryFunc

func (*Platform) GetBinaryWithKubeConfig

func (platform *Platform) GetBinaryWithKubeConfig(binary string) deps.BinaryFunc

func (*Platform) GetCA

func (platform *Platform) GetCA() certs.CertificateAuthority

GetCA retrieves the cert.CertificateAuthority for the given platform, initialising it (platform.ca) if it hasn't been read from the specified config (platform.CA) yet.

func (*Platform) GetConsulClient

func (platform *Platform) GetConsulClient() api.Consul

func (*Platform) GetDNSClient

func (platform *Platform) GetDNSClient() dns.Client

func (*Platform) GetDefaultIssuerCA added in v0.30.0

func (platform *Platform) GetDefaultIssuerCA() ([]byte, error)

func (*Platform) GetIngressCA

func (platform *Platform) GetIngressCA() certs.CertificateAuthority

func (*Platform) GetKubeConfig

func (platform *Platform) GetKubeConfig() (string, error)

GetKubeConfig gets the path to the admin kubeconfig, creating it if necessary

func (*Platform) GetKubeConfigBytes

func (platform *Platform) GetKubeConfigBytes() ([]byte, error)

func (*Platform) GetKubectl

func (platform *Platform) GetKubectl() deps.BinaryFunc

func (*Platform) GetNodeNames

func (platform *Platform) GetNodeNames() map[string]bool

func (*Platform) GetOrCreateBucket

func (platform *Platform) GetOrCreateBucket(name string) error

func (*Platform) GetOrCreateBucketFor added in v0.17.15

func (platform *Platform) GetOrCreateBucketFor(conn types.S3Connection, name string) error

func (*Platform) GetProxyTransport added in v0.17.15

func (platform *Platform) GetProxyTransport(endpoint string) (*http.Transport, error)

func (*Platform) GetResourceByName

func (platform *Platform) GetResourceByName(file string, pkg string) (string, error)

func (*Platform) GetResourcesByDir

func (platform *Platform) GetResourcesByDir(path string, pkg string) (map[string]fs.File, error)

func (*Platform) GetS3Client

func (platform *Platform) GetS3Client() (*minio.Client, error)

func (*Platform) GetS3ClientFor added in v0.17.15

func (platform *Platform) GetS3ClientFor(conn types.S3Connection) (*minio.Client, error)

func (*Platform) GetSecretValue added in v0.30.0

func (platform *Platform) GetSecretValue(namespace, name, key string) ([]byte, error)

func (*Platform) ImportSecret added in v0.44.0

func (platform *Platform) ImportSecret(secretRef v1.SecretReference) error

func (*Platform) Init

func (platform *Platform) Init() error

func (*Platform) IsMaster

func (platform *Platform) IsMaster(machine types.TagInterface) bool

func (*Platform) IsMonitoringEnabled added in v0.67.0

func (platform *Platform) IsMonitoringEnabled() bool

func (*Platform) NewSelfSigned added in v0.16.3

func (platform *Platform) NewSelfSigned(domain string) *certs.Certificate

func (*Platform) ReadIngressCACertString

func (platform *Platform) ReadIngressCACertString() string

func (*Platform) ResetMasterConnection

func (platform *Platform) ResetMasterConnection()

func (*Platform) Template

func (platform *Platform) Template(file string, pkg string) (string, error)

func (*Platform) TemplateText added in v0.23.1

func (platform *Platform) TemplateText(raw string) (string, error)

func (*Platform) WaitForAPIServer added in v0.30.0

func (platform *Platform) WaitForAPIServer() error

WaitFor at least 1 master IP to be reachable

func (*Platform) WithField

func (platform *Platform) WithField(key string, value interface{}) *Platform

func (*Platform) WithLogOutput

func (platform *Platform) WithLogOutput(output io.Writer) *Platform

type ProvisionHook

type ProvisionHook interface {
	fmt.Stringer
	BeforeProvision(platform *Platform, machine *types.VM) error
	AfterProvision(platform *Platform, machine types.Machine) error
	BeforeTerminate(platform *Platform, machine types.Machine) error
	AfterTerminate(platform *Platform, machine types.Machine) error
}

Jump to

Keyboard shortcuts

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