-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
163 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
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,66 @@ | ||
# Minio | ||
|
||
|
||
<!--description-start--> | ||
Self Hosted S3 Storage | ||
<!--description-end--> | ||
|
||
|
||
<!--header-start--> | ||
**Namespace:** `minio` | ||
**Deployment:** | ||
**Terraform Provider:** [aminueza/minio](https://registry.terraform.io/providers/aminueza/minio/latest/docs) | ||
**Web:** [min.io](https://min.io/) | ||
<!--header-end--> | ||
|
||
## User Access | ||
|
||
|
||
Load Access Key and Secret Key direct from the k8s secret `minio-creds-secret`. | ||
|
||
```sh | ||
export AWS_ACCESS_KEY_ID=$(kubectl -n minio get secrets minio-creds-secret -ojson | jq -r '.data.secretkey' | base64 -d) | ||
|
||
export AWS_SECRET_ACCESS_KEY=$(kubectl -n minio get secrets minio-creds-secret -ojson | jq -r '.data.accesskey' | base64 -d) | ||
``` | ||
|
||
```sh | ||
export MINIO_USER=minioadmin \ | ||
&& export MINIO_PASSWORD=minioadmin | ||
``` | ||
|
||
|
||
```sh | ||
export MINIO_ENDPOINT=localhost:9090 \ | ||
&& export MINIO_ACCESS_KEY=$(kubectl -n minio get secrets minio-creds-secret -ojson | jq -r '.data.secretkey' | base64 -d) \ | ||
&& export MINIO_SECRET_KEY=$(kubectl -n minio get secrets minio-creds-secret -ojson | jq -r '.data.accesskey' | base64 -d) | ||
`` | ||
|
||
|
||
|
||
<!--s3-state-tf-env-vars-start--> | ||
```sh | ||
export AWS_S3_ENDPOINT=https://$(kubectl -n minio get httpproxies.projectcontour.io minio -ojson | jq '.spec.virtualhost.fqdn' -r) \ | ||
&& export AWS_ACCESS_KEY_ID=$(vault kv get -field=accesskey secrets-tf/services/s3/users/admin) \ | ||
&& export AWS_SECRET_ACCESS_KEY=$(vault kv get -field=secretkey secrets-tf/services/s3/users/admin) | ||
``` | ||
<!--s3-state-tf-env-vars-end--> | ||
|
||
|
||
```sh | ||
export MINIO_ENDPOINT=$(kubectl -n minio get httpproxies.projectcontour.io minio -ojson | jq '.spec.virtualhost.fqdn' -r) \ | ||
&& export MINIO_ACCESS_KEY=$(vault kv get -field=accesskey secrets-tf/services/s3/users/admin) \ | ||
&& export MINIO_SECRET_KEY=$(vault kv get -field=secretkey secrets-tf/services/s3/users/admin) | ||
``` | ||
|
||
|
||
|
||
## Useful Commands | ||
|
||
**Port Forward** | ||
<!--port-forward-start--> | ||
```sh | ||
kubectl -n vault port-forward svc/vault 8200 | ||
``` | ||
<!--port-forward-end--> | ||
|
22 changes: 22 additions & 0 deletions
22
src/clusters/smart-home/configuration/minio/.terraform.lock.hcl
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,12 @@ | ||
resource "minio_s3_bucket" "state_terraform_s3" { | ||
bucket = "state-terraform-s3" | ||
acl = "public" | ||
} | ||
|
||
output "minio_id" { | ||
value = "${minio_s3_bucket.state_terraform_s3.id}" | ||
} | ||
|
||
output "minio_url" { | ||
value = "${minio_s3_bucket.state_terraform_s3.bucket_domain_name}" | ||
} |
48 changes: 48 additions & 0 deletions
48
src/clusters/smart-home/configuration/minio/terragrunt.hcl
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,48 @@ | ||
|
||
include { | ||
path = "../../../../terraground-common/terraground.hcl" | ||
} | ||
|
||
locals { | ||
STATE_NAMESPACE="minio" | ||
root_config = read_terragrunt_config("../../../../terraground-common/state-kubernetes.hcl") | ||
provider_version = read_terragrunt_config("../../../../terraground-common/provider-versions.hcl") | ||
} | ||
|
||
remote_state { | ||
backend = local.root_config.remote_state.backend | ||
generate = local.root_config.remote_state.generate | ||
config = merge( | ||
local.root_config.remote_state.config, | ||
{ | ||
namespace = local.STATE_NAMESPACE | ||
}, | ||
) | ||
} | ||
|
||
|
||
generate "providers" { | ||
path = "provider.gen.tf" | ||
if_exists = "overwrite_terragrunt" | ||
contents = <<EOF | ||
provider "minio" { | ||
minio_region = "us-east-1" | ||
} | ||
EOF | ||
} | ||
|
||
generate "versions" { | ||
path = "versions.gen.tf" | ||
if_exists = "overwrite_terragrunt" | ||
contents = <<EOF | ||
terraform { | ||
required_providers { | ||
minio = { | ||
source = "aminueza/minio" | ||
version = "${local.provider_version.inputs.minio}" | ||
} | ||
} | ||
} | ||
EOF | ||
} |