Documentation
¶
Index ¶
- Constants
- func ChangeAPIEndpoint(clusterName, oldEndpoint, newEndpoint, directory string, ...) error
- func GenerateInventoryFile(inventoryTemplate, outputDirectory string, data interface{}) error
- func GenerateLBBaseFiles(outputDirectory string, lbClustersInfo *LBClustersInfo) error
- type Ansible
- type LBClusterRolesInfo
- type LBClustersInfo
- type LBInventoryFileParameters
- type LBPlaybookParameters
- type LBcluster
- type NginxConfigTemplateParameters
- type NodePools
- type ProxyInventoryFileParameters
Constants ¶
const (
// File name for the ansible inventory.
InventoryFileName = "inventory.ini"
)
Variables ¶
This section is empty.
Functions ¶
func ChangeAPIEndpoint ¶
func ChangeAPIEndpoint(clusterName, oldEndpoint, newEndpoint, directory string, spawnProcessLimit *semaphore.Weighted) error
ChangeAPIEndpoint will change the kubeadm configuration. It will set the Api endpoint of the cluster to the public IP of the newly selected ApiEndpoint node.
func GenerateInventoryFile ¶
GenerateInventoryFile generates an Ansible inventory file that defines the hosts and groups of hosts that Ansible can manage.
func GenerateLBBaseFiles ¶
func GenerateLBBaseFiles(outputDirectory string, lbClustersInfo *LBClustersInfo) error
GenerateLBBaseFiles generates the files like Ansible inventory file and SSH keys to be used by Ansible. Returns error if not successful, nil otherwise
Types ¶
type Ansible ¶
type Ansible struct { Playbook string Inventory string Flags string Directory string // SpawnProcessLimit limits the number of spawned ansible processes. SpawnProcessLimit *semaphore.Weighted }
func (*Ansible) RunAnsiblePlaybook ¶
RunAnsiblePlaybook executes ansible-playbook with the default forks of defaultAnsibleForks any additional flags like -l <name>, or --extra-vars <vars> include in flags parameter if command unsuccessful, the function will retry it until successful or maxAnsibleRetries reached all commands are executed with ANSIBLE_HOST_KEY_CHECKING set to false
type LBClusterRolesInfo ¶
type LBClustersInfo ¶
type LBClustersInfo struct { // LbClusters are Load-Balancers that share the targeted k8s cluster. Lbs []*spec.LBcluster // TargetK8sNodepool are all nodepools used by the targeted k8s cluster. TargetK8sNodepool []*spec.NodePool // ClusterID contains the ClusterName-Hash- prefix of the kubernetes cluster ClusterID string }
LBClustersInfo wraps all Load-balancers and Nodepools used for a single K8s cluster.
type LBPlaybookParameters ¶
type LBPlaybookParameters struct {
Loadbalancer string
}
type NginxConfigTemplateParameters ¶
type NginxConfigTemplateParameters struct {
Roles []LBClusterRolesInfo
}