Commit Graph

53 Commits

Author SHA1 Message Date
Andrew Chen
ce4ad4dc0b fix typo 2021-12-22 22:18:42 -08:00
Xan Manning
59f0a2152e fix(systemd): templating error for environment vars 2021-12-20 21:34:15 +00:00
Xan Manning
0c77eb143d feat(systemd): unit file allows environment variables to be defined #164 2021-12-19 18:59:42 +00:00
Xan Manning
e90448f40b Updated systemd template to use token when joining a cluster 2021-07-24 17:21:31 +01:00
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
赵安家
d563dcca05 style(k3s): change code style
change code style
2021-05-08 18:39:19 +08:00
赵安家
c9e2b619d1 feat(k3s): support k3s's private-registry configuration
rancher doc url https://rancher.com/docs/k3s/latest/en/installation/private-registry/
2021-05-07 17:56:45 +08:00
Vegetto
5305eb3758
Unmount CSI plugin folder
Fixed upstream - see https://github.com/k3s-io/k3s/issues/3264
2021-05-04 23:20:46 +02: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
99c22dceab Uninstall scripts now in-line with upstream
Fixes #74
Addresses #73 - move rancher reference to vars/
2020-12-19 14:05:41 +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
f3173f193f Merge branch 'bugfix-k3s_node_data_dir' into role_v2 2020-10-19 20:35:32 +01:00
Xan Manning
6e29200d9a Attempt to fix #57 - k3s_node_data_dir set in templates 2020-10-19 20:32:53 +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
0bfbaa302e Fix uninstall 2020-07-25 20:42:26 +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
26467de186 Unknown issue with k3s-uninstall.sh exiting with 1.
The script looks to be completing without error in my testing as well as
in the original issue so I am forcing an exit with 0 until the cause can
be found.

Fixes #23
2020-05-16 21:19:48 +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
Xan Manning
84bf657f1c Merge branch 'master' of github.com:carpenike/ansible-role-k3s into carpenike/master 2020-02-27 18:16:49 +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
Xan Manning
56b2d7bc03 Fixed path in k3s-uninstall.sh - my bad 2020-02-26 21:52:56 +00:00
Xan Manning
75fd17aac8 Slightly updated tasks and added validation checks
1. Now does not remove prerequisite packages, lvm2 was included in
these packages (not good when you use LVM2 for real).
  2. Added a bit more idempotency to the shell scripts - only delete if
it exists.
  3. Check that the process isn't running and binaries are gone.
2020-02-26 20:56:05 +00:00
Devin Buhl
9bbf5fd746 add uninstall state 2020-02-25 12:29:39 -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