mirror of
https://github.com/vcscsvcscs/OCI-Kubernetes-cluster-with-traefik.git
synced 2025-08-12 13:59:09 +02:00
Format according to terraform fmt
This commit is contained in:
@@ -27,7 +27,7 @@ resource "helm_release" "argocd" {
|
|||||||
resource "kubectl_manifest" "dashboard-ingress" {
|
resource "kubectl_manifest" "dashboard-ingress" {
|
||||||
depends_on = [helm_release.argocd]
|
depends_on = [helm_release.argocd]
|
||||||
|
|
||||||
force_new = true
|
force_new = true
|
||||||
server_side_apply = true
|
server_side_apply = true
|
||||||
|
|
||||||
yaml_body = templatefile("${path.module}/argocd_ingress_route.tfpl.yaml", {
|
yaml_body = templatefile("${path.module}/argocd_ingress_route.tfpl.yaml", {
|
||||||
|
@@ -34,7 +34,7 @@ resource "helm_release" "trust-manager" {
|
|||||||
resource "kubectl_manifest" "cert-manager-cluster-issuer" {
|
resource "kubectl_manifest" "cert-manager-cluster-issuer" {
|
||||||
depends_on = [helm_release.cert-manager, helm_release.trust-manager]
|
depends_on = [helm_release.cert-manager, helm_release.trust-manager]
|
||||||
|
|
||||||
force_new = true
|
force_new = true
|
||||||
server_side_apply = true
|
server_side_apply = true
|
||||||
|
|
||||||
yaml_body = templatefile("${path.module}/cluster_issuer.tfpl.yaml", {
|
yaml_body = templatefile("${path.module}/cluster_issuer.tfpl.yaml", {
|
||||||
|
@@ -29,7 +29,7 @@ module "snet" {
|
|||||||
vcn_id = module.vcn.vcn_id
|
vcn_id = module.vcn.vcn_id
|
||||||
vcn_nat_route_id = module.vcn.nat_route_id
|
vcn_nat_route_id = module.vcn.nat_route_id
|
||||||
vcn_ig_route_id = module.vcn.ig_route_id
|
vcn_ig_route_id = module.vcn.ig_route_id
|
||||||
depends_on = [ module.vcn ]
|
depends_on = [module.vcn]
|
||||||
}
|
}
|
||||||
|
|
||||||
module "oke" {
|
module "oke" {
|
||||||
@@ -45,7 +45,7 @@ module "oke" {
|
|||||||
node_availability_domains = var.availability_domain
|
node_availability_domains = var.availability_domain
|
||||||
node_pool_size = var.node_pool_size
|
node_pool_size = var.node_pool_size
|
||||||
ssh_public_key = var.public_key_path
|
ssh_public_key = var.public_key_path
|
||||||
depends_on = [ module.snet ]
|
depends_on = [module.snet]
|
||||||
}
|
}
|
||||||
|
|
||||||
module "nlb" {
|
module "nlb" {
|
||||||
@@ -57,28 +57,28 @@ module "nlb" {
|
|||||||
traefik_template_values = {
|
traefik_template_values = {
|
||||||
cloudflare_origin_certificate_pem = base64encode(file(var.cloudflare_origin_certificate_pem))
|
cloudflare_origin_certificate_pem = base64encode(file(var.cloudflare_origin_certificate_pem))
|
||||||
cloudflare_origin_certificate_key = base64encode(file(var.cloudflare_origin_certificate_key))
|
cloudflare_origin_certificate_key = base64encode(file(var.cloudflare_origin_certificate_key))
|
||||||
my_domain = var.my_domain
|
my_domain = var.my_domain
|
||||||
}
|
}
|
||||||
|
|
||||||
depends_on = [ module.oke ]
|
depends_on = [module.oke]
|
||||||
}
|
}
|
||||||
|
|
||||||
module "cert-manager" {
|
module "cert-manager" {
|
||||||
compartment_ocid = var.compartment_ocid
|
compartment_ocid = var.compartment_ocid
|
||||||
cluster_ocid = module.oke.cluster_ocid
|
cluster_ocid = module.oke.cluster_ocid
|
||||||
count = var.install_cert_manager ? 1 : 0
|
count = var.install_cert_manager ? 1 : 0
|
||||||
source = "./certmanager"
|
source = "./certmanager"
|
||||||
|
|
||||||
depends_on = [ module.oke ]
|
depends_on = [module.oke]
|
||||||
}
|
}
|
||||||
|
|
||||||
module "argocd" {
|
module "argocd" {
|
||||||
compartment_ocid = var.compartment_ocid
|
compartment_ocid = var.compartment_ocid
|
||||||
cluster_ocid = module.oke.cluster_ocid
|
cluster_ocid = module.oke.cluster_ocid
|
||||||
count = var.install_argocd ? 1 : 0
|
count = var.install_argocd ? 1 : 0
|
||||||
source = "./argocd"
|
source = "./argocd"
|
||||||
|
|
||||||
my_domain = var.my_domain
|
my_domain = var.my_domain
|
||||||
|
|
||||||
depends_on = [ module.nlb ]
|
depends_on = [module.nlb]
|
||||||
}
|
}
|
@@ -3,19 +3,19 @@ data "oci_identity_availability_domains" "ads" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
data "oci_core_images" "latest_image" {
|
data "oci_core_images" "latest_image" {
|
||||||
compartment_id = var.compartment_ocid
|
compartment_id = var.compartment_ocid
|
||||||
operating_system = "Oracle Linux"
|
operating_system = "Oracle Linux"
|
||||||
operating_system_version = "8.8"
|
operating_system_version = "8.8"
|
||||||
shape = "VM.Standard.A1.Flex"
|
shape = "VM.Standard.A1.Flex"
|
||||||
filter {
|
filter {
|
||||||
name = "display_name"
|
name = "display_name"
|
||||||
values = ["^.*aarch64-.*$"]
|
values = ["^.*aarch64-.*$"]
|
||||||
regex = true
|
regex = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
data "oci_containerengine_cluster_kube_config" "cluster_kube_config" {
|
data "oci_containerengine_cluster_kube_config" "cluster_kube_config" {
|
||||||
#Required
|
#Required
|
||||||
cluster_id = oci_containerengine_cluster.k8s_cluster.id
|
cluster_id = oci_containerengine_cluster.k8s_cluster.id
|
||||||
token_version = "2.0.0"
|
token_version = "2.0.0"
|
||||||
}
|
}
|
||||||
|
@@ -21,8 +21,8 @@ resource "oci_containerengine_node_pool" "k8s_node_pool" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
node_source_details {
|
node_source_details {
|
||||||
image_id = var.node_image_ocid
|
image_id = var.node_image_ocid
|
||||||
source_type = "image"
|
source_type = "image"
|
||||||
boot_volume_size_in_gbs = 100
|
boot_volume_size_in_gbs = 100
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -7,6 +7,6 @@ output "public_endpoint" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource "local_file" "oke_kubeconfig" {
|
resource "local_file" "oke_kubeconfig" {
|
||||||
content = data.oci_containerengine_cluster_kube_config.cluster_kube_config.content
|
content = data.oci_containerengine_cluster_kube_config.cluster_kube_config.content
|
||||||
filename = "${path.module}/kubeconfig"
|
filename = "${path.module}/kubeconfig"
|
||||||
}
|
}
|
@@ -16,7 +16,7 @@ variable "node_image_ocid" {
|
|||||||
default = "ocid1.image.oc1.eu-frankfurt-1.aaaaaaaa3mctwlkbkaj76pnlrmdr7w6dd4frkrhuqrdadpq4g67kh5gqbn3q"
|
default = "ocid1.image.oc1.eu-frankfurt-1.aaaaaaaa3mctwlkbkaj76pnlrmdr7w6dd4frkrhuqrdadpq4g67kh5gqbn3q"
|
||||||
}
|
}
|
||||||
variable "node_availability_domains" {
|
variable "node_availability_domains" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
}
|
}
|
||||||
variable "node_pool_size" {
|
variable "node_pool_size" {
|
||||||
type = number
|
type = number
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
output "traefik_dashboard_username" {
|
output "traefik_dashboard_username" {
|
||||||
value = module.nlb.traefik_dashboard_username
|
value = module.nlb.traefik_dashboard_username
|
||||||
sensitive = true
|
sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
output "traefik_dashboard_password" {
|
output "traefik_dashboard_password" {
|
||||||
value = module.nlb.traefik_dashboard_password
|
value = module.nlb.traefik_dashboard_password
|
||||||
sensitive = true
|
sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
output "traefik_nlb_public_ip" {
|
output "traefik_nlb_public_ip" {
|
||||||
value = module.nlb.traefik_nlb_public_ip
|
value = module.nlb.traefik_nlb_public_ip
|
||||||
}
|
}
|
@@ -13,7 +13,7 @@ terraform {
|
|||||||
version = "~> 4.0"
|
version = "~> 4.0"
|
||||||
}
|
}
|
||||||
kubernetes = {
|
kubernetes = {
|
||||||
source = "hashicorp/kubernetes"
|
source = "hashicorp/kubernetes"
|
||||||
version = "2.28.0"
|
version = "2.28.0"
|
||||||
}
|
}
|
||||||
kubectl = {
|
kubectl = {
|
||||||
|
@@ -10,7 +10,7 @@ resource "oci_core_security_list" "private_subnet_sl" {
|
|||||||
destination_type = "CIDR_BLOCK"
|
destination_type = "CIDR_BLOCK"
|
||||||
protocol = "all"
|
protocol = "all"
|
||||||
}
|
}
|
||||||
|
|
||||||
ingress_security_rules {
|
ingress_security_rules {
|
||||||
stateless = false
|
stateless = false
|
||||||
source = "10.0.0.0/16"
|
source = "10.0.0.0/16"
|
||||||
@@ -53,7 +53,7 @@ resource "oci_core_security_list" "public_subnet_sl" {
|
|||||||
destination_type = "CIDR_BLOCK"
|
destination_type = "CIDR_BLOCK"
|
||||||
protocol = "all"
|
protocol = "all"
|
||||||
}
|
}
|
||||||
|
|
||||||
egress_security_rules {
|
egress_security_rules {
|
||||||
stateless = false
|
stateless = false
|
||||||
destination = "10.0.1.0/24"
|
destination = "10.0.1.0/24"
|
||||||
@@ -86,7 +86,7 @@ resource "oci_core_security_list" "public_subnet_sl" {
|
|||||||
max = 80
|
max = 80
|
||||||
min = 80
|
min = 80
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ingress_security_rules {
|
ingress_security_rules {
|
||||||
stateless = false
|
stateless = false
|
||||||
|
@@ -24,12 +24,12 @@ variable "my_domain" {
|
|||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
variable "install_argocd" {
|
variable "install_argocd" {
|
||||||
type = bool
|
type = bool
|
||||||
default = true
|
default = true
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "install_cert_manager" {
|
variable "install_cert_manager" {
|
||||||
type = bool
|
type = bool
|
||||||
default = true
|
default = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,10 +8,10 @@ terraform {
|
|||||||
}
|
}
|
||||||
|
|
||||||
provider "oci" {
|
provider "oci" {
|
||||||
tenancy_ocid = var.tenancy_ocid
|
tenancy_ocid = var.tenancy_ocid
|
||||||
user_ocid = var.user_ocid
|
user_ocid = var.user_ocid
|
||||||
private_key_path = pathexpand(var.private_key_path)
|
private_key_path = pathexpand(var.private_key_path)
|
||||||
fingerprint = var.fingerprint
|
fingerprint = var.fingerprint
|
||||||
region = var.region
|
region = var.region
|
||||||
retry_duration_seconds = 120
|
retry_duration_seconds = 120
|
||||||
}
|
}
|
||||||
|
@@ -8,7 +8,7 @@ resource "oci_core_instance_configuration" "k3s_server_template" {
|
|||||||
update = "11m"
|
update = "11m"
|
||||||
delete = "10m"
|
delete = "10m"
|
||||||
}
|
}
|
||||||
|
|
||||||
freeform_tags = {
|
freeform_tags = {
|
||||||
"provisioner" = "terraform"
|
"provisioner" = "terraform"
|
||||||
"environment" = "${var.environment}"
|
"environment" = "${var.environment}"
|
||||||
@@ -113,9 +113,9 @@ resource "oci_core_instance_configuration" "k3s_worker_template" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
availability_domain = var.availability_domain
|
availability_domain = var.availability_domain
|
||||||
# fault_domain = "FAULT-DOMAIN-3"
|
# fault_domain = "FAULT-DOMAIN-3"
|
||||||
compartment_id = var.compartment_ocid
|
compartment_id = var.compartment_ocid
|
||||||
|
|
||||||
create_vnic_details {
|
create_vnic_details {
|
||||||
assign_public_ip = true
|
assign_public_ip = true
|
||||||
|
Reference in New Issue
Block a user