k8s

package
v0.1.5 Latest Latest
Warning

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

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

Documentation

Overview

Copyright © 2021 Antoine Martin <antoine@openance.com>

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 © 2021 Antoine Martin <antoine@openance.com>

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

View Source
const (
	KubernetesVersion = "1.23.1"
)

Variables

This section is empty.

Functions

func CleanConfig

func CleanConfig() (err error)

func RunKubeadm

func RunKubeadm(parameters []string) (err error)

func RunKubeadmInit

func RunKubeadmInit(ip net.IP) error

Types

type Config

type Config api.Config

func LoadFromDefault

func LoadFromDefault() (*Config, error)

LoadFromDefault loads the configuration from the default admin.conf file, usually located at /etc/kubernetes/admin.conf.

func (*Config) CheckClusterRunning

func (config *Config) CheckClusterRunning() error

CheckClusterRunning checks that the cluster is running by requesting the API server /readyz endpoint. It checks 10 times and waits for 2 seconds between each check.

func (*Config) Client

func (config *Config) Client() (client *kubernetes.Clientset, err error)

Client returns a clientset for config.

func (*Config) IsConfigServerAddress

func (config *Config) IsConfigServerAddress(ip net.IP) bool

IsConfigServerAddress checks that config points to the server at ip IP address

func (*Config) RenameConfig

func (c *Config) RenameConfig(newName string) *Config

RenameConfig changes the name of the cluster and the context from the default (kubernetes) to newName in c.

func (*Config) RestartProxy

func (config *Config) RestartProxy() (err error)

RestartProxy restarts kube-proxy after config has been updated. This needs to be done after an IP address change. The restart method is taken from kubectl: https://github.com/kubernetes/kubectl/blob/652881798563c00c1895ded6ced819030bfaa4d7/pkg/polymorphichelpers/objectrestarter.go#L81

func (*Config) WriteToFile

func (config *Config) WriteToFile(filename string) error

WriteToFile writes the config configuration to the file pointed by filename. it returns the appropriate error in case of failure.

Jump to

Keyboard shortcuts

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