Fix example in downward-api docs

This commit is contained in:
Paul Morie
2015-05-09 22:19:44 -04:00
parent 738f403eea
commit 634fb6e9a4

View File

@@ -24,37 +24,24 @@ field is the version of the API schema that the `fieldPath` is written in terms
This is an example of a pod that consumes its name and namespace via the downward API: This is an example of a pod that consumes its name and namespace via the downward API:
```json ```yaml
{ apiVersion: v1beta3
"apiVersion":"v1beta3", kind: Pod
"name": "downward-api-pod", metadata:
"kind": "Pod", name: dapi-test-pod
"spec": { spec:
"manifest": { containers:
"containers": [{ - name: test-container
"name": "example-container", image: gcr.io/google_containers/busybox
"image": "gcr.io/google_containers/busybox", command: [ "/bin/sh", "-c", "env" ]
"command": [ "sh", "-c", "env" ] env:
"env": [{ - name: POD_NAME
"name": "POD_NAMESPACE", valueFrom:
"valueFrom": { fieldRef:
"fieldPath": { fieldPath: metadata.name
"apiVersion": "v1beta3", - name: POD_NAMESPACE
"fieldPath": "metadata.namespace" valueFrom:
} fieldRef:
} fieldPath: metadata.namespace
}, restartPolicy: Never
{
"name": "POD_NAME",
"valueFrom": {
"fieldPath": {
"apiVersion": "v1beta3",
"fieldPath": "metadata.name"
}
}
}]
}]
}
}
}]
``` ```