From f242815b6dca7b31c3984f3e55ed8e6bb77e9a2f Mon Sep 17 00:00:00 2001 From: Sven Dowideit Date: Thu, 27 Apr 2017 16:55:41 -0700 Subject: [PATCH] bring back Josh's docs from #1364 Signed-off-by: Sven Dowideit --- docs/_includes/os-sidebar.html | 10 +- .../prepacking-docker-images/index.md | 22 ---- .../built-in-system-services/index.md | 110 ------------------ 3 files changed, 8 insertions(+), 134 deletions(-) delete mode 100644 docs/os/configuration/prepacking-docker-images/index.md delete mode 100644 docs/os/system-services/built-in-system-services/index.md diff --git a/docs/_includes/os-sidebar.html b/docs/_includes/os-sidebar.html index 982c9ad6..081927ae 100644 --- a/docs/_includes/os-sidebar.html +++ b/docs/_includes/os-sidebar.html @@ -45,7 +45,6 @@
  • Setting up Docker TLS
  • Private Registries
  • Switching Docker Versions
  • -
  • Pre-packing Docker Images
  • Users
  • Resizing a Device Partition
  • sysctl Settings
  • @@ -60,11 +59,18 @@ System Services +
  • + Boot Process + +
  • Storage
      diff --git a/docs/os/configuration/prepacking-docker-images/index.md b/docs/os/configuration/prepacking-docker-images/index.md deleted file mode 100644 index 91285061..00000000 --- a/docs/os/configuration/prepacking-docker-images/index.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: Pre-packing Docker Images -layout: os-default - ---- - -## Pre-packing Docker Images ---- - -On boot, RancherOS scans `/var/lib/rancher/preload/docker` and `/var/lib/rancher/preload/system-docker` directories and tries to load container image archives it finds there, with `docker load` and `system-docker load`. - -The archives are `.tar` files, optionally compressed with `xz` or `gzip`. These can be produced by `docker save` command, e.g.: - -``` -$ docker save my-image1 my-image2 some-other/image3 | xz > my-images.tar.xz -``` - -The resulting files should be placed into `/var/lib/rancher/preload/docker` or `/var/lib/rancher/preload/system-docker` (depending on whether you want it preloaded into Docker or System Docker). - -Pre-loading process only reads each new archive once, so it won't take time on subsequent boots (`.done` files are created to mark the read archives). If you update the archive (place a newer archive with the same name) it'll get read on the next boot as well. - -Pre-packing docker images is handy when you're customizing your RancherOS distribution (perhaps, building cloud VM images for your infrastructure). diff --git a/docs/os/system-services/built-in-system-services/index.md b/docs/os/system-services/built-in-system-services/index.md deleted file mode 100644 index a8601c1d..00000000 --- a/docs/os/system-services/built-in-system-services/index.md +++ /dev/null @@ -1,110 +0,0 @@ ---- -title: Built-in System Services in RancherOS -layout: os-default - ---- - -## Built-in System Services ---- - -To launch RancherOS, we have built-in system services. They are defined in the [Docker Compose](https://docs.docker.com/compose/compose-file/) format, and can be found in the default system config file, `/usr/share/ros/os-config.yml`. You can [add your own system services]({{site.baseurl}}/os/system-services/) or override services in the cloud-config. - -In start up order, here are the groups of services: - -1. Device and power management: -- udev-cold -- udev -- acpid - -2. syslog - -3. System configuration and networking: -- preload-system-images -- cloud-init-pre -- network-pre -- ntp -- cloud-init -- network - -4. User interaction: -- console -- docker - -5. Post configuration: -- preload-user-images - -### preload-system-images & preload-user-images - -Read more about [pre-packing Docker images]({{site.baseurl}}/os/configuration/prepacking-docker-images/). - -### cloud-init-pre - -User-data (i.e. [cloud-config]({{site.baseurl}}/os/configuration/#cloud-config)) and metadata from cloud provider, VM runtime, or a management service, is loaded in this service. - -The user-data is written to: - -* `/var/lib/rancher/conf/cloud-config.d/boot.yml` - If the user-data is a cloud-config, i.e. begins with `#cloud-config` and is YAML format. -* `/var/lib/rancher/conf/cloud-config-script` - If the user-data is a script, i.e begins with `#!`. -* `/var/lib/rancher/conf/metadata` - If it is serialized cloud provider metadata. - -It is configured by the `rancher.cloud_init.datasources` list in [cloud-config]({{site.baseurl}}/os/configuration/#cloud-config). It is pre-configured in cloud-provider specific images (e.g. AWS, GCE). - -### network-pre - -During this service, networking is set up, e.g. hostname, interfaces, and DNS. - -It is configured by `hostname` and `rancher.network`[settings]({{site.baseurl}}/os/networking/) in [cloud-config]({{site.baseurl}}/os/configuration/#cloud-config). - -### ntp - -Runs `ntpd` in a System Docker container. - -### cloud-init - -It does the same thing as cloud-init-pre, but in this step, it can also use the network to fetch user-data and metadata (e.g. in cloud providers). - - -### network - -Completes setting up networking with configuration obtained by cloud-init. - - -### console - -This service provides the RancherOS user interface by running `sshd` and `getty`. It completes the RancherOS configuration on start up: - -1. If the `rancher.password=` kernel parameter exists, it sets `` as the password for the `rancher` user. - -2. If there are no host SSH keys, it generates host SSH keys and saves them under `rancher.ssh.keys` in [cloud-config]({{site.baseurl}}/os/configuration/#cloud-config). - -3. Runs `cloud-init -execute`, which does the following: - - * Updates `.ssh/authorized_keys` in `/home/rancher` and `/home/docker` from [cloud-config]({{site.baseurl}}/os/configuration/ssh-keys/) and metadata. - * Writes files specified by the `write_files` [cloud-config]({{site.baseurl}}/os/configuration/write-files/) setting. - * Resizes the device specified by the `rancher.resize_device` [cloud-config]({{site.baseurl}}/os/configuration/resizing-device-partition/) setting. - * Mount devices specified in the `mounts` [cloud-config]({{site.baseurl}}/os/configuration/additional-mounts/) setting. - * Set sysctl parameters specified in the`rancher.sysctl` [cloud-config]({{site.baseurl}}/os/configuration/sysctl/) setting. - -4. If user-data contained a file that started with `#!`, then a file would be saved at `/var/lib/rancher/conf/cloud-config-script` during cloud-init and then executed. Any errors are ignored. - -5. Runs `/opt/rancher/bin/start.sh` if it exists and is executable. Any errors are ignored. - -6. Runs `/etc/rc.local` if it exists and is executable. Any errors are ignored. - - -### docker - -This system service runs the user docker daemon. Normally it runs inside the console system container by running `docker-init` script which, in turn, looks for docker binaries in `/opt/bin`, `/usr/local/bin` and `/usr/bin`, adds the first found directory with docker binaries to PATH and runs `dockerlaunch docker daemon` appending the passed arguments. - -Docker daemon args are read from `rancher.docker.args` cloud-config property (followed by `rancher.docker.extra_args`). - -### RancherOS Configuration Load Order - -[Cloud-config]({{site.baseurl}}/os/configuration/#cloud-config/) is read by system services when they need to get configuration. Each additional file overwrites and extends the previous configuration file. - -1. `/usr/share/ros/os-config.yml` - This is the system default configuration, which should **not** be modified by users. -2. `/usr/share/ros/oem/oem-config.yml` - This will typically exist by OEM, which should **not** be modified by users. -3. Files in `/var/lib/rancher/conf/cloud-config.d/` ordered by filename. If a file is passed in through user-data, it is written by cloud-init and saved as `/var/lib/rancher/conf/cloud-config.d/boot.yml`. -4. `/var/lib/rancher/conf/cloud-config.yml` - If you set anything with `ros config set`, the changes are saved in this file. -5. Kernel parameters with names starting with `rancher`. -6. `/var/lib/rancher/conf/metadata` - Metadata added by cloud-init.