diff --git a/minio/openshift.deploy.yml b/minio/openshift.deploy.yml new file mode 100644 index 000000000..d0ee74740 --- /dev/null +++ b/minio/openshift.deploy.yml @@ -0,0 +1,155 @@ +--- +apiVersion: v1 +kind: Template +metadata: + annotations: + description: "Minio deployment" + labels: + app: "${NAME}" + template: "${NAME}-template" + name: "${NAME}" +parameters: + - name: "NAME" + displayName: "App to deploy" + value: "minio" + - name: "SECRETS" + displayName: "Secret object to reference" + value: "minio-secrets" + - name: "SRC_NAMESPACE" + displayName: "Namespace containing the deployment source" + value: "moe-gwells-tools" + - name: "SRC_IMAGE" + displayName: "Name of source image" + value: "minio" + # - name: "SRC_TAG" + # displayName: "Tag of source image" + #value: "latest" + - name: "DEST_PVC_SIZE" + displayName: "PVC size" + value: "10Gi" + - name: "DEST_PVC_CLASS" + displayName: "PVC class" + value: "gluster-file" + - name: "DEST_PVC_ACCESS" + displayName: "PVC access mode" + value: "ReadWriteOnce" + - name: "IMAGE_TAG" + required: true + - name: "MINIO_ACCESS_KEY" + required: true + - name: "MINIO_SECRET_KEY" + required: true + - name: "MINIO_DATA_DIR" + required: true + - name: "ENV_NAME" + required: true + - name: "NAME_SUFFIX" + required: false +objects: + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + finalizers: + - kubernetes.io/pvc-protection + name: "${NAME}-config-vol-v2" + labels: + app: "${NAME}" + spec: + accessModes: + - ${DEST_PVC_ACCESS} + resources: + requests: + storage: ${DEST_PVC_SIZE} + storageClassName: ${DEST_PVC_CLASS} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + finalizers: + - kubernetes.io/pvc-protection + name: "${NAME}-data-vol" + labels: + app: "${NAME}" + spec: + accessModes: + - ${DEST_PVC_ACCESS} + resources: + requests: + storage: ${DEST_PVC_SIZE} + storageClassName: ${DEST_PVC_CLASS} + - apiVersion: apps.openshift.io/v1 + kind: DeploymentConfig + metadata: + labels: + app: "${NAME}" + template: "${NAME}-template" + name: "${NAME}" + spec: + replicas: 1 + strategy: + activeDeadlineSeconds: 3000 + recreateParams: + timeoutSeconds: 600 + type: Recreate + template: + metadata: + labels: + app: "${NAME}" + template: "${NAME}-template" + spec: + containers: + - env: + - name: MINIO_ACCESS_KEY + valueFrom: + secretKeyRef: + name: ${SECRETS} + key: MINIO_ACCESS_KEY + - name: MINIO_SECRET_KEY + valueFrom: + secretKeyRef: + name: ${SECRETS} + 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: "${NAME}" + ports: + - containerPort: 9000 + protocol: TCP + resources: + limits: + cpu: 250m + 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: "${NAME}-config-vol-v2" + - name: data-vol + persistentVolumeClaim: + claimName: "${NAME}-data-vol" + triggers: + - type: ConfigChange + - apiVersion: v1 + kind: Service + metadata: + labels: + app: ${NAME} + name: ${NAME} + spec: + ports: + - name: 9000-tcp + port: 9000 + protocol: TCP + targetPort: 9000