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
- func CleanConfig() (err error)
- func RunKubeadm(parameters []string) (err error)
- func RunKubeadmInit(ip net.IP) error
- type Config
- func (config *Config) CheckClusterRunning() error
- func (config *Config) Client() (client *kubernetes.Clientset, err error)
- func (config *Config) IsConfigServerAddress(ip net.IP) bool
- func (c *Config) RenameConfig(newName string) *Config
- func (config *Config) RestartProxy() (err error)
- func (config *Config) WriteToFile(filename string) error
Constants ¶
const (
KubernetesVersion = "1.23.1"
)
Variables ¶
This section is empty.
Functions ¶
func CleanConfig ¶
func CleanConfig() (err error)
func RunKubeadm ¶
func RunKubeadmInit ¶
Types ¶
type Config ¶
func LoadFromDefault ¶
LoadFromDefault loads the configuration from the default admin.conf file, usually located at /etc/kubernetes/admin.conf.
func (*Config) CheckClusterRunning ¶
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 ¶
IsConfigServerAddress checks that config points to the server at ip IP address
func (*Config) RenameConfig ¶
RenameConfig changes the name of the cluster and the context from the default (kubernetes) to newName in c.
func (*Config) RestartProxy ¶
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 ¶
WriteToFile writes the config configuration to the file pointed by filename. it returns the appropriate error in case of failure.