@@ -75,11 +75,11 @@ Here are some ideas for how to use Init Containers:
|
|||||||
|
|
||||||
* Wait for a service to be created with a shell command like:
|
* Wait for a service to be created with a shell command like:
|
||||||
|
|
||||||
for i in {1..100}; do sleep 1; if dig myservice; then exit 0; fi; exit 1
|
for i in {1..100}; do sleep 1; if dig myservice; then exit 0; fi; exit 1
|
||||||
|
|
||||||
* Register this Pod with a remote server from the downward API with a command like:
|
* Register this Pod with a remote server from the downward API with a command like:
|
||||||
|
|
||||||
curl -X POST http://$MANAGEMENT_SERVICE_HOST:$MANAGEMENT_SERVICE_PORT/register -d 'instance=$(<POD_NAME>)&ip=$(<POD_IP>)'
|
curl -X POST http://$MANAGEMENT_SERVICE_HOST:$MANAGEMENT_SERVICE_PORT/register -d 'instance=$(<POD_NAME>)&ip=$(<POD_IP>)'
|
||||||
|
|
||||||
* Wait for some time before starting the app Container with a command like `sleep 60`.
|
* Wait for some time before starting the app Container with a command like `sleep 60`.
|
||||||
* Clone a git repository into a volume.
|
* Clone a git repository into a volume.
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ Once the nginx pod is running, use the port-forward command to set up a proxy fr
|
|||||||
./cluster/kubectl.sh port-forward nginx 8888:80
|
./cluster/kubectl.sh port-forward nginx 8888:80
|
||||||
```
|
```
|
||||||
|
|
||||||
You should now see nginx on [http://localhost:8888]().
|
You should now see nginx on `http://localhost:8888`.
|
||||||
|
|
||||||
For more complex examples please see the [examples directory](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/).
|
For more complex examples please see the [examples directory](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/).
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,8 @@ where `command`, `TYPE`, `NAME`, and `flags` are:
|
|||||||
Example: `$ kubectl get pod/example-pod1 replicationcontroller/example-rc1`
|
Example: `$ kubectl get pod/example-pod1 replicationcontroller/example-rc1`
|
||||||
|
|
||||||
* To specify resources with one or more files: `-f file1 -f file2 -f file<#>`
|
* To specify resources with one or more files: `-f file1 -f file2 -f file<#>`
|
||||||
[Use YAML rather than JSON](/docs/concepts/configuration/overview/#general-config-tips) since YAML tends to be more user-friendly, especially for configuration files.<br/>
|
|
||||||
|
* [Use YAML rather than JSON](/docs/concepts/configuration/overview/#general-config-tips) since YAML tends to be more user-friendly, especially for configuration files.<br/>
|
||||||
Example: `$ kubectl get pod -f ./pod.yaml`
|
Example: `$ kubectl get pod -f ./pod.yaml`
|
||||||
* `flags`: Specifies optional flags. For example, you can use the `-s` or `--server` flags to specify the address and port of the Kubernetes API server.<br/>
|
* `flags`: Specifies optional flags. For example, you can use the `-s` or `--server` flags to specify the address and port of the Kubernetes API server.<br/>
|
||||||
**Important**: Flags that you specify from the command line override default values and any corresponding environment variables.
|
**Important**: Flags that you specify from the command line override default values and any corresponding environment variables.
|
||||||
|
|||||||
Reference in New Issue
Block a user