Skip to content

Commit 5211932

Browse files
restructure terraform for oke
1 parent 50150af commit 5211932

File tree

8 files changed

+176
-249
lines changed

8 files changed

+176
-249
lines changed

logan/terraform/inputs.tf

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

logan/terraform/helm.tf renamed to logan/terraform/oke/helm.tf

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11

2-
resource "helm_release" "la-release" {
3-
name = "my-la-release"
4-
chart = "${path.module}/../helm-chart"
5-
#repository = "https://github.com/oracle-quickstart/oci-kubernetes-monitoring"
2+
resource "helm_release" "oci-kubernetes-monitoring" {
3+
name = "oci-kubernetes-monitoring"
4+
chart = "${path.module}/../../helm-chart"
65

76
set {
87
name = "image.url"
9-
value = var.oke_containerImage_url
8+
value = var.container_image_url
109
}
1110

1211
set {
@@ -21,17 +20,17 @@ resource "helm_release" "la-release" {
2120

2221
set {
2322
name = "namespace"
24-
value = var.oke_namespace
23+
value = var.kubernetes_namespace
2524
}
2625

2726
set {
2827
name = "ociLANamespace"
29-
value = var.la_namespace
28+
value = var.oci_la_namespace
3029
}
3130

3231
set {
3332
name = "ociLALogGroupID"
34-
value = var.la_logGroup_id
33+
value = var.oci_la_logGroup_id
3534
}
3635

3736
set {
@@ -43,6 +42,4 @@ resource "helm_release" "la-release" {
4342
name = "fluentd.baseDir"
4443
value = var.fluentd_baseDir_path
4544
}
46-
47-
4845
}

logan/terraform/oke/inputs.tf

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# When defined in the Terraform configuration, the following variables automatically prepopulate with values on the Console pages used to create and edit the stack.
2+
# The stack's values are used when you select the Terraform actions Plan, Apply, and Destroy.
3+
# - tenancy_ocid (tenancy OCID)
4+
# - region (region)
5+
#
6+
# Ref - https://docs.oracle.com/en-us/iaas/Content/ResourceManager/Concepts/terraformconfigresourcemanager_topic-schema.htm#console-howto__prepop
7+
8+
9+
variable "tenancy_ocid" {
10+
type = string
11+
}
12+
13+
variable "region" {
14+
type = string
15+
}
16+
17+
####
18+
## Inputs for deploying helm-chart
19+
####
20+
21+
# OKE Cluster Compartment
22+
variable "oke_cluster_compartment" {
23+
type = string
24+
}
25+
26+
# OKE Cluster OCID
27+
variable "oke_cluster_ocid" {
28+
type = string
29+
}
30+
31+
# OKE Cluster Name
32+
variable "oke_cluster_name" {
33+
type = string
34+
}
35+
36+
# OCI LA Fluentd Container Image
37+
variable "container_image_url" {
38+
type = string
39+
}
40+
41+
# Kubernetes Namespace
42+
variable "kubernetes_namespace" {
43+
type = string
44+
}
45+
46+
# Fluentd Base Directory
47+
variable "fluentd_baseDir_path" {
48+
type = string
49+
}
50+
51+
# OCI Logging Analytics Namespace
52+
variable "oci_la_namespace" {
53+
type = string
54+
}
55+
56+
# OCI Logging Analytics LogGroup OCID
57+
variable "oci_la_logGroup_id" {
58+
type = string
59+
}

logan/terraform/oke.tf renamed to logan/terraform/oke/oke.tf

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@ data "oci_containerengine_cluster_kube_config" "oke" {
22
cluster_id = var.oke_cluster_ocid
33
}
44

5-
# Local kubeconfig for when using Terraform locally. Not used by Oracle Resource Manager
5+
# kubeconfig when using Terraform locally. Not used by Oracle Resource Manager
66
resource "local_file" "oke_kubeconfig" {
77
content = data.oci_containerengine_cluster_kube_config.oke.content
88
filename = "${path.module}/kubeconfig"
9-
}
10-
11-
# data "local_file" "oke_kubeconfig" {
12-
# filename = "${path.module}/kubeconfig"
13-
# }
9+
}

logan/terraform/providers.tf renamed to logan/terraform/oke/providers.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Update this oci provider when using terraform locally to have all other relevent fields set
2+
# https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
13
provider "oci" {
24
tenancy_ocid = var.tenancy_ocid
35
region = var.region

logan/terraform/oke/schema.yaml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
title: OCI Kubernetes Monitoring Solution
2+
description: Monitoring Solution for Kubernetes offered by OCI Logging Analytics
3+
informationalText: Monitoring Solution for Kubernetes offered by OCI Logging Analytics
4+
schemaVersion: 1.1.0
5+
version: "20221004"
6+
7+
# URL of Logo Icon used on Application Information tab. Logo must be 130x130 pixels.
8+
# (Optional)
9+
#logoUrl: https://cloudmarketplace.oracle.com/marketplace/content?contentId=53066708
10+
11+
source:
12+
type: quickstart
13+
14+
locale: "en"
15+
16+
variableGroups:
17+
- title: "Defualt inputs"
18+
variables:
19+
- tenancy_ocid
20+
- region
21+
visible: false
22+
23+
- title: "OKE Cluster Information"
24+
variables:
25+
- oke_cluster_compartment
26+
- oke_cluster_ocid
27+
- oke_cluster_name
28+
- container_image_url
29+
- kubernetes_namespace
30+
31+
- title: "OCI Logging Analytics Information"
32+
variables:
33+
- oci_la_namespace
34+
- oci_la_logGroup_id
35+
36+
- title: "Fluentd Configuration"
37+
variables:
38+
- fluentd_baseDir_path
39+
40+
variables:
41+
oke_cluster_compartment:
42+
type: oci:identity:compartment:id
43+
required: true
44+
title: OKE Cluster Compartment
45+
default: compartment_ocid
46+
47+
oke_cluster_ocid:
48+
type: oci:container:cluster:id
49+
dependsOn:
50+
compartmentId: ${oke_cluster_compartment}
51+
title: OKE Cluster
52+
required: true
53+
54+
# string field
55+
oke_cluster_name:
56+
type: string
57+
minLength: 1
58+
maxLength: 255
59+
title: OKE Cluster Name
60+
required: true
61+
62+
# string field
63+
container_image_url:
64+
type: string
65+
minLength: 1
66+
maxLength: 255
67+
title: OCI LA Fluentd Container Image
68+
description: Image URL of OCI LA Fluentd Container
69+
required: true
70+
71+
# string field
72+
kubernetes_namespace:
73+
type: string
74+
minLength: 1
75+
maxLength: 255
76+
title: Kubernetes Namespace
77+
description: Kubernetes Namespace in which the monitoring solution to be deployed
78+
default: kube-system
79+
required: true
80+
81+
# string field
82+
fluentd_baseDir_path:
83+
type: string
84+
maxLength: 255
85+
minLength: 1
86+
title: Fluentd Base Directory
87+
description: Base directory on the node (with read write permission) to store fluentd plugin's related data
88+
default: /var/log
89+
required: true
90+
91+
# string field
92+
oci_la_namespace:
93+
type: string
94+
maxLength: 40
95+
minLength: 1
96+
title: OCI Logging Analytics Namespace
97+
required: true
98+
99+
# string field
100+
oci_la_logGroup_id:
101+
type: string
102+
maxLength: 255
103+
minLength: 1
104+
title: OCI Logging Analytics LogGroup OCID
105+
description: The LogGroup in which the collected log data to be stored
106+
required: true

logan/terraform/outputs.tf

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

0 commit comments

Comments
 (0)