You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-48Lines changed: 15 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,47 +28,20 @@ It groups containers that make up an application into logical units for easy man
28
28
29
29
### Setup Requirements
30
30
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.
32
35
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:
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
44
38
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)
67
40
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:
*`ETCD_IP` and `ETCD_IP KUBE_API_ADVERTISE_ADDRESS`: we recommend passing the fact for the interface to be used by the cluster.
83
56
*`INSTALL_DASHBOARD`: a boolean to install the dashboard or not.
84
57
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.
92
60
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.
94
64
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:
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).
0 commit comments