Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3.1.0 #49

Open
wants to merge 45 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
80ef6a9
adds meta-schema validation
paliwalparitosh Aug 16, 2023
d638ac2
moves mgmt_agent module inside helm module
paliwalparitosh Aug 16, 2023
cfba9d6
adds helm deployment options
paliwalparitosh Aug 16, 2023
65504ac
converts the helm deloyment option to boolean
paliwalparitosh Aug 16, 2023
23935a9
change mgmt_agent module parent from helm to oke module
paliwalparitosh Aug 16, 2023
6beeb0d
rearrange UI elements
paliwalparitosh Aug 16, 2023
da3d6e6
update livelab switch file
paliwalparitosh Aug 16, 2023
ccabccf
move livelab specific code to it's own module
paliwalparitosh Aug 16, 2023
986f723
enables module controls; include entity creation for cluster
paliwalparitosh Aug 18, 2023
ece683b
add missing input
paliwalparitosh Aug 22, 2023
1dc7b74
includes cluster entity properties
paliwalparitosh Aug 22, 2023
e416784
adds input triggered_by_add_data_flow
paliwalparitosh Aug 22, 2023
c3427c4
converts deployment options into a dropdown
paliwalparitosh Aug 22, 2023
6ff95ca
adds external values.yaml content as output
paliwalparitosh Aug 23, 2023
4bd32ac
adds optional option input
paliwalparitosh Aug 24, 2023
b5ecef4
updates output to generate helm install command
paliwalparitosh Aug 24, 2023
908b6ba
replaces local helm chart wih helm repo
paliwalparitosh Aug 24, 2023
c14f20e
updates helm install command
paliwalparitosh Aug 24, 2023
61ad7df
removes cluster entity creation via stack
paliwalparitosh Aug 31, 2023
c8b1f7a
adds addtional outputs to contruct helm install command
paliwalparitosh Aug 31, 2023
18ef185
stack output changes and refactor
paliwalparitosh Sep 4, 2023
e4a89f9
adds cluster name and cluster entity ocid as optional inputs for the …
paliwalparitosh Sep 4, 2023
46531a9
removes references of ociLAEntityID from helm
paliwalparitosh Sep 4, 2023
56cf530
sets mgmt agent key life-span/expiry to 1 year
paliwalparitosh Sep 4, 2023
33ada92
fixes typos and lang updates
paliwalparitosh Sep 4, 2023
678c6f7
fixes for livelab stack
paliwalparitosh Sep 4, 2023
0d8724e
included content changes as per TC review
paliwalparitosh Sep 6, 2023
8f446bc
tc review fix
paliwalparitosh Sep 12, 2023
5f03ce5
adds option to render templates independently
paliwalparitosh Sep 27, 2023
e77bb09
adds lifecycle policy
paliwalparitosh Sep 29, 2023
f8035ef
dev_switch_install_helm fix
paliwalparitosh Sep 29, 2023
9038761
ignore vscode metadata'
paliwalparitosh Sep 29, 2023
b960bdf
EOL fix
paliwalparitosh Sep 29, 2023
132e5a3
fmt
paliwalparitosh Sep 29, 2023
be487b1
ignore local test files
paliwalparitosh Sep 29, 2023
d9efd68
replace Default values
paliwalparitosh Oct 16, 2023
183e96e
adds comment to explain default helm repo use
paliwalparitosh Oct 16, 2023
035fbe6
refactor
paliwalparitosh Oct 16, 2023
1bb6358
fix comments
paliwalparitosh Oct 16, 2023
abd42f2
update outputs related to helm installation
paliwalparitosh Oct 16, 2023
17e2fea
udpate outputs for helm commands
paliwalparitosh Oct 16, 2023
82258d3
fmt
paliwalparitosh Oct 16, 2023
991c609
hides stack deployment options
paliwalparitosh Oct 17, 2023
0ffa5ec
OCR Image updates
paliwalparitosh Oct 18, 2023
8001523
revert back to correct mgmt_agent OCR image
paliwalparitosh Oct 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 69 additions & 65 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,65 +1,69 @@
# Copyright (c) 2023, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl.

.DS_Store

####
## Ignore PEM files
####

**.pem

####
## gitignore for terraform artifacts
####

# Local .terraform directories
**/.terraform/*

## Terraform Locck files
*.terraform.lock.hcl

# .tfstate filesdas
*.tfstate
*.tfstate.*

# Crash log files
crash.log
crash.*.log

# Exclude all .tfvars files, which are likely to contain sensitive data, such as
# password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
# to change depending on the environment.
*.tfvars
*.tfvars.json

# Include sample tfvars
!terraform-sample.tfvars

# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json

# Include override files you do wish to add to version control using negated pattern
# !example_override.tf

# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*

# Ignore CLI configuration files
.terraformrc
terraform.rc

# Ignore util dir
logan/util/*

# helm-chart
charts/oci-onm/Chart.lock
charts/oci-onm/charts/

# zip artifacts
releases/
# Copyright (c) 2023, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl.

.DS_Store

####
## Ignore PEM files
####

**.pem

####
## gitignore for terraform artifacts
####

# Local .terraform directories
**/.terraform/*

## Terraform Locck files
*.terraform.lock.hcl

# .tfstate filesdas
*.tfstate
*.tfstate.*

# Crash log files
crash.log
crash.*.log

# Exclude all .tfvars files, which are likely to contain sensitive data, such as
# password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
# to change depending on the environment.
*.tfvars
*.tfvars.json

# Include sample tfvars
!terraform-sample.tfvars

# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json

# Include override files you do wish to add to version control using negated pattern
# !example_override.tf

# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*

# Ignore CLI configuration files
.terraformrc
terraform.rc

# Ignore util dir
logan/util/*

# helm-chart
charts/oci-onm/Chart.lock
charts/oci-onm/charts/
charts/.tests/

# zip artifacts
releases/

# VSCode
.vscode/
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ It does extensive enrichment of logs, metrics and object information to enable c
![Kubernetes Cluster Summary Dashboard](logan/images/kubernetes-cluster-summary-dashboard.png)

<details>
<summary>Expand for more dasshboard screenshots</summary>
<summary>Expand for more dashboard screenshots</summary>

![Kubernetes Nodes Dashboard](logan/images/kubernetes-nodes-dashboard.png)

Expand Down Expand Up @@ -67,9 +67,9 @@ It does extensive enrichment of logs, metrics and object information to enable c
```
</details>

### Installation instructions
### Installation instructions

#### Multiple methods of installation are avialble, with following differences:
#### Multiple methods of installation are available, with following differences

| Deployment Method | Supported Environments | Collection Automation | Dashboards | Customzations |
| ----| :----:| :----:| :---: | ---|
Expand Down Expand Up @@ -114,7 +114,7 @@ It does extensive enrichment of logs, metrics and object information to enable c
# Provide the base64 encoded content of the Management Agent Install Key file
installKeyFileContent:
```
* **Refer to the oci-onm chart and sub-charts values.yaml for customising or modifying any other configuration.** It is recommended to not modify the values.yaml provided with the charts, instead use override_values.yaml to achieve the same.
* **Refer to the values.yaml file in oci-onm chart and sub-charts for customising or modifying any other configuration.** It is recommended to not modify the values.yaml provided with the charts, instead use override_values.yaml to achieve the same.

##### 3.a Install helm release

Expand Down
2 changes: 1 addition & 1 deletion charts/logan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Charts for sending Kubernetes platform logs, compute logs, and Kubernetes Object
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| authtype | string | `"InstancePrincipal"` | Allowed values: InstancePrincipal, config |
| extraEnv | list | `[]` | Logging Analytics OCID for OKE Cluster ociLAEntityID: Logging Analytics additional metadata. Use this to tag all the collected logs with one or more key:value pairs. Key must be a valid field in Logging Analytics metadata: "Client Host Region": "PCT" "Environment": "Production" "Third key": "Third Value" @param extra environment variables. Example name: ENV_VARIABLE_NAME value: ENV_VARIABLE_VALUE |
| extraEnv | list | `[]` | Use this to tag all the collected logs with one or more key:value pairs. Key must be a valid field in Logging Analytics metadata: "Client Host Region": "PCT" "Environment": "Production" "Third key": "Third Value" @param extra environment variables. Example name: ENV_VARIABLE_NAME value: ENV_VARIABLE_VALUE |
| extraVolumeMounts | list | `[]` | @param extraVolumeMounts Mount extra volume(s). Example: - name: tmpDir mountPath: /tmp |
| extraVolumes | list | `[]` | @param extraVolumes Extra volumes. Example: - name: tmpDir hostPath: path: /tmp log |
| fluentd.baseDir | string | `"/var/log"` | Base directory on the node (with read write permission) for storing fluentd plugins related data. |
Expand Down
22 changes: 0 additions & 22 deletions charts/logan/templates/logs-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@ data:
{{- end }}
oci_la_log_path "${record['tailed_path']}"
oci_la_log_source_name "{{ $logDefinition.ociLALogSourceName | required (printf "fluentd.kubernetesSystem.logs.%s.ociLALogSourceName is required" $name) }}"
{{- if $logDefinition.ociLAEntityID }}
oci_la_entity_id "{{ $logDefinition.ociLAEntityID }}"
{{- else }}
oci_la_entity_id "{{ $.Values.fluentd.kubernetesSystem.ociLAEntityID | default $.Values.ociLAEntityID }}"
{{- end }}
{{- if $logDefinition.ociLALogSet }}
oci_la_log_set "{{ $logDefinition.ociLALogSet }}"
{{- else }}
Expand Down Expand Up @@ -205,11 +200,6 @@ data:
{{- end }}
oci_la_log_path "${record['tailed_path']}"
oci_la_log_source_name "{{ $logDefinition.ociLALogSourceName | required (printf "fluentd.linuxSystem.logs.%s.ociLALogSourceName is required" $name) }}"
{{- if $logDefinition.ociLAEntityID }}
oci_la_entity_id "{{ $logDefinition.ociLAEntityID }}"
{{- else }}
oci_la_entity_id "{{ $.Values.fluentd.linuxSystem.ociLAEntityID | default $.Values.ociLAEntityID }}"
{{- end }}
{{- if $logDefinition.ociLALogSet }}
oci_la_log_set "{{ $logDefinition.ociLALogSet }}"
{{- else }}
Expand Down Expand Up @@ -294,11 +284,6 @@ data:
{{- end }}
oci_la_log_path "${record['tailed_path']}"
oci_la_log_source_name "{{ required "fluentd.linuxSystem.logs.kubeletlog.ociLALogSourceName is required" $.Values.fluentd.linuxSystem.logs.kubeletlog.ociLALogSourceName }}"
{{- if $.Values.fluentd.linuxSystem.logs.kubeletlog.ociLAEntityID }}
oci_la_entity_id "{{ $.Values.fluentd.linuxSystem.logs.kubeletlog.ociLAEntityID }}"
{{- else }}
oci_la_entity_id "{{ $.Values.fluentd.linuxSystem.ociLAEntityID | default $.Values.ociLAEntityID }}"
{{- end }}
{{- if $.Values.fluentd.linuxSystem.logs.kubeletlog.ociLALogSet }}
oci_la_log_set "{{ $.Values.fluentd.linuxSystem.logs.kubeletlog.ociLALogSet }}"
{{- else }}
Expand Down Expand Up @@ -329,11 +314,6 @@ data:
{{- end }}
oci_la_log_path "${record['tailed_path']}"
oci_la_log_source_name "{{ required "fluentd.linuxSystem.logs.syslog.ociLALogSourceName is required" $.Values.fluentd.linuxSystem.logs.syslog.ociLALogSourceName }}"
{{- if $.Values.fluentd.linuxSystem.logs.syslog.ociLAEntityID }}
oci_la_entity_id "{{ $.Values.fluentd.linuxSystem.logs.syslog.ociLAEntityID }}"
{{- else }}
oci_la_entity_id "{{ $.Values.fluentd.linuxSystem.ociLAEntityID | default $.Values.ociLAEntityID }}"
{{- end }}
{{- if $.Values.fluentd.linuxSystem.logs.syslog.ociLALogSet }}
oci_la_log_set "{{ $.Values.fluentd.linuxSystem.logs.syslog.ociLALogSet }}"
{{- else }}
Expand Down Expand Up @@ -408,7 +388,6 @@ data:
{{- end }}
oci_la_log_path "${record['tailed_path']}"
oci_la_log_source_name "{{ $logDefinition.ociLALogSourceName | required (printf "fluentd.customLogs.%s.ociLALogSourceName is required" $name) }}"
oci_la_entity_id "{{ $logDefinition.ociLAEntityID | default $.Values.ociLAEntityID }}"
oci_la_log_set "{{ $logDefinition.ociLALogSet | default $.Values.ociLALogSet }}"
{{- if and (ne "false" ($logDefinition.isContainerLog | toString)) (eq $runtime "docker") }}
message "${record['log']}"
Expand Down Expand Up @@ -515,7 +494,6 @@ data:
oci_la_log_group_id ${record.dig("kubernetes", "annotations", "oracle.com/oci_la_log_group_id") ? record.dig("kubernetes", "annotations", "oracle.com/oci_la_log_group_id") : "{{ $.Values.fluentd.genericContainerLogs.ociLALogGroupID | default $.Values.ociLALogGroupID }}"}
oci_la_log_path "${record['tailed_path']}"
oci_la_log_source_name ${record.dig("kubernetes", "annotations", "oracle.com/oci_la_log_source_name") ? record.dig("kubernetes", "annotations", "oracle.com/oci_la_log_source_name") : "{{ $.Values.fluentd.genericContainerLogs.ociLALogSourceName | default "Kubernetes Container Generic Logs" }}"}
oci_la_entity_id ${record.dig("kubernetes", "annotations", "oracle.com/oci_la_entity_id") ? record.dig("kubernetes", "annotations", "oracle.com/oci_la_entity_id") : "{{ $.Values.fluentd.genericContainerLogs.ociLAEntityID | default $.Values.ociLAEntityID }}"}
oci_la_log_set ${record.dig("kubernetes", "annotations", "oracle.com/oci_la_log_set") ? record.dig("kubernetes", "annotations", "oracle.com/oci_la_log_set") : "{{ $.Values.fluentd.genericContainerLogs.ociLALogSet | default $.Values.ociLALogSet }}"}
{{- if eq $runtime "docker" }}
message "${record['log']}"
Expand Down
1 change: 0 additions & 1 deletion charts/logan/templates/objects-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ data:
oci_la_metadata ${{"{{"}}"Kubernetes Cluster Name":"{{ $kubernetesClusterName }}", "Kubernetes Cluster ID": "{{ $kubernetesClusterId }}" {{- range $k, $v := .Values.metadata }},{{ $k | quote }}: {{ $v | quote -}} {{- end }}{{"}}"}}
{{- end }}
oci_la_log_group_id "{{ .Values.fluentd.kubernetesObjects.ociLALogGroupID | default .Values.ociLALogGroupID }}"
oci_la_entity_id "{{ .Values.fluentd.kubernetesObjects.ociLAEntityID | default .Values.ociLAEntityID }}"
oci_la_log_set "{{ .Values.fluentd.kubernetesObjects.ociLALogSet | default .Values.ociLALogSet }}"
oci_la_log_path ${tag}
oci_la_log_source_name "Kubernetes Object Logs"
Expand Down
10 changes: 3 additions & 7 deletions charts/logan/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ kubernetesClusterID:
# e.g. production-cluster
kubernetesClusterName:

# -- Logging Analytics OCID for OKE Cluster
#ociLAEntityID:
# -- Kubernetes Cluster Entity OCID.
# e.g. ocid1.loganalyticsentity.oc1.phx.amaaaaaabulluiqabqeq4delvhdlmd7aqcjrdla57n2szsxyz7pfdvnhwuua
ociLAClusterEntityID:

# Logging Analytics additional metadata. Use this to tag all the collected logs with one or more key:value pairs.
# Key must be a valid field in Logging Analytics
Expand Down Expand Up @@ -231,7 +232,6 @@ fluentd:
#"Client Host Region": "America"
#"Environment": "Production"
#"Third Key": "Third Value"
#ociLAEntityID:
#encoding:
# Worker number in case of multi process workers enabled. If not set when multi process workers enabled, then it defaults to 0.
#worker:
Expand All @@ -249,7 +249,6 @@ fluentd:
#"Client Host Region": "America"
#"Environment": "Production"
#"Third Key": "Third Value"
#ociLAEntityID:
#ociLALogGroupID:
#encoding:
# Worker number in case of multi process workers enabled. If not set when multi process workers enabled, then it defaults to 0.
Expand Down Expand Up @@ -311,7 +310,6 @@ fluentd:
#"Client Host Region": "America"
#"Environment": "Production"
#"Third Key": "Third Value"
#ociLAEntityID:
#encoding:
# Worker number in case of multi process workers enabled. If not set when multi process workers enabled, then it defaults to 0.
#worker:
Expand Down Expand Up @@ -417,7 +415,6 @@ fluentd:
#"Client Host Region": "America"
#"Environment": "Production"
#"Third Key": "Third Value"
#ociLAEntityID:
#encoding:
# Worker number in case of multi process workers enabled. If not set when multi process workers enabled, then it defaults to 0.
#worker:
Expand Down Expand Up @@ -445,7 +442,6 @@ fluentd:
#"Client Host Region": "America"
#"Environment": "Production"
#"Third Key": "Third Value"
#ociLAEntityID:
#ociLALogGroupID:
objectsList:
nodes:
Expand Down
41 changes: 29 additions & 12 deletions terraform/modules/helm/helm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ data "oci_containerengine_clusters" "oke_clusters_list" {
}

locals {
helm_repo_url = "https://oracle-quickstart.github.io/oci-kubernetes-monitoring"
helm_repo_chart = "oci-onm"

oke_clusters_list = data.oci_containerengine_clusters.oke_clusters_list.clusters
oke_cluster_name = [for c in local.oke_clusters_list : c.name if c.id == var.oke_cluster_ocid][0]
oke_cluster_name = var.oke_cluster_name == "NoInput" ? [for c in local.oke_clusters_list :
paliwalparitosh marked this conversation as resolved.
Show resolved Hide resolved
c.name if c.id == var.oke_cluster_ocid][0] : var.oke_cluster_name
oke_cluster_entity_ocid = var.oke_cluster_entity_ocid == "NoInput" ? null : var.oke_cluster_entity_ocid
paliwalparitosh marked this conversation as resolved.
Show resolved Hide resolved

helm_inputs = {
# global
Expand All @@ -32,12 +37,13 @@ locals {
"createServiceAccount" = false
"serviceAccount" = var.livelab_service_account
}

}

# Create helm release
resource "helm_release" "oci-kubernetes-monitoring" {
name = "oci-kubernetes-monitoring"
chart = var.helm_abs_path
repository = var.use_local_helm_chart ? null : local.helm_repo_url
chart = var.use_local_helm_chart ? var.helm_abs_path : local.helm_repo_chart
paliwalparitosh marked this conversation as resolved.
Show resolved Hide resolved
wait = true
dependency_update = true
atomic = true
Expand All @@ -52,6 +58,14 @@ resource "helm_release" "oci-kubernetes-monitoring" {
}
}

dynamic "set" {
for_each = var.oke_cluster_entity_ocid == "NoInput" ? [] : ["run_once"]
content {
name = "oci-onm-logan.ociLAClusterEntityID"
value = var.oke_cluster_entity_ocid
}
}

dynamic "set" {
for_each = var.deploy_mushop_config ? local.mushop_helm_inputs : {}
content {
Expand All @@ -60,12 +74,14 @@ resource "helm_release" "oci-kubernetes-monitoring" {
}
}

count = var.generate_helm_template ? 0 : 1
count = var.install_helm ? 1 : 0
}

# Create helm template
data "helm_template" "oci-kubernetes-monitoring" {
name = "oci-kubernetes-monitoring"
chart = var.helm_abs_path
repository = var.use_local_helm_chart ? null : local.helm_repo_url
chart = var.use_local_helm_chart ? var.helm_abs_path : local.helm_repo_chart
dependency_update = true

values = var.deploy_mushop_config ? ["${file("${path.module}/mushop_values.yaml")}"] : null
Expand All @@ -78,6 +94,14 @@ data "helm_template" "oci-kubernetes-monitoring" {
}
}

dynamic "set" {
for_each = var.oke_cluster_entity_ocid == "NoInput" ? [] : ["run_once"]
content {
name = "oci-onm-logan.ociLAClusterEntityID"
value = var.oke_cluster_entity_ocid
}
}

dynamic "set" {
for_each = var.deploy_mushop_config ? local.mushop_helm_inputs : {}
content {
Expand All @@ -87,11 +111,4 @@ data "helm_template" "oci-kubernetes-monitoring" {
}

count = var.generate_helm_template ? 1 : 0
}

# Helm release artifacts for local testing and validation. Not used by helm resource.
resource "local_file" "helm_release" {
content = tostring(data.helm_template.oci-kubernetes-monitoring[0].manifest)
filename = "${path.module}/local/helmrelease.yaml"
count = var.generate_helm_template ? 1 : 0
}
Loading