Commit graph

37 commits

Author SHA1 Message Date
Yajo
4b42a9bf49 fix: restore clustering feature
For some weird reason, string booleans were set on `k3s_control_node` and `k3s_primary_control_node`, making their behavior non-obvious (for python `bool("false") == True`).

This fixes that problem, and BTW restores the ability to create clusters, which got lost with this bug.

After running the role against a cluster, see:

```sh
❯ ansible -i inventories/testing.yaml k8s_node -m command -ba 'kubectl get node'
vm0 | CHANGED | rc=0 >>
NAME   STATUS   ROLES                       AGE     VERSION
vm0    Ready    control-plane,etcd,master   9m19s   v1.21.2+k3s1
vm2 | CHANGED | rc=0 >>
NAME   STATUS   ROLES                       AGE     VERSION
vm2    Ready    control-plane,etcd,master   9m22s   v1.21.2+k3s1
vm1 | CHANGED | rc=0 >>
NAME   STATUS   ROLES                       AGE     VERSION
vm1    Ready    control-plane,etcd,master   9m22s   v1.21.2+k3s1
```

Now, after the patch:

```sh
❯ ansible -i inventories/testing.yaml k8s_node -m command -ba 'kubectl get node'
vm0 | CHANGED | rc=0 >>
NAME   STATUS   ROLES                       AGE    VERSION
vm0    Ready    control-plane,etcd,master   2m2s   v1.21.2+k3s1
vm1    Ready    control-plane,etcd,master   58s    v1.21.2+k3s1
vm2    Ready    control-plane,etcd,master   80s    v1.21.2+k3s1
vm1 | CHANGED | rc=0 >>
NAME   STATUS   ROLES                       AGE    VERSION
vm0    Ready    control-plane,etcd,master   2m2s   v1.21.2+k3s1
vm1    Ready    control-plane,etcd,master   58s    v1.21.2+k3s1
vm2    Ready    control-plane,etcd,master   80s    v1.21.2+k3s1
vm2 | CHANGED | rc=0 >>
NAME   STATUS   ROLES                       AGE    VERSION
vm0    Ready    control-plane,etcd,master   2m2s   v1.21.2+k3s1
vm1    Ready    control-plane,etcd,master   58s    v1.21.2+k3s1
vm2    Ready    control-plane,etcd,master   80s    v1.21.2+k3s1
```

@Tecnativa TT2541
2021-07-21 12:37:17 +00:00
Xan Manning
4326f4497d Renamed k3s_control_node_address -> k3s_registration_address 2021-03-14 16:29:14 +00:00
Xan Manning
62b2d7cb36 Typo bugfixes 2021-02-27 19:02:49 +00:00
Xan Manning
7e4a16e167 Pre-documentation work
- Restructured when and asserts
  - Standardise molecule call, add systemd config
2021-02-16 16:53:49 +00:00
Xan Manning
e7c714424c
Tiidy up and refactoring of tasks (#80)
* Tidy up and refactoring of tasks

  - `k3s_config_dir` derived from `k3s_config_file`, reused throughout the role
    to allow for easy removal of "Rancher" references #73.
  - `k3s_token_location` has moved to be in `k3s_config_dir`.
  - Tasks for creating directories now looped to caputure configuration from
    `k3s_server` and `k3s_agent` and ensure directories exist before k3s
    starts, see #75.
  - Server token collected directly from token file, not symlinked file
    (node-token).
  - `k3s_runtime_config` defined in `vars/` for validation and overwritten in
    tasks for control plane and workers.
  - Removed unused references to GitHub API.

* set_fact now uses FQCN

* re-pin molecule<3.2

* Command module now uses FQCN

* Added package checks for #72

* Reorder task files

  - Docker tasks moved into a separate directory for ease of removal #67
  - Bugfix: Control plane on alternate port didn't work.
  - Validation tasks grouped

* Fix Fedora tests

* Add optional documentation links to validations steps #76

* Removed jmespath requirement

* Fix issue with data collection

* Release candidate
2020-12-21 19:14:52 +00:00
Xan Manning
4afc2c8a5a Fixed data-dir configuration and draining of nodes. Added documentation. 2020-12-05 21:56:28 +00:00
Xan Manning
35b037c7ee Pre-FQCN breakage 2020-10-23 16:31:21 +01:00
Xan Manning
57b9a2a0be Moved to file based config, pre-FQCN, pre-update to documentation 2020-10-22 19:26:15 +01:00
Xan Manning
9b800d9fba moving to file-based config 2020-10-19 20:26:12 +01:00
Xan Manning
23cdd3edda Fix missing --disable flags mentioned in #56 2020-10-18 17:58:32 +01:00
Xan Manning
9a15d8eddf
Merge pull request #55 from onedr0p/patch-3
Implement setting multiple k3s_tls_san
2020-09-26 17:37:11 +01:00
ᗪєνιη ᗷυнʟ
6cf09c8efa
implement k3s_tls_san iterable in systemd service
keeps support for non-array values
2020-09-24 10:21:48 -04:00
ᗪєνιη ᗷυнʟ
564d693e9d
add disable-kube-proxy to systemd servie 2020-09-24 08:36:48 -04:00
ᗪєνιη ᗷυнʟ
c447fcec39 A number of enhancements for v1.19 release.
- Added option to skip validation checks #47
  - Add SELinux support in containerd #48
  - Added check for Etcd member count #46
  - Moved token to a file #50
  - Added Etcd snapshot configuration options #49
2020-09-22 20:30:50 +01:00
Xan Manning
1438ddde69
Merge pull request #43 from onedr0p/patch-2
Set LimitNOFILE to 1048576 in k3s systemd file
2020-09-21 20:45:34 +01:00
ᗪєνιη ᗷυнʟ
36d44bc1af
move debug to before server and agent flags 2020-09-21 13:44:11 -04:00
ᗪєνιη ᗷυнʟ
cc0c686e61
Set LimitNOFILE to 1048576
https://github.com/containerd/containerd/issues/3201
2020-09-21 08:39:55 -04:00
ᗪєνιη ᗷυнʟ
0129ec3e5c
add debug flag service file 2020-09-21 08:29:13 -04:00
Xan Manning
175b90ecb0 Added support for Etcd, removed DQLite support. See #41 2020-09-17 21:01:20 +01:00
Xan Manning
c743df868b Fixing ansible-linting, exclude name check for Travis-CI
This release also fixes:

  - #38 : removing the --disable-agent option. Please use node taints.
  - #39 : clarified where jmespath should be installed in README.md
2020-09-15 18:20:23 +01:00
Xan Manning
230aaa110c Bugfix, bind address is for listener 2020-08-01 14:17:20 +01:00
Xan Manning
504b84a8b6 Use --disable rather than --no-deploy, fix issue #33 2020-07-16 12:49:31 +01:00
Xan Manning
3a6b411430 Added support for args, private registries. Fixes #32 2020-07-04 13:24:10 +01:00
Xan Manning
e93b438ee0 Added secrets encryption at rest option 2020-03-28 12:58:58 +00:00
Xan Manning
f709caf371 Skip final checks when no-flannel option is used.
Fixes #16

This is because without a CNI, nodes will never be ready and the task
will fail. You need to deploy your choice of CNI manually (such as
Calico) then check the state of the cluster using `kubectl get nodes`.
2020-03-07 14:23:09 +00:00
Ryan Holt
c473f932c4
added kubelet args key
Signed-off-by: Ryan Holt <ryan@ryanholt.net>
2020-02-26 18:03:08 -05:00
Devin Buhl
c4547306ce
add option to specify local storage path (#10) 2020-02-25 08:48:09 +00:00
Xan Manning
3a1c7e7b35 Added workflow for Database backed and DQLite HA 2020-01-13 19:08:37 +00:00
Xan Manning
c3ae2b79eb Added database container and proved connectivity. Logic needs to be changed for HA. 2020-01-11 19:20:52 +00:00
Xan Manning
f2a3f75f08 Added some validation steps, fixed issue with checksum, introducing rootless
as an option, however this is experimental in both K3s and this role.
2019-12-22 18:54:25 +00:00
Xan Manning
26a3b2eef0 Added extra no-deploy options for v1.0.0 2019-12-04 19:10:05 +00:00
Xan Manning
8f3b2428c8 Added experimental options to ansible role:
1. Ability to specify control host address, for connecting to a control plane
     provisioned outside of the role.
  2. Ability to specify the control host token, again for connecting to
     a control plane provisioned outside of the role.
  3. Included upstream changes from @nolte to define KubeConfig file
     permissions.
2019-12-04 17:17:15 +00:00
Xan Manning
2b8f354a88 Updated service unit template for neater output 2019-11-03 15:35:32 +00:00
Xan Manning
5e39160ed9 Added a number of extra options to configure K3s in systemd unit file.
Testing:
  - Added docker networking, ensure that test output is verbose.
  - Fix build for AmazonLinux 2
  - No-deploy flag test added
2019-11-02 22:19:33 +00:00
Xan Manning
efc703541c Updated for 0.10.0, adding molecule testing with Travis-CI 2019-10-26 22:23:17 +01:00
Xan Manning
2327d0433d Added new options for Flannel interfaces, tested on openSUSE LEAP 15.1 2019-09-29 18:11:05 +01:00
Xan Manning
750c72295e Initial commit and release 2019-03-09 20:54:44 +00:00