Skip to content

Commit

Permalink
Merge pull request kubernetes#34766 from jessfraz/automated-cherry-pi…
Browse files Browse the repository at this point in the history
…ck-of-#31854-kubernetes#32198-origin-release-1.4

Automatic merge from submit-queue

Automated cherry pick of kubernetes#31854 kubernetes#32198 origin release 1.4

Cherry pick of kubernetes#31854 kubernetes#32198 on release-1.4.

kubernetes#31854: Update glusterfs provisioner readme with endpoint/service
kubernetes#32198: fixup storage examples
  • Loading branch information
Kubernetes Submit Queue authored Oct 14, 2016
2 parents 0d2f858 + b2325ef commit 782bc55
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 11 deletions.
45 changes: 37 additions & 8 deletions examples/experimental/persistent-volume-provisioning/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The name of a StorageClass object is significant, and is how users can request a

```yaml
kind: StorageClass
apiVersion: extensions/v1beta1
apiVersion: storage.k8s.io/v1beta1
metadata:
name: slow
provisioner: kubernetes.io/aws-ebs
Expand All @@ -42,7 +42,7 @@ parameters:

```yaml
kind: StorageClass
apiVersion: extensions/v1beta1
apiVersion: storage.k8s.io/v1beta1
metadata:
name: slow
provisioner: kubernetes.io/gce-pd
Expand All @@ -57,7 +57,7 @@ parameters:
#### GLUSTERFS

```yaml
apiVersion: extensions/v1beta1
apiVersion: storage.k8s.io/v1beta1
kind: StorageClass
metadata:
name: slow
Expand All @@ -70,17 +70,46 @@ parameters:
restuserkey: "password"
```

* `endpoint`: `glusterfs-cluster` is the endpoint/service name which includes GlusterFS trusted pool IP addresses and this parameter is mandatory.
* `resturl` : Gluster REST service url which provision gluster volumes on demand. The format should be `IPaddress:Port` and this is a mandatory parameter for GlusterFS dynamic provisioner.
* `endpoint`: `glusterfs-cluster` is the endpoint name which includes GlusterFS trusted pool IP addresses. This parameter is mandatory. We need to also create a service for this endpoint, so that the endpoint will be persisted. This service can be without a selector to tell Kubernetes we want to add its endpoints manually. Please note that, glusterfs plugin looks for the endpoint in the pod namespace, so it is mandatory that the endpoint and service have to be created in Pod's namespace for successful mount of gluster volumes in the pod.
* `resturl` : Gluster REST service/Heketi service url which provision gluster volumes on demand. The general format should be `IPaddress:Port` and this is a mandatory parameter for GlusterFS dynamic provisioner. If Heketi service is exposed as a routable service in openshift/kubernetes setup, this can have a format similar to
`http://heketi-storage-project.cloudapps.mystorage.com` where the fqdn is a resolvable heketi service url.
* `restauthenabled` : Gluster REST service authentication boolean is required if the authentication is enabled on the REST server. If this value is 'true', 'restuser' and 'restuserkey' have to be filled.
* `restuser` : Gluster REST service user who has access to create volumes in the Gluster Trusted Pool.
* `restuserkey` : Gluster REST service user's password which will be used for authentication to the REST server.
* `restuser` : Gluster REST service/Heketi user who has access to create volumes in the Gluster Trusted Pool.
* `restuserkey` : Gluster REST service/Heketi user's password which will be used for authentication to the REST server.

Reference : ([How to configure Heketi](https://github.com/heketi/heketi/wiki/Setting-up-the-topology))

Create endpoints

As in example [glusterfs-endpoints.json](../../volumes/glusterfs/glusterfs-endpoints.json) file, the "IP" field should be filled with the address of a node in the Glusterfs server cluster. It is fine to give any valid value (from 1 to 65535) to the "port" field.

Create the endpoints,

```sh
$ kubectl create -f examples/volumes/glusterfs/glusterfs-endpoints.json
```

You can verify that the endpoints are successfully created by running

```sh
$ kubectl get endpoints
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 persisted. It is possible to create `service` without a selector to tell Kubernetes we want to add its endpoints manually. For an example service file refer [glusterfs-service.json](../../volumes/glusterfs/glusterfs-service.json).

Use this command to create the service:

```sh
$ kubectl create -f examples/volumes/glusterfs/glusterfs-service.json
```

#### OpenStack Cinder

```yaml
kind: StorageClass
apiVersion: extensions/v1beta1
apiVersion: storage.k8s.io/v1beta1
metadata:
name: gold
provisioner: kubernetes.io/cinder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: StorageClass
apiVersion: extensions/v1beta1
apiVersion: storage.k8s.io/v1beta1
metadata:
name: slow
provisioner: kubernetes.io/aws-ebs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: StorageClass
apiVersion: extensions/v1beta1
apiVersion: storage.k8s.io/v1beta1
metadata:
name: slow
provisioner: kubernetes.io/gce-pd
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: storage.k8s.io/v1beta1
kind: StorageClass
metadata:
name: slow
Expand Down
3 changes: 3 additions & 0 deletions pkg/master/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,16 @@ func (m *Master) InstallAPIs(c *Config) {
// TODO find a better way to configure priority of groups
for _, group := range sets.StringKeySet(c.RESTStorageProviders).List() {
if !c.APIResourceConfigSource.AnyResourcesForGroupEnabled(group) {
glog.V(1).Infof("Skipping disabled API group %q.", group)
continue
}
restStorageBuilder := c.RESTStorageProviders[group]
apiGroupInfo, enabled := restStorageBuilder.NewRESTStorage(c.APIResourceConfigSource, restOptionsGetter)
if !enabled {
glog.Warningf("Problem initializing API group %q, skipping.", group)
continue
}
glog.V(1).Infof("Enabling API group %q.", group)

// This is here so that, if the policy group is present, the eviction
// subresource handler wil be able to find poddisruptionbudgets
Expand Down

0 comments on commit 782bc55

Please sign in to comment.