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

Feat: Introducing Grafana(7.0.2) and Prometheus(25.4.0) Addon #44

Merged
merged 36 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
d635c56
feat: introducing jaeger and prometheus
anmolnagpal Nov 1, 2023
342addd
update default override for testing
anmolnagpal Nov 1, 2023
b2bc424
ran terraform format command
anmolnagpal Nov 1, 2023
0065b28
update ref branch in ci
anmolnagpal Nov 1, 2023
0812d82
readme: Update add-on's readme
clouddrove-ci Nov 1, 2023
9241ead
update default setting for jaeger dependency
anmolnagpal Nov 2, 2023
541a37b
Merge branch 'feat/prom_jaeger' of github.com:clouddrove/terraform-aw…
anmolnagpal Nov 2, 2023
25edaa8
readme: Update add-on's readme
clouddrove-ci Nov 2, 2023
61fbcd5
updated a jaeger with manifest file deployment
anmolnagpal Nov 2, 2023
aae1160
Merge branch 'feat/prom_jaeger' of github.com:clouddrove/terraform-aw…
anmolnagpal Nov 2, 2023
462b2a8
pulled from master branch
anmolnagpal Nov 2, 2023
cc41c0c
readme: Update add-on's readme
clouddrove-ci Nov 2, 2023
5c780fb
feat: added grafana helm addon
anmolnagpal Nov 2, 2023
19f98a5
readme: Update add-on's readme
clouddrove-ci Nov 3, 2023
c4bc6e2
fix: fix typo in grafana resurce
anmolnagpal Nov 7, 2023
4e002c7
Merge branch 'feat/prom_jaeger' of github.com:clouddrove/terraform-aw…
anmolnagpal Nov 7, 2023
93a7130
fix: fixed conflicts
anmolnagpal Nov 29, 2023
b38715a
fix: fix terraform format
anmolnagpal Nov 29, 2023
9658282
fix: remove test example
anmolnagpal Nov 29, 2023
bc52e42
fix: added grafana in complete example
anmolnagpal Nov 29, 2023
10366a2
feat: update multi document apply in single yaml for jaeger addon
anmolnagpal Dec 7, 2023
29b7a92
ran terraform format command
anmolnagpal Dec 11, 2023
8cbeba9
fix- update trigger point for readme workflow
anmolnagpal Dec 12, 2023
464813d
fix: added output in the root structure to get addons details in example
anmolnagpal Dec 26, 2023
673e974
fix- terraform code format command ran
anmolnagpal Dec 26, 2023
0901f6a
fix: removed jaeger manifest deployment
anmolnagpal Dec 27, 2023
e72e2fb
Merge branch 'master' of github.com:clouddrove/terraform-aws-eks-addo…
anmolnagpal Dec 27, 2023
80c3b94
fix- terraform code format command ran
anmolnagpal Dec 27, 2023
5bb32b5
Merge branch 'master' of github.com:clouddrove/terraform-aws-eks-addo…
anmolnagpal Dec 29, 2023
d725de1
Merge branch 'feat/prom_jaeger' of github.com:clouddrove/terraform-aw…
anmolnagpal Dec 29, 2023
94c05aa
fix: added jaeger helm config file for jaeger deploy
anmolnagpal Dec 29, 2023
c893237
fix- terraform code format command ran
anmolnagpal Dec 29, 2023
7d7f8c6
feat- added vs for grafana service
anmolnagpal Jan 2, 2024
2808067
feat- added grafana virtual service and update prometheus readme
anmolnagpal Jan 2, 2024
4092d20
feat- added grafana virtual service and update prometheus readme
anmolnagpal Jan 2, 2024
1b7c688
fix: remove jaeger addon
h1manshu98 Jan 5, 2024
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
8 changes: 3 additions & 5 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
push:
branches:
- master
paths:
- '_examples/**'
anmolnagpal marked this conversation as resolved.
Show resolved Hide resolved
workflow_dispatch:

jobs:
Expand All @@ -26,7 +24,7 @@ jobs:
uses: actions/checkout@master
with:
fetch-depth: 0
ref: master
ref: ${{ github.head_ref }}
token: ${{ env.GH_TOKEN }}

- name: 'Set up Python 3.7'
Expand Down Expand Up @@ -84,13 +82,13 @@ jobs:
uses: actions/checkout@master
with:
fetch-depth: 0
ref: master
ref: ${{ github.head_ref }}
token: ${{ env.GH_TOKEN }}

- name: Generate TF Docs
uses: terraform-docs/gh-actions@v1.0.0
with:
working-dir: addons/aws-ebs-csi-driver,addons/aws-efs-csi-driver,addons/aws-load-balancer-controller,addons/aws-node-termination-handler,addons/calico-tigera,addons/cluster-autoscaler,addons/external-secrets,addons/fluent-bit,addons/helm,addons/ingress-nginx,addons/istio-ingress,addons/karpenter,addons/kiali-server,addons/kubeclarity,addons/metrics-server,addons/nri-bundle,addons/velero,addons/kube-state-metrics,addons/keda,addons/cert-manager,addons/filebeat,addons/reloader,addons/external-dns,addons/redis,addons/actions-runner-controller
working-dir: addons/aws-ebs-csi-driver,addons/aws-efs-csi-driver,addons/aws-load-balancer-controller,addons/aws-node-termination-handler,addons/calico-tigera,addons/cluster-autoscaler,addons/external-secrets,addons/fluent-bit,addons/helm,addons/ingress-nginx,addons/istio-ingress,addons/karpenter,addons/kiali-server,addons/kubeclarity,addons/metrics-server,addons/nri-bundle,addons/velero,addons/kube-state-metrics,addons/keda,addons/cert-manager,addons/filebeat,addons/reloader,addons/external-dns,addons/redis,addons/prometheus,addons/jaeger,addons/grafana,addons/actions-runner-controller
git-push: true
template: |-
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
Expand Down
16 changes: 16 additions & 0 deletions _examples/complete/config/jaeger/override-cassandra.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "eks.amazonaws.com/nodegroup"
operator: In
values:
- "test-clouddrove-eks-test-cluster-critical-nodes"
resources:
limits:
cpu: 300m
memory: 250Mi
requests:
cpu: 50m
memory: 150Mi
64 changes: 64 additions & 0 deletions _examples/complete/config/jaeger/override-jaeger.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
provisionDataStore:
cassandra: false
agent:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "eks.amazonaws.com/nodegroup"
operator: In
values:
- "test-clouddrove-eks-test-cluster-critical-nodes"
resources:
limits:
cpu: 300m
memory: 250Mi
requests:
cpu: 50m
memory: 150Mi

collector:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "eks.amazonaws.com/nodegroup"
operator: In
values:
- "test-clouddrove-eks-test-cluster-critical-nodes"
resources:
limits:
cpu: 300m
memory: 250Mi
requests:
cpu: 50m
memory: 150Mi

query:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "eks.amazonaws.com/nodegroup"
operator: In
values:
- "test-clouddrove-eks-test-cluster-critical-nodes"
resources:
limits:
cpu: 300m
memory: 250Mi
requests:
cpu: 50m
memory: 150Mi

schema:
resources:
limits:
cpu: 300m
memory: 250Mi
requests:
cpu: 50m
memory: 150Mi
16 changes: 16 additions & 0 deletions _examples/complete/config/override-grafana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "eks.amazonaws.com/nodegroup"
operator: In
values:
- "critical"
resources:
limits:
cpu: 300m
memory: 250Mi
requests:
cpu: 50m
memory: 150Mi
47 changes: 47 additions & 0 deletions _examples/complete/config/override-prometheus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
server:
service:
## If false, no Service will be created for the Prometheus server
##
enabled: true
annotations:
service.beta.kubernetes.io/aws-load-balancer-scheme: "internet-facing"
service.beta.kubernetes.io/aws-load-balancer-name: "prometheus"
labels: {}
clusterIP: ""

## Node affinity for particular node in which labels key is "Infra-Services" and value is "true"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "eks.amazonaws.com/nodegroup"
operator: In
values:
- "critical"

## List of IP addresses at which the Prometheus server service is available
## Ref: https://kubernetes.io/docs/concepts/services-networking/service/#external-ips
##
externalIPs: []
loadBalancerIP: ""
loadBalancerSourceRanges: []
servicePort: 80
sessionAffinity: None
type: LoadBalancer

persistentVolume:
accessModes:
- ReadWriteOnce
enabled: true
mountPath: /data
size: 20Gi
storageClass: gp2

resources:
limits:
cpu: 300m
memory: 250Mi
requests:
cpu: 50m
memory: 150Mi
11 changes: 10 additions & 1 deletion _examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,13 @@ module "addons" {
external_dns = true
redis = true
actions_runner_controller = true
prometheus = true
grafana = true


# Jaeger deployment
jaeger = true
jaeger_extra_configs = var.jaeger_extra_configs
jaeger_extra_manifests = var.jaeger_extra_manifests

# -- Addons with mandatory variable
istio_ingress = true
Expand Down Expand Up @@ -208,6 +213,8 @@ module "addons" {
external_dns_helm_config = { values = [file("./config/override-external-dns.yaml")] }
redis_helm_config = { values = [file("./config/override-redis.yaml")] }
actions_runner_controller_helm_config = { values = [file("./config/override-actions-runner-controller.yaml")] }
prometheus_helm_config = { values = [file("./config/override-prometheus.yaml")] }
grafana_helm_config = { values = [file("./config/override-grafana.yaml")] }

# -- Override Helm Release attributes
metrics_server_extra_configs = var.metrics_server_extra_configs
Expand All @@ -234,6 +241,8 @@ module "addons" {
external_dns_extra_configs = var.external_dns_extra_configs
redis_extra_configs = var.redis_extra_configs
actions_runner_controller_extra_configs = var.actions_runner_controller_extra_configs
prometheus_extra_configs = var.prometheus_extra_configs
grafana_extra_configs = var.grafana_extra_configs

# -- Custom IAM Policy Json for Addon's ServiceAccount
cluster_autoscaler_iampolicy_json_content = file("./custom-iam-policies/cluster-autoscaler.json")
Expand Down
41 changes: 41 additions & 0 deletions _examples/complete/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,44 @@ variable "actions_runner_controller_extra_configs" {
type = any
default = {}
}

# ------------------ PROMETHEUS --------------------------------------------------
variable "prometheus_extra_configs" {
type = any
default = {
atomic = true
namespace = "istio-system"
}
}

# ------------------ JAEGER --------------------------------------------------
variable "jaeger_extra_configs" {
type = any
default = {
manifest_deployment = true
enable_cassandra = false
enable_kafka = false
}
}

variable "jaeger_extra_manifests" {
type = object({
jaeger_cassandra_file_path = list(any)
jaeger_kafka_file_path = list(any)
jaeger_manifest = list(any)
})
default = {
jaeger_cassandra_file_path = [""]
jaeger_kafka_file_path = [""]
jaeger_manifest = ["./config/jaeger/jaeger.yaml"]
}
description = "Path of override files to create customized depedency helm charts for jaeger"
}

# ------------------------------- GRAFANA ------------------------------------------
variable "grafana_extra_configs" {
type = any
default = {
atomic = true
}
}
117 changes: 117 additions & 0 deletions _examples/external-eks/config/jaeger/jaeger.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: jaeger
namespace: istio-system
labels:
app: jaeger
spec:
selector:
matchLabels:
app: jaeger
template:
metadata:
labels:
app: jaeger
annotations:
sidecar.istio.io/inject: "false"
prometheus.io/scrape: "true"
prometheus.io/port: "14269"
spec:
containers:
- name: jaeger
image: "docker.io/jaegertracing/all-in-one:1.35"
env:
- name: BADGER_EPHEMERAL
value: "false"
- name: SPAN_STORAGE_TYPE
value: "badger"
- name: BADGER_DIRECTORY_VALUE
value: "/badger/data"
- name: BADGER_DIRECTORY_KEY
value: "/badger/key"
- name: COLLECTOR_ZIPKIN_HOST_PORT
value: ":9411"
- name: MEMORY_MAX_TRACES
value: "50000"
- name: QUERY_BASE_PATH
value: /jaeger
livenessProbe:
httpGet:
path: /
port: 14269
readinessProbe:
httpGet:
path: /
port: 14269
volumeMounts:
- name: data
mountPath: /badger
resources:
requests:
cpu: 10m
volumes:
- name: data
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: tracing
namespace: istio-system
labels:
app: jaeger
spec:
type: ClusterIP
ports:
- name: http-query
port: 80
protocol: TCP
targetPort: 16686
# Note: Change port name if you add '--query.grpc.tls.enabled=true'
- name: grpc-query
port: 16685
protocol: TCP
targetPort: 16685
selector:
app: jaeger
---
# Jaeger implements the Zipkin API. To support swapping out the tracing backend, we use a Service named Zipkin.
apiVersion: v1
kind: Service
metadata:
labels:
name: zipkin
name: zipkin
namespace: istio-system
spec:
ports:
- port: 9411
targetPort: 9411
name: http-query
selector:
app: jaeger
---
apiVersion: v1
kind: Service
metadata:
name: jaeger-collector
namespace: istio-system
labels:
app: jaeger
spec:
type: ClusterIP
ports:
- name: jaeger-collector-http
port: 14268
targetPort: 14268
protocol: TCP
- name: jaeger-collector-grpc
port: 14250
targetPort: 14250
protocol: TCP
- port: 9411
targetPort: 9411
name: http-zipkin
selector:
app: jaeger
16 changes: 16 additions & 0 deletions _examples/external-eks/config/jaeger/override-cassandra.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "eks.amazonaws.com/nodegroup"
operator: In
values:
- "test-clouddrove-eks-test-cluster-critical-nodes"
resources:
limits:
cpu: 300m
memory: 250Mi
requests:
cpu: 50m
memory: 150Mi
Loading