Skip to content

Commit

Permalink
Workflow fix + Monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
knowbase committed Jan 17, 2023
1 parent 59659a4 commit 58631a6
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/xc-nap-destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
terraform_arcadia:
name: "arcadia"
runs-on: ubuntu-latest
needs: terraform_nap
needs: terraform_xc
defaults:
run:
working-directory: ./arcadia
Expand Down
50 changes: 50 additions & 0 deletions nap/charts/grafana/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
grafana:
rbac:
pspEnabled: false
testFramework:
enabled: false
persistence:
enabled: true
type: pvc
accessModes:
- ReadWriteOnce
size: 4Gi
finalizers:
- kubernetes.io/pvc-protection
datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://prometheus-server
dashboardProviders:
dashboardproviders.yaml:
apiVersion: 1
providers:
- name: "default"
orgId: 1
folder: ""
type: file
disableDeletion: false
editable: true
options:
path: /var/lib/grafana/dashboards/default
dashboards:
default:
nginx:
url: https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/main/grafana/NGINXPlusICDashboard.json
datasource: Prometheus
service:
type: ClusterIP
port: 8080
targetPort: 3000
portName: service
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
hosts:
- chart-example.local
path: /grafana
10 changes: 0 additions & 10 deletions nap/charts/prometheus/Chart.yaml

This file was deleted.

8 changes: 8 additions & 0 deletions nap/grafana.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resource "helm_release" "grafana" {
name = format("%s-gfa-%s", local.project_prefix, local.build_suffix)
repository = "https://grafana.github.io/helm-charts"
chart = "grafana"
version = "6.31.1"
namespace = kubernetes_namespace.monitoring.metadata[0].name
values = [templatefile("./charts/grafana/values.yaml", { external_name = "${data.kubernetes_service_v1.nginx-service.status.0.load_balancer.0.ingress.0.hostname}"})]
}
1 change: 1 addition & 0 deletions nap/locals.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
locals {
project_prefix = data.tfe_outputs.infra.values.project_prefix
build_suffix = data.tfe_outputs.infra.values.build_suffix
aws_region = data.tfe_outputs.infra.values.aws_region
host = data.tfe_outputs.eks.values.cluster_endpoint
cluster_ca_certificate = data.tfe_outputs.eks.values.kubeconfig-certificate-authority-data
Expand Down
5 changes: 5 additions & 0 deletions nap/namespace.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ resource "kubernetes_namespace" "nginx-ingress" {
name = "nginx-ingress"
}
}
resource "kubernetes_namespace" "monitoring" {
metadata {
name = "monitoring"
}
}
2 changes: 1 addition & 1 deletion nap/nap.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "helm_release" "nginx-plus-ingress" {
name = local.project_prefix
name = format("%s-nap-%s", local.project_prefix, local.build_suffix)
repository = "https://helm.nginx.com/stable"
chart = "nginx-ingress"
namespace = kubernetes_namespace.nginx-ingress.metadata[0].name
Expand Down
8 changes: 8 additions & 0 deletions nap/prometheus.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resource "helm_release" "prometheus" {
name = format("%s-pro-%s", local.project_prefix, local.build_suffix)
repository = "https://prometheus-community.github.io/helm-charts"
chart = "prometheus"
#version = "15.10.2"
namespace = kubernetes_namespace.monitoring.metadata[0].name
values = [file("./charts/prometheus/values.yaml")]
}

0 comments on commit 58631a6

Please sign in to comment.