Skip to content

Commit

Permalink
Merge pull request #395 from MylesJP/k8s-observability
Browse files Browse the repository at this point in the history
Integrate k8s to observability stack
  • Loading branch information
gboutry authored Jan 9, 2025
2 parents 6379629 + 627d7fd commit c6bc2f7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,17 @@ resource "juju_application" "grafana-agent" {
}

# juju integrate <principal-application>:cos-agent grafana-agent:cos-agent
resource "juju_integration" "principal-application-to-grafana-agent" {
model = var.principal-application-model
resource "juju_integration" "grafana_agent_integrations" {
for_each = toset(var.grafana-agent-integration-apps)
model = var.principal-application-model

application {
name = juju_application.grafana-agent.name
endpoint = "cos-agent"
}

application {
name = var.principal-application
name = each.value
endpoint = "cos-agent"
}
}
Expand All @@ -71,7 +72,7 @@ resource "juju_integration" "grafana-agent-to-cos-prometheus" {

# juju integrate grafana-agent cos.loki-logging
resource "juju_integration" "grafana-agent-to-cos-loki" {
count = var.logging-offer-url != null ? 1 : 0
count = var.logging-offer-url != null ? 1 : 0
model = var.principal-application-model

application {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

variable "principal-application" {
description = "Name of the deployed principal application that integrates with grafana-agent"
variable "grafana-agent-integration-apps" {
description = "List of the deployed principal applications that integrate with grafana-agent"
type = list(string)
default = []
}

variable "principal-application-model" {
Expand Down
3 changes: 2 additions & 1 deletion sunbeam-python/sunbeam/features/observability/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,10 @@ def __init__(

def run(self, status: Status | None = None) -> Result:
"""Execute configuration using terraform."""
integration_apps = ["k8s", "openstack-hypervisor"]
extra_tfvars = {
"principal-application-model": self.model,
"principal-application": "openstack-hypervisor",
"grafana-agent-integration-apps": integration_apps,
}
# Offer URLs from COS are added from feature
extra_tfvars.update(
Expand Down

0 comments on commit c6bc2f7

Please sign in to comment.