utils

package
v0.0.0-...-578aad9 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	VmwareVarsTempl = `` /* 3559-byte string literal not displayed */

	OpenstackVarsTempl = `` /* 4040-byte string literal not displayed */

)

Variables

View Source
var (
	Homedir     string
	Mkcaasproot string
	Config      *MKCaaSPCfg //CaaSP4CFG(Mkcaasproot)

	Skubaroot      string
	Vmwaretfdir    string
	Openstacktfdir string
	Myclusterdir   string
	Testworkdir    string
	ENV2           = os.Environ()
	Workdir        string
)
View Source
var CulsterTempl = `` /* 379-byte string literal not displayed */

Functions

func AdminOrchCmd

func AdminOrchCmd(homedir string, caaspdir string, s *CAASPOut, option string, command string) (string, string)

func AppendParse

func AppendParse(appendnodes string) (int, int)

func ByHandUpdater

func ByHandUpdater(homedir string, caaspdir string, list map[string]SaltCluster)

func CheckIfIP

func CheckIfIP(IP string)

/-----------------------WORKS ONLY FOR IPV4--------------------------------------

func CheckOS

func CheckOS() (string, error)

func CheckRebootNeeded

func CheckRebootNeeded(IP string, a *CAASPOut, homedir string, caaspdir string, list map[string]SaltCluster)

func CheckSaltMinions

func CheckSaltMinions(homedir string, caaspdir string) map[string]SaltCluster

func CheckVelumUp

func CheckVelumUp(page string) float64

CheckVelumUp returns Velum worm up time in Seconds

func CheckVersions

func CheckVersions()

func CmdRun

func CmdRun(dir, openstackAPIauth, command string) (string, string)

CmdRun takes a directory, openstack api auth, command and runs RunScript

func CreateAcc

func CreateAcc(nodes *CAASPOut)

func CreateCaasp4

func CreateCaasp4(action string) (string, string)

func Download

func Download(url string) error

Download downloads the kubeconfig file

func FirstSetup

func FirstSetup(nodes *CAASPOut)

func FolderFinder

func FolderFinder(sysos string, skubarpm bool) (string, string)

func InstallUI

func InstallUI(nodes *CAASPOut, Cluster *CaaSPCluster)

InstallUI handles Velum interactions

func NiceBufRunner

func NiceBufRunner(cmd *exec.Cmd) (string, string)

func NiceBuffRunner

func NiceBuffRunner(cmd *exec.Cmd, workdir string) (string, string)

func OpenstackExporter

func OpenstackExporter(Mkcaasproot string)

func RunScript

func RunScript(command string, env EnvOS) (string, string)

RunScript accepts 4 inputs and a runs terraform script

func TfInit

func TfInit(dir string)

TfInit tinitializes the needed terraform modules

func VMWareexporter

func VMWareexporter()

func VelumUpdater

func VelumUpdater(homedir string, caaspdir string, nodes *CAASPOut)

Types

type Admin

type Admin struct {
	Value string
}

type CAASPOut

type CAASPOut struct {
	IPAdminExt   *Admin   `json:"ip_admin_external"`
	IPAdminInt   *Admin   `json:"ip_admin_internal"`
	IPMastersExt Machines `json:"ip_masters"`
	IPWorkersExt Machines `json:"ip_workers"`
}

CAASPOut is holding caasp terraform output json variables

func CAASPOutReturner

func CAASPOutReturner(openstack string, homedir string, caaspDir string) *CAASPOut

func (*CAASPOut) SSHCommand

func (s *CAASPOut) SSHCommand(IP string, homedir string, caaspdir string, cmd ...string) *exec.Cmd

type CaaSPCluster

type CaaSPCluster struct {
	ImageName string
	IntNet    string
	ExtNet    string
	AdmSize   string
	MastSize  string
	MastCount int
	WorkSize  string
	WorkCount int
	DnsDomain string
	DnsEntry  int
	StackName string
	Diff      int //----it is to indicate how many more new nodes you add when appending new nodes to the cluster
}

CaSPCluster is holding all opentsack.tfvars info

var Cluster CaaSPCluster

func NodesAdder

func NodesAdder(dir string, append string, nodes *CAASPOut, Firsttime bool) *CaaSPCluster

type CriticalChain

type CriticalChain struct {
	Unit      string
	TimeAt    string
	TimeDelay string
}

type EnvOS

type EnvOS []string

EnvOS holds as slice with openstack API variables

var ENV EnvOS

func SetOSEnv

func SetOSEnv(file string) (EnvOS, error)

SetOSEnv sets up Openstack environment variables

type K8s

type K8s struct {
}

type MKCaaSPCfg

type MKCaaSPCfg struct {
	Platform    string  `json: "platform"`
	Deploy      string  `json: "deploy"`
	Vmware      *VMWare `json: "vmware"`
	Skubaroot   string  `json: "skubaroot"`
	ClusterName string  `json: "clustername"`
}

func CaaSP4CFG

func CaaSP4CFG(mkcaasproot string) (*MKCaaSPCfg, error)

type Machines

type Machines struct {
	Value []string
}

type Node

type Node struct {
	IP         string
	NodeName   string
	K8sName    string
	Role       string
	Username   string
	Network    bool
	Port22     bool
	SSH        bool
	ContHealth bool
	PackHealth bool
	RepoHealth bool
	Services   bool
	Systemd    Systemd
	K8sHealth  *K8s
}

func CheckIPSSH

func CheckIPSSH(node Node) Node

func CheckNodename

func CheckNodename(node Node, mode string) Node

func CheckSystemd

func CheckSystemd(node Node) Node

func (*Node) SSHCmd

func (node *Node) SSHCmd(workdir string, command []string) *exec.Cmd

type OSAPI

type OSAPI struct {
	AuthURL            string
	RegionName         string
	ProjectName        string
	UserDomainName     string
	IdentityAPIVersion string
	Interface          string
	Username           string
	Password           string //[]byte
	ProjectID          string
	Insecure           string
}

OSAPI holds openstack API variables

type PackageData

type PackageData struct {
	Name         string
	Version      string
	Release      string
	Architecture string
}

func RpmOutputParser

func RpmOutputParser(output string) *PackageData

type SESOut

type SESOut struct {
	K8SSC      Machines `json:"k8s_StorageClass_internal_ip"`
	K8SCS      Machines `json:"ceph_secret"`
	IPAdminExt *Admin   `json:"external_ip_admin"`
	IPAdminInt Machines `json:"internal_ip_admin"`
	IPMonsExt  Machines `json:"external_ip_mons"`
	IPMonsInt  Machines `json:"internal_ip_mons"`
	IPOsdsInt  Machines `json:"internal_ip_osds"`
}

SESOut is holding ses terraform output json variables

type SaltCluster

type SaltCluster struct {
	Name           string
	IP             string
	RebootNeeded   bool
	FailedServices int
}

SaltCluster connects hashname of all nodes + hostname and IPs all together

func (*SaltCluster) SSHCmd

func (s *SaltCluster) SSHCmd(IP string, homedir string, caaspdir string, cmd ...string) *exec.Cmd

type Setup

type Setup struct {
	MastCount int `json: WorkCount`
	WorkCount int `json: MastCount`
}

type SkubaCluster

type SkubaCluster struct {
	ClusterName string
	Diagnosis   map[string]Node
	TF_ostack   *TFOutput_openstack
	TF_vmware   *TFOutput_vmware
	Testdir     string
	Setup       Setup `json: setup`
}

func (*SkubaCluster) BootstrapMaster

func (cluster *SkubaCluster) BootstrapMaster(mode string) (string, string)

------------------Bootstrapping Masters on CaaSP4 with Skuba---------------

func (*SkubaCluster) CheckSkuba

func (cluster *SkubaCluster) CheckSkuba() (string, string)

func (*SkubaCluster) ClusterCheckBuilder

func (cluster *SkubaCluster) ClusterCheckBuilder(mode string) map[string]Node

func (*SkubaCluster) CopyAdminConf

func (cluster *SkubaCluster) CopyAdminConf() (string, string)

---------copying the admin conf to .kube/conf ...

func (*SkubaCluster) EnvOSExporter

func (cluster *SkubaCluster) EnvOSExporter() []string

func (*SkubaCluster) JoinWorkers

func (cluster *SkubaCluster) JoinWorkers() (string, string)

------------Joining workers with Skuba-------------------------

func (*SkubaCluster) NodesAdderV4

func (cluster *SkubaCluster) NodesAdderV4()

func (*SkubaCluster) RebootNodes

func (cluster *SkubaCluster) RebootNodes(flagg string) (string, string)

func (*SkubaCluster) RefreshSkubaCluster

func (cluster *SkubaCluster) RefreshSkubaCluster()

func (*SkubaCluster) RunGinkgo

func (cluster *SkubaCluster) RunGinkgo() (string, string)

func (*SkubaCluster) SkubaInit

func (cluster *SkubaCluster) SkubaInit() (string, string)

------------------Initializing CaaSP4 Cluster with Skuba-----------------

func (*SkubaCluster) TFParser

func (cluster *SkubaCluster) TFParser() error

type StringOrSlice

type StringOrSlice interface{}

type Systemd

type Systemd struct {
	CriticalChain []CriticalChain
	AnalyzeBlame  string
	AllFine       bool
}

type TFOutput

type TFOutput struct {
	IP_Load_Balancer *TFTag `json: ip_load_balancer`
	IP_Masters       *TFTag `json: ip_masters`
	IP_Workers       *TFTag `json: ip_workers`
}

type TFOutput_openstack

type TFOutput_openstack struct {
	IP_Load_Balancer *TFTagLoadBalancer `json: ip_load_balancer`
	IP_Masters       *TFTag             `json: ip_masters`
	IP_Workers       *TFTag             `json: ip_workers`
}

type TFOutput_vmware

type TFOutput_vmware struct {
	IP_Load_Balancer *TFTag `json: ip_load_balancer`
	IP_Masters       *TFTag `json: ip_masters`
	IP_Workers       *TFTag `json: ip_workers`
}

type TFTag

type TFTag struct {
	Sensitive bool     `json: sensitive`
	Type      string   `json: type`
	Value     []string `json: value`
}

type TFTagLoadBalancer

type TFTagLoadBalancer struct {
	Sensitive bool   `json: sensitive`
	Type      string `json: type`
	Value     string `json: value`
}

type TFTag_variable

type TFTag_variable struct {
	Sensitive bool          `json: sensitive`
	Type      string        `json: type`
	Value     StringOrSlice `json: value`
}

type VMWare

type VMWare struct {
	GOVC_URL                     string
	GOVC_USERNAME                string
	GOVC_PASSWORD                string `json: "GOVC_PASSWORD"`
	GOVC_INSECURE                int
	VSPHERE_SERVER               string `json: "VSPHERE_SERVER"`
	VSPHERE_USER                 string
	VSPHERE_PASSWORD             string
	VSPHERE_ALLOW_UNVERIFIED_SSL bool
}

Jump to

Keyboard shortcuts

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