Skip to content

Commit

Permalink
Merge pull request #17 from goci-io/improvements
Browse files Browse the repository at this point in the history
making replicas configureable, create pdb only when using 1 replica
  • Loading branch information
etwillbefine authored Aug 12, 2020
2 parents 4772d28 + 79036ea commit 9de1917
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ txtOwnerId: ${owner_id}
interval: 2m
provider: aws
policy: ${update_policy}
replicas: ${replicas}
sources:
- ingress

Expand Down
3 changes: 3 additions & 0 deletions release.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ resource "helm_release" "external_dns" {
values = [
templatefile("${path.module}/defaults.yaml", {
domains = var.domains
replicas = var.replicas
aws_region = var.aws_region
update_policy = var.update_records_policy
iam_role_arn = local.iam_role_arn
Expand All @@ -28,6 +29,8 @@ resource "helm_release" "external_dns" {
}

resource "kubernetes_pod_disruption_budget" "allow_unavailable" {
count = var.replicas == 1 ? 1 : 0

metadata {
name = var.name
namespace = var.k8s_namespace
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,9 @@ variable "is_private_zone" {
default = false
description = "Type of the hosted zones specified in domains"
}

variable "replicas" {
type = number
default = 1
description = "Amount of Replicas for External-DNS. When set to 1 we also create a PodDisruptionBudget"
}

0 comments on commit 9de1917

Please sign in to comment.