Skip to content

Commit 2cd6554

Browse files
pmoriestaebler
authored andcommitted
Clean up docs/ folder (openshift#1609)
1 parent 1d7e96d commit 2cd6554

File tree

2 files changed

+47
-89
lines changed

2 files changed

+47
-89
lines changed

Diff for: docs/design.md

+47-78
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,13 @@ and therefore a separate persistent storage (from Kubernetes) is not needed.
9696
storage. The plan is to add support for CRDs to the `rest.storage` interface
9797
of the API Server in the near future.*
9898

99-
The Service Catalog resource model is defined within a file called
100-
`pkg/apis/servicecatalog/types.go` and the initial (current) version
101-
of the model is in `pkg/apis/servicecatalog/v1alpha1/`. As of now there is
102-
only one version of the model but over time additional versions will be
103-
created and each will have its own sub-directory under
104-
`pkg/apis/servicecatalog/`.
99+
The Service Catalog API resources are defined within a file called
100+
`pkg/apis/servicecatalog/types.go` and the version
101+
of the api is in `pkg/apis/servicecatalog/v1beta1/`.
105102

106-
**TODO** add a brief discussion of how resources are created and we'll
107-
use the Status section to know when its fully realized. Instead of the
108-
"claim" model that is used by other parts of Kube.
109-
110-
The Controller is the brains of the Service Catalog. It monitors the
111-
resource model (via watches on the API server), and takes the appropriate
112-
actions based on the changes it detects.
103+
The controller implements the behaviors of the service-catalog API. It monitors the
104+
API resources (by watching the API server), and takes the appropriate
105+
actions based on the user's desired intent.
113106

114107
To understand the Service Catalog resource model, it is best to walk through
115108
a typical workflow:
@@ -123,41 +116,51 @@ can be in different NS's than the rest (which must all be in the same).
123116
Before a Service can be used by an Application it must first be registered
124117
with the Kubernetes platform. Since Services are managed by Service Brokers
125118
we must first register the Service Broker by creating an instance of a
126-
`ServiceBroker`:
119+
`ClusterServiceBroker`:
127120

128121
kubectl create -f broker.yaml
129122

130123
where `broker.yaml` might look like:
131124

132-
apiVersion: servicecatalog.k8s.io/v1alpha1
133-
kind: ServiceBroker
125+
apiVersion: servicecatalog.k8s.io/v1beta1
126+
kind: ClusterServiceBroker
134127
metadata:
135-
name: BestDataBase
128+
name: best-db-broker
136129
spec:
137130
url: http://bestdatabase.com
138131

139-
**TODO** beef-up theses sample resource snippets
132+
**Note:** As the name implies, the `ClusterServiceBroker` resource is cluster-scoped, ie,
133+
outside of any namespace.
134+
135+
**TODO** beef-up these sample resource snippets
140136

141-
After a `ServiceBroker` resource is created the Service Catalog Controller will
137+
After a `ClusterServiceBroker` resource is created the Service Catalog Controller will
142138
receive an event indicating its addition to the datastore. The Controller
143139
will then query the Service Broker (at the `url` specified) for the list
144140
of available Services. Each Service will then have a corresponding
145-
`ServiceClass` resource created:
141+
`ClusterServiceClass` resource created:
146142

147-
apiVersion: servicecatalog.k8s.io/v1alpha1
148-
kind: ServiceClass
143+
apiVersion: servicecatalog.k8s.io/v1beta1
144+
kind: ClusterServiceClass
149145
metadata:
150146
name: smallDB
151-
brokerName: BestDataBase
152-
plans...
147+
spec:
148+
bindable: true
149+
clusterServiceBrokerName: ups-broker
150+
description: A user provided service
151+
externalID: 4f6e6cf6-ffdd-425f-a2c7-3c9258ad2468
152+
externalName: user-provided-service
153+
planUpdatable: false
154+
155+
Each Service has one or more Plans associated with it.
153156

154-
Notice that each Service can have one or more Plans associated with it.
157+
For each plan of each service, a `ClusterServicePlan` will be created.
155158

156159
**TODO** Anything special about the CF flows we need to discuss?
157160

158161
Users can then query for the list of available Services:
159162

160-
kubectl get services
163+
kubectl get clusterserviceclasses
161164

162165
### Creating a Service Instance
163166

@@ -168,18 +171,20 @@ done by creating a new `ServiceInstance` resource:
168171

169172
where `instance.yaml` might look like:
170173

171-
apiVersion: servicecatalog.k8s.io/v1alpha1
174+
apiVersion: servicecatalog.k8s.io/v1beta1
172175
kind: ServiceInstance
173176
metadata:
174-
name: johnsDB
177+
namespace: example-ns
178+
name: test-database
175179
spec:
176-
serviceClassName: smallDB
180+
clusterServiceClassExternalName: small-db
181+
clusterServicePlanExternalName: free
177182

178183
Within the `ServiceInstance` resource is the specified Plan to be used. This allows
179184
for the user of the Service to indicate which variant of the Service they
180185
want - perhaps based on QoS type of variants.
181186

182-
When creating a ServiceInstance, extra metadata (called "parameters") can be
187+
When creating a `ServiceInstance`, extra metadata (called "parameters") can be
183188
passed in to help configure the new Service being provisioned. Parameters
184189
can be provided two different ways: raw JSON or referencing a Kubernetes
185190
Secret. In the case of a Secret, the Secret name and key holding the
@@ -197,6 +202,8 @@ ServiceInstanceSpec resource that would cause a reconciliation to occur.
197202
Within the ServiceInstanceSpec is a property called `UpdateRequests` which
198203
can be incremented to cause this to happen.
199204

205+
For more information, see the documentation on [parameters](parameters.md).
206+
200207
**TODO** Discuss the parameters that can be passed in
201208

202209
Once an `ServiceInstance` resource is created, the Controller talks with the
@@ -240,13 +247,15 @@ Service Instance must be established. This is done by creating a new
240247

241248
where `instance.yaml` might look like:
242249

243-
apiVersion: servicecatalog.k8s.io/v1alpha1
250+
apiVersion: servicecatalog.k8s.io/v1beta1
244251
kind: ServiceBinding
245252
metadata:
246-
name: johnsServiceBinding
253+
namespace: example-ns
254+
name: test-database-binding
247255
spec:
248-
secretName: johnSecret
249-
...Pod selector labels...
256+
instanceRef:
257+
name: test-database
258+
secretName: db-secret
250259

251260
The Controller, upon being notified of the new `ServiceBinding` resource, will
252261
then talk to the Service Broker to create a new ServiceBinding for the specified
@@ -267,50 +276,13 @@ by reading the documentation of the Service.
267276
The Credentials will not be stored in the Service Catalog's datastore.
268277
Rather, they will be stored in the Kubenetes core as Secrets and a reference
269278
to the Secret will be saved within the `ServiceBinding` resource. If the
270-
ServiceBinding `Spec.SecretName` is not specified then the Controller will
271-
use the ServiceBinding `Name` property as the name of the Secret.
279+
ServiceBinding `spec.secretName` is not specified then the Controller will
280+
use the ServiceBinding `metadata.name` property as the name of the Secret.
272281

273282
ServiceBindings are not required to be in the same Kubenetes Namespace
274283
as the Service Instance. This allows for sharing of Service Instances
275284
across Applications and Namespaces.
276285

277-
In addition to the Secret, the Controller will also create a Pod Injection
278-
Policy (PIP) resource in the Kubernetes core. See the
279-
[PIP Proposal](https://github.com/kubernetes/community/pull/254) for more
280-
information, but in short, the PIP defines how to modify the specification
281-
of a Pod during its creation to include additional volumes and environment
282-
variables.
283-
In particular, Service Catalog will use PIPs to allow the Application
284-
owner to indicate how the Secret should be made available to its Pods. For
285-
example, they may define a PIP to indicate that the Secret should be mounted
286-
into its Pods. Or perhaps the Secret's names/values should be exposed as
287-
environment variables.
288-
289-
PIPs will use label selectors to indicate which Pods will be modified.
290-
For example:
291-
292-
kind: PodInjectionPolicy
293-
apiVersion: extensions/v1alpha1
294-
metadata:
295-
name: allow-database
296-
namespace: myns
297-
spec:
298-
selector:
299-
matchLabels:
300-
role: frontend
301-
env:
302-
- name: DB_PORT
303-
value: 6379
304-
305-
defines a PIP that will add an environment variable called `DB_PORT` with
306-
a value of `6379` to all Pods that have a label of `role` with a value
307-
of `frontend`.
308-
309-
Eventually, the OSB API specification will hopefully have additional metadata
310-
about the Credentials to indicate which fields are considered "secret" and
311-
which are not. When that support is available expect the non-secret Credential
312-
information to be placed into a ConfigMap instead of a Secret.
313-
314286
Once the Secret is made available to the Application's Pods, it is then up
315287
to the Application code to use that information to talk to the Service
316288
ServiceInstance.
@@ -321,12 +293,9 @@ As with all resources in Kubernetes, you can delete any of the Service
321293
Catalog resource by doing an HTTP DELETE to the resource's URL. However,
322294
it is important to note the you can not delete a Service Instance while
323295
there are ServiceBindings associated with it. In other words, before a Service
324-
ServiceInstance can be delete, you must first delete all of its ServiceBindings.
325-
Attempting to delete an ServiceInstance that still has a ServiceBinding will fail
326-
and generate an error.
296+
ServiceInstance can be deleted, you must first delete all of its ServiceBindings.
327297

328-
Deleting a ServiceBinding will also, automatically, delete any Secrets or ConfigMaps
329-
that might be associated with it.
298+
Deleting a `ServiceBinding` indicates a user's intent to unbind. The service-catalog controller handles deleting any Secrets associated with a binding.
330299

331300
**TODO** what happens to the Pods using them?
332301

Diff for: docs/futures/README.md

-11
This file was deleted.

0 commit comments

Comments
 (0)