Documentation ¶
Overview ¶
Copyright 2021 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 2021 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 2021 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 2021 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.
Index ¶
- func CreateControllerUsers(clusterConfig *v1beta1.ClusterConfig, k0sVars constant.CfgVars) error
- func CreateUser(userName string, homeDir string, shell string) error
- func DeleteControllerUsers(clusterConfig *v1beta1.ClusterConfig) error
- func DeleteUser(userName string) error
- func EnsureService(args []string) error
- func EnsureUser(name string, homeDir string) error
- func GetRoleByPID(pid int) (role string, err error)
- func GetRoleByStagedKubelet(binPath string) string
- func GetSysInit(role string) (sysInitPlatform string, stubFile string, err error)
- func UninstallService(role string) error
- type CleanUpConfig
- type K0sStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateControllerUsers ¶ added in v0.11.0
func CreateControllerUsers(clusterConfig *v1beta1.ClusterConfig, k0sVars constant.CfgVars) error
CreateControllerUsers accepts a cluster config, and cfgVars and creates controller users accordingly
func CreateUser ¶
CreateUser creates a system user with either `adduser` or `useradd` command
func DeleteControllerUsers ¶ added in v0.11.0
func DeleteControllerUsers(clusterConfig *v1beta1.ClusterConfig) error
CreateControllerUsers accepts a cluster config, and cfgVars and creates controller users accordingly
func DeleteUser ¶ added in v0.11.0
DeleteUser deletes system users with either `deluser` or `userdel` command
func EnsureService ¶
EnsureService installs the k0s service, per the given arguments, and the detected platform
func EnsureUser ¶
EnsureUser checks if a user exists, and creates it, if it doesn't TODO: we should also consider modifying the user, if the user exists, but with wrong settings
func GetRoleByPID ¶ added in v0.11.0
func GetRoleByStagedKubelet ¶ added in v0.11.0
This function attempts to find out the host role, by staged binaries
func GetSysInit ¶ added in v0.10.0
GetSysInit returns the sys init platform name, and the stub file path for a system
func UninstallService ¶ added in v0.11.0
Types ¶
type CleanUpConfig ¶ added in v0.11.0
type CleanUpConfig struct {
// contains filtered or unexported fields
}
func NewCleanUpConfig ¶ added in v0.11.0
func NewCleanUpConfig(dataDir string) *CleanUpConfig
func (*CleanUpConfig) RemoveAllDirectories ¶ added in v0.11.0
func (c *CleanUpConfig) RemoveAllDirectories() error
func (*CleanUpConfig) WorkerCleanup ¶ added in v0.11.0
func (c *CleanUpConfig) WorkerCleanup() error