Skip to content

Commit

Permalink
Adding minio with dex auth to nerc-ocp-test cluster
Browse files Browse the repository at this point in the history
Adding support for object stores in the test cluster with authentication
and policy based authorization by OpenShift groups.
  • Loading branch information
computate committed Nov 26, 2024
1 parent 3777e4b commit 85ad749
Show file tree
Hide file tree
Showing 14 changed files with 176 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cluster-scope/base/core/namespaces/minio/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
5 changes: 5 additions & 0 deletions cluster-scope/base/core/namespaces/minio/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
kind: Namespace
metadata:
name: minio
spec: {}
6 changes: 6 additions & 0 deletions cluster-scope/bundles/minio/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
nerc.mghpcc.org/bundle: minio
resources:
- ../../base/core/namespaces/minio
1 change: 1 addition & 0 deletions cluster-scope/overlays/nerc-ocp-test/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ resources:
- ../../bundles/openshift-pipelines-operator
- ../../bundles/virt
- ../../bundles/autopilot
- ../../bundles/minio

components:
- ../../components/nerc-oauth-github
Expand Down
13 changes: 13 additions & 0 deletions minio/base/console-route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: minio-console
spec:
port:
targetPort: console
to:
kind: "Service"
name: minio
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
46 changes: 46 additions & 0 deletions minio/base/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: minio
spec:
strategy:
type: Recreate
replicas: 1
template:
spec:
containers:
- name: minio
envFrom:
- secretRef:
name: minio-admin-credentials
- configMapRef:
name: minio-config
optional: true
image: docker.io/minio/minio:RELEASE.2024-11-07T00-52-20Z
ports:
- containerPort: 9000
name: object-storage
- containerPort: 8080
name: console
args:
- server
- --console-address
- ":8080"
- /data
volumeMounts:
- name: minio-data
mountPath: /data
livenessProbe:
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 1
httpGet:
scheme: HTTP
path: /minio/health/live
port: 9000
volumes:
- name: minio-data
persistentVolumeClaim:
claimName: minio-data
15 changes: 15 additions & 0 deletions minio/base/externalsecret-minio-admin-credentials.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: minio-admin-credentials
namespace: minio
spec:
refreshInterval: 15s
secretStoreRef:
name: nerc-cluster-secrets
kind: ClusterSecretStore
target:
name: minio-admin-credentials
dataFrom:
- extract:
key: $ENV/$CLUSTER/minio/minio-config
14 changes: 14 additions & 0 deletions minio/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: minio
commonLabels:
app: minio
component: minio

resources:
- externalsecret-minio-admin-credentials.yaml
- deployment.yaml
- pvc.yaml
- service.yaml
- console-route.yaml
- object-storage-route.yaml
13 changes: 13 additions & 0 deletions minio/base/object-storage-route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: minio
spec:
port:
targetPort: object-storage
to:
kind: "Service"
name: minio
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
12 changes: 12 additions & 0 deletions minio/base/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: minio-data
spec:
storageClassName: ocs-external-storagecluster-ceph-rbd
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
14 changes: 14 additions & 0 deletions minio/base/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: minio
spec:
selector:
app: minio
ports:
- name: object-storage
port: 9000
targetPort: object-storage
- name: console
port: 8080
targetPort: console
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: minio-admin-credentials
namespace: minio
spec:
dataFrom:
- extract:
key: nerc/nerc-ocp-test/minio/minio-admin-credentials
11 changes: 11 additions & 0 deletions minio/overlays/nerc-ocp-test/files/minio-config.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Documentation: https://min.io/docs/minio/linux/reference/minio-server/settings/iam/openid.html

MINIO_IDENTITY_OPENID_CONFIG_URL=https://dex-dex.apps.ocp-test.nerc.mghpcc.org/.well-known/openid-configuration
MINIO_IDENTITY_OPENID_CLIENT_ID=minio
MINIO_IDENTITY_OPENID_REDIRECT_URI_DYNAMIC=on

# This tells minio to look up policy names in the "groups" claim (so e.g. if
# someone in the "nerc-ops" group logs in, minio will look for a "nerc-ops"
# policy to apply). A person cannot log in if there is no policy matches any of
# the claim values.
MINIO_IDENTITY_OPENID_CLAIM_NAME=groups
13 changes: 13 additions & 0 deletions minio/overlays/nerc-ocp-test/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base

configMapGenerator:
- name: minio-config
namespace: minio
envs:
- files/minio-config.env

patches:
- path: externalsecrets/patch-minio-admin-credentials.yaml

0 comments on commit 85ad749

Please sign in to comment.