Skip to content

Commit ded702d

Browse files
committed
Clenup
1 parent 8ee51c3 commit ded702d

File tree

1 file changed

+53
-21
lines changed

1 file changed

+53
-21
lines changed

README.md

Lines changed: 53 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,60 @@ variable "environment" {
8585
}
8686
8787
variable "AWS_REGION" {
88-
default = "<YOUR_REGION>"
88+
default = "<CHANGE_ME>"
89+
}
90+
91+
variable "my_public_ip_cidr" {
92+
default = "<CHANGE_ME>"
93+
}
94+
95+
variable "vpc_cidr_block" {
96+
default = "<CHANGE_ME>"
97+
}
98+
99+
variable "certmanager_email_address" {
100+
default = "<CHANGE_ME>"
101+
}
102+
103+
variable "ssk_key_pair_name" {
104+
default = "<CHANGE_ME>"
105+
}
106+
107+
module "private-vpc" {
108+
region = var.AWS_REGION
109+
my_public_ip_cidr = var.my_public_ip_cidr
110+
vpc_cidr_block = var.vpc_cidr_block
111+
environment = var.environment
112+
source = "github.com/garutilorenzo/aws-terraform-examples/private-vpc"
113+
}
114+
115+
output "private_subnets_ids" {
116+
value = module.private-vpc.private_subnet_ids
117+
}
118+
119+
output "public_subnets_ids" {
120+
value = module.private-vpc.public_subnet_ids
121+
}
122+
123+
output "vpc_id" {
124+
value = module.private-vpc.vpc_id
89125
}
90126
91127
module "k8s-cluster" {
92-
ssk_key_pair_name = "<SSH_KEY_NAME>"
93-
environment = var.environment
94-
vpc_id = "<VPC_ID>"
95-
vpc_private_subnets = "<PRIVATE_SUBNET_LIST>"
96-
vpc_public_subnets = "<PUBLIC_SUBNET_LIST>"
97-
vpc_subnet_cidr = "<SUBNET_CIDR>"
98-
install_nginx_ingress = true
99-
source = "github.com/garutilorenzo/k8s-aws-terraform-cluster"
128+
ssk_key_pair_name = var.ssk_key_pair_name
129+
environment = var.environment
130+
vpc_id = module.private-vpc.vpc_id
131+
vpc_private_subnets = module.private-vpc.private_subnet_ids
132+
vpc_public_subnets = module.private-vpc.public_subnet_ids
133+
vpc_subnet_cidr = var.vpc_cidr_block
134+
my_public_ip_cidr = var.my_public_ip_cidr
135+
create_extlb = true
136+
install_nginx_ingress = true
137+
efs_persistent_storage = true
138+
expose_kubeapi = true
139+
install_certmanager = true
140+
certmanager_email_address = var.certmanager_email_address
141+
source = "github.com/garutilorenzo/k8s-aws-terraform-cluster"
100142
}
101143
102144
output "k8s_dns_name" {
@@ -181,7 +223,7 @@ Once you have created the `terraform.tfvars` file edit the `main.tf` file (alway
181223

182224
| Var | Required | Desc |
183225
| ------- | ------- | ----------- |
184-
| `region` | `yes` | set the correct OCI region based on your needs |
226+
| `region` | `yes` | set the correct AWS region based on your needs |
185227
| `environment` | `yes` | Current work environment (Example: staging/dev/prod). This value is used for tag all the deployed resources |
186228
| `ssk_key_pair_name` | `yes` | Name of the ssh key to use |
187229
| `my_public_ip_cidr` | `yes` | your public ip in cidr format (Example: 195.102.xxx.xxx/32) |
@@ -301,19 +343,9 @@ metadata:
301343
namespace: ingress-nginx
302344
```
303345
304-
**NOTE** to use nginx ingress controller with the proxy protocol enabled, an external nginx instance is used as proxy (since OCI LB doesn't support proxy protocol at the moment). Nginx will be installed on each worker node and the configuation of nginx will:
305-
306-
* listen in proxy protocol mode
307-
* forward the traffic from port `80` to `extlb_http_port` (default to `30080`) on any server of the cluster
308-
* forward the traffic from port `443` to `extlb_https_port` (default to `30443`) on any server of the cluster
309-
310-
This is the final result:
311-
312-
Client -> Public L4 LB (with proxy protocol enabled) -> nginx ingress (with proxy protocol enabled) -> k8s service -> pod(s)
313-
314346
### Cert-manager
315347
316-
[cert-manager](https://cert-manager.io/docs/) is used to issue certificates from a variety of supported source. To use cert-manager take a look at [nginx-ingress-cert-manager.yml](https://github.com/garutilorenzo/k3s-oci-cluster/blob/master/deployments/nginx/nginx-ingress-cert-manager.yml) and [nginx-configmap-cert-manager.yml](https://github.com/garutilorenzo/k3s-oci-cluster/blob/master/deployments/nginx/nginx-configmap-cert-manager.yml) example. To use cert-manager and get the certificate you **need** set on your DNS configuration the public ip address of the load balancer.
348+
[cert-manager](https://cert-manager.io/docs/) is used to issue certificates from a variety of supported source.
317349
318350
## Deploy
319351

0 commit comments

Comments
 (0)