Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nolte committed Nov 23, 2023
1 parent 14be8ec commit a0f25d7
Show file tree
Hide file tree
Showing 5 changed files with 163 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/services/minio.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# MinIO

{%
include-markdown "../../src/applications/minio/README.md"
start="<!--description-start-->"
end="<!--description-end-->"
%}

---

{%
include-markdown "../../src/applications/minio/README.md"
start="<!--header-start-->"
end="<!--header-end-->"
%}

---

## Useful Commands

Expand Down
66 changes: 66 additions & 0 deletions src/applications/minio/README.md
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 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.

12 changes: 12 additions & 0 deletions src/clusters/smart-home/configuration/minio/main.tf
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 src/clusters/smart-home/configuration/minio/terragrunt.hcl
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
}

0 comments on commit a0f25d7

Please sign in to comment.