server

package
v0.10.0-beta3 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: Apache-2.0 Imports: 52 Imported by: 0

Documentation

Overview

Copyright 2020 k0s authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Mirantis, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Mirantis, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Mirantis, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Mirantis, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Mirantis, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Mirantis, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Mirantis, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Mirantis, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Mirantis, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Mirantis, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Mirantis, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Mirantis, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Mirantis, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Mirantis, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Mirantis, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Mirantis, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIEndpointReconciler added in v0.9.0

type APIEndpointReconciler struct {
	ClusterConfig *config.ClusterConfig

	L *logrus.Entry
	// contains filtered or unexported fields
}

APIEndpointReconciler is the component to reconcile in-cluster API address endpoint based from externalName

func NewEndpointReconciler added in v0.9.0

func NewEndpointReconciler(c *k0sv1beta1.ClusterConfig, leaderElector LeaderElector, kubeClientFactory k8sutil.ClientFactory) *APIEndpointReconciler

NewEndpointReconciler creates new endpoint reconciler

func (*APIEndpointReconciler) Healthy added in v0.9.0

func (a *APIEndpointReconciler) Healthy() error

Healthy dummy implementation

func (*APIEndpointReconciler) Init added in v0.9.0

func (a *APIEndpointReconciler) Init() error

Init initializes the APIEndpointReconciler

func (*APIEndpointReconciler) Run added in v0.9.0

func (a *APIEndpointReconciler) Run() error

Run runs the main loop for reconciling the externalAddress

func (*APIEndpointReconciler) Stop added in v0.9.0

func (a *APIEndpointReconciler) Stop() error

Stop stops the reconciler

type APIServer

type APIServer struct {
	ClusterConfig *config.ClusterConfig
	K0sVars       constant.CfgVars
	LogLevel      string
	Storage       component.Component
	// contains filtered or unexported fields
}

APIServer implement the component interface to run kube api

func (*APIServer) Healthy

func (a *APIServer) Healthy() error

Health-check interface

func (*APIServer) Init

func (a *APIServer) Init() error

Init extracts needed binaries

func (*APIServer) Run

func (a *APIServer) Run() error

Run runs kube api

func (*APIServer) Stop

func (a *APIServer) Stop() error

Stop stops APIServer

type CASyncer

type CASyncer struct {
	JoinClient *v1beta1.JoinClient
	K0sVars    constant.CfgVars
}

CASyncer is the Component implementation to sync CAs between multiple controllers

func (*CASyncer) Healthy

func (c *CASyncer) Healthy() error

Health-check interface

func (*CASyncer) Init

func (c *CASyncer) Init() error

Init initializes the CASyncer component

func (*CASyncer) Run

func (c *CASyncer) Run() error

Run does nothing, there's nothing running constantly

func (*CASyncer) Stop

func (c *CASyncer) Stop() error

Stop does nothing, there's nothing running constantly

type CRD

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

CRD unpacks bundled CRD definitions to the filesystem

func NewCRD

func NewCRD(s manifestsSaver) *CRD

NewCRD build new CRD

func (CRD) Healthy

func (c CRD) Healthy() error

func (CRD) Init

func (c CRD) Init() error

Init (c CRD) Init() error {

func (CRD) Run

func (c CRD) Run() error

Run unpacks manifests from bindata

func (CRD) Stop

func (c CRD) Stop() error

type Calico

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

Calico is the Component interface implementation to manage Calico

func NewCalico

func NewCalico(clusterConf *config.ClusterConfig, crdSaver manifestsSaver, manifestsSaver manifestsSaver) (*Calico, error)

NewCalico creates new Calico reconciler component

func (*Calico) Healthy

func (c *Calico) Healthy() error

Health-check interface

func (*Calico) Init

func (c *Calico) Init() error

Init does nothing

func (*Calico) Run

func (c *Calico) Run() error

Run runs the calico reconciler

func (*Calico) Stop

func (c *Calico) Stop() error

Stop stops the calico reconciler

type Certificates

type Certificates struct {
	CACert      string
	CertManager certificate.Manager
	ClusterSpec *config.ClusterSpec
	K0sVars     constant.CfgVars
}

Certificates is the Component implementation to manage all k0s certs

func (*Certificates) Healthy

func (c *Certificates) Healthy() error

Health-check interface

func (*Certificates) Init

func (c *Certificates) Init() error

Init initializes the certificate component

func (*Certificates) Run

func (c *Certificates) Run() error

Run does nothing, the cert component only needs to be initialized

func (*Certificates) Stop

func (c *Certificates) Stop() error

Stop does nothing, the cert component is not constantly running

type ControllerManager

type ControllerManager struct {
	ClusterConfig *config.ClusterConfig

	K0sVars  constant.CfgVars
	LogLevel string
	// contains filtered or unexported fields
}

ControllerManager implement the component interface to run kube scheduler

func (*ControllerManager) Healthy

func (a *ControllerManager) Healthy() error

Health-check interface

func (*ControllerManager) Init

func (a *ControllerManager) Init() error

Init extracts the needed binaries

func (*ControllerManager) Run

func (a *ControllerManager) Run() error

Run runs kube ControllerManager

func (*ControllerManager) Stop

func (a *ControllerManager) Stop() error

Stop stops ControllerManager

type CoreDNS

type CoreDNS struct {
	K0sVars constant.CfgVars
	// contains filtered or unexported fields
}

CoreDNS is the component implementation to manage CoreDNS

func NewCoreDNS

func NewCoreDNS(clusterConfig *config.ClusterConfig, k0sVars constant.CfgVars, clientFactory k8sutil.ClientFactory) (*CoreDNS, error)

NewCoreDNS creates new instance of CoreDNS component

func (*CoreDNS) Healthy

func (c *CoreDNS) Healthy() error

Health-check interface

func (*CoreDNS) Init

func (c *CoreDNS) Init() error

Init does nothing

func (*CoreDNS) Run

func (c *CoreDNS) Run() error

Run runs the CoreDNS reconciler component

func (*CoreDNS) Stop

func (c *CoreDNS) Stop() error

Stop stops the CoreDNS reconciler

type DefaultPSP

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

DefaultPSP implements system RBAC reconciler

 It always creates two sets of PSP rules:
	- 00-k0s-privileged: allows "privileged" stuff (host namespaces, privileged etc.) to be running
	- 99-k0s-restricted: more restricted rules, usually suitable for "normal" workloads

Depending on user config, we select either of the above rule sets to be the default

func NewDefaultPSP

func NewDefaultPSP(clusterSpec *config.ClusterSpec, k0sVars constant.CfgVars) (*DefaultPSP, error)

NewDefaultPSP creates new system level RBAC reconciler

func (*DefaultPSP) Healthy

func (d *DefaultPSP) Healthy() error

Health-check interface

func (*DefaultPSP) Init

func (d *DefaultPSP) Init() error

Init does currently nothing

func (*DefaultPSP) Run

func (d *DefaultPSP) Run() error

Run reconciles the k0s default PSP rules

func (*DefaultPSP) Stop

func (d *DefaultPSP) Stop() error

Stop does currently nothing

type Etcd

type Etcd struct {
	CertManager certificate.Manager
	Config      *config.EtcdConfig
	Join        bool
	JoinClient  *v1beta1.JoinClient
	K0sVars     constant.CfgVars
	LogLevel    string
	// contains filtered or unexported fields
}

Etcd implement the component interface to run etcd

func (*Etcd) Healthy

func (e *Etcd) Healthy() error

Health-check interface

func (*Etcd) Init

func (e *Etcd) Init() error

Init extracts the needed binaries

func (*Etcd) Run

func (e *Etcd) Run() error

Run runs etcd

func (*Etcd) Stop

func (e *Etcd) Stop() error

Stop stops etcd

type FsManifestsSaver

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

FsManifestsSaver saves all given manifests under the specified root dir

func NewManifestsSaver

func NewManifestsSaver(dir string, dataDir string) (*FsManifestsSaver, error)

NewManifestsSaver builds new filesystem manifests saver

func (FsManifestsSaver) Save

func (f FsManifestsSaver) Save(dst string, content []byte) error

Save saves given manifest under the given path

type HelmAddons

type HelmAddons struct {
	Client        clientset.ChartV1Beta1Interface
	ClusterConfig *k0sv1beta1.ClusterConfig

	L *logrus.Entry
	// contains filtered or unexported fields
}

Helm watch for Chart crd

func NewHelmAddons

func NewHelmAddons(c *k0sv1beta1.ClusterConfig, s manifestsSaver, k0sVars constant.CfgVars, kubeClientFactory kubeutil.ClientFactory) *HelmAddons

NewHelmAddons builds new HelmAddons

func (*HelmAddons) CrdControlLoop

func (h *HelmAddons) CrdControlLoop()

func (*HelmAddons) Healthy

func (h *HelmAddons) Healthy() error

Healthy

func (*HelmAddons) Init

func (h *HelmAddons) Init() error

Run

func (*HelmAddons) Run

func (h *HelmAddons) Run() error

Run runs the helm controller

func (*HelmAddons) Stop

func (h *HelmAddons) Stop() error

Stop

type K0SControlAPI

type K0SControlAPI struct {
	ConfigPath    string
	ClusterConfig *config.ClusterConfig
	K0sVars       constant.CfgVars
	// contains filtered or unexported fields
}

K0SControlAPI implements the k0s control API component

func (*K0SControlAPI) Healthy

func (m *K0SControlAPI) Healthy() error

Healthy for health-check interface

func (*K0SControlAPI) Init

func (m *K0SControlAPI) Init() error

Init does currently nothing

func (*K0SControlAPI) Run

func (m *K0SControlAPI) Run() error

Run runs k0s control api as separate process

func (*K0SControlAPI) Stop

func (m *K0SControlAPI) Stop() error

Stop stops k0s api

type Kine

type Kine struct {
	Config *config.KineConfig

	K0sVars constant.CfgVars
	// contains filtered or unexported fields
}

Kine implement the component interface to run kine

func (*Kine) Healthy

func (k *Kine) Healthy() error

Health-check interface

func (*Kine) Init

func (k *Kine) Init() error

Init extracts the needed binaries

func (*Kine) Run

func (k *Kine) Run() error

Run runs kine

func (*Kine) Stop

func (k *Kine) Stop() error

Stop stops kine

type Konnectivity

type Konnectivity struct {
	ClusterConfig *config.ClusterConfig
	K0sVars       constant.CfgVars
	LogLevel      string
	// contains filtered or unexported fields
}

Konnectivity implement the component interface of konnectivity server

func (*Konnectivity) Healthy

func (k *Konnectivity) Healthy() error

Health-check interface

func (*Konnectivity) Init

func (k *Konnectivity) Init() error

Init ...

func (*Konnectivity) Run

func (k *Konnectivity) Run() error

Run ..

func (*Konnectivity) Stop

func (k *Konnectivity) Stop() error

Stop stops

type KubeProxy

type KubeProxy struct {
	K0sVars constant.CfgVars
	// contains filtered or unexported fields
}

KubeProxy is the component implementation to manage kube-proxy

func NewKubeProxy

func NewKubeProxy(clusterSpec *config.ClusterConfig, k0sVars constant.CfgVars) (*KubeProxy, error)

NewKubeProxy creates new KubeProxy component

func (*KubeProxy) Healthy

func (k *KubeProxy) Healthy() error

Health-check interface

func (*KubeProxy) Init

func (k *KubeProxy) Init() error

Init does nothing

func (*KubeProxy) Run

func (k *KubeProxy) Run() error

Run runs the kube-proxy reconciler

func (*KubeProxy) Stop

func (k *KubeProxy) Stop() error

Stop stop the reconcilier

type KubeletConfig

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

KubeletConfig is the reconciler for generic kubelet configs

func NewKubeletConfig

func NewKubeletConfig(clusterSpec *config.ClusterSpec, k0sVars constant.CfgVars) (*KubeletConfig, error)

NewKubeletConfig creates new KubeletConfig reconciler

func (*KubeletConfig) Healthy

func (k *KubeletConfig) Healthy() error

Health-check interface

func (*KubeletConfig) Init

func (k *KubeletConfig) Init() error

Init does nothing

func (*KubeletConfig) Run

func (k *KubeletConfig) Run() error

Run dumps the needed manifest objects

func (*KubeletConfig) Stop

func (k *KubeletConfig) Stop() error

Stop does nothign, nothing actually running

type LeaderElector added in v0.9.0

type LeaderElector interface {
	IsLeader() bool
	component.Component
}

LeaderElector is the common leader elector component to manage each controller leader status

func NewLeaderElector added in v0.9.0

func NewLeaderElector(c *k0sv1beta1.ClusterConfig, kubeClientFactory kubeutil.ClientFactory) LeaderElector

NewLeaderElector creates new leader elector

type MetricServer

type MetricServer struct {
	K0sVars constant.CfgVars
	// contains filtered or unexported fields
}

MetricServer is the reconciler implementation for metrics server

func NewMetricServer

func NewMetricServer(clusterConfig *config.ClusterConfig, k0sVars constant.CfgVars, kubeClientFactory k8sutil.ClientFactory) (*MetricServer, error)

NewMetricServer creates new MetricServer reconciler

func (*MetricServer) Healthy

func (m *MetricServer) Healthy() error

Healthy is the health-check interface

func (*MetricServer) Init

func (m *MetricServer) Init() error

Init does nothing

func (*MetricServer) Run

func (m *MetricServer) Run() error

Run runs the metric server reconciler

func (*MetricServer) Stop

func (m *MetricServer) Stop() error

Stop stops the reconciler

type Scheduler

type Scheduler struct {
	ClusterConfig *config.ClusterConfig

	K0sVars  constant.CfgVars
	LogLevel string
	// contains filtered or unexported fields
}

Scheduler implement the component interface to run kube scheduler

func (*Scheduler) Healthy

func (a *Scheduler) Healthy() error

Health-check interface

func (*Scheduler) Init

func (a *Scheduler) Init() error

Init extracts the needed binaries

func (*Scheduler) Run

func (a *Scheduler) Run() error

Run runs kube scheduler

func (*Scheduler) Stop

func (a *Scheduler) Stop() error

Stop stops Scheduler

type SystemRBAC

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

SystemRBAC implements system RBAC reconciler

func NewSystemRBAC

func NewSystemRBAC(manifestDir string) (*SystemRBAC, error)

NewSystemRBAC creates new system level RBAC reconciler

func (*SystemRBAC) Healthy

func (s *SystemRBAC) Healthy() error

Health-check interface

func (*SystemRBAC) Init

func (s *SystemRBAC) Init() error

Init does nothing

func (*SystemRBAC) Run

func (s *SystemRBAC) Run() error

Run reconciles the k0s related system RBAC rules

func (*SystemRBAC) Stop

func (s *SystemRBAC) Stop() error

Stop does currently nothing

Jump to

Keyboard shortcuts

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