minio.yaml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. ---
  2. # Copyright Materialize, Inc. and contributors. All rights reserved.
  3. #
  4. # Use of this software is governed by the Business Source License
  5. # included in the LICENSE file at the root of this repository.
  6. #
  7. # As of the Change Date specified in that file, in accordance with
  8. # the Business Source License, use of this software will be governed
  9. # by the Apache License, Version 2.0.
  10. apiVersion: apps/v1
  11. kind: Deployment
  12. metadata:
  13. name: minio
  14. namespace: materialize
  15. labels:
  16. app: minio
  17. spec:
  18. replicas: 1
  19. selector:
  20. matchLabels:
  21. app: minio
  22. template:
  23. metadata:
  24. labels:
  25. app: minio
  26. spec:
  27. containers:
  28. - name: minio
  29. image: minio/minio
  30. args:
  31. - server
  32. - /data
  33. env:
  34. - name: MINIO_ACCESS_KEY
  35. value: "minio"
  36. - name: MINIO_SECRET_KEY
  37. value: "minio123"
  38. - name: MINIO_BROWSER
  39. value: "on"
  40. ports:
  41. - containerPort: 9000
  42. volumeMounts:
  43. - name: storage
  44. mountPath: /data
  45. resources:
  46. requests:
  47. memory: "512Mi"
  48. cpu: "250m"
  49. limits:
  50. memory: "1Gi"
  51. cpu: "500m"
  52. livenessProbe:
  53. httpGet:
  54. path: /minio/health/live
  55. port: 9000
  56. initialDelaySeconds: 10
  57. periodSeconds: 20
  58. timeoutSeconds: 5
  59. readinessProbe:
  60. httpGet:
  61. path: /minio/health/ready
  62. port: 9000
  63. initialDelaySeconds: 5
  64. periodSeconds: 10
  65. timeoutSeconds: 5
  66. lifecycle:
  67. postStart:
  68. exec:
  69. command:
  70. - "bash"
  71. - "-euc"
  72. - |
  73. function setup_buckets() {
  74. while true; do
  75. echo "Waiting for minio to become ready..."
  76. if curl --fail localhost:9000/minio/health/ready; then
  77. echo "Minio is ready"
  78. break
  79. fi
  80. sleep 1
  81. done
  82. echo "Creating local alias"
  83. mc alias set local http://localhost:9000 minio minio123
  84. echo $?
  85. echo "Creating local/persist bucket"
  86. mc mb -p local/persist
  87. echo $?
  88. echo "Creating local/bucket bucket"
  89. mc mb -p local/bucket
  90. echo $?
  91. }
  92. setup_buckets 2>&1 > poststart.log
  93. volumes:
  94. - name: storage
  95. emptyDir: {}
  96. ---
  97. apiVersion: v1
  98. kind: Service
  99. metadata:
  100. name: minio
  101. namespace: materialize
  102. spec:
  103. ports:
  104. - port: 9000
  105. targetPort: 9000
  106. selector:
  107. app: minio