Skip to content

Commit

Permalink
chore(ci): Update minio deployment. (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
fergmac authored Nov 14, 2024
1 parent 053cbd8 commit 8fdc1a5
Show file tree
Hide file tree
Showing 6 changed files with 217 additions and 80 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ jobs:
parameters:
-p NAME_SUFFIX=${{ inputs.target }}
-p IMAGE_TAG=${{ inputs.tag }}
${{ inputs.environment && '' || '-p MINIO_DATA_DIR=/tmp/data' }}
${{ inputs.environment && '' || '-p DEST_PVC_SIZE=1Mi' }}
# ${{ inputs.environment && '' || '-p MINIO_DATA_DIR=/tmp/data' }}
# ${{ inputs.environment && '' || '-p DEST_PVC_SIZE=1Mi' }}

database:
name: Database
Expand Down
2 changes: 1 addition & 1 deletion common/openshift.init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ objects:
- apiVersion: v1
kind: Secret
metadata:
name: gwells-${NAME_SUFFIX}-minio
name: gwells-minio-${NAME_SUFFIX}
labels:
app: nr-gwells-${NAME_SUFFIX}
creationTimestamp:
Expand Down
11 changes: 11 additions & 0 deletions minio/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
FROM minio/minio:RELEASE.2020-11-25T22-36-25Z

COPY ./minio-entrypoint.sh /

RUN ["chmod", "+x", "/minio-entrypoint.sh"]

USER 1001

ENTRYPOINT ["/minio-entrypoint.sh"]

# RUN mkdir -p $MINIO_DATA_DIR/aquifer-docs
# RUN mkdir -p $MINIO_DATA_DIR/driller-docs
# RUN mkdir -p $MINIO_DATA_DIR/gwells
# RUN mkdir -p $MINIO_DATA_DIR/well-docs
# RUN mkdir -p $MINIO_DATA_DIR/gwells-docs
2 changes: 1 addition & 1 deletion minio/minio-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ mkdir -p $MINIO_DATA_DIR/gwells
mkdir -p $MINIO_DATA_DIR/well-docs
mkdir -p $MINIO_DATA_DIR/gwells-docs

/usr/bin/docker-entrypoint.sh server $MINIO_DATA_DIR
/usr/bin/docker-entrypoint.sh $@
139 changes: 139 additions & 0 deletions minio/openshift.deploy.old.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
kind: Template
apiVersion: template.openshift.io/v1
metadata:
annotations:
description: "Minio deployment"
labels:
app: "${NAME}"
template: "${NAME}-template"
name: "${NAME}"
parameters:
- name: "NAME"
displayName: "App to deploy"
value: "minio"
- name: "SRC_NAMESPACE"
displayName: "Namespace containing the deployment source"
value: "moe-gwells-tools"
- name: "SRC_IMAGE"
displayName: "Name of source image"
value: "minio"
- name: "DEST_PVC_SIZE"
displayName: "PVC size"
value: "1Gi"
- name: "DEST_PVC_ACCESS"
displayName: "PVC access mode"
value: "ReadWriteOnce"
- name: "IMAGE_TAG"
required: true
- name: "MINIO_DATA_DIR"
default: /opt/minio/s3/data
- name: "NAME_SUFFIX"
required: false
objects:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
finalizers:
- kubernetes.io/pvc-protection
name: "gwells-${NAME_SUFFIX}-minio-config-vol-v2"
labels:
app: nr-gwells-${NAME_SUFFIX}
spec:
accessModes:
- ${DEST_PVC_ACCESS}
resources:
requests:
storage: ${DEST_PVC_SIZE}
storageClassName: netapp-file-standard
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
finalizers:
- kubernetes.io/pvc-protection
name: "gwells-${NAME_SUFFIX}-minio-data-vol"
labels:
app: nr-gwells-${NAME_SUFFIX}
spec:
accessModes:
- ${DEST_PVC_ACCESS}
resources:
requests:
storage: ${DEST_PVC_SIZE}
storageClassName: netapp-file-standard
- apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nr-gwells-${NAME_SUFFIX}
name: "gwells-${NAME_SUFFIX}-minio"
spec:
replicas: 1
selector:
matchLabels:
deployment: "gwells-${NAME_SUFFIX}-minio"
strategy:
activeDeadlineSeconds: 3000
recreateParams:
timeoutSeconds: 600
type: Recreate
template:
metadata:
labels:
name: "gwells-${NAME_SUFFIX}-minio"
deployment: "gwells-${NAME_SUFFIX}-minio"
spec:
containers:
- env:
- name: MINIO_ACCESS_KEY
valueFrom:
secretKeyRef:
name: gwells-${NAME_SUFFIX}-minio
key: MINIO_ACCESS_KEY
- name: MINIO_SECRET_KEY
valueFrom:
secretKeyRef:
name: gwells-${NAME_SUFFIX}-minio
key: MINIO_SECRET_KEY
- name: MINIO_DATA_DIR
value: /opt/minio/s3/data
- name: MINIO_CONFIG_DIR
value: /opt/minio/s3/config
image: ghcr.io/bcgov/nr-gwells/minio:${IMAGE_TAG}
imagePullPolicy: Always
name: "gwells-${NAME_SUFFIX}-minio"
ports:
- containerPort: 9000
protocol: TCP
resources:
limits:
cpu: 150m
requests:
cpu: 100m
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /opt/minio/s3/config
name: config-vol
- mountPath: /opt/minio/s3/data
name: data-vol
restartPolicy: Always
terminationGracePeriodSeconds: 30
volumes:
- name: config-vol
persistentVolumeClaim:
claimName: "gwells-${NAME_SUFFIX}-minio-config-vol-v2"
- name: data-vol
persistentVolumeClaim:
claimName: "gwells-${NAME_SUFFIX}-minio-data-vol"
- kind: Service
apiVersion: v1
metadata:
labels:
app: nr-gwells-${NAME_SUFFIX}
name: "gwells-${NAME_SUFFIX}-minio"
spec:
ports:
- name: 9000-tcp
port: 9000
protocol: TCP
targetPort: 9000
Loading

0 comments on commit 8fdc1a5

Please sign in to comment.