Skip to content

Commit 5ec55a1

Browse files
authored
Merge pull request #38 from ccaum/use_docker_hub_image_in_docs
Update README to use new puppet/kubetool image
2 parents 4b83ccf + 1d10d8b commit 5ec55a1

File tree

1 file changed

+15
-48
lines changed

1 file changed

+15
-48
lines changed

README.md

Lines changed: 15 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -28,47 +28,20 @@ It groups containers that make up an application into logical units for easy man
2828

2929
### Setup Requirements
3030

31-
The included configuration tool `kube_tools` auto generates all the security parameters, the bootstrap token, and other configurations for your cluster into a file. The `kube_tool` requires Ruby 2.3 and above.
31+
This module includes a configuration tool called `kubetool` to auto generate
32+
all the security parameters, the bootstrap token, and other configurations for
33+
your Kubernetes cluster into a Hiera file. The tool is available as a Docker
34+
image to simplify installation and use.
3235

33-
1. cfssl is a requirement, so we recommend you install the module on a local machine and not a Puppet server by running this command:
3436

35-
```puppet
36-
puppet module install puppetlabs-kubernetes --version 0.2.0
37-
```
38-
39-
2. Install cfssl. See Cloudflare's [cfssl documentation](https://github.com/cloudflare/cfssl).
40-
41-
3. Change directory into the root of the module, and run the `bundle install` command.
42-
43-
4. Change directory into the [tools](https://github.com/puppetlabs/puppetlabs-kubernetes/tree/master/tooling) directory, and run the `kube_tool` command.
37+
#### Generate the module's configuration
4438

45-
5. To view the help menu, run the `./kube_tool.rb -h` command.
46-
47-
The kube_tools help menu:
48-
49-
```puppet
50-
Usage: kube_tool [options]
51-
-o, --os-type os-type the os that kubernetes will run on
52-
-v, --version version the kubernetes version to install
53-
-r container runtime, the container runtime to use. this can only be docker or cri_containerd
54-
--container_runtime
55-
-f, --fqdn fqdn fqdn
56-
-i, --ip ip ip
57-
-b bootstrap, the bootstrap controller ip address
58-
--bootstrap-controller-ip
59-
-e etcd_initial_cluster, members of the initial etcd cluster
60-
--etcd-initial-cluster
61-
-t, --etcd-ip etcd_ip ip address of etcd
62-
-a, --api-address api_address the ip address that kube api will listen on
63-
-d dashboard, install the kube dashboard
64-
--install-dashboard
65-
-h, --help Displays Help
66-
```
39+
If you do not already have Docker installed on your workstation, install it [here](https://www.docker.com/community-edition)
6740

68-
So to generate the hiera file for my cluster I use:
41+
The kubetool docker image takes each of the parameters as environment variables. When run as follows it will output a `kubernetes.yaml` file in your current working directory:
6942

7043
```puppet
71-
./kube_tool.rb -o debian -v 1.8.4 -r docker -f kubernetes -i 172.17.10.101 -b 172.17.10.101 -e "etcd-kube-master=http://172.17.10.101:2380,etcd-kube-replica-master-01=http://172.17.10.210:2380,etcd-kube-replica-master-02=http://172.17.10.220:2380" -t "%{::ipaddress_enp0s8}" -a "%{::ipaddress_enp0s8}" -d true
44+
docker run -v $(pwd):/mnt -e FQDN=kubernetes -e IP=172.17.10.101 -e BOOTSTRAP_CONTROLLER_IP=172.17.10.101 -e ETCD_INITIAL_CLUSTER="etcd-kube-master=http://172.17.10.101:2380" -e ETCD_IP="%{::ipaddress_enp0s8}" -e KUBE_API_ADVERTISE_ADDRESS="%{::ipaddress_enp0s8}" -e INSTALL_DASHBOARD=true puppetlabs/kubetool
7245
```
7346

7447
The parameters are:
@@ -82,22 +55,16 @@ The parameters are:
8255
* `ETCD_IP` and `ETCD_IP KUBE_API_ADVERTISE_ADDRESS`: we recommend passing the fact for the interface to be used by the cluster.
8356
* `INSTALL_DASHBOARD`: a boolean to install the dashboard or not.
8457

85-
The tool creates a `kubernetes.yaml` file. To view the file contents on screen, run the `cat` command.
86-
87-
6. Add the `kubernetes.yaml` file to the Hiera directory on your Puppet server.
88-
89-
The tool also creates a bootstrap token and base64 encodes any values that need to be encoded for Kubernetes. If you run the `cat` command again, all the values are re-generated, including the certificates and tokens. You can then use Jenkins or Bamboo to add the Hiera file to your control repository or version control application.
90-
91-
If you don't want to use the `kube_tools` configuration tool and want to manually configure the module, all of the parameters are listed in the [Reference](#reference) section and in the [init.pp](https://github.com/puppetlabs/puppetlabs-kubernetes/blob/master/manifests/init.pp) file.
58+
The kubetool creates a `kubernetes.yaml` file. To view the file contents on
59+
screen, run the `cat kubernetes.yaml` command.
9260

93-
If you don't want to install the dependencies in your local environment, a Dockerfile is included. To build, change directory into the tooling directory, and run the `docker build -t puppet/kubetool` command.
61+
The tool also creates a bootstrap token and base64 encodes any values that need
62+
to be encoded for Kubernetes. If you run the `kubetool` command again, all the
63+
values are re-generated, including the certificates and tokens.
9464

95-
The docker image takes each of the parameters as environment variables. When run as follows it will output a kubernetes.yaml file in your current working directory:
96-
97-
```puppet
98-
docker run -v $(pwd):/mnt -e FQDN=kubernetes -e IP=172.17.10.101 -e BOOTSTRAP_CONTROLLER_IP=172.17.10.101 -e ETCD_INITIAL_CLUSTER="etcd-kube-master=http://172.17.10.101:2380" -e ETCD_IP="%{::ipaddress_enp0s8}" -e KUBE_API_ADVERTISE_ADDRESS="%{::ipaddress_enp0s8}" -e INSTALL_DASHBOARD=true puppetlabs/kubetool
99-
```
65+
#### 2. Add the `kubernetes.yaml` file to Hiera
10066

67+
The resuling `kubernetes.yaml` file should be added to your [control repo](https://puppet.com/docs/pe/2017.3/code_management/control_repo.html) where you keep your [Hiera](https://docs.puppet.com/hiera/) data, usually the `data` directory. Each cluster can be given its own configuration by leveraging location facts such as the [pp_datacenter](https://puppet.com/docs/puppet/5.0/ssl_attributes_extensions.html#puppet-specific-registered-ids) [trusted fact](https://puppet.com/docs/puppet/5.0/lang_facts_and_builtin_vars.html#trusted-facts).
10168

10269
### Begininning with kubernetes
10370

0 commit comments

Comments
 (0)