From bfdfbd0be32fa0ed3ca5efd0cd830c6e16596e2d Mon Sep 17 00:00:00 2001 From: Bin Wang Date: Mon, 31 Aug 2015 13:52:51 +0800 Subject: [PATCH] Add a service with glusterfs endpoints --- examples/examples_test.go | 1 + examples/glusterfs/README.md | 9 +++++++++ examples/glusterfs/glusterfs-service.json | 12 ++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 examples/glusterfs/glusterfs-service.json diff --git a/examples/examples_test.go b/examples/examples_test.go index f7d957c9d58..9e258d51eea 100644 --- a/examples/examples_test.go +++ b/examples/examples_test.go @@ -194,6 +194,7 @@ func TestExampleObjectSchemas(t *testing.T) { "../examples/glusterfs": { "glusterfs-pod": &api.Pod{}, "glusterfs-endpoints": &api.Endpoints{}, + "glusterfs-service": &api.Service{}, }, "../docs/user-guide/liveness": { "exec-liveness": &api.Pod{}, diff --git a/examples/glusterfs/README.md b/examples/glusterfs/README.md index b4ae9ddaf9a..cde80d2ca5c 100644 --- a/examples/glusterfs/README.md +++ b/examples/glusterfs/README.md @@ -75,6 +75,15 @@ NAME ENDPOINTS glusterfs-cluster 10.240.106.152:1,10.240.79.157:1 ``` +We need also create a service for this endpoints, so that the endpoints will be persistented. We will add this service without a selector to tell Kubernetes we want to add its endpoints manually. You can see [glusterfs-service.json](glusterfs-service.json) for details. + +Use this command to create the service: + +```sh +$ kubectl create -f examples/glusterfs/glusterfs-service.json +``` + + ### Create a POD The following *volume* spec in [glusterfs-pod.json](glusterfs-pod.json) illustrates a sample configuration. diff --git a/examples/glusterfs/glusterfs-service.json b/examples/glusterfs/glusterfs-service.json new file mode 100644 index 00000000000..79139febd8e --- /dev/null +++ b/examples/glusterfs/glusterfs-service.json @@ -0,0 +1,12 @@ +{ + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "glusterfs-cluster" + }, + "spec": { + "ports": [ + {"port": 1} + ] + } +}