Chef cookbook to install K3s using MariaDB as a Cluster Datastore.
This cookbook requires a running MariaDB instance to use as a backend for K3s. See the mariadb cookbook for examples of how to setup a standalone or Galera instance.
The k3s_install
resource is responsible for fetching and running a Terraform Cloud Agent docker image.
default_action :run
:create
- Pulls the container image.:remove
- Removes the cached image.
disable
- Array of components to disable/not deploy.disable_cloud_controller
- Boolean to disable the default cloud controller manager. Defaults tofalse
.datastore
- Cluster Datastore to use, at the moment onlymariadb
is supported. Defaults tomariadb
.kubeconfig_mode
- kube config file mode. Defaults to0644
.kubelet_args
- Array of customised flags for the kubelet process.mariadb_database
- MariaDB database to use. Defaults tok3s
.mariadb_user
- MariaDB username used by k3s. Defaults tok3s
.mariadb_password
- MariaDB password used by k3s. Defaults tok3s
.mariadb_host
- MariaDB host to use. Defaults tolocalhost
.node_labels
- Array ofkey=value
pairs to apply as node labels.snapshotter
- Set to override the default containerd snapshotter.tls_san
- Additional TLS SAN(s); can be specified either as an array or string.
Minimal usage:
k3s_install 'server'
Using non-default MariaDB settings:
k3s_install 'server' do
mariadb_user 'k3s'
mariadb_password 'p4ssw0rd'
mariadb_host 'db.local'
end
Specifying custom node labels and additional TLS SAN:
k3s_install 'server' do
node_labels ['foo=bar', 'something=amazing']
tls_san 'k3s.example.com'
end
This cookbook uses Semantic Versioning 2.0.0.
Given a version number MAJOR.MINOR.PATCH, increment the:
- MAJOR version when you make functional cookbook changes,
- MINOR version when you add functionality in a backwards-compatible manner,
- PATCH version when you make backwards-compatible bug fixes.
We welcome contributed improvements and bug fixes via the usual work flow:
- Fork this repository
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new pull request
Authors and contributors:
- Stephen Hoekstra [email protected]
Copyright 2020 Stephen Hoekstra <[email protected]>
Copyright 2020 Schuberg Philis
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.