Created
July 28, 2022 22:16
-
-
Save carlosedp/703bf3cae3715ac0fb677499550be295 to your computer and use it in GitHub Desktop.
Min.io OpenShift template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To create a new Minio instance, you can use the following command: | |
# | |
# oc new-project minio | |
# oc new-app --namespace=minio -f minio-template.yaml -p MINIO_ROOT_USER=root -p MINIO_ROOT_PASSWORD=mysecret -p APPLICATION_DOMAIN=minio.$(oc get ingresses.config/cluster -o jsonpath={.spec.domain}) -p PV_SIZE=20Gi | |
# | |
apiVersion: v1 | |
kind: Template | |
labels: | |
app: minio | |
template: minio | |
message: |- | |
The following service(s) have been created in your project: ${NAME}. | |
Get latest version of this template at: https://gist.github.com/carlosedp/703bf3cae3715ac0fb677499550be295 | |
metadata: | |
annotations: | |
description: |- | |
Get latest version of this template at: https://gist.github.com/carlosedp/703bf3cae3715ac0fb677499550be295 | |
WARNING: This template needs a default storage class with enough space. | |
iconClass: icon-database | |
openshift.io/display-name: min.io | |
openshift.io/documentation-url: https://gist.github.com/carlosedp/703bf3cae3715ac0fb677499550be295 | |
openshift.io/long-description: | |
This template defines resources needed to deploy | |
a min.io service that allows you to use a AWS S3 compatible api in your apps. | |
tags: minio,min.io,s3 | |
template.openshift.io/bindable: "false" | |
name: minio | |
objects: | |
- apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: ${NAME}-keys | |
namespace: ${NAMESPACE} | |
stringData: | |
access-key: ${MINIO_ROOT_USER} | |
secret-key: ${MINIO_ROOT_PASSWORD} | |
- apiVersion: v1 | |
kind: Service | |
metadata: | |
annotations: | |
description: Exposes the application pod API | |
service.alpha.openshift.io/dependencies: '[{"name": "${MINIO_SERVICE_NAME}", "kind": "Service"}]' | |
name: ${NAME}-api | |
namespace: ${NAMESPACE} | |
spec: | |
ports: | |
- name: ${NAME} | |
port: 9000 | |
targetPort: 9000 | |
selector: | |
app: ${NAME} | |
- apiVersion: v1 | |
kind: Service | |
metadata: | |
annotations: | |
description: Exposes the application pod Console | |
service.alpha.openshift.io/dependencies: '[{"name": "${MINIO_SERVICE_NAME}", "kind": "Service"}]' | |
name: ${NAME}-console | |
namespace: ${NAMESPACE} | |
spec: | |
ports: | |
- name: ${NAME} | |
port: 9001 | |
targetPort: 9001 | |
selector: | |
app: ${NAME} | |
- apiVersion: v1 | |
kind: Route | |
metadata: | |
name: ${NAME}-api | |
namespace: ${NAMESPACE} | |
spec: | |
host: api-${APPLICATION_DOMAIN} | |
to: | |
kind: Service | |
name: ${NAME}-api | |
tls: | |
termination: edge | |
insecureEdgeTerminationPolicy: Redirect | |
- apiVersion: v1 | |
kind: Route | |
metadata: | |
name: ${NAME}-console | |
namespace: ${NAMESPACE} | |
spec: | |
host: console-${APPLICATION_DOMAIN} | |
to: | |
kind: Service | |
name: ${NAME}-console | |
tls: | |
termination: edge | |
insecureEdgeTerminationPolicy: Redirect | |
- apiVersion: apps/v1 | |
kind: StatefulSet | |
metadata: | |
labels: | |
app: ${NAME} | |
name: ${NAME} | |
namespace: ${NAMESPACE} | |
spec: | |
podManagementPolicy: OrderedReady | |
replicas: 1 | |
revisionHistoryLimit: 1 | |
selector: | |
matchLabels: | |
app: ${NAME} | |
serviceName: ${NAME} | |
template: | |
metadata: | |
creationTimestamp: null | |
labels: | |
app: ${NAME} | |
spec: | |
containers: | |
- args: | |
- server | |
- /data | |
env: | |
- name: MINIO_ROOT_USER | |
valueFrom: | |
secretKeyRef: | |
key: access-key | |
name: ${NAME}-keys | |
- name: MINIO_ROOT_PASSWORD | |
valueFrom: | |
secretKeyRef: | |
key: secret-key | |
name: ${NAME}-keys | |
- name: MINIO_BROWSER_REDIRECT_URL | |
value: https://console-${APPLICATION_DOMAIN} | |
- name: MINIO_SERVER_URL | |
value: https://api-${APPLICATION_DOMAIN} | |
- name: MINIO_CONSOLE_ADDRESS | |
value: ":9001" | |
image: minio/minio:latest | |
imagePullPolicy: IfNotPresent | |
name: ${NAME} | |
ports: | |
- containerPort: 9000 | |
protocol: TCP | |
resources: | |
limits: | |
cpu: 200m | |
memory: ${MEMORY_LIMIT} | |
terminationMessagePath: /dev/termination-log | |
terminationMessagePolicy: File | |
volumeMounts: | |
- mountPath: /data | |
name: data | |
dnsPolicy: ClusterFirst | |
restartPolicy: Always | |
schedulerName: default-scheduler | |
securityContext: {} | |
terminationGracePeriodSeconds: 30 | |
updateStrategy: | |
type: OnDelete | |
volumeClaimTemplates: | |
- metadata: | |
name: data | |
spec: | |
# storageClassName: "thin" # uncomment this line to use an existing storage class otherwise, default will be used | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: ${PV_SIZE} | |
parameters: | |
- description: The name assigned to all of the frontend objects defined in this template. | |
displayName: Name | |
name: NAME | |
required: true | |
value: minio | |
- description: The project used for the application. | |
displayName: Namespace | |
name: NAMESPACE | |
required: true | |
value: minio | |
- description: Maximum amount of memory the container can use. | |
displayName: Memory Limit | |
name: MEMORY_LIMIT | |
required: true | |
value: 512Mi | |
- description: Persistent volume storage size. | |
displayName: Storage size | |
name: PV_SIZE | |
required: true | |
value: 20Gi | |
- description: | |
The exposed hostname that will route to the Min.io service, if left | |
blank a value will be defaulted. | |
displayName: Application Hostname | |
name: APPLICATION_DOMAIN | |
- description: Root user for min.io api. | |
displayName: Root user | |
from: "[a-zA-Z0-9]{32}" | |
generate: expression | |
name: MINIO_ROOT_USER | |
- description: Root password for min.io api. | |
displayName: Root password | |
from: "[a-zA-Z0-9]{32}" | |
generate: expression | |
name: MINIO_ROOT_PASSWORD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment