From 26e274e3c9f87b8c21868a35c2997a7ae27a3e48 Mon Sep 17 00:00:00 2001 From: Nitish Date: Tue, 7 Mar 2017 22:44:03 +0530 Subject: [PATCH] Updated as per review comments. --- examples/storage/minio-distributed/README.md | 56 +++++++------------ .../minio-distributed-service.yaml | 5 +- .../minio-distributed-statefulset.yaml | 15 +++-- examples/storage/minio/README.md | 44 +++++---------- .../minio/minio-standalone-deployment.yaml | 9 ++- .../minio/minio-standalone-service.yaml | 2 +- 6 files changed, 53 insertions(+), 78 deletions(-) diff --git a/examples/storage/minio-distributed/README.md b/examples/storage/minio-distributed/README.md index a54c5c4ac08..b54e87b7e06 100644 --- a/examples/storage/minio-distributed/README.md +++ b/examples/storage/minio-distributed/README.md @@ -42,7 +42,7 @@ kubectl create -f https://github.com/kubernetes/kubernetes/blob/master/examples/ ## Step 1: Create Minio Headless Service -Headless Service controls the domain within which we create StatefulSets. The domain managed by this Service takes the form: `$(service name).$(namespace).svc.cluster.local` (where “cluster.local” is the cluster domain), and the pods in this domain take the form: `$(pod-name-{i}).$(service name).$(namespace).svc.cluster.local`. This is required to get a DNS resolvable URL for each of the pods created within the Statefulset. +Headless Service controls the domain within which StatefulSets are created. The domain managed by this Service takes the form: `$(service name).$(namespace).svc.cluster.local` (where “cluster.local” is the cluster domain), and the pods in this domain take the form: `$(pod-name-{i}).$(service name).$(namespace).svc.cluster.local`. This is required to get a DNS resolvable URL for each of the pods created within the Statefulset. This is the Headless service description. @@ -61,16 +61,11 @@ spec: selector: app: minio ``` -[Download example] (minio-distributed-headless-service.yaml?raw=true) Create the Headless Service ```sh -kubectl create -f minio-distributed-headless-service.yaml -``` -The response should be like this: - -```sh +$ kubectl create -f https://github.com/kubernetes/kubernetes/blob/master/examples/storage/minio-distributed/minio-distributed-headless-service.yaml?raw=true service "minio" created ``` @@ -86,7 +81,7 @@ kind: StatefulSet metadata: name: minio spec: - serviceName: "minio" + serviceName: minio replicas: 4 template: metadata: @@ -103,8 +98,14 @@ spec: - name: MINIO_SECRET_KEY value: "minio123" image: minio/minio - command: ["minio"] - args: ["server", "http://minio-0.minio.default.svc.cluster.local/data", "http://minio-1.minio.default.svc.cluster.local/data", "http://minio-2.minio.default.svc.cluster.local/data", "http://minio-3.minio.default.svc.cluster.local/data"] + command: + - minio + args: + - server + - http://minio-0.minio.default.svc.cluster.local/data + - http://minio-1.minio.default.svc.cluster.local/data + - http://minio-2.minio.default.svc.cluster.local/data + - http://minio-3.minio.default.svc.cluster.local/data ports: - containerPort: 9000 hostPort: 9000 @@ -121,23 +122,17 @@ spec: annotations: volume.alpha.kubernetes.io/storage-class: anything spec: - accessModes: [ "ReadWriteOnce" ] + accessModes: + - ReadWriteOnce resources: requests: storage: 10Gi ``` -[Download example] (minio-distributed-statefulset.yaml?raw=true) - Create the Statefulset ```sh -kubectl create -f minio-distributed-statefulset.yaml -``` - -The response should be like this - -```sh +$ kubectl create -f https://github.com/kubernetes/kubernetes/blob/master/examples/storage/minio-distributed/minio-distributed-statefulset.yaml?raw=true statefulset "minio" created ``` @@ -159,35 +154,26 @@ spec: targetPort: 9000 protocol: TCP selector: - app: minio-server + app: minio ``` - -[Download example] (minio-distributed-service.yaml?raw=true) - -```sh -kubectl create -f minio-distributed-service.yaml -``` - -The response should be like this +Create the Minio service ```sh +$ kubectl create -f https://github.com/kubernetes/kubernetes/blob/master/examples/storage/minio-distributed/minio-distributed-service.yaml?raw=true service "minio-service" created ``` -To check if the service was created successfully, run the command + +The `LoadBalancer` service takes couple of minutes to launch. To check if the service was created successfully, run the command ```sh -kubectl get svc minio-service -``` - -You should get a response like this -```sh +$ kubectl get svc minio-service NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE minio-service 10.55.248.23 104.199.249.165 9000:31852/TCP 1m ``` # Step 4: Resource cleanup -Once you are done, cleanup the cluster using +You can cleanup the cluster using ```sh kubectl delete statefulset minio \ && kubectl delete svc minio \ diff --git a/examples/storage/minio-distributed/minio-distributed-service.yaml b/examples/storage/minio-distributed/minio-distributed-service.yaml index d1a24d6f669..60514a8636b 100644 --- a/examples/storage/minio-distributed/minio-distributed-service.yaml +++ b/examples/storage/minio-distributed/minio-distributed-service.yaml @@ -2,14 +2,11 @@ apiVersion: v1 kind: Service metadata: name: minio-service - labels: - app: minio spec: type: LoadBalancer ports: - port: 9000 targetPort: 9000 - protocol: "TCP" - name: minio + protocol: TCP selector: app: minio diff --git a/examples/storage/minio-distributed/minio-distributed-statefulset.yaml b/examples/storage/minio-distributed/minio-distributed-statefulset.yaml index 779ec935f8d..0d3f3adcf8c 100644 --- a/examples/storage/minio-distributed/minio-distributed-statefulset.yaml +++ b/examples/storage/minio-distributed/minio-distributed-statefulset.yaml @@ -3,7 +3,7 @@ kind: StatefulSet metadata: name: minio spec: - serviceName: "minio" + serviceName: minio replicas: 4 template: metadata: @@ -20,8 +20,14 @@ spec: - name: MINIO_SECRET_KEY value: "minio123" image: minio/minio - command: ["minio"] - args: ["server", "http://minio-0.minio.default.svc.cluster.local/data", "http://minio-1.minio.default.svc.cluster.local/data", "http://minio-2.minio.default.svc.cluster.local/data", "http://minio-3.minio.default.svc.cluster.local/data"] + command: + - minio + args: + - server + - http://minio-0.minio.default.svc.cluster.local/data + - http://minio-1.minio.default.svc.cluster.local/data + - http://minio-2.minio.default.svc.cluster.local/data + - http://minio-3.minio.default.svc.cluster.local/data ports: - containerPort: 9000 hostPort: 9000 @@ -38,7 +44,8 @@ spec: annotations: volume.alpha.kubernetes.io/storage-class: anything spec: - accessModes: [ "ReadWriteOnce" ] + accessModes: + - ReadWriteOnce resources: requests: storage: 10Gi diff --git a/examples/storage/minio/README.md b/examples/storage/minio/README.md index 7889b3893c4..f4be0163a09 100644 --- a/examples/storage/minio/README.md +++ b/examples/storage/minio/README.md @@ -67,16 +67,11 @@ spec: requests: storage: 10Gi ``` -[Download example] (minio-standalone-pvc.yaml?raw=true) Create the PersistentVolumeClaim ```sh -kubectl create -f minio-standalone-pvc.yaml -``` -The response should be like this: - -```sh +kubectl create -f https://github.com/kubernetes/kubernetes/blob/master/examples/storage/minio/minio-standalone-pvc.yaml?raw=true persistentvolumeclaim "minio-pv-claim" created ``` @@ -99,7 +94,7 @@ spec: metadata: labels: # Label is used as selector in the service. - app: minio-server + app: minio spec: # Refer to the PVC created earlier volumes: @@ -111,8 +106,11 @@ spec: - name: minio # Pulls the default Minio image from Docker Hub image: minio/minio - command: ["minio"] - args: ["server", "/storage"] + command: + - minio + args: + - server + - /storage env: # Minio access key and secret key - name: MINIO_ACCESS_KEY @@ -128,17 +126,10 @@ spec: mountPath: "/storage" ``` -[Download example] (minio-standalone-deployment.yaml?raw=true) - Create the Deployment ```sh -kubectl create -f minio-standalone-deployment.yaml -``` - -The response should be like this - -```sh +kubectl create -f https://github.com/kubernetes/kubernetes/blob/master/examples/storage/minio/minio-standalone-deployment.yaml?raw=true deployment "minio-deployment" created ``` @@ -160,28 +151,19 @@ spec: targetPort: 9000 protocol: TCP selector: - app: minio-server + app: minio ``` - -[Download example] (minio-standalone-service.yaml?raw=true) - -```sh -kubectl create -f minio-standalone-service.yaml -``` - -The response should be like this +Create the Minio service ```sh +kubectl create -f https://github.com/kubernetes/kubernetes/blob/master/examples/storage/minio/minio-standalone-service.yaml?raw=true service "minio-service" created ``` -To check if the service was created successfully, run the command + +The `LoadBalancer` service takes couple of minutes to launch. To check if the service was created successfully, run the command ```sh kubectl get svc minio-service -``` - -You should get a response like this -```sh NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE minio-service 10.55.248.23 104.199.249.165 9000:31852/TCP 1m ``` diff --git a/examples/storage/minio/minio-standalone-deployment.yaml b/examples/storage/minio/minio-standalone-deployment.yaml index 6d234e2f276..1ec25a5ebf8 100644 --- a/examples/storage/minio/minio-standalone-deployment.yaml +++ b/examples/storage/minio/minio-standalone-deployment.yaml @@ -10,7 +10,7 @@ spec: metadata: labels: # Label is used as selector in the service. - app: minio-server + app: minio spec: # Refer to the PVC created earlier volumes: @@ -22,8 +22,11 @@ spec: - name: minio # Pulls the default Minio image from Docker Hub image: minio/minio - command: ["minio"] - args: ["server", "/storage"] + command: + - minio + args: + - server + - /storage env: # Minio access key and secret key - name: MINIO_ACCESS_KEY diff --git a/examples/storage/minio/minio-standalone-service.yaml b/examples/storage/minio/minio-standalone-service.yaml index 4d4ad7a562a..60514a8636b 100644 --- a/examples/storage/minio/minio-standalone-service.yaml +++ b/examples/storage/minio/minio-standalone-service.yaml @@ -9,4 +9,4 @@ spec: targetPort: 9000 protocol: TCP selector: - app: minio-server + app: minio