-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add-port-testing-module #31
Draft
eamonnmoloney-nuuday
wants to merge
6
commits into
master
Choose a base branch
from
add-port-testing-module
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0cd3c09
Adding the port-testing module. This would be used to confirm our por…
eamonnmoloney 77b82f6
removed namespace to configure it through another module
eamonnmoloney 95503c3
allowing terraform to create the namespace
eamonnmoloney e335514
updated to allow terraform to control the namespace for the port-tester
eamonnmoloney 4e502fd
Updates to the README.md with an example usage
eamonnmoloney 9532e6d
refactor: updates to reflect changes needed by terraform fmt
eamonnmoloney File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,5 @@ override.tf.json | |
|
||
*.swp | ||
|
||
# Jetbrains | ||
**/.idea/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Port testing Addon | ||
Very simple go webserver that executes an HTTP GET against a | ||
provided endpoint and tests for an expected returned status code | ||
|
||
This application doesn't do any testing itself, it will only execute | ||
what you want it to. An expected use is to config a dashboard like grafana | ||
to poll endpoints and check the response. | ||
|
||
## Example | ||
|
||
```shell script | ||
curl "http://HOST/?endpoint=https://rancher.lqd.dk&expectedStatusCode=200" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
resource "kubernetes_namespace" "this" { | ||
count = var.create_namespace == true ? 1 : 0 | ||
|
||
metadata { | ||
name = var.namespace | ||
|
||
annotations = { | ||
managedby = "terraform" | ||
} | ||
} | ||
} | ||
|
||
locals { | ||
chart_name = "port-tester" | ||
chart_version = var.chart_version | ||
release_name = "port-tester" | ||
repository = "https://harbor.aws.c.dk/chartrepo/shared-platforms" | ||
create_namespace = true | ||
|
||
values = { | ||
namespace = var.namespace | ||
name = "port-tester" | ||
} | ||
} | ||
|
||
resource "helm_release" "port-tester" { | ||
count = var.enable ? 1 : 0 | ||
name = local.release_name | ||
chart = local.chart_name | ||
version = local.chart_version | ||
repository = local.repository | ||
namespace = var.namespace | ||
values = [yamlencode(local.values)] | ||
|
||
depends_on = [ | ||
kubernetes_namespace.this, | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
variable "chart_version" { | ||
default = "0.1.0" | ||
description = "port-testing version to install" | ||
type = string | ||
} | ||
|
||
variable "namespace" { | ||
description = "Namespace to install port-tester in" | ||
type = string | ||
} | ||
|
||
variable "enable" { | ||
default = false | ||
description = "Enable or Disable port-testing" | ||
type = bool | ||
} | ||
|
||
variable "create_namespace" { | ||
description = "Whether to create the namespace defined in the namespace variable. Will fail if the namespace already exists" | ||
default = false | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed as it's replaced by
kubernetes_namespace.this