K3s on Docker Quickstart
Prerequisites
-
Access to a functional Docker Engine,
-
CGroupv2 disabled (K3s does not support it for now),
-
Knowledge of Terraform basics
Create the Terraform root module
module "cluster" {
source = "git::https://github.com/camptocamp/camptocamp-devops-stack.git//modules/k3s/docker?ref=master"
cluster_name = "my-cluster"
node_count = 2
repo_url = "https://github.com/camptocamp/camptocamp-devops-stack.git"
target_revision = "master"
}
If you want to use this in a pipeline, declare the required outputs:
output "argocd_auth_token" {
sensitive = true
value = module.cluster.argocd_auth_token
}
output "kubeconfig" {
sensitive = true
value = module.cluster.kubeconfig
}
output "repo_url" {
value = module.cluster.repo_url
}
output "target_revision" {
value = module.cluster.target_revision
}
output "app_of_apps_values" {
sensitive = true
value = module.cluster.app_of_apps_values
}