Skip to content

Commit

Permalink
fix up nlb config
Browse files Browse the repository at this point in the history
  • Loading branch information
vcscsvcscs committed Mar 3, 2024
1 parent 0ca08d2 commit ff933a3
Show file tree
Hide file tree
Showing 11 changed files with 1,026 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ override.tf.json
terraform.rc
*tf.plan
*.terraform.lock.hcl
oci-managed/oke/kubeconfig
11 changes: 6 additions & 5 deletions oci-managed/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ module "snet" {
environment = var.environment

vcn_id = module.vcn.vcn_id
vcn_nat_route_id = module.vcn.vcn_nat_route_table_id
vcn_ig_route_id = module.vcn.vcn_ig_route_table_id
vcn_nat_route_id = module.vcn.nat_route_id
vcn_ig_route_id = module.vcn.ig_route_id
}

module "oke" {
Expand All @@ -41,7 +41,7 @@ module "oke" {
vcn_id = module.vcn.vcn_id
vcn_public_subnet_id = module.snet.public_subnet_id
vcn_private_subnet_id = module.snet.private_subnet_id
node_availability_domains = [var.availability_domain]
node_availability_domains = var.availability_domain
node_pool_size = var.node_pool_size
ssh_public_key = var.public_key_path
}
Expand All @@ -51,6 +51,7 @@ module "nlb" {

compartment_ocid = var.compartment_ocid
cluster_ocid = module.oke.cluster_ocid
cluster_public_endpoint = module.oke.public_endpoint
values_file = "traefik-values.yaml"
values_file = "traefik-values.yaml"

depends_on = [ module.oke ]
}
8 changes: 0 additions & 8 deletions oci-managed/nlb/data.tf

This file was deleted.

Empty file removed oci-managed/nlb/output.tf
Empty file.
5 changes: 0 additions & 5 deletions oci-managed/nlb/provider.tf

This file was deleted.

3 changes: 0 additions & 3 deletions oci-managed/nlb/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ variable "environment" {
variable "cluster_ocid" {
type = string
}
variable "cluster_public_endpoint" {
type = string
}

variable "namespace" {
description = "Namespace to install traefik chart into"
Expand Down
12 changes: 12 additions & 0 deletions oci-managed/oke/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,21 @@ data "oci_core_images" "latest_image" {
compartment_id = var.compartment_ocid
operating_system = "Oracle Linux"
operating_system_version = "8.8"
shape = "VM.Standard.A1.Flex"
filter {
name = "display_name"
values = ["^.*aarch64-.*$"]
regex = true
}
}

data "oci_containerengine_cluster_kube_config" "cluster_kube_config" {
#Required
cluster_id = oci_containerengine_cluster.k8s_cluster.id
token_version = "2.0.0"
}

resource "local_file" "oke_kubeconfig" {
content = data.oci_containerengine_cluster_kube_config.cluster_kube_config.content
filename = "${path.module}/kubeconfig"
}
2 changes: 1 addition & 1 deletion oci-managed/oke/node_pool.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resource "oci_containerengine_node_pool" "k8s_node_pool" {
}

node_source_details {
image_id = data.oci_core_images.latest_image.images.0.id
image_id = var.node_image_ocid
source_type = "image"
}

Expand Down
5 changes: 3 additions & 2 deletions oci-managed/oke/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ variable "kubernetes_version" {
variable "ssh_public_key" {
type = string
}
variable "node_image_ocid" {
default = "ocid1.image.oc1.eu-frankfurt-1.aaaaaaaaiiymiaz2loraurxo6dgj5y4oiturf4inrkzvwimzw3d2a42kns6q"
}
variable "node_availability_domains" {
type = list(string)
default = data.oci_identity_availability_domains.ads.availability_domains[*].name
}
variable "node_pool_size" {
type = number
Expand All @@ -34,4 +36,3 @@ variable "vcn_public_subnet_id" {
variable "vcn_private_subnet_id" {
type = string
}

6 changes: 6 additions & 0 deletions oci-managed/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ provider "oci" {
region = var.region
retry_duration_seconds = 120
}

provider "helm" {
kubernetes {
config_path = "oke/kubeconfig"
}
}
Loading

0 comments on commit ff933a3

Please sign in to comment.