Tighten validation of Name and Namespace

This commit is contained in:
Tim Hockin
2015-01-20 11:42:00 -08:00
committed by Clayton Coleman
parent 358ace610d
commit a480794efc
15 changed files with 51 additions and 43 deletions

View File

@@ -121,7 +121,7 @@ Use the file `examples/guestbook/redis-slave-controller.json`:
```js
{
"id": "redisSlaveController",
"id": "redis-slave-controller",
"kind": "ReplicationController",
"apiVersion": "v1beta1",
"desiredState": {
@@ -131,7 +131,7 @@ Use the file `examples/guestbook/redis-slave-controller.json`:
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "redisSlaveController",
"id": "redis-slave-controller",
"containers": [{
"name": "slave",
"image": "brendanburns/redis-slave",
@@ -153,11 +153,11 @@ to create the replication controller by running:
```shell
$ cluster/kubectl.sh create -f examples/guestbook/redis-slave-controller.json
redisSlaveController
redis-slave-controller
# cluster/kubectl.sh get replicationcontrollers
NAME IMAGE(S) SELECTOR REPLICAS
redisSlaveController brendanburns/redis-slave name=redisslave 2
NAME IMAGE(S) SELECTOR REPLICAS
redis-slave-controller brendanburns/redis-slave name=redisslave 2
```
The redis slave configures itself by looking for the Kubernetes service environment variables in the container environment. In particular, the redis slave is started with the following command:
@@ -225,7 +225,7 @@ The pod is described in the file `examples/guestbook/frontend-controller.json`:
```js
{
"id": "frontendController",
"id": "frontend-controller",
"kind": "ReplicationController",
"apiVersion": "v1beta1",
"desiredState": {
@@ -235,7 +235,7 @@ The pod is described in the file `examples/guestbook/frontend-controller.json`:
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "frontendController",
"id": "frontend-controller",
"containers": [{
"name": "php-redis",
"image": "kubernetes/example-guestbook-php-redis",
@@ -258,12 +258,12 @@ Using this file, you can turn up your frontend with:
```shell
$ cluster/kubectl.sh create -f examples/guestbook/frontend-controller.json
frontendController
frontend-controller
$ cluster/kubectl.sh get replicationcontrollers
NAME IMAGE(S) SELECTOR REPLICAS
redisSlaveController brendanburns/redis-slave name=redisslave 2
frontendController kubernetes/example-guestbook-php-redis name=frontend 3
NAME IMAGE(S) SELECTOR REPLICAS
redis-slave-controller brendanburns/redis-slave name=redisslave 2
frontend-controller kubernetes/example-guestbook-php-redis name=frontend 3
```
Once that's up (it may take ten to thirty seconds to create the pods) you can list the pods in the cluster, to verify that the master, slaves and frontends are running:

View File

@@ -1,5 +1,5 @@
{
"id": "frontendController",
"id": "frontend-controller",
"kind": "ReplicationController",
"apiVersion": "v1beta1",
"desiredState": {
@@ -9,7 +9,7 @@
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "frontendController",
"id": "frontend-controller",
"containers": [{
"name": "php-redis",
"image": "kubernetes/example-guestbook-php-redis",

View File

@@ -1,5 +1,5 @@
{
"id": "redisSlaveController",
"id": "redis-slave-controller",
"kind": "ReplicationController",
"apiVersion": "v1beta1",
"desiredState": {
@@ -9,7 +9,7 @@
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "redisSlaveController",
"id": "redis-slave-controller",
"containers": [{
"name": "slave",
"image": "brendanburns/redis-slave",

View File

@@ -23,7 +23,7 @@ Replication controllers are the objects to answer these questions. A replicatio
An example replica controller that instantiates two pods running nginx looks like:
```yaml
id: nginxController
id: nginx-controller
apiVersion: v1beta1
kind: ReplicationController
desiredState:

View File

@@ -1,4 +1,4 @@
id: nginxController
id: nginx-controller
apiVersion: v1beta1
kind: ReplicationController
desiredState: