-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sandbox): add-tf-to-sandbox (#263)
- Loading branch information
1 parent
299535b
commit 691e6ce
Showing
52 changed files
with
1,417 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
# Uses editorconfig to maintain consistent coding styles | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
max_line_length = 80 | ||
trim_trailing_whitespace = true | ||
|
||
[*.{tf,tfvars}] | ||
indent_size = 2 | ||
indent_style = space | ||
|
||
[*.md] | ||
max_line_length = 0 | ||
trim_trailing_whitespace = false | ||
|
||
[Makefile] | ||
tab_width = 2 | ||
indent_style = tab | ||
|
||
[COMMIT_EDITMSG] | ||
max_line_length = 0 |
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,14 @@ | ||
# terraform | ||
*.tf text=auto eol=lf | ||
|
||
# dot files | ||
*.gitattributes text=auto eol=lf | ||
*.yaml text=auto eol=lf | ||
*.yml text=auto eol=lf | ||
*.md text=auto eol=lf | ||
.gitignore text=auto eol=lf | ||
.editorconfig text=auto eol=lf | ||
.terraform-version text=auto eol=lf | ||
|
||
# golang | ||
*.go text=auto eol=lf |
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,6 @@ | ||
.terraform | ||
terraform.tfstate | ||
*.tfstate* | ||
terraform.tfvars | ||
*.backup | ||
venv/ |
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,11 @@ | ||
repos: | ||
- repo: git://github.com/antonbabenko/pre-commit-terraform | ||
rev: v1.50.0 | ||
hooks: | ||
- id: terraform_fmt | ||
- id: terraform_docs | ||
- repo: git://github.com/dnephin/pre-commit-golang | ||
rev: v0.4.0 | ||
hooks: | ||
- id: go-fmt | ||
- id: go-lint |
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 @@ | ||
latest:^0.14 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,88 @@ | ||
# tf-sourceloop-sandbox | ||
|
||
> This project was generated by [generator-tf-module](https://github.com/sudokar/generator-tf-module) | ||
## Overview | ||
|
||
k8s managed by Terraform for the Sourceloop sandbox | ||
|
||
## Usage | ||
|
||
```hcl | ||
module "tf-sourceloop-sandbox" { | ||
source = "git::ssh://" | ||
} | ||
``` | ||
|
||
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
## Requirements | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| null | ~> 2.1 | | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| null | ~> 2.1 | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| mandatory | this field is mandatory | `string` | n/a | yes | | ||
| optional | this field is optional | `string` | `"default_value"` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| output\_name | description for output\_name | | ||
|
||
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
|
||
## Development | ||
|
||
### Prerequisites | ||
|
||
- [terraform](https://learn.hashicorp.com/terraform/getting-started/install#installing-terraform) | ||
- [terraform-docs](https://github.com/segmentio/terraform-docs) | ||
- [pre-commit](https://pre-commit.com/#install) | ||
- [golang](https://golang.org/doc/install#install) | ||
- [golint](https://github.com/golang/lint#installation) | ||
|
||
### Configurations | ||
|
||
- Configure pre-commit hooks | ||
```sh | ||
pre-commit install | ||
``` | ||
|
||
|
||
- Configure golang deps for tests | ||
```sh | ||
> go get github.com/gruntwork-io/terratest/modules/terraform | ||
> go get github.com/stretchr/testify/assert | ||
``` | ||
|
||
|
||
|
||
### Tests | ||
|
||
- Tests are available in `test` directory | ||
|
||
- In the test directory, run the below command | ||
```sh | ||
go test | ||
``` | ||
|
||
|
||
|
||
## Authors | ||
|
||
This project is authored by below people | ||
|
||
- SourceFuse | ||
|
||
> This project was generated by [generator-tf-module](https://github.com/sudokar/generator-tf-module) |
53 changes: 53 additions & 0 deletions
53
sandbox/k8s/tf-sourceloop-sandbox/audit-ms-example/audit-ms-example-deployment.yaml
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,53 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
# network/sourceloop-sanbox: "true" | ||
io.sourceloop.service: audit-ms-example | ||
name: audit-ms-example | ||
namespace: sourceloop-sandbox | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
io.sourceloop.service: audit-ms-example | ||
template: | ||
metadata: | ||
labels: | ||
io.sourceloop.service: audit-ms-example | ||
spec: | ||
containers: | ||
- env: | ||
- name: DB_DATABASE | ||
value: audit_db | ||
- name: DB_HOST | ||
value: postgres.sourceloop-sandbox.svc.cluster.local | ||
- name: DB_PASSWORD | ||
value: changeme | ||
- name: DB_PORT | ||
value: "5432" | ||
- name: DB_USER | ||
value: postgres | ||
- name: JWT_ISSUER | ||
value: https://loopback4-microservice-catalog | ||
- name: JWT_SECRET | ||
value: i_am_a_strong_secret | ||
- name: LOG_LEVEL | ||
value: debug | ||
- name: NODE_ENV | ||
value: dev | ||
- name: REDIS_DB | ||
value: "0" | ||
- name: REDIS_HOST | ||
value: redis | ||
- name: REDIS_PASSWORD | ||
value: test | ||
- name: REDIS_PORT | ||
value: "6379" | ||
image: localhost:32000/audit-ms-example | ||
name: audit-ms-example | ||
ports: | ||
- containerPort: 3000 | ||
resources: { } | ||
restartPolicy: Always | ||
status: {} |
17 changes: 17 additions & 0 deletions
17
sandbox/k8s/tf-sourceloop-sandbox/audit-ms-example/audit-ms-example-service.yaml
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,17 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
io.sourceloop.service: audit-ms-example | ||
name: audit-ms-example | ||
namespace: sourceloop-sandbox | ||
spec: | ||
type: LoadBalancer | ||
ports: | ||
- name: "3000" | ||
port: 3000 | ||
targetPort: 3000 | ||
selector: | ||
io.sourceloop.service: audit-ms-example | ||
status: | ||
loadBalancer: {} |
46 changes: 46 additions & 0 deletions
46
sandbox/k8s/tf-sourceloop-sandbox/audit-ms-example/audit-ms-migration-pod.yaml
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,46 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
labels: | ||
# network/sourceloop-sanbox: "true" | ||
io.sourceloop.service: audit-ms-migration | ||
name: audit-ms-migration | ||
namespace: sourceloop-sandbox | ||
spec: | ||
containers: | ||
- args: | ||
- sh | ||
- -c | ||
- sleep 60 && npm run db:migrate | ||
env: | ||
- name: DB_DATABASE | ||
value: audit_db | ||
- name: DB_HOST | ||
value: postgres.sourceloop-sandbox.svc.cluster.local | ||
- name: DB_PASSWORD | ||
value: changeme | ||
- name: DB_PORT | ||
value: "5432" | ||
- name: DB_USER | ||
value: postgres | ||
- name: JWT_ISSUER | ||
value: https://loopback4-microservice-catalog | ||
- name: JWT_SECRET | ||
value: i_am_a_strong_secret | ||
- name: LOG_LEVEL | ||
value: debug | ||
- name: NODE_ENV | ||
value: dev | ||
- name: REDIS_DB | ||
value: "0" | ||
- name: REDIS_HOST | ||
value: redis | ||
- name: REDIS_PASSWORD | ||
value: test | ||
- name: REDIS_PORT | ||
value: "6379" | ||
image: localhost:32000/audit-ms-example:latest | ||
name: audit-ms-migration | ||
resources: {} | ||
restartPolicy: OnFailure | ||
status: {} |
Empty file.
Oops, something went wrong.