Skip to content

Commit

Permalink
Feature/internal svc (#101)
Browse files Browse the repository at this point in the history
* internal service with client affinity

* update service names

* update changelog

* fix changelog

Co-authored-by: Raj Poluri <[email protected]>
  • Loading branch information
rpoluri and Raj Poluri authored Jan 12, 2022
1 parent 3b8f73f commit c9fb312
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ 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.4.1] - 2022-01-11
- Add k8s internal service with client affinity, for usecases than cannot use headless service and seamlessly failover to new waggle-dance instances.

## [3.4.0] - 2022-01-11
- Variable to enable waggle-dance autoscaling on k8s.

Expand Down
19 changes: 19 additions & 0 deletions k8s.tf
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,25 @@ resource "kubernetes_service" "waggle_dance" {
}
}

resource "kubernetes_service" "waggle_dance_internal" {
count = var.wd_instance_type == "k8s" ? 1 : 0
metadata {
name = "${local.instance_alias}-internal"
namespace = var.k8s_namespace
}
spec {
selector = {
name = local.instance_alias
}
session_affinity = "ClientIP"
port {
port = local.wd_port
target_port = local.wd_port
}
type = "ClusterIP"
}
}

resource "kubernetes_service" "waggle_dance_headless" {
count = var.wd_instance_type == "k8s" ? 1 : 0
metadata {
Expand Down

0 comments on commit c9fb312

Please sign in to comment.