deployer

package
v0.0.0-...-661cecb Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2019 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Copyright © 2019 Jeff Wu <jeff.wu.junfei@gmail.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

This section is empty.

Variables

This section is empty.

Functions

func ConfigVM

func ConfigVM(vmconfig *model.K8sNode) error

func CopyLocalFileToRemote

func CopyLocalFileToRemote(vmconfig *model.K8sNode, localpath, remotepath string) error

func CopyRemoteFileToLocal

func CopyRemoteFileToLocal(vmconfig *model.K8sNode, remotepath, localpath string) error

func CreateVM

func CreateVM(vmConfig *model.K8sNode, answers *model.Answers) (*object.VirtualMachine, error)

func DeleteWorkerNodeFromKubenretes

func DeleteWorkerNodeFromKubenretes(vmconfig *model.K8sNode, k8sNodes *model.K8sNodes) error

func DeployNodes

func DeployNodes(answers *model.Answers) (*model.K8sNodes, error)

func DeployOVA

func DeployOVA(answers *model.Answers, targetpath string) (*object.VirtualMachine, error)

func DeployWorkderNode

func DeployWorkderNode(vmconfig *model.K8sNode, answers *model.Answers, k8sNodes *model.K8sNodes) error

func Destory

func Destory(answers *model.Answers, k8snodes *model.K8sNodes) error

func DestorySingle

func DestorySingle(answers *model.Answers, k8snode *model.K8sNode) error

func DownloadKubeCtlConfig

func DownloadKubeCtlConfig(vmconfig *model.K8sNode) error

func FindMasterNode

func FindMasterNode(answers *model.Answers) (*model.K8sNode, error)

func GetKubeAdmJoinCommand

func GetKubeAdmJoinCommand(vmconfig *model.K8sNode) (string, error)

func PopuldateKubeConfig

func PopuldateKubeConfig(c *ssh.Client) error

func PrepareFolder

func PrepareFolder(answers model.Answers) error

func PrepareResourcePool

func PrepareResourcePool(answers model.Answers) error

func PrepareVM

func PrepareVM(vmconfig *model.K8sNode) error

func UpdateMasterNode

func UpdateMasterNode(k8snodes *model.K8sNodes) error

func UpdateWorkerNode

func UpdateWorkerNode(vmconfig *model.K8sNode, k8snodes *model.K8sNodes) error

func UploadConfigToMasterNode

func UploadConfigToMasterNode(answers *model.Answers, k8sNodes *model.K8sNodes) error

func ValidatevSphereAccount

func ValidatevSphereAccount(answers *model.Answers) error

Types

type SSHRunner

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

SSHRunner runs commands through SSH.

It implements the CommandRunner interface.

func GetSSHRunner

func GetSSHRunner(vmconfig *model.K8sNode) (*SSHRunner, *ssh.Client, error)

func GetSSHRunner2

func GetSSHRunner2(vmconfig *model.K8sNode) (*SSHRunner, *ssh.Client, error)

func NewSSHRunner

func NewSSHRunner(c *ssh.Client) *SSHRunner

NewSSHRunner returns a new SSHRunner that will run commands through the ssh.Client provided.

func (*SSHRunner) CombinedOutput

func (s *SSHRunner) CombinedOutput(cmd string) (string, error)

CombinedOutput runs the command on the remote and returns its combined standard output and standard error.

func (*SSHRunner) CombinedOutputTo

func (s *SSHRunner) CombinedOutputTo(cmd string, out io.Writer) error

CombinedOutputTo runs the command and stores both command output and error to out.

func (*SSHRunner) Copy

func (s *SSHRunner) Copy(f assets.CopyableFile) error

Copy copies a file to the remote over SSH.

func (*SSHRunner) Remove

func (s *SSHRunner) Remove(f assets.CopyableFile) error

Remove runs a command to delete a file on the remote.

func (*SSHRunner) Run

func (s *SSHRunner) Run(cmd string) error

Run starts a command on the remote and waits for it to return.

Jump to

Keyboard shortcuts

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