Skip to content

Commit 8c1226f

Browse files
authored
feat: build helm chart, update modules (#86)
Signed-off-by: matttrach <matt.trachier@suse.com>
1 parent 2a85f76 commit 8c1226f

48 files changed

Lines changed: 526 additions & 1477 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ examples/*/kubeconfig
2727
test/tests/data/*
2828
examples/basic/rancher_bootstrap
2929
.terraform.lock.hcl
30+
run.sh

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,30 @@ We recommend setting the following environment variables for quick personal use:
1616

1717
```shell
1818
GITHUB_TOKEN
19+
GITHUB_OWNER
1920
AWS_REGION
2021
AWS_SECRET_ACCESS_KEY
2122
AWS_ACCESS_KEY_ID
2223
ZONE
2324
```
2425

26+
This module now supports the use of AWS temporary credentials to deploy cert manager.
27+
At the moment it uses the same credentials supplied to generate the infrastructure,
28+
but in the future we intend to add the ability to supply cert manager specific credentials.
29+
Make sure to set the AWS_SESSION_TOKEN environment variable when using this.
30+
2531
#### Tools
2632

2733
These tools will need to be installed on the machine running Terraform:
2834
- curl
2935
- jq
3036
- kubectl
3137
- terraform
38+
- yq
39+
- helm (v3)
40+
- git
41+
42+
Check out the flake.nix file for a list of packages that we use when developing and testing (lines 50-80).
3243

3344
#### Local Filesystem Write Access
3445

@@ -74,9 +85,8 @@ These tools are not necessary, but they can make it much simpler to collaborate.
7485

7586
#### Automated Tests
7687

77-
Our continuous integration tests using the GitHub [ubuntu-latest runner](https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md), we then rely on Nix to deploy the additional dependencies.
78-
79-
It also has special integrations with AWS to allow secure authentication, see https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services for more information.
88+
Our continuous integration tests using the GitHub [ubuntu-latest runner](https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md),
89+
we then rely on Nix to deploy the additional dependencies.
8090

81-
With this tool it is possible to retrieve the aws access key and aws secret key to the temporarily defined access to the AWS account.
82-
We send these to Rancher when building our tests, this allows us to temporarily and securely setup certmanger and Rancher provisioning.
91+
It also has special integrations with AWS to allow secure authentication,
92+
see https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services for more information.

examples/check_for_vpc_dependencies.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

examples/deploy_rke2/main.tf

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -39,29 +39,28 @@ provider "rancher2" {
3939
}
4040

4141
locals {
42-
identifier = var.identifier
43-
example = "basic"
44-
project_name = "tf-${substr(md5(join("-", [local.example, local.identifier])), 0, 5)}"
45-
username = local.project_name
46-
domain = local.project_name
47-
zone = var.zone
48-
key_name = var.key_name
49-
key = var.key
50-
owner = var.owner
51-
rke2_version = var.rke2_version
52-
local_file_path = var.file_path
53-
runner_ip = chomp(data.http.myip.response_body) # "runner" is the server running Terraform
54-
rancher_version = var.rancher_version
55-
rancher_helm_repository = "https://releases.rancher.com/server-charts/stable"
56-
cert_manager_version = "1.16.3" #"1.13.1"
57-
os = "sle-micro-60"
58-
aws_access_key_id = var.aws_access_key_id
59-
aws_secret_access_key = var.aws_secret_access_key
60-
aws_session_token = var.aws_session_token
61-
aws_region = var.aws_region
62-
email = (var.email != "" ? var.email : "${local.identifier}@${local.zone}")
63-
acme_server_url = "https://acme-v02.api.letsencrypt.org"
64-
private_ip = replace(module.rancher.private_endpoint, "http://", "")
42+
identifier = var.identifier
43+
example = "basic"
44+
project_name = "tf-${substr(md5(join("-", [local.example, local.identifier])), 0, 5)}"
45+
username = local.project_name
46+
domain = local.project_name
47+
zone = var.zone
48+
key_name = var.key_name
49+
key = var.key
50+
owner = var.owner
51+
rke2_version = var.rke2_version
52+
local_file_path = var.file_path
53+
runner_ip = chomp(data.http.myip.response_body) # "runner" is the server running Terraform
54+
rancher_version = var.rancher_version
55+
cert_manager_version = "1.16.3" #"1.13.1"
56+
os = "sle-micro-61"
57+
aws_access_key_id = var.aws_access_key_id
58+
aws_secret_access_key = var.aws_secret_access_key
59+
aws_session_token = var.aws_session_token
60+
aws_region = var.aws_region
61+
email = (var.email != "" ? var.email : "${local.identifier}@${local.zone}")
62+
acme_server_url = "https://acme-v02.api.letsencrypt.org"
63+
private_ip = replace(module.rancher.private_endpoint, "http://", "")
6564
}
6665

6766
data "http" "myip" {
@@ -97,10 +96,9 @@ module "rancher" {
9796
}
9897
}
9998
# rancher
100-
rancher_version = local.rancher_version
101-
rancher_helm_repository = local.rancher_helm_repository
102-
cert_manager_version = local.cert_manager_version
103-
configure_cert_manager = true
99+
rancher_version = local.rancher_version
100+
cert_manager_version = local.cert_manager_version
101+
configure_cert_manager = true
104102
cert_manager_configuration = {
105103
aws_access_key_id = local.aws_access_key_id
106104
aws_secret_access_key = local.aws_secret_access_key
@@ -113,7 +111,7 @@ module "rancher" {
113111

114112
module "rke2_image" {
115113
source = "rancher/server/aws"
116-
version = "v1.3.1"
114+
version = "v1.4.0"
117115
server_use_strategy = "skip"
118116
image_use_strategy = "find"
119117
image_type = local.os

examples/deploy_rke2_multiple_pools/main.tf

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -39,30 +39,29 @@ provider "rancher2" {
3939
}
4040

4141
locals {
42-
identifier = var.identifier
43-
example = "basic"
44-
project_name = "tf-${substr(md5(join("-", [local.example, local.identifier])), 0, 5)}"
45-
username = local.project_name
46-
domain = local.project_name
47-
zone = var.zone
48-
key_name = var.key_name
49-
key = var.key
50-
owner = var.owner
51-
rke2_version = var.rke2_version
52-
local_file_path = var.file_path
53-
runner_ip = chomp(data.http.myip.response_body) # "runner" is the server running Terraform
54-
rancher_version = var.rancher_version
55-
rancher_helm_repository = "https://releases.rancher.com/server-charts/stable"
56-
cert_manager_version = "1.16.3" #"1.13.1"
57-
os = "sle-micro-60"
58-
acme_server_url = "https://acme-v02.api.letsencrypt.org"
59-
aws_access_key_id = var.aws_access_key_id
60-
aws_secret_access_key = var.aws_secret_access_key
61-
aws_region = var.aws_region
62-
aws_session_token = var.aws_session_token
63-
email = (var.email != "" ? var.email : "${local.identifier}@${local.zone}")
64-
private_ip = replace(module.rancher.private_endpoint, "http://", "")
65-
hostname_prefix = local.project_name
42+
identifier = var.identifier
43+
example = "basic"
44+
project_name = "tf-${substr(md5(join("-", [local.example, local.identifier])), 0, 5)}"
45+
username = local.project_name
46+
domain = local.project_name
47+
zone = var.zone
48+
key_name = var.key_name
49+
key = var.key
50+
owner = var.owner
51+
rke2_version = var.rke2_version
52+
local_file_path = var.file_path
53+
runner_ip = chomp(data.http.myip.response_body) # "runner" is the server running Terraform
54+
rancher_version = var.rancher_version
55+
cert_manager_version = "1.16.3" #"1.13.1"
56+
os = "sle-micro-61"
57+
acme_server_url = "https://acme-v02.api.letsencrypt.org"
58+
aws_access_key_id = var.aws_access_key_id
59+
aws_secret_access_key = var.aws_secret_access_key
60+
aws_region = var.aws_region
61+
aws_session_token = var.aws_session_token
62+
email = (var.email != "" ? var.email : "${local.identifier}@${local.zone}")
63+
private_ip = replace(module.rancher.private_endpoint, "http://", "")
64+
hostname_prefix = local.project_name
6665
}
6766

6867
data "http" "myip" {
@@ -98,10 +97,9 @@ module "rancher" {
9897
}
9998
}
10099
# rancher
101-
rancher_version = local.rancher_version
102-
rancher_helm_repository = local.rancher_helm_repository
103-
cert_manager_version = local.cert_manager_version
104-
configure_cert_manager = true
100+
rancher_version = local.rancher_version
101+
cert_manager_version = local.cert_manager_version
102+
configure_cert_manager = true
105103
cert_manager_configuration = {
106104
aws_access_key_id = local.aws_access_key_id
107105
aws_secret_access_key = local.aws_secret_access_key
@@ -114,7 +112,7 @@ module "rancher" {
114112

115113
module "rke2_image" {
116114
source = "rancher/server/aws"
117-
version = "v1.3.1"
115+
version = "v1.4.0"
118116
server_use_strategy = "skip"
119117
image_use_strategy = "find"
120118
image_type = local.os

examples/import_rke2/main.tf

Lines changed: 0 additions & 78 deletions
This file was deleted.

examples/import_rke2/modules/cluster/calico.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

examples/import_rke2/modules/cluster/cilium.yaml

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)