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 all 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
10 changes: 5 additions & 5 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
push:
branches:
- master
paths:
- '_examples/**'
anmolnagpal marked this conversation as resolved.
Show resolved Hide resolved
paths-ignore:
- '**/*README.md'
workflow_dispatch:

jobs:
Expand All @@ -26,7 +26,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 +84,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/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/grafana/grafana-vs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: grafana
namespace: monitoring
spec:
hosts:
- dash.test.clouddrove.com
gateways:
- istio-system/istio-gateway
http:
- route:
- destination:
host: grafana
port:
number: 80
16 changes: 16 additions & 0 deletions _examples/complete/config/grafana/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
36 changes: 36 additions & 0 deletions _examples/complete/config/override-prometheus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
server:
## 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"

persistentVolume: # Persistent volume will not be deployed for prometheus server pod - Enable if EBS or EFS CSI Driver is installed
enabled: false

resources:
limits:
cpu: 300m
memory: 250Mi
requests:
cpu: 50m
memory: 150Mi

alertmanager: # Dependency for prometheus server
enabled: true
persistence: # Persistent volume will not be deployed for alertmanager - Enable if EBS or EFS CSI Driver is installed
enabled: false

kube-state-metrics: # Dependency for prometheus server
enabled: true

prometheus-node-exporter: # Dependency for prometheus server
enabled: true

prometheus-pushgateway: # Dependency for prometheus server
enabled: true
9 changes: 8 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


# Grafaa Deployment
grafana = true
grafana_helm_config = { values = [file("./config/grafana/override-grafana.yaml")] }
grafana_manifests = var.grafana_manifests
grafana_extra_configs = var.grafana_extra_configs

# -- Addons with mandatory variable
istio_ingress = true
Expand Down Expand Up @@ -208,6 +213,7 @@ 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")] }

# -- Override Helm Release attributes
metrics_server_extra_configs = var.metrics_server_extra_configs
Expand All @@ -234,6 +240,7 @@ 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

# -- Custom IAM Policy Json for Addon's ServiceAccount
cluster_autoscaler_iampolicy_json_content = file("./custom-iam-policies/cluster-autoscaler.json")
Expand Down
15 changes: 12 additions & 3 deletions _examples/complete/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,31 @@ provider "aws" {

provider "kubernetes" {
host = module.eks.cluster_endpoint
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
token = data.aws_eks_cluster_auth.eks_cluster.token
cluster_ca_certificate = base64decode(data.aws_eks_cluster.eks_cluster.certificate_authority[0].data)
exec {
api_version = "client.authentication.k8s.io/v1beta1"
args = ["eks", "get-token", "--cluster-name", data.aws_eks_cluster.eks_cluster.name]
command = "aws"
}
}

provider "helm" {
kubernetes {
host = module.eks.cluster_endpoint
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
token = data.aws_eks_cluster_auth.eks_cluster.token
exec {
api_version = "client.authentication.k8s.io/v1beta1"
args = ["eks", "get-token", "--cluster-name", data.aws_eks_cluster.eks_cluster.name]
command = "aws"
}
}
}

provider "kubectl" {
host = module.eks.cluster_endpoint
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
token = data.aws_eks_cluster_auth.eks_cluster.token
load_config_file = false
}

# ------------------------------------------------------------------------------
Expand Down
26 changes: 26 additions & 0 deletions _examples/complete/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,29 @@ variable "actions_runner_controller_extra_configs" {
type = any
default = {}
}

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

# ------------------------------- GRAFANA ------------------------------------------
variable "grafana_extra_configs" {
type = any
default = {
atomic = true
}
}

variable "grafana_manifests" {
type = object({
grafana_virtualservice_file_path = string
})
default = {
grafana_virtualservice_file_path = "./config/grafana/grafana-vs.yaml"
}
}
2 changes: 1 addition & 1 deletion _examples/complete/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ terraform {
}
kubectl = {
source = "gavinbunney/kubectl"
version = ">= 1.7.0"
version = ">= 1.14.0"
}
}
}
16 changes: 16 additions & 0 deletions _examples/external-eks/config/grafana/grafana-vs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: grafana
namespace: istio-system
spec:
hosts:
- dash.test.clouddrove.com
gateways:
- istio-system/istio-gateway
http:
- route:
- destination:
host: grafana
port:
number: 80
16 changes: 16 additions & 0 deletions _examples/external-eks/config/grafana/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
16 changes: 16 additions & 0 deletions _examples/external-eks/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/external-eks/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
9 changes: 8 additions & 1 deletion _examples/external-eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ module "addons" {
filebeat = true
reloader = true
redis = true
prometheus = true

# Grafana Deployment
grafana = true
grafana_helm_config = { values = [file("./config/grafana/override-grafana.yaml")] }
grafana_manifests = var.grafana_manifests
grafana_extra_configs = var.grafana_extra_configs

# -- Addons with mandatory variable
istio_ingress = true
Expand Down Expand Up @@ -64,6 +70,7 @@ module "addons" {
filebeat_helm_config = { values = [file("./config/override-filebeat.yaml")] }
reloader_helm_config = { values = [file("./config/reloader/override-reloader.yaml")] }
redis_helm_config = { values = [file("./config/override-redis.yaml")] }
prometheus_helm_config = { values = [file("./config/override-prometheus.yaml")] }

# -- Override Helm Release attributes
metrics_server_extra_configs = var.metrics_server_extra_configs
Expand All @@ -88,7 +95,7 @@ module "addons" {
filebeat_extra_configs = var.filebeat_extra_configs
reloader_extra_configs = var.reloader_extra_configs
redis_extra_configs = var.redis_extra_configs

prometheus_extra_configs = var.prometheus_extra_configs

# -- Custom IAM Policy Json for Addon's ServiceAccount
external_secrets_iampolicy_json_content = file("./custom-iam-policies/external-secrets.json")
Expand Down
15 changes: 12 additions & 3 deletions _examples/external-eks/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,30 @@ provider "aws" {
provider "kubernetes" {
host = data.aws_eks_cluster.eks_cluster.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.eks_cluster.certificate_authority[0].data)
token = join("", data.aws_eks_cluster_auth.eks_cluster[*].token)
exec {
api_version = "client.authentication.k8s.io/v1beta1"
args = ["eks", "get-token", "--cluster-name", data.aws_eks_cluster.eks_cluster.name]
command = "aws"
}
}

provider "helm" {
kubernetes {
host = data.aws_eks_cluster.eks_cluster.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.eks_cluster.certificate_authority[0].data)
token = join("", data.aws_eks_cluster_auth.eks_cluster[*].token)
exec {
api_version = "client.authentication.k8s.io/v1beta1"
args = ["eks", "get-token", "--cluster-name", data.aws_eks_cluster.eks_cluster.name]
command = "aws"
}
}
}

provider "kubectl" {
host = data.aws_eks_cluster.eks_cluster.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.eks_cluster.certificate_authority[0].data)
token = join("", data.aws_eks_cluster_auth.eks_cluster[*].token)
token = data.aws_eks_cluster_auth.eks_cluster.token
load_config_file = false
}

data "aws_eks_cluster_auth" "eks_cluster" {
Expand Down
Loading