This repository has been archived by the owner on Jun 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Add the kvm-libvirt platform to lokoctl #810
Open
pothos
wants to merge
5
commits into
master
Choose a base branch
from
kai/kvm-libvirt
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9edcfe6
Add the kvm-libvirt platform to lokoctl
pothos 9b28bd4
terraform: update terraform providers to new format
ipochi 08a65cb
platform/kvmlibvirt: add charts to be installed
ipochi bd7ce15
kvmlibvirt: enable tls bootstrap
ipochi e052b80
lint: fix lint issues
ipochi File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
assets/terraform-modules/kvm-libvirt/flatcar-linux/kubernetes/bootstrap-configs.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
locals { | ||
controller_bootstrap_token = var.enable_tls_bootstrap ? { | ||
token_id = random_string.bootstrap_token_id[0].result | ||
token_secret = random_string.bootstrap_token_secret[0].result | ||
} : {} | ||
} | ||
|
||
# Generate a cryptographically random token id (public). | ||
resource random_string "bootstrap_token_id" { | ||
count = var.enable_tls_bootstrap == true ? 1 : 0 | ||
|
||
length = 6 | ||
upper = false | ||
special = false | ||
} | ||
|
||
# Generate a cryptographically random token secret. | ||
resource random_string "bootstrap_token_secret" { | ||
count = var.enable_tls_bootstrap == true ? 1 : 0 | ||
|
||
length = 16 | ||
upper = false | ||
special = false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 13 additions & 3 deletions
16
assets/terraform-modules/kvm-libvirt/flatcar-linux/kubernetes/versions.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
# Terraform version and plugin versions | ||
|
||
terraform { | ||
required_version = ">= 0.12.0" | ||
required_version = ">= 0.13" | ||
|
||
required_providers { | ||
ct = "0.6.0" | ||
|
||
ct = { | ||
source = "poseidon/ct" | ||
version = "0.6.1" | ||
} | ||
|
||
libvirt = { | ||
source = "dmacvicar/libvirt" | ||
uri = "qemu:///system" | ||
version = "0.6.2" | ||
} | ||
|
||
null = "2.1.2" | ||
template = "2.1.2" | ||
libvirt = "0.6.0" | ||
random = "2.3.0" | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
assets/terraform-modules/kvm-libvirt/flatcar-linux/kubernetes/workers/bootstrap-configs.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
locals { | ||
worker_bootstrap_token = var.enable_tls_bootstrap ? { | ||
token_id = random_string.bootstrap_token_id[0].result | ||
token_secret = random_string.bootstrap_token_secret[0].result | ||
} : {} | ||
} | ||
|
||
# Generate a cryptographically random token id (public). | ||
resource random_string "bootstrap_token_id" { | ||
count = var.enable_tls_bootstrap == true ? 1 : 0 | ||
|
||
length = 6 | ||
upper = false | ||
special = false | ||
} | ||
|
||
# Generate a cryptographically random token secret. | ||
resource random_string "bootstrap_token_secret" { | ||
count = var.enable_tls_bootstrap == true ? 1 : 0 | ||
|
||
length = 16 | ||
upper = false | ||
special = false | ||
} |
15 changes: 15 additions & 0 deletions
15
...rm-modules/kvm-libvirt/flatcar-linux/kubernetes/workers/cl/bootstrap-kubeconfig.yaml.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
kind: Config | ||
clusters: | ||
- name: local | ||
cluster: | ||
server: ${server} | ||
certificate-authority-data: ${ca_cert} | ||
users: | ||
- name: kubelet | ||
user: | ||
token: ${token_id}.${token_secret} | ||
contexts: | ||
- context: | ||
cluster: local | ||
user: kubelet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
assets/terraform-modules/kvm-libvirt/flatcar-linux/kubernetes/workers/outputs.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
output "worker_bootstrap_token" { | ||
value = local.worker_bootstrap_token | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 11 additions & 3 deletions
14
assets/terraform-modules/kvm-libvirt/flatcar-linux/kubernetes/workers/versions.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
# Terraform version and plugin versions | ||
|
||
terraform { | ||
required_version = ">= 0.12.0" | ||
required_version = ">= 0.13" | ||
|
||
required_providers { | ||
ct = "0.6.0" | ||
ct = { | ||
source = "poseidon/ct" | ||
version = "0.6.1" | ||
} | ||
|
||
libvirt = { | ||
source = "dmacvicar/libvirt" | ||
uri = "qemu:///system" | ||
version = "0.6.2" | ||
} | ||
template = "2.1.2" | ||
libvirt = "0.6.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
cluster "kvm-libvirt" { | ||
asset_dir = pathexpand("~/lokoctl-assets") | ||
ssh_pubkeys = [file(pathexpand("~/.ssh/id_rsa.pub"))] | ||
cluster_name = "vmcluster" | ||
machine_domain = "vmcluster.k8s" | ||
os_image = "file:///var/tmp/flatcar_production_qemu_image.img" | ||
|
||
worker_pool "one" { | ||
count = 2 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have a CI pipeline for this platform yet, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was one which shared the baremetal CI setup. The code was probably removed but can be recovered from git.