BjornMagnussonXA | b998ed6 | 2022-09-21 09:26:21 +0200 | [diff] [blame^] | 1 | |
| 2 | |
| 3 | # Minio |
| 4 | |
| 5 | |
| 6 | apiVersion: v1 |
| 7 | kind: Service |
| 8 | metadata: |
| 9 | name: minio |
| 10 | namespace: nonrtric |
| 11 | labels: |
| 12 | run: minio |
| 13 | prodtest: minio |
| 14 | spec: |
| 15 | clusterIP: None |
| 16 | selector: |
| 17 | run: minio |
| 18 | |
| 19 | --- |
| 20 | |
| 21 | apiVersion: v1 |
| 22 | kind: Service |
| 23 | metadata: |
| 24 | name: minio-ext |
| 25 | namespace: nonrtric |
| 26 | labels: |
| 27 | prodtest: minio |
| 28 | spec: |
| 29 | type: NodePort |
| 30 | selector: |
| 31 | statefulset.kubernetes.io/pod-name: minio-0 |
| 32 | ports: |
| 33 | - protocol: TCP |
| 34 | port: 9001 |
| 35 | targetPort: 9001 |
| 36 | nodePort: 31768 |
| 37 | |
| 38 | --- |
| 39 | |
| 40 | apiVersion: apps/v1 |
| 41 | kind: StatefulSet |
| 42 | metadata: |
| 43 | name: minio |
| 44 | namespace: nonrtric |
| 45 | labels: |
| 46 | run: minio |
| 47 | prodtest: minio |
| 48 | spec: |
| 49 | serviceName: minio |
| 50 | replicas: $NUM_MINIO |
| 51 | selector: |
| 52 | matchLabels: |
| 53 | run: minio |
| 54 | template: |
| 55 | metadata: |
| 56 | labels: |
| 57 | run: minio |
| 58 | prodtest: minio |
| 59 | spec: |
| 60 | initContainers: |
| 61 | - name: init |
| 62 | image: alpine:latest |
| 63 | imagePullPolicy: IfNotPresent |
| 64 | command: ["ash","-c"] |
| 65 | args: ["IDX=${HOSTNAME##*-} && mkdir -p /data/$IDX && rm -rf /data/$IDX/*"] |
| 66 | volumeMounts: |
| 67 | - mountPath: /data |
| 68 | name: data-vol |
| 69 | containers: |
| 70 | - name: minio |
| 71 | image: minio/minio:latest |
| 72 | imagePullPolicy: IfNotPresent |
| 73 | args: |
| 74 | - server |
| 75 | - "--console-address" |
| 76 | - ":9001" |
| 77 | - $MINIO_SERVER_CONF |
| 78 | # $MINIO_SERVER_0 |
| 79 | # $MINIO_SERVER_1 |
| 80 | # $MINIO_SERVER_2 |
| 81 | # $MINIO_SERVER_3 |
| 82 | # $MINIO_SERVER_4 |
| 83 | # $MINIO_SERVER_5 |
| 84 | # $MINIO_SERVER_6 |
| 85 | # $MINIO_SERVER_7 |
| 86 | # $MINIO_SERVER_8 |
| 87 | # $MINIO_SERVER_9 |
| 88 | env: |
| 89 | - name: MINIO_ROOT_USER |
| 90 | value: admin |
| 91 | - name: MINIO_ROOT_PASSWORD |
| 92 | value: adminadmin |
| 93 | volumeMounts: |
| 94 | - mountPath: /data |
| 95 | name: data-vol |
| 96 | volumes: |
| 97 | #MINIO_EMPTY_DIR_START |
| 98 | - name: data-vol |
| 99 | emptyDir: {} |
| 100 | #MINIO_EMPTY_DIR_STOP |
| 101 | #MINIO_HOSTPATH_DIR_START |
| 102 | - name: data-vol |
| 103 | hostPath: |
| 104 | path: $MINIO_MNT/minio |
| 105 | type: DirectoryOrCreate |
| 106 | #MINIO_HOSTPATH_DIR_STOP |
| 107 | |