TringaliLuca

MinIO Kubernetes example YAML

Aug 9th, 2020
90
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. apiVersion: v1
  2. kind: PersistentVolumeClaim
  3. metadata:
  4.  # This name uniquely identifies the PVC. Will be used in deployment below.
  5.   name: minio-pv-claim
  6.   labels:
  7.     app: minio-storage-claim
  8. spec:
  9.  # Read more about access modes here: https://kubernetes.io/docs/user-guide/persistent-volumes/#access-modes
  10.   accessModes:
  11.    - ReadWriteOnce
  12.   resources:
  13.    # This is the request for storage. Should be available in the cluster.
  14.     requests:
  15.       storage: 30Gi
  16.   # Uncomment and add storageClass specific to your requirements below. Read more https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class-1
  17.   #storageClassName:
  18. ---
  19. apiVersion: extensions/v1
  20. kind: Deployment
  21. metadata:
  22.  # This name uniquely identifies the Deployment
  23.   name: minio-deployment
  24. spec:
  25.   strategy:
  26.     type: Recreate
  27.   template:
  28.     metadata:
  29.       labels:
  30.        # Label is used as selector in the service.
  31.         app: minio
  32.     spec:
  33.      # Refer to the PVC created earlier
  34.       volumes:
  35.       - name: storage
  36.         persistentVolumeClaim:
  37.          # Name of the PVC created earlier
  38.           claimName: minio-pv-claim
  39.       containers:
  40.       - name: minio
  41.         # Pulls the default MinIO image from Docker Hub
  42.         image: minio/minio
  43.         args:
  44.        - server
  45.         - /storage
  46.         env:
  47.        # MinIO access key and secret key
  48.         - name: MINIO_ACCESS_KEY
  49.           value: "AKIAIOSFODNN7EXAMPLE"
  50.         - name: MINIO_SECRET_KEY
  51.           value: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
  52.         ports:
  53.         - containerPort: 9000
  54.         # Mount the volume into the pod
  55.         volumeMounts:
  56.         - name: storage # must match the volume name, above
  57.           mountPath: "/storage"
  58. ---
  59. apiVersion: v1
  60. kind: Service
  61. metadata:
  62.   name: minio-service
  63. spec:
  64.   type: LoadBalancer
  65.   ports:
  66.     - port: 9000
  67.       targetPort: 9000
  68.       protocol: TCP
  69.   selector:
  70.     app: minio
RAW Paste Data