Skip to content

Commit

Permalink
fix multi instance deployment on k8s (#76)
Browse files Browse the repository at this point in the history
* fix k8s multi instance  naming

* cleaup

* update changelog

Co-authored-by: Raj Poluri <[email protected]>
  • Loading branch information
rpoluri and Raj Poluri authored Aug 4, 2020
1 parent b20bfae commit ddef067
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [3.1.1] - 2020-08-04

### Changed
- Fix k8s multi instance deployment resource names.

## [3.1.0] - 2020-03-05

### Changed
Expand Down
2 changes: 1 addition & 1 deletion iam-ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ resource "aws_iam_role" "waggledance_task" {
}
EOF

tags = "${var.tags}"
tags = var.tags
}

resource "aws_iam_role_policy" "secretsmanager_for_waggledance_task" {
Expand Down
20 changes: 10 additions & 10 deletions k8s.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,37 @@ locals {
resource "kubernetes_deployment" "waggle_dance" {
count = var.wd_instance_type == "k8s" ? 1 : 0
metadata {
name = "waggle-dance"
name = local.instance_alias
namespace = var.k8s_namespace
labels = {
name = "waggle-dance"
name = local.instance_alias
}
}

spec {
replicas = 3
selector {
match_labels = {
name = "waggle-dance"
name = local.instance_alias
}
}

template {
metadata {
labels = {
name = "waggle-dance"
name = local.instance_alias
}
annotations = {
"prometheus.io/scrape": var.prometheus_enabled
"prometheus.io/port": 18000
"prometheus.io/path": "/actuator/prometheus"
"prometheus.io/scrape" : var.prometheus_enabled
"prometheus.io/port" : 18000
"prometheus.io/path" : "/actuator/prometheus"
}
}

spec {
container {
image = "${var.docker_image}:${var.docker_version}"
name = "waggle-dance"
name = local.instance_alias
env {
name = "HEAPSIZE"
value = local.heapsize
Expand Down Expand Up @@ -73,7 +73,7 @@ resource "kubernetes_deployment" "waggle_dance" {
resource "kubernetes_service" "waggle_dance" {
count = var.wd_instance_type == "k8s" ? 1 : 0
metadata {
name = "waggle-dance"
name = local.instance_alias
namespace = var.k8s_namespace
annotations = {
"service.beta.kubernetes.io/aws-load-balancer-internal" = "true"
Expand All @@ -82,7 +82,7 @@ resource "kubernetes_service" "waggle_dance" {
}
spec {
selector = {
name = "waggle-dance"
name = local.instance_alias
}
port {
port = 48869
Expand Down

0 comments on commit ddef067

Please sign in to comment.