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 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates to new version and according file changes for the respective version. Part of #314 Signed-off-by: Kautilya Tripathi <[email protected]>
- Loading branch information
Showing
21 changed files
with
1,026 additions
and
349 deletions.
There are no files selected for viewing
33 changes: 23 additions & 10 deletions
33
assets/terraform-modules/azure/flatcar-linux/kubernetes/bootkube.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,22 +1,35 @@ | ||
# Self-hosted Kubernetes assets (kubeconfig, manifests) | ||
locals { | ||
api_server = format("%s.%s", var.cluster_name, var.dns_zone) | ||
} | ||
|
||
module "bootkube" { | ||
source = "../../../bootkube" | ||
|
||
cluster_name = var.cluster_name | ||
api_servers = [format("%s.%s", var.cluster_name, var.dns_zone)] | ||
etcd_servers = formatlist("%s.%s", azurerm_dns_a_record.etcds.*.name, var.dns_zone) | ||
asset_dir = var.asset_dir | ||
cluster_name = var.cluster_name | ||
api_servers = [local.api_server] | ||
etcd_servers = [for i, d in azurerm_linux_virtual_machine.controllers : format("%s-etcd%d.%s", var.cluster_name, i, var.dns_zone)] | ||
etcd_endpoints = azurerm_linux_virtual_machine.controllers.*.private_ip_address | ||
asset_dir = var.asset_dir | ||
controller_count = var.controller_count | ||
|
||
networking = var.networking | ||
|
||
network_encapsulation = "vxlan" | ||
|
||
# we should be able to use 1450 MTU, but in practice, 1410 was needed | ||
network_mtu = "1410" | ||
|
||
pod_cidr = var.pod_cidr | ||
service_cidr = var.service_cidr | ||
cluster_domain_suffix = var.cluster_domain_suffix | ||
enable_reporting = var.enable_reporting | ||
enable_aggregation = var.enable_aggregation | ||
|
||
conntrack_max_per_core = var.conntrack_max_per_core | ||
pod_cidr = var.pod_cidr | ||
service_cidr = var.service_cidr | ||
cluster_domain_suffix = var.cluster_domain_suffix | ||
bootstrap_tokens = var.enable_tls_bootstrap ? concat([local.controller_bootstrap_token], var.worker_bootstrap_tokens) : [] | ||
enable_tls_bootstrap = var.enable_tls_bootstrap | ||
enable_reporting = var.enable_reporting | ||
enable_aggregation = var.enable_aggregation | ||
encrypt_pod_traffic = var.encrypt_pod_traffic | ||
# Disable the self hosted kubelet. | ||
disable_self_hosted_kubelet = var.disable_self_hosted_kubelet | ||
certs_validity_period_hours = var.certs_validity_period_hours | ||
} |
24 changes: 24 additions & 0 deletions
24
assets/terraform-modules/azure/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 | ||
} |
Oops, something went wrong.