github.com/enmand/kubernetes@v1.2.0-alpha.0/docs/getting-started-guides/rkt/README.md (about)

     1  <!-- BEGIN MUNGE: UNVERSIONED_WARNING -->
     2  
     3  <!-- BEGIN STRIP_FOR_RELEASE -->
     4  
     5  <img src="http://kubernetes.io/img/warning.png" alt="WARNING"
     6       width="25" height="25">
     7  <img src="http://kubernetes.io/img/warning.png" alt="WARNING"
     8       width="25" height="25">
     9  <img src="http://kubernetes.io/img/warning.png" alt="WARNING"
    10       width="25" height="25">
    11  <img src="http://kubernetes.io/img/warning.png" alt="WARNING"
    12       width="25" height="25">
    13  <img src="http://kubernetes.io/img/warning.png" alt="WARNING"
    14       width="25" height="25">
    15  
    16  <h2>PLEASE NOTE: This document applies to the HEAD of the source tree</h2>
    17  
    18  If you are using a released version of Kubernetes, you should
    19  refer to the docs that go with that version.
    20  
    21  <strong>
    22  The latest 1.0.x release of this document can be found
    23  [here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/rkt/README.md).
    24  
    25  Documentation for other releases can be found at
    26  [releases.k8s.io](http://releases.k8s.io).
    27  </strong>
    28  --
    29  
    30  <!-- END STRIP_FOR_RELEASE -->
    31  
    32  <!-- END MUNGE: UNVERSIONED_WARNING -->
    33  
    34  # Run Kubernetes with rkt
    35  
    36  This document describes how to run Kubernetes using [rkt](https://github.com/coreos/rkt) as a container runtime.
    37  We still have [a bunch of work](http://issue.k8s.io/8262) to do to make the experience with rkt wonderful, please stay tuned!
    38  
    39  ### **Prerequisite**
    40  
    41  - [systemd](http://www.freedesktop.org/wiki/Software/systemd/) should be installed on the machine and should be enabled. The minimum version required at this moment (2015/09/01) is 219
    42    *(Note that systemd is not required by rkt itself, we are using it here to monitor and manage the pods launched by kubelet.)*
    43  
    44  - Install the latest rkt release according to the instructions [here](https://github.com/coreos/rkt).
    45    The minimum version required for now is [v0.8.0](https://github.com/coreos/rkt/releases/tag/v0.8.0).
    46  
    47  - Note that for rkt version later than v0.7.0, `metadata service` is not required for running pods in private networks. So now rkt pods will not register the metadata service be default.
    48  
    49  ### Local cluster
    50  
    51  To use rkt as the container runtime, we need to supply `--container-runtime=rkt` and `--rkt-path=$PATH_TO_RKT_BINARY` to kubelet. Additionally we can provide `--rkt-stage1-image` flag
    52  as well to select which [stage1 image](https://github.com/coreos/rkt/blob/master/Documentation/running-lkvm-stage1.md) we want to use.
    53  
    54  If you are using the [hack/local-up-cluster.sh](../../../hack/local-up-cluster.sh) script to launch the local cluster, then you can edit the environment variable `CONTAINER_RUNTIME`, `RKT_PATH` and `RKT_STAGE1_IMAGE` to
    55  set these flags:
    56  
    57  ```console
    58  $ export CONTAINER_RUNTIME=rkt
    59  $ export RKT_PATH=$PATH_TO_RKT_BINARY
    60  $ export RKT_STAGE1_IMAGE=PATH=$PATH_TO_STAGE1_IMAGE
    61  ```
    62  
    63  Then we can launch the local cluster using the script:
    64  
    65  ```console
    66  $ hack/local-up-cluster.sh
    67  ```
    68  
    69  ### CoreOS cluster on Google Compute Engine (GCE)
    70  
    71  To use rkt as the container runtime for your CoreOS cluster on GCE, you need to specify the OS distribution, project, image:
    72  
    73  ```console
    74  $ export KUBE_OS_DISTRIBUTION=coreos
    75  $ export KUBE_GCE_MINION_IMAGE=<image_id>
    76  $ export KUBE_GCE_MINION_PROJECT=coreos-cloud
    77  $ export KUBE_CONTAINER_RUNTIME=rkt
    78  ```
    79  
    80  You can optionally choose the version of rkt used by setting `KUBE_RKT_VERSION`:
    81  
    82  ```console
    83  $ export KUBE_RKT_VERSION=0.8.0
    84  ```
    85  
    86  Then you can launch the cluster by:
    87  
    88  ```console
    89  $ kube-up.sh
    90  ```
    91  
    92  Note that we are still working on making all containerized the master components run smoothly in rkt. Before that we are not able to run the master node with rkt yet.
    93  
    94  ### CoreOS cluster on AWS
    95  
    96  To use rkt as the container runtime for your CoreOS cluster on AWS, you need to specify the provider and OS distribution:
    97  
    98  ```console
    99  $ export KUBERNETES_PROVIDER=aws
   100  $ export KUBE_OS_DISTRIBUTION=coreos
   101  $ export KUBE_CONTAINER_RUNTIME=rkt
   102  ```
   103  
   104  You can optionally choose the version of rkt used by setting `KUBE_RKT_VERSION`:
   105  
   106  ```console
   107  $ export KUBE_RKT_VERSION=0.8.0
   108  ```
   109  
   110  You can optionally choose the CoreOS channel  by setting `COREOS_CHANNEL`:
   111  
   112  ```console
   113  $ export COREOS_CHANNEL=stable
   114  ```
   115  
   116  Then you can launch the cluster by:
   117  
   118  ```console
   119  $ kube-up.sh
   120  ```
   121  
   122  Note: CoreOS is not supported as the master using the automated launch
   123  scripts. The master node is always Ubuntu.
   124  
   125  ### Getting started with your cluster
   126  
   127  See [a simple nginx example](../../../docs/user-guide/simple-nginx.md) to try out your new cluster.
   128  
   129  For more complete applications, please look in the [examples directory](../../../examples/).
   130  
   131  
   132  ### Debugging
   133  
   134  Here are severals tips for you when you run into any issues.
   135  
   136  ##### Check logs
   137  
   138  By default, the log verbose level is 2. In order to see more logs related to rkt, we can set the verbose level to 4.
   139  For local cluster, we can set the environment variable: `LOG_LEVEL=4`.
   140  If the cluster is using salt, we can edit the [logging.sls](../../../cluster/saltbase/pillar/logging.sls) in the saltbase.
   141  
   142  ##### Check rkt pod status
   143  
   144  To check the pods' status, we can use rkt command, such as `rkt list`, `rkt status`, `rkt image list`, etc.
   145  More information about rkt command line can be found [here](https://github.com/coreos/rkt/blob/master/Documentation/commands.md)
   146  
   147  ##### Check journal logs
   148  
   149  As we use systemd to launch rkt pods(by creating service files which will run `rkt run-prepared`, we can check the pods' log
   150  using `journalctl`:
   151  
   152  - Check the running state of the systemd service:
   153  
   154  ```console
   155  $ sudo journalctl -u $SERVICE_FILE
   156  ```
   157  
   158  where `$SERVICE_FILE` is the name of the service file created for the pod, you can find it in the kubelet logs.
   159  
   160  ##### Check the log of the container in the pod:
   161  
   162  ```console
   163  $ sudo journalctl -M rkt-$UUID -u $CONTAINER_NAME
   164  ```
   165  
   166  where `$UUID` is the rkt pod's UUID, which you can find via `rkt list --full`, and `$CONTAINER_NAME` is the container's name.
   167  
   168  ##### Check Kubernetes events, logs.
   169  
   170  Besides above tricks, Kubernetes also provides us handy tools for debugging the pods. More information can be found [here](../../../docs/user-guide/application-troubleshooting.md)
   171  
   172  <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
   173  [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/rkt/README.md?pixel)]()
   174  <!-- END MUNGE: GENERATED_ANALYTICS -->