Skip to content

Commit

Permalink
Feature/headless service (#99)
Browse files Browse the repository at this point in the history
* add headless service

* update changelog

Co-authored-by: Raj Poluri <[email protected]>
  • Loading branch information
rpoluri and Raj Poluri authored Jan 7, 2022
1 parent 9fede84 commit 041b721
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.3.15] - 2022-01-06
- Add k8s headless service, so that clients running in k8s cluster can connect to a WD container instead of virtual ip.

## [3.3.14] - 2021-12-16
- Set env var `LOG4J_FORMAT_MSG_NO_LOOKUPS=”true”` for WD containers for log4j-shell bug.

Expand Down
19 changes: 19 additions & 0 deletions k8s.tf
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,22 @@ resource "kubernetes_service" "waggle_dance" {
load_balancer_source_ranges = var.ingress_cidr
}
}

resource "kubernetes_service" "waggle_dance_headless" {
count = var.wd_instance_type == "k8s" ? 1 : 0
metadata {
name = "${local.instance_alias}-headless"
namespace = var.k8s_namespace
}
spec {
selector = {
name = local.instance_alias
}
port {
port = local.wd_port
target_port = local.wd_port
}
type = "ClusterIP"
cluster_ip = "None"
}
}

0 comments on commit 041b721

Please sign in to comment.