Skip to content
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

Deploy MinIO #70

Draft
wants to merge 5 commits into
base: feature/pulumi
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions services/ni/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ NI_CERT_CERT=$2


kubectl apply -f $(dirname $0)/website
kubectl apply -f $(dirname $0)/nijobs
kubectl apply -f $(dirname $0)/nitsig
kubectl apply -f $(dirname $0)/plausible

Expand All @@ -24,6 +23,8 @@ if [[ -z "$NI_CERT_CERT" ]]; then
exit 1
fi

kubectl create secret tls --namespace=nijobs website-cert --key=$NI_CERT_KEY --cert=$NI_CERT_CERT
kubectl delete secret --namespace=nitsig website-cert
kubectl delete secret --namespace=ni-website website-cert

kubectl create secret tls --namespace=nitsig website-cert --key=$NI_CERT_KEY --cert=$NI_CERT_CERT
kubectl create secret tls --namespace=ni-website website-cert --key=$NI_CERT_KEY --cert=$NI_CERT_CERT
7 changes: 7 additions & 0 deletions services/pulumi/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ repositories:
url: https://charts.longhorn.io
- name: traefik
url: https://traefik.github.io/charts
- name: minio-operator
url: https://operator.min.io

manifests:
# cert-manager
Expand Down Expand Up @@ -53,3 +55,8 @@ manifests:
- type: helm
chart: traefik/traefik
version: 28.3.0

# minio
- type: template
chart: minio-operator/operator
version: 6.0.0
1 change: 1 addition & 0 deletions services/pulumi/niployments/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rendered-debug-yaml/
8 changes: 5 additions & 3 deletions services/pulumi/niployments/Pulumi.prod.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
encryptionsalt: v1:upriG3hjats=:v1:Mjju6ZYDjjKKyVPn:Bn6nuCMHoUCltZWaXycxDl5bvv7ndA==
encryptionsalt: v1:vcKJMHA+4iI=:v1:e3jUh+xx0WgDWY6G:q2pOOhKgl7SGqFxV8uvsb1Kk7Ak9oA==
config:
niployments:minio/root-secret:
secure: v1:kvZP8Y8P467RUkhA:x26ulATfs7XIw0T4NH4VUCtcKmRLew==
niployments:mongodb/admin-password:
secure: v1:GXCb2z0V4Az3053O:y6EgjlKVYr6BWebVazmAmdC/YCI=
secure: v1:+r7V2XJ515b5e9G4:tNcpo4Lqkz5nnplay+3ev3xoAvYDgQ==
niployments:mongodb/nimentas-password:
secure: v1:HxF47P+9RXfi4nfc:47vWUGoYJgjmqxaWwT2M8SSCgI0=
secure: v1:ud1QrQI7peJMh0OC:I2QeTvr+r9kiFtqWjMk75C7Aimk/ow==
2 changes: 2 additions & 0 deletions services/pulumi/niployments/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import "./services/ementas/index.js";
import "./resources/minio/tenant.js";

import { CommitSignal } from "./utils/pending.js";

CommitSignal.globalParent.resolve();
19 changes: 19 additions & 0 deletions services/pulumi/niployments/resources/minio/charts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as k8s from "@pulumi/kubernetes";


export const namespace = new k8s.core.v1.Namespace("minio-operator-namespace", {
metadata: {
name: "minio-operator"
}
})

export const chart = new k8s.helm.v4.Chart(
"minio-operator",
{
chart: "operator",
namespace: namespace.metadata.name,
version: "6.0.0",
repositoryOpts: {
repo: "https://operator.min.io",
},
})
60 changes: 60 additions & 0 deletions services/pulumi/niployments/resources/minio/tenant.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/* eslint-disable @typescript-eslint/no-base-to-string */
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import { minio } from "@pulumi/crds";
import { chart, namespace } from "./charts.js";
import * as pulumi from "@pulumi/pulumi";
import * as k8s from "@pulumi/kubernetes";



const config = new pulumi.Config();

export const secret = new k8s.core.v1.Secret("minio-tenant-root-secret", {
metadata: {
namespace: namespace.metadata.name,
name: "minio-tenant-root-secret"
},
stringData: {
"config.env":
`
export MINIO_ROOT_USER=root
export MINIO_ROOT_PASSWORD=${config.requireSecret("minio/root-secret")}
`
}
})


export const minioTenant = new minio.v2.Tenant("minio-tenant", {
metadata: {
namespace: namespace.metadata.name,
name: "minio-tenant"
},
spec: {
pools: [{
name: "main-pool",
servers: 1,
volumesPerServer: 1,
volumeClaimTemplate: {
apiVersion: "v1",
kind: "PersistentVolumeClaim",
metadata: {
namespace: namespace.metadata.name
},
spec: {
resources: {
requests: {
storage: "20Gi"
}
},
storageClassName: "longhorn-strict-local-retain",
accessModes: ["ReadWriteOnce"]
}
}
}],
credsSecret: {
name: secret.metadata.name
}
}
}, {dependsOn: [
chart
]})