Puppet Kubernetes Setting up the environment to use kubernetes in puppet

0 votes

I have installed the puppetlabs/kubernetes module in order to use it to manage my kubernetes cluster. But how do I setup the environment? 

what's the procedure to configure my node? I need help with the setup.

Aug 21, 2019 in Puppet by Karan
• 19,610 points
1,171 views

1 answer to this question.

0 votes

As you have already installed the module, the next steps would be:

  • Generate the configuration

  • Add theOS and hostname yaml files to Hiera

  • Configure your node

This module has Kubetool a configuration tool that auto-generates the Hiera security parameters, the discovery token hash, and other configurations for your Kubernetes cluster. To simplify installation and use, the tool is available as a Docker image.

Generating the module configuration:

If Docker is not installed on your workstation, install it.

The Kubetool Docker image takes each parameter as an environment variable.

Note:: The version of Kubetool you use must match the version of the module on the Puppet Forge. 

To output a yaml file into your working directory that corresponds to the operating system you want Kubernetes to run on, and for each controller node, run either of these docker run commands:

docker run --rm -v $(pwd):/mnt --env-file env puppet/kubetool:{$module_version}

The docker run command above includes an env file which is included in the root folder of this repo.

docker run --rm -v $(pwd):/mnt -e OS=debian -e VERSION=1.10.2 -e CONTAINER_RUNTIME=docker -e CNI_PROVIDER=cilium -e CNI_PROVIDER_VERSION=1.4.3 -e ETCD_INITIAL_CLUSTER=kube-master:172.17.10.101,kube-replica-master-01:172.17.10.210,kube-replica-master-02:172.17.10.220 -e ETCD_IP="%{::ipaddress_eth1}" -e KUBE_API_ADVERTISE_ADDRESS="%{::ipaddress_eth1}" -e INSTALL_DASHBOARD=true puppet/kubetool:{$module-version}

Adding the {$OS}.yaml and {$hostname}.yaml files to Hiera:

Add the {$OS}.yaml file to the same control repo where your Hiera data is, usually the data directory. By leveraging location facts, such as the pp_datacenter trusted_fact each cluster can be allocated its own configuration.

Configuring your node:

After the {$OS}.yaml and {$hostname}.yaml files have been added to the Hiera directory on your Puppet server, configure your node as the controller or worker.

A controller node contains the control plane and etcd

In a production cluster, you should have three, five, or seven controllers. A worker node runs your applications. You can add as many worker nodes as Kubernetes can handle. 

And you are good to go!

answered Aug 21, 2019 by Sirajul
• 59,230 points

Related Questions In Puppet

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to change the run interval in puppet?

To check the run interval run the following ...READ MORE

answered Jul 29, 2019 in Puppet by Sirajul
• 59,230 points
3,589 views
0 votes
1 answer
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
15,328 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 12, 2019 in Kubernetes by Kalgi
• 52,360 points

reshown Apr 12, 2019 by Kalgi 6,944 views
0 votes
1 answer

How to check the installed modules in puppet?

Puppet Module list command will list all ...READ MORE

answered Jul 24, 2019 in Puppet by Sirajul
• 59,230 points
8,759 views
0 votes
1 answer

How can i avoid the "environment leakage" in puppet?

Environment leakage is one of the limitations ...READ MORE

answered Jul 25, 2019 in Puppet by Sirajul
• 59,230 points
695 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP