| 1 |
- {"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"Ansible to create and configure minikube clusters. Install role \u00b6 ansible-galaxy role install kameshsampath.minikube Role Variables \u00b6 Variable Name Description Default minikube_create If True creates the cluster True minikube_destroy If True destroys the cluster False minikube_version The minikube version v1.24.0 minikube_home_dir The directory where minikube files will be stored {{ playbook_dir }}/.minikube minikube_driver The minikube driver hyperkit minikube_memory The memory to use for minikube 8g minikube_cpus The cpus to use for minikube 4 minikube_disk_size The disk size to use for minikube 50g minikube_kubernetes_version The kubernetes version to use stable kubeconfig_dir The directory to create the flattened kubeconfig {{ playbook_dir }}/.kube minikube_profiles is used to configure the minikube profiles(clusters) that will be created while using the role, The default value of minikube_profiles is: minikube_profiles : minikube : create : yes destroy : no addons : - registry - registry-aliases - metallb A minikube dictionary as shown above will create minikube profile named minikube with 8g of RAM and 4 cpus. The profile also enables the addons registry,registry-aliases and metallb. The create attribute determines if this profile needs to be created, similarly destroy will determine if the cluster is to be deleted. Note The minkube_profiles create and destroy are mutally exclusive. Overriding default values \u00b6 All the role variables like minikube_* could be overriden at the profile level. When overiding the value at profile level make sure you add attribute name without minikube_ prefix. Lets say we want to create minikube cluster with 4 cpus , 16G ram and 100g hard-disk , then the minikube profile looks like, minikube_profiles : minikube : create : yes destroy : no cpus : 4 memory : 16g disk_size : 100g addons : - registry - registry-aliases - metallb Example playbooks \u00b6 Creating a minikube Cluster(s) \u00b6 - name : \"Create minikube Clusters\" hosts : all vars : # the demo work directory work_dir : \"{{ playbook_dir }}/work\" # the kubeconfig directory kubeconfig_dir : \"{{ work_dir }}/.kube\" # the kubernetes version to use with minikube minikube_kubernetes_version : v1.21.6 # the minikube home directory minikube_home_dir : \"{{ work_dir }}/.minikube\" # minikube profiles minikube_profiles : mgmt : # profile name and Kubernetes context name create : yes destroy : no memory : 16g # override the default memory, note the attribute name without prefix _minikube addons : - metallb lbStartIP : 192.168.64.80 lbEndIP : 192.168.64.90 cluster1 : # profile name and Kubernetes context name create : yes destroy : no addons : - metallb lbStartIP : 192.168.64.110 lbEndIP : 192.168.64.120 roles : - role : kameshsampath.minikube # Some extra configurations tasks : - name : \"Configure metallb\" ansible.builtin.expect : command : \"{{ minikube_binary }} -p {{ item.key }} addons configure metallb\" responses : \"-- Enter Load Balancer Start IP:\" : \"{{ item.value.lbStartIP}}\" \"-- Enter Load Balancer End IP:\" : \"{{ item.value.lbEndIP}}\" loop : \"{{ minikube_profiles | dict2items }}\" loop_control : label : \"{{ item.key }}\" register : lb_setup_result when : item.value.create and not item.value.destroy Deleting minikue Cluster(s) \u00b6 - name : \"Delete minikube Cluster(s)\" hosts : all vars : # the demo work directory work_dir : \"{{ playbook_dir }}/work\" # the kubeconfig directory kubeconfig_dir : \"{{ work_dir }}/.kube\" # the kubernetes version to use with minikube minikube_kubernetes_version : v1.21.6 # the minikube home directory minikube_home_dir : \"{{ work_dir }}/.minikube\" # minikube profiles minikube_profiles : mgmt : # profile name and Kubernetes context name create : no destroy : yes cluster1 : # profile name and Kubernetes context name create : no destroy : yes roles : - role : kameshsampath.minikube","title":"Overview"},{"location":"#install-role","text":"ansible-galaxy role install kameshsampath.minikube","title":"Install role"},{"location":"#role-variables","text":"Variable Name Description Default minikube_create If True creates the cluster True minikube_destroy If True destroys the cluster False minikube_version The minikube version v1.24.0 minikube_home_dir The directory where minikube files will be stored {{ playbook_dir }}/.minikube minikube_driver The minikube driver hyperkit minikube_memory The memory to use for minikube 8g minikube_cpus The cpus to use for minikube 4 minikube_disk_size The disk size to use for minikube 50g minikube_kubernetes_version The kubernetes version to use stable kubeconfig_dir The directory to create the flattened kubeconfig {{ playbook_dir }}/.kube minikube_profiles is used to configure the minikube profiles(clusters) that will be created while using the role, The default value of minikube_profiles is: minikube_profiles : minikube : create : yes destroy : no addons : - registry - registry-aliases - metallb A minikube dictionary as shown above will create minikube profile named minikube with 8g of RAM and 4 cpus. The profile also enables the addons registry,registry-aliases and metallb. The create attribute determines if this profile needs to be created, similarly destroy will determine if the cluster is to be deleted. Note The minkube_profiles create and destroy are mutally exclusive.","title":"Role Variables"},{"location":"#overriding-default-values","text":"All the role variables like minikube_* could be overriden at the profile level. When overiding the value at profile level make sure you add attribute name without minikube_ prefix. Lets say we want to create minikube cluster with 4 cpus , 16G ram and 100g hard-disk , then the minikube profile looks like, minikube_profiles : minikube : create : yes destroy : no cpus : 4 memory : 16g disk_size : 100g addons : - registry - registry-aliases - metallb","title":"Overriding default values"},{"location":"#example-playbooks","text":"","title":"Example playbooks"},{"location":"#creating-a-minikube-clusters","text":"- name : \"Create minikube Clusters\" hosts : all vars : # the demo work directory work_dir : \"{{ playbook_dir }}/work\" # the kubeconfig directory kubeconfig_dir : \"{{ work_dir }}/.kube\" # the kubernetes version to use with minikube minikube_kubernetes_version : v1.21.6 # the minikube home directory minikube_home_dir : \"{{ work_dir }}/.minikube\" # minikube profiles minikube_profiles : mgmt : # profile name and Kubernetes context name create : yes destroy : no memory : 16g # override the default memory, note the attribute name without prefix _minikube addons : - metallb lbStartIP : 192.168.64.80 lbEndIP : 192.168.64.90 cluster1 : # profile name and Kubernetes context name create : yes destroy : no addons : - metallb lbStartIP : 192.168.64.110 lbEndIP : 192.168.64.120 roles : - role : kameshsampath.minikube # Some extra configurations tasks : - name : \"Configure metallb\" ansible.builtin.expect : command : \"{{ minikube_binary }} -p {{ item.key }} addons configure metallb\" responses : \"-- Enter Load Balancer Start IP:\" : \"{{ item.value.lbStartIP}}\" \"-- Enter Load Balancer End IP:\" : \"{{ item.value.lbEndIP}}\" loop : \"{{ minikube_profiles | dict2items }}\" loop_control : label : \"{{ item.key }}\" register : lb_setup_result when : item.value.create and not item.value.destroy","title":"Creating a minikube Cluster(s)"},{"location":"#deleting-minikue-clusters","text":"- name : \"Delete minikube Cluster(s)\" hosts : all vars : # the demo work directory work_dir : \"{{ playbook_dir }}/work\" # the kubeconfig directory kubeconfig_dir : \"{{ work_dir }}/.kube\" # the kubernetes version to use with minikube minikube_kubernetes_version : v1.21.6 # the minikube home directory minikube_home_dir : \"{{ work_dir }}/.minikube\" # minikube profiles minikube_profiles : mgmt : # profile name and Kubernetes context name create : no destroy : yes cluster1 : # profile name and Kubernetes context name create : no destroy : yes roles : - role : kameshsampath.minikube","title":"Deleting minikue Cluster(s)"}]}
|