Skip to content

Commit

Permalink
Update Kubernetes deployment and service YAML files
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlahbib committed Nov 15, 2024
1 parent f4dedc2 commit 560b9d6
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions k8s/dev/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: app
namespace: dev
labels:
app: my-app
spec:
Expand Down
1 change: 1 addition & 0 deletions k8s/dev/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: app-service
namespace: dev
labels:
app: my-app
spec:
Expand Down
1 change: 1 addition & 0 deletions k8s/prod/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: app
namespace: prod
labels:
app: my-app
spec:
Expand Down
1 change: 1 addition & 0 deletions k8s/prod/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: app-service
namespace: prod
labels:
app: my-app
spec:
Expand Down
4 changes: 4 additions & 0 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ terraform {
backend "s3" {}
}

data "aws_eks_cluster_auth" "cluster_auth" {
name = var.cluster_name
}

resource "aws_eks_cluster" "eks_cluster" {
name = var.cluster_name
role_arn = aws_iam_role.eks_role.arn
Expand Down
10 changes: 10 additions & 0 deletions terraform/monitoring.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ resource "helm_release" "grafana" {
chart = "grafana"
namespace = "monitoring"
version = "6.50.7"

set {
name = "service.type"
value = "NodePort"
}

set {
name = "persistence.enabled"
value = "true"
}
}

resource "helm_release" "loki" {
Expand Down
5 changes: 5 additions & 0 deletions terraform/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ terraform {
helm = {
source = "hashicorp/helm"
version = ">= 2.0.2"
kubernetes {
host = aws_eks_cluster.eks_cluster.endpoint
token = aws_eks_cluster_auth.cluster_auth.token
insecure = true
}
}
}
}
Expand Down

0 comments on commit 560b9d6

Please sign in to comment.