mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
Update Kubernetes example yaml files (#5278)
Removed the non production ready Kubernetes constructs that are not needed for standard Minio deployment. General cleanup of the documents.
This commit is contained in:
parent
2853fa1882
commit
8c08571cd9
@ -29,8 +29,7 @@
|
|||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
To run this example, you need Kubernetes version >=1.4 cluster installed and running, and that you have installed the [`kubectl`](https://kubernetes.io/docs/tasks/kubectl/install/) command line tool in your path. Please see the
|
To run this example, you need Kubernetes version >=1.4 cluster installed and running, and that you have installed the [`kubectl`](https://kubernetes.io/docs/tasks/kubectl/install/) command line tool in your path. Please see the [getting started guides](https://kubernetes.io/docs/getting-started-guides/) for installation instructions for your platform.
|
||||||
[getting started guides](https://kubernetes.io/docs/getting-started-guides/) for installation instructions for your platform.
|
|
||||||
|
|
||||||
## Minio Standalone Server Deployment
|
## Minio Standalone Server Deployment
|
||||||
|
|
||||||
@ -66,15 +65,12 @@ This is the PVC description.
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
metadata:
|
metadata:
|
||||||
# This name uniquely identifies the PVC. Will be used in deployment below.
|
# This name uniquely identifies the PVC. This is used in deployment.
|
||||||
name: minio-pv-claim
|
name: minio-pv-claim
|
||||||
annotations:
|
|
||||||
volume.alpha.kubernetes.io/storage-class: anything
|
|
||||||
labels:
|
|
||||||
app: minio-storage-claim
|
|
||||||
spec:
|
spec:
|
||||||
# Read more about access modes here: http://kubernetes.io/docs/user-guide/persistent-volumes/#access-modes
|
# Read more about access modes here: http://kubernetes.io/docs/user-guide/persistent-volumes/#access-modes
|
||||||
accessModes:
|
accessModes:
|
||||||
|
# The volume is mounted as read-write by a single node
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
resources:
|
resources:
|
||||||
# This is the request for storage. Should be available in the cluster.
|
# This is the request for storage. Should be available in the cluster.
|
||||||
@ -100,26 +96,34 @@ apiVersion: extensions/v1beta1
|
|||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
# This name uniquely identifies the Deployment
|
# This name uniquely identifies the Deployment
|
||||||
name: minio-deployment
|
name: minio
|
||||||
spec:
|
spec:
|
||||||
strategy:
|
strategy:
|
||||||
|
# Specifies the strategy used to replace old Pods by new ones
|
||||||
|
# Refer: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy
|
||||||
type: Recreate
|
type: Recreate
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
# Label is used as selector in the service.
|
# This label is used as a selector in Service definition
|
||||||
app: minio
|
app: minio
|
||||||
spec:
|
spec:
|
||||||
# Refer to the PVC created earlier
|
# Volumes used by this deployment
|
||||||
volumes:
|
volumes:
|
||||||
- name: data
|
- name: data
|
||||||
|
# This volume is based on PVC
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
# Name of the PVC created earlier
|
# Name of the PVC created earlier
|
||||||
claimName: minio-pv-claim
|
claimName: minio-pv-claim
|
||||||
containers:
|
containers:
|
||||||
- name: minio
|
- name: minio
|
||||||
# Pulls the default Minio image from Docker Hub
|
# Volume mounts for this container
|
||||||
image: minio/minio:RELEASE.2017-05-05T01-14-51Z
|
volumeMounts:
|
||||||
|
# Volume 'data' is mounted to path '/data'
|
||||||
|
- name: data
|
||||||
|
mountPath: "/data"
|
||||||
|
# Pulls the lastest Minio image from Docker Hub
|
||||||
|
image: minio/minio:RELEASE.2017-11-22T19-55-46Z
|
||||||
args:
|
args:
|
||||||
- server
|
- server
|
||||||
- /data
|
- /data
|
||||||
@ -132,10 +136,6 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- containerPort: 9000
|
- containerPort: 9000
|
||||||
hostPort: 9000
|
hostPort: 9000
|
||||||
# Mount the volume into the pod
|
|
||||||
volumeMounts:
|
|
||||||
- name: data # must match the volume name, above
|
|
||||||
mountPath: "/data"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Create the Deployment
|
Create the Deployment
|
||||||
@ -155,6 +155,7 @@ In this example, we expose the Minio Deployment by creating a LoadBalancer servi
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
|
# This name uniquely identifies the service
|
||||||
name: minio-service
|
name: minio-service
|
||||||
spec:
|
spec:
|
||||||
type: LoadBalancer
|
type: LoadBalancer
|
||||||
@ -163,6 +164,7 @@ spec:
|
|||||||
targetPort: 9000
|
targetPort: 9000
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
selector:
|
selector:
|
||||||
|
# Looks for labels `app:minio` in the namespace and applies the spec
|
||||||
app: minio
|
app: minio
|
||||||
```
|
```
|
||||||
Create the Minio service
|
Create the Minio service
|
||||||
@ -199,7 +201,7 @@ deployment "minio-deployment" image updated
|
|||||||
You can cleanup the cluster using
|
You can cleanup the cluster using
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
kubectl delete deployment minio-deployment \
|
kubectl delete deployment minio \
|
||||||
&& kubectl delete pvc minio-pv-claim \
|
&& kubectl delete pvc minio-pv-claim \
|
||||||
&& kubectl delete svc minio-service
|
&& kubectl delete svc minio-service
|
||||||
```
|
```
|
||||||
@ -263,16 +265,18 @@ This is the Statefulset description.
|
|||||||
apiVersion: apps/v1beta1
|
apiVersion: apps/v1beta1
|
||||||
kind: StatefulSet
|
kind: StatefulSet
|
||||||
metadata:
|
metadata:
|
||||||
|
# This name uniquely identifies the StatefulSet
|
||||||
name: minio
|
name: minio
|
||||||
spec:
|
spec:
|
||||||
serviceName: minio
|
serviceName: minio
|
||||||
replicas: 4
|
replicas: 4
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: minio # has to match .spec.template.metadata.labels
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
|
||||||
pod.alpha.kubernetes.io/initialized: "true"
|
|
||||||
labels:
|
labels:
|
||||||
app: minio
|
app: minio # has to match .spec.selector.matchLabels
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: minio
|
- name: minio
|
||||||
@ -281,7 +285,7 @@ spec:
|
|||||||
value: "minio"
|
value: "minio"
|
||||||
- name: MINIO_SECRET_KEY
|
- name: MINIO_SECRET_KEY
|
||||||
value: "minio123"
|
value: "minio123"
|
||||||
image: minio/minio:RELEASE.2017-05-05T01-14-51Z
|
image: minio/minio:RELEASE.2017-11-22T19-55-46Z
|
||||||
args:
|
args:
|
||||||
- server
|
- server
|
||||||
- http://minio-0.minio.default.svc.cluster.local/data
|
- http://minio-0.minio.default.svc.cluster.local/data
|
||||||
@ -301,8 +305,6 @@ spec:
|
|||||||
volumeClaimTemplates:
|
volumeClaimTemplates:
|
||||||
- metadata:
|
- metadata:
|
||||||
name: data
|
name: data
|
||||||
annotations:
|
|
||||||
volume.alpha.kubernetes.io/storage-class: anything
|
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
|
@ -1,16 +1,18 @@
|
|||||||
apiVersion: apps/v1beta1
|
apiVersion: apps/v1beta1
|
||||||
kind: StatefulSet
|
kind: StatefulSet
|
||||||
metadata:
|
metadata:
|
||||||
|
# This name uniquely identifies the StatefulSet
|
||||||
name: minio
|
name: minio
|
||||||
spec:
|
spec:
|
||||||
serviceName: minio
|
serviceName: minio
|
||||||
replicas: 4
|
replicas: 4
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: minio # has to match .spec.template.metadata.labels
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
|
||||||
pod.alpha.kubernetes.io/initialized: "true"
|
|
||||||
labels:
|
labels:
|
||||||
app: minio
|
app: minio # has to match .spec.selector.matchLabels
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: minio
|
- name: minio
|
||||||
@ -39,8 +41,6 @@ spec:
|
|||||||
volumeClaimTemplates:
|
volumeClaimTemplates:
|
||||||
- metadata:
|
- metadata:
|
||||||
name: data
|
name: data
|
||||||
annotations:
|
|
||||||
volume.alpha.kubernetes.io/storage-class: anything
|
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
|
@ -2,25 +2,33 @@ apiVersion: extensions/v1beta1
|
|||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
# This name uniquely identifies the Deployment
|
# This name uniquely identifies the Deployment
|
||||||
name: minio-deployment
|
name: minio
|
||||||
spec:
|
spec:
|
||||||
strategy:
|
strategy:
|
||||||
|
# Specifies the strategy used to replace old Pods by new ones
|
||||||
|
# Refer: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy
|
||||||
type: Recreate
|
type: Recreate
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
# Label is used as selector in the service.
|
# This label is used as a selector in Service definition
|
||||||
app: minio
|
app: minio
|
||||||
spec:
|
spec:
|
||||||
# Refer to the PVC created earlier
|
# Volumes used by this deployment
|
||||||
volumes:
|
volumes:
|
||||||
- name: data
|
- name: data
|
||||||
|
# This volume is based on PVC
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
# Name of the PVC created earlier
|
# Name of the PVC created earlier
|
||||||
claimName: minio-pv-claim
|
claimName: minio-pv-claim
|
||||||
containers:
|
containers:
|
||||||
- name: minio
|
- name: minio
|
||||||
# Pulls the default Minio image from Docker Hub
|
# Volume mounts for this container
|
||||||
|
volumeMounts:
|
||||||
|
# Volume 'data' is mounted to path '/data'
|
||||||
|
- name: data
|
||||||
|
mountPath: "/data"
|
||||||
|
# Pulls the lastest Minio image from Docker Hub
|
||||||
image: minio/minio:RELEASE.2017-11-22T19-55-46Z
|
image: minio/minio:RELEASE.2017-11-22T19-55-46Z
|
||||||
args:
|
args:
|
||||||
- server
|
- server
|
||||||
@ -34,7 +42,3 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- containerPort: 9000
|
- containerPort: 9000
|
||||||
hostPort: 9000
|
hostPort: 9000
|
||||||
# Mount the volume into the pod
|
|
||||||
volumeMounts:
|
|
||||||
- name: data # must match the volume name, above
|
|
||||||
mountPath: "/data"
|
|
||||||
|
@ -1,15 +1,12 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
metadata:
|
metadata:
|
||||||
# This name uniquely identifies the PVC. Will be used in deployment below.
|
# This name uniquely identifies the PVC. This is used in deployment.
|
||||||
name: minio-pv-claim
|
name: minio-pv-claim
|
||||||
annotations:
|
|
||||||
volume.alpha.kubernetes.io/storage-class: anything
|
|
||||||
labels:
|
|
||||||
app: minio-storage-claim
|
|
||||||
spec:
|
spec:
|
||||||
# Read more about access modes here: http://kubernetes.io/docs/user-guide/persistent-volumes/#access-modes
|
# Read more about access modes here: http://kubernetes.io/docs/user-guide/persistent-volumes/#access-modes
|
||||||
accessModes:
|
accessModes:
|
||||||
|
# The volume is mounted as read-write by a single node
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
resources:
|
resources:
|
||||||
# This is the request for storage. Should be available in the cluster.
|
# This is the request for storage. Should be available in the cluster.
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
|
# This name uniquely identifies the service
|
||||||
name: minio-service
|
name: minio-service
|
||||||
spec:
|
spec:
|
||||||
type: LoadBalancer
|
type: LoadBalancer
|
||||||
@ -9,4 +10,5 @@ spec:
|
|||||||
targetPort: 9000
|
targetPort: 9000
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
selector:
|
selector:
|
||||||
|
# Looks for labels `app:minio` in the namespace and applies the spec
|
||||||
app: minio
|
app: minio
|
||||||
|
Loading…
Reference in New Issue
Block a user