Skip to content

Commit

Permalink
Add ingress_annotations and fix a bug with the resources
Browse files Browse the repository at this point in the history
  • Loading branch information
TwiN committed Sep 15, 2021
1 parent 49116b5 commit 6faeed9
Showing 3 changed files with 15 additions and 8 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ For documentation on Gatus, see [TwinProduction/gatus](https://github.com/TwinPr
```hcl
module "gatus" {
source = "TwinProduction/gatus/kubernetes"
version = "0.0.3"
version = "0.0.4"
configuration_file_content = file("${path.module}/files/gatus.yaml")
}
```
@@ -16,9 +16,10 @@ module "gatus" {
|:-------------------------- |:---------------------------------------- |:----------------------------- |
| name | Name to use for resources | `gatus` |
| namespace | Namespace in which Gatus will be running | `kube-system` |
| image | Image to use for the container | `twinproduction/gatus:v2.8.1` |
| image | Image to use for the container | `twinproduction/gatus:v3.1.0` |
| configuration_file_content | Gatus configuration. See [TwinProduction/gatus](https://github.com/TwinProduction/gatus). | `""` Required |
| ingress_host | Ingress host through which Gatus will be exposed. Not created if blank. | `""` |
| ingress_annotations | Ingress annotations. | `{}` |
| memory_request | Memory request | `40M` |
| memory_limit | Memory limit | `100M` |
| cpu_request | CPU request | `30m` |
9 changes: 5 additions & 4 deletions gatus.tf
Original file line number Diff line number Diff line change
@@ -45,11 +45,11 @@ resource "kubernetes_deployment" "gatus" {
container_port = 8080
}
resources {
requests {
requests = {
cpu = var.cpu_request
memory = var.memory_request
}
limits {
limits = {
cpu = var.cpu_limit
memory = var.memory_limit
}
@@ -120,8 +120,9 @@ resource "kubernetes_service" "gatus" {
resource "kubernetes_ingress" "gatus" {
count = var.ingress_host != "" ? 1 : 0
metadata {
name = var.name
namespace = var.namespace
name = var.name
namespace = var.namespace
annotations = var.ingress_annotations
}
spec {
backend {
9 changes: 7 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ variable "namespace" {

variable "image" {
type = string
default = "twinproduction/gatus:v2.8.1"
default = "twinproduction/gatus:v3.1.0"
}

variable "configuration_file_content" {
@@ -19,11 +19,16 @@ variable "configuration_file_content" {
}

variable "ingress_host" {
default = ""
type = string
default = ""
description = "Ingress host through which Gatus will be exposed. Not created if blank."
}

variable "ingress_annotations" {
type = map(string)
default = {}
}

variable "memory_request" {
type = string
default = "40M"

0 comments on commit 6faeed9

Please sign in to comment.